Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ tests/bcl-test/mscorlib*.csproj
tests/bcl-test/SystemCoreXunit*.csproj
tests/bcl-test/SystemXunit.csproj
global.json
global5.json
.idea
device-tests-provisioning.csx
mono_crash.*.json
Expand Down
6 changes: 3 additions & 3 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,6 @@ endif
DOTNET_VERSION=3.1.100
DOTNET_URL=https://download.visualstudio.microsoft.com/download/pr/787e81f1-f0da-4e3b-a989-8a199132ed8c/61a8dba81fbf2b3d533562d7b96443ec/dotnet-sdk-3.1.100-osx-x64.pkg
DOTNET=/usr/local/share/dotnet/dotnet
DOTNET_BCL_REF_URL=https://www.nuget.org/api/v2/package/Microsoft.NETCore.App.Ref/3.1.0
DOTNET_BCL_REF_NAME=microsoft.netcore.app.ref.3.1.0.nupkg
DOTNET_BCL_DIR:=$(abspath $(TOP)/builds/downloads/$(basename $(DOTNET_BCL_REF_NAME)))/ref/netcoreapp3.1

DOTNET_DESTDIR ?= $(TOP)/_build
DOTNET_NUPKG_DIR ?= $(DOTNET_DESTDIR)/nupkgs
Expand All @@ -454,6 +451,9 @@ DOTNET5=$(DOTNET)
else
DOTNET5=$(abspath $(TOP)/builds/downloads/dotnet/$(DOTNET5_VERSION))/dotnet
endif
DOTNET5_BCL_REF_URL=https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/7d9f5c21-0d79-403f-bfe3-9a4506529760/nuget/v3/flat2/microsoft.netcore.app.ref/5.0.0-rc.1.20404.16/microsoft.netcore.app.ref.5.0.0-rc.1.20404.16.nupkg
DOTNET5_BCL_REF_NAME=microsoft.netcore.app.ref.5.0.0-rc.1.20404.16.nupkg
DOTNET5_BCL_DIR:=$(abspath $(TOP)/builds/downloads/$(basename $(DOTNET5_BCL_REF_NAME)))/ref/net5.0

DOTNET_PLATFORMS=
ifdef INCLUDE_IOS
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,19 @@ ifdef INCLUDE_IOS
@echo Validated file permissions for Xamarin.iOS.
endif

all-local:: global.json
all-local:: global.json global5.json
global.json: Make.config Makefile
$(Q) printf "{\n\t\"sdk\": {\n\t\t\"version\": \"$(DOTNET_VERSION)\"\n\t}\n}\n" > $@

# This tells NuGet to use the exact same dotnet version we've configured in Make.config
global5.json: $(TOP)/Make.config.inc Makefile $(TOP)/.git/HEAD $(TOP)/.git/index
$(Q_GEN) \
printf "{\n" > $@; \
printf "\t\"sdk\": { \"version\": \"$(DOTNET5_VERSION)\" },\n" >> $@; \
printf "\t\"msbuild-sdks\": {\n" >> $@; \
printf "\t\t\"Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk\": \"5.0.0-beta.20120.1\"\n" >> $@; \
printf "\t}\n}\n" >> $@

install-hook::
@$(MAKE) check-permissions
ifdef INCLUDE_IOS
Expand Down
2 changes: 2 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<packageSources>
<add key="Nuget Official" value ="https://www.nuget.org/api/v2/" />
<add key="Dotnet arcade" value ="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
</packageSources>
</configuration>

6 changes: 3 additions & 3 deletions builds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ download-mono: downloads/$(basename $(MONO_IOS_FILENAME)) downloads/$(basename $

downloads/$(basename $(MONO_IOS_FILENAME)): MONO_URL=$(MONO_IOS_URL)
downloads/$(basename $(MONO_MAC_FILENAME)): MONO_URL=$(MONO_MAC_URL)
downloads/$(DOTNET_BCL_REF_NAME): MONO_URL=$(DOTNET_BCL_REF_URL)
downloads/$(DOTNET5_BCL_REF_NAME): MONO_URL=$(DOTNET5_BCL_REF_URL)

include $(TOP)/mk/colors.mk

DOWNLOADS = \
downloads/$(MONO_IOS_FILENAME) \
downloads/$(MONO_MAC_FILENAME) \
downloads/$(DOTNET_BCL_REF_NAME) \
downloads/$(DOTNET5_BCL_REF_NAME) \

# This target downloads the mono archives, there's one for Xamarin.iOS and one for Xamarin.Mac.
# If doing many clean builds, it's possible to copy the downloaded zip file to ~/Library/Caches/xamarin-macios
Expand Down Expand Up @@ -68,7 +68,7 @@ downloads/%: downloads/%.nupkg
$(Q) touch $@

DOTNET_DOWNLOADS = \
downloads/$(basename $(DOTNET_BCL_REF_NAME)) \
downloads/$(basename $(DOTNET5_BCL_REF_NAME)) \

dotnet: $(DOTNET_DOWNLOADS)
ifdef ENABLE_DOTNET
Expand Down
9 changes: 2 additions & 7 deletions dotnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,8 @@ all-local:: $(TARGETS) targets/Xamarin.Shared.Sdk.Versions.props
endif

# This tells NuGet to use the exact same dotnet version we've configured in Make.config
global.json: $(TOP)/Make.config.inc Makefile $(TOP)/.git/HEAD $(TOP)/.git/index
$(Q_GEN) \
printf "{\n" > $@; \
printf "\t\"sdk\": { \"version\": \"$(DOTNET5_VERSION)\" },\n" >> $@; \
printf "\t\"msbuild-sdks\": {\n" >> $@; \
printf "\t\t\"Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk\": \"5.0.0-beta.20120.1\"\n" >> $@; \
printf "\t}\n}\n" >> $@
global.json: $(TOP)/global5.json
$(CP) $< $@

clean-local::
$(Q) rm -Rf $(DOTNET_NUPKG_DIR) $(DOTNET_FEED_DIR)
Expand Down
66 changes: 35 additions & 31 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,41 @@ TVOS_DOTNET_BUILD_DIR=$(DOTNET_BUILD_DIR)/tvos
GENERATOR_FLAGS=-process-enums -core -nologo -nostdlib -noconfig -native-exception-marshalling --ns:ObjCRuntime

DOTNET_REFERENCES = \
/r:$(DOTNET_BCL_DIR)/System.Buffers.dll \
/r:$(DOTNET_BCL_DIR)/System.Collections.Concurrent.dll \
/r:$(DOTNET_BCL_DIR)/System.Collections.dll \
/r:$(DOTNET_BCL_DIR)/System.Collections.NonGeneric.dll \
/r:$(DOTNET_BCL_DIR)/System.Console.dll \
/r:$(DOTNET_BCL_DIR)/System.Diagnostics.Debug.dll \
/r:$(DOTNET_BCL_DIR)/System.Diagnostics.Tools.dll \
/r:$(DOTNET_BCL_DIR)/System.Drawing.Primitives.dll \
/r:$(DOTNET_BCL_DIR)/System.IO.Compression.dll \
/r:$(DOTNET_BCL_DIR)/System.IO.FileSystem.dll \
/r:$(DOTNET_BCL_DIR)/System.Linq.dll \
/r:$(DOTNET_BCL_DIR)/System.Memory.dll \
/r:$(DOTNET_BCL_DIR)/System.Net.Http.dll \
/r:$(DOTNET_BCL_DIR)/System.Net.NameResolution.dll \
/r:$(DOTNET_BCL_DIR)/System.Net.Primitives.dll \
/r:$(DOTNET_BCL_DIR)/System.Net.Requests.dll \
/r:$(DOTNET_BCL_DIR)/System.Net.Security.dll \
/r:$(DOTNET_BCL_DIR)/System.Net.ServicePoint.dll \
/r:$(DOTNET_BCL_DIR)/System.Net.Sockets.dll \
/r:$(DOTNET_BCL_DIR)/System.Resources.ResourceManager.dll \
/r:$(DOTNET_BCL_DIR)/System.Runtime.dll \
/r:$(DOTNET_BCL_DIR)/System.Runtime.Extensions.dll \
/r:$(DOTNET_BCL_DIR)/System.Runtime.InteropServices.dll \
/r:$(DOTNET_BCL_DIR)/System.Security.Cryptography.X509Certificates.dll \
/r:$(DOTNET_BCL_DIR)/System.Text.RegularExpressions.dll \
/r:$(DOTNET_BCL_DIR)/System.Threading.dll \
/r:$(DOTNET_BCL_DIR)/System.Threading.Tasks.dll \
/r:$(DOTNET_BCL_DIR)/System.Threading.Thread.dll \
/r:$(DOTNET_BCL_DIR)/System.Xml.dll \
/r:$(DOTNET_BCL_DIR)/System.Xml.ReaderWriter.dll \
/r:$(DOTNET5_BCL_DIR)/System.Buffers.dll \
/r:$(DOTNET5_BCL_DIR)/System.Collections.Concurrent.dll \
/r:$(DOTNET5_BCL_DIR)/System.Collections.dll \
/r:$(DOTNET5_BCL_DIR)/System.Collections.NonGeneric.dll \
/r:$(DOTNET5_BCL_DIR)/System.Console.dll \
/r:$(DOTNET5_BCL_DIR)/System.Diagnostics.Debug.dll \
/r:$(DOTNET5_BCL_DIR)/System.Diagnostics.Tools.dll \
/r:$(DOTNET5_BCL_DIR)/System.Drawing.Primitives.dll \
/r:$(DOTNET5_BCL_DIR)/System.IO.Compression.dll \
/r:$(DOTNET5_BCL_DIR)/System.IO.FileSystem.dll \
/r:$(DOTNET5_BCL_DIR)/System.Linq.dll \
/r:$(DOTNET5_BCL_DIR)/System.Memory.dll \
/r:$(DOTNET5_BCL_DIR)/System.Net.Http.dll \
/r:$(DOTNET5_BCL_DIR)/System.Net.NameResolution.dll \
/r:$(DOTNET5_BCL_DIR)/System.Net.Primitives.dll \
/r:$(DOTNET5_BCL_DIR)/System.Net.Requests.dll \
/r:$(DOTNET5_BCL_DIR)/System.Net.Security.dll \
/r:$(DOTNET5_BCL_DIR)/System.Net.ServicePoint.dll \
/r:$(DOTNET5_BCL_DIR)/System.Net.Sockets.dll \
/r:$(DOTNET5_BCL_DIR)/System.Resources.ResourceManager.dll \
/r:$(DOTNET5_BCL_DIR)/System.Runtime.dll \
/r:$(DOTNET5_BCL_DIR)/System.Runtime.Extensions.dll \
/r:$(DOTNET5_BCL_DIR)/System.Runtime.InteropServices.dll \
/r:$(DOTNET5_BCL_DIR)/System.Security.Cryptography.X509Certificates.dll \
/r:$(DOTNET5_BCL_DIR)/System.Text.RegularExpressions.dll \
/r:$(DOTNET5_BCL_DIR)/System.Threading.dll \
/r:$(DOTNET5_BCL_DIR)/System.Threading.Tasks.dll \
/r:$(DOTNET5_BCL_DIR)/System.Threading.Thread.dll \
/r:$(DOTNET5_BCL_DIR)/System.Xml.dll \
/r:$(DOTNET5_BCL_DIR)/System.Xml.ReaderWriter.dll \

DOTNET_FLAGS=/noconfig /nostdlib+ /deterministic /features:strict /nologo /target:library /debug /unsafe /define:NET /define:NET_TODO $(DOTNET_REFERENCES)

DOTNET_COMPILER=$(DOTNET_BUILD_DIR)/compiler
DOTNET_GENERATOR_FLAGS=$(GENERATOR_FLAGS) -compiler=$(abspath $(DOTNET_COMPILER)) --lib=$(DOTNET_BCL_DIR) -attributelib:$(DOTNET_BINDING_ATTRIBUTES) $(DOTNET_REFERENCES)
DOTNET_GENERATOR_FLAGS=$(GENERATOR_FLAGS) -compiler=$(abspath $(DOTNET_COMPILER)) --lib=$(DOTNET5_BCL_DIR) -attributelib:$(DOTNET_BINDING_ATTRIBUTES) $(DOTNET_REFERENCES)
DOTNET_GENERATOR=$(DOTNET_BUILD_DIR)/bgen/bgen
DOTNET_BINDING_ATTRIBUTES=$(DOTNET_BUILD_DIR)/Xamarin.Apple.BindingAttributes.dll

Expand Down Expand Up @@ -1194,6 +1194,10 @@ $(DOTNET_COMPILER): Makefile $(TOP)/Make.config | $(DOTNET_BUILD_DIR)
$(Q) echo "exec $(SYSTEM_CSC) $(DOTNET_FLAGS) \"\$$@\"" >> $@
$(Q) chmod +x $@

# This tells NuGet to use the exact same dotnet version we've configured in Make.config
global.json: $(TOP)/global5.json
$(Q) $(CP) $< $@

install-local:: $(INSTALL_TARGETS)
all-local:: $(ALL_TARGETS)

Expand Down
7 changes: 5 additions & 2 deletions src/Makefile.generator
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ $(BUILD_DIR)/generator.csproj: generator.csproj | $(BUILD_DIR)
$(BUILD_DIR)/common/bgen.exe: $(generator_dependencies) Makefile.generator $(BUILD_DIR)/generator-frameworks.g.cs
$(Q_GEN) $(SYSTEM_MSBUILD) $(XBUILD_VERBOSITY) /p:Configuration=Debug generator.csproj /p:IntermediateOutputPath=$(BUILD_DIR)/IDE/obj/common/ /p:OutputPath=$(BUILD_DIR)/common

$(DOTNET_BUILD_DIR)/bgen/bgen: $(generator_dependencies) Makefile.generator $(BUILD_DIR)/generator-frameworks.g.cs | $(DOTNET_BUILD_DIR)/bgen
$(Q_DOTNET_BUILD) $(DOTNET) build $(XBUILD_VERBOSITY) /p:Configuration=Debug bgen/bgen.csproj /p:IntermediateOutputPath=$(abspath $(DOTNET_BUILD_DIR)/IDE/obj/common)/ /p:OutputPath=$(abspath $(DOTNET_BUILD_DIR)/IDE/bin/common)/
$(DOTNET_BUILD_DIR)/bgen/bgen: $(generator_dependencies) Makefile.generator $(BUILD_DIR)/generator-frameworks.g.cs global.json | $(DOTNET_BUILD_DIR)/bgen
$(Q_DOTNET_BUILD) $(DOTNET5) publish $(XBUILD_VERBOSITY) /p:Configuration=Debug bgen/bgen.csproj /p:IntermediateOutputPath=$(abspath $(DOTNET_BUILD_DIR)/IDE/obj/common)/ /p:OutputPath=$(abspath $(DOTNET_BUILD_DIR)/IDE/bin/common)/
$(Q) $(CP) $(DOTNET_BUILD_DIR)/IDE/bin/common/bgen* $(dir $@)
$(Q) printf 'exec $(DOTNET5) "$$(dirname "$$0")"/bgen.dll $$@\n' > $@
$(Q) chmod +x $@


$(DOTNET_DESTDIR)/%.Sdk/tools/lib/bgen/bgen: $(DOTNET_BUILD_DIR)/bgen/bgen | $(DOTNET_DESTDIR)/%.Sdk/tools/lib/bgen
$(Q) rm -f $(dir $@)/bgen*
Expand Down
2 changes: 1 addition & 1 deletion src/bgen/bgen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFramework>net5.0</TargetFramework>
<OutputType>Exe</OutputType>
<DefineConstants>DEBUG;BGENERATOR;NET_4_0;NO_AUTHENTICODE;STATIC;NO_SYMBOL_WRITER</DefineConstants>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/bgen/bgen.dotnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ pushd "$(dirname "$0")/.." > /dev/null
MONOTOUCH_PREFIX=$(pwd -P)
popd > /dev/null

exec "$MONOTOUCH_PREFIX/lib/bgen/bgen" "$@"
exec dotnet "$MONOTOUCH_PREFIX/lib/bgen/bgen.dll" "$@"
1 change: 1 addition & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NuGet.config
generated-projects
*index.html
*.log
Expand Down
2 changes: 1 addition & 1 deletion tests/bgen/bgen-tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>bgen_tests</RootNamespace>

<IsPackable>false</IsPackable>
Expand Down
9 changes: 8 additions & 1 deletion tests/dotnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ include $(TOP)/Make.config
NuGet.config: $(TOP)/NuGet.config Makefile
$(Q) $(CP) $< [email protected]
$(Q) nuget sources add -Name local-dotnet-feed -Source $(abspath $(DOTNET_FEED_DIR)) -ConfigFile [email protected]
$(Q) nuget sources add -Name dotnet5 -Source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" -ConfigFile [email protected]
$(Q) nuget config -Set globalPackagesFolder=$(abspath $(CURDIR)/packages) -Config [email protected]
$(Q) nuget config -Set repositorypath=$(abspath $(CURDIR)/packages) -Config [email protected]
$(Q) mv [email protected] $@
Expand All @@ -24,8 +23,16 @@ global.json: $(TOP)/Make.config.inc Makefile $(TOP)/.git/HEAD $(TOP)/.git/index
printf "\t\t\"Microsoft.macOS.Sdk\": \"$(MACOS_NUGET_VERSION_NO_METADATA)\"\n" >> $@; \
printf "\t}\n}\n" >> $@

../bgen/global.json: global.json
$(Q) $(CP) $< $@

../bgen/NuGet.config: NuGet.config
$(Q) $(CP) $< $@

TARGETS += \
NuGet.config \
global.json \
../bgen/NuGet.config \
../bgen/global.json \

all-local:: $(TARGETS)
2 changes: 2 additions & 0 deletions tests/xharness/Jenkins/TestTasks/DotNetTestTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public override async Task RunTestAsync ()
"--logger:html;LogFileName=" + Path.GetFileName (html.FullPath)
};

WorkingDirectory = Path.GetDirectoryName (ProjectFile);

await ExecuteProcessAsync (Jenkins.Harness.GetDotNetExecutable (Path.GetDirectoryName (ProjectFile)), args);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/mmp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Xamarin.Mac.registrar.mobile.x86_64.m: $(TOP)/src/build/mac/mobile-64/Xamarin.Ma
$(Q) touch Xamarin.Mac.registrar.mobile.x86_64.m Xamarin.Mac.registrar.mobile.x86_64.h

Microsoft.macOS.registrar.x86_64.m: $(TOP)/src/build/dotnet/macos/64/Xamarin.Mac.dll $(LOCAL_MMP)
$(GENERATE_PART_REGISTRAR) --target-framework .NETCoreApp,Version=5.0,Profile=macos -a:$(DOTNET_BCL_DIR)/System.Runtime.dll
$(GENERATE_PART_REGISTRAR) --target-framework .NETCoreApp,Version=5.0,Profile=macos -a:$(DOTNET5_BCL_DIR)/System.Runtime.dll
$(Q) touch $@ $(basename $@).h

Xamarin.Mac.registrar.full.x86_64.m: $(TOP)/src/build/mac/full-64/Xamarin.Mac.dll $(LOCAL_MMP)
Expand Down
2 changes: 1 addition & 1 deletion tools/mtouch/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ define RunRegistrar
$$(Q) touch $$(basename $$@).m $$(basename $$@).h

.libs/Microsoft.$(9).registrar.$(10)%m .libs/Microsoft.$(9).registrar.$(10)%h: $(TOP)/src/build/dotnet/$(1)/$(3)/Xamarin.$(5).dll $(LOCAL_MTOUCH) | .libs
$$(Q_GEN) $$(LOCAL_MTOUCH_COMMAND) --xamarin-framework-directory=$$(IOS_DESTDIR)/$$(MONOTOUCH_PREFIX) $$(MTOUCH_VERBOSITY) --runregistrar:$$(abspath $$(basename $$@).m) --sdkroot $$(XCODE_DEVELOPER_ROOT) --sdk $(4) $$< --registrar:static --target-framework .NETCoreApp,Version=5.0,Profile=$(1) --abi $(2) -r:$(DOTNET_BCL_DIR)/System.Runtime.dll
$$(Q_GEN) $$(LOCAL_MTOUCH_COMMAND) --xamarin-framework-directory=$$(IOS_DESTDIR)/$$(MONOTOUCH_PREFIX) $$(MTOUCH_VERBOSITY) --runregistrar:$$(abspath $$(basename $$@).m) --sdkroot $$(XCODE_DEVELOPER_ROOT) --sdk $(4) $$< --registrar:static --target-framework .NETCoreApp,Version=5.0,Profile=$(1) --abi $(2) -r:$(DOTNET5_BCL_DIR)/System.Runtime.dll
$$(Q) touch $$(basename $$@).m $$(basename $$@).h

%.registrar.$(1).$(2).a: %.registrar.$(1).$(2).m %.registrar.$(1).$(2).h
Expand Down