diff --git a/.gitignore b/.gitignore
index dcbcb19e9e51..32c7243fdcb5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/Make.config b/Make.config
index 0417373b1bba..13431c6844e0 100644
--- a/Make.config
+++ b/Make.config
@@ -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
@@ -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
diff --git a/Makefile b/Makefile
index c86f2cf2dbbd..a39c0db2115d 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/NuGet.config b/NuGet.config
index aa239d6eb39e..32cb576046df 100644
--- a/NuGet.config
+++ b/NuGet.config
@@ -6,6 +6,8 @@
+
+
diff --git a/builds/Makefile b/builds/Makefile
index 088a0b5606ac..dac64f0742d8 100644
--- a/builds/Makefile
+++ b/builds/Makefile
@@ -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
@@ -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
diff --git a/dotnet/Makefile b/dotnet/Makefile
index 6e33f452b0b9..a7bab01f9b10 100644
--- a/dotnet/Makefile
+++ b/dotnet/Makefile
@@ -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)
diff --git a/src/Makefile b/src/Makefile
index b00381e63604..a7398b80fa92 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -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
@@ -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)
diff --git a/src/Makefile.generator b/src/Makefile.generator
index a11d9f62f8ae..abe046f18c1e 100644
--- a/src/Makefile.generator
+++ b/src/Makefile.generator
@@ -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*
diff --git a/src/bgen/bgen.csproj b/src/bgen/bgen.csproj
index c057ca13e00b..e4194faaa723 100644
--- a/src/bgen/bgen.csproj
+++ b/src/bgen/bgen.csproj
@@ -2,7 +2,7 @@
- netcoreapp3.1
+ net5.0
Exe
DEBUG;BGENERATOR;NET_4_0;NO_AUTHENTICODE;STATIC;NO_SYMBOL_WRITER
diff --git a/src/bgen/bgen.dotnet b/src/bgen/bgen.dotnet
index f0b0c903d020..7c77c236927b 100755
--- a/src/bgen/bgen.dotnet
+++ b/src/bgen/bgen.dotnet
@@ -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" "$@"
diff --git a/tests/.gitignore b/tests/.gitignore
index 1dac47c41c64..eaadefc8a76b 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,3 +1,4 @@
+NuGet.config
generated-projects
*index.html
*.log
diff --git a/tests/bgen/bgen-tests.csproj b/tests/bgen/bgen-tests.csproj
index 9a70dc9ce8e3..fcc8e1aeef97 100644
--- a/tests/bgen/bgen-tests.csproj
+++ b/tests/bgen/bgen-tests.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
bgen_tests
false
diff --git a/tests/dotnet/Makefile b/tests/dotnet/Makefile
index b1e30dfc44a4..a242a8f79adc 100644
--- a/tests/dotnet/Makefile
+++ b/tests/dotnet/Makefile
@@ -7,7 +7,6 @@ include $(TOP)/Make.config
NuGet.config: $(TOP)/NuGet.config Makefile
$(Q) $(CP) $< $@.tmp
$(Q) nuget sources add -Name local-dotnet-feed -Source $(abspath $(DOTNET_FEED_DIR)) -ConfigFile $@.tmp
- $(Q) nuget sources add -Name dotnet5 -Source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" -ConfigFile $@.tmp
$(Q) nuget config -Set globalPackagesFolder=$(abspath $(CURDIR)/packages) -Config $@.tmp
$(Q) nuget config -Set repositorypath=$(abspath $(CURDIR)/packages) -Config $@.tmp
$(Q) mv $@.tmp $@
@@ -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)
diff --git a/tests/xharness/Jenkins/TestTasks/DotNetTestTask.cs b/tests/xharness/Jenkins/TestTasks/DotNetTestTask.cs
index 9162af782b48..6c0dd9efa572 100644
--- a/tests/xharness/Jenkins/TestTasks/DotNetTestTask.cs
+++ b/tests/xharness/Jenkins/TestTasks/DotNetTestTask.cs
@@ -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);
}
}
diff --git a/tools/mmp/Makefile b/tools/mmp/Makefile
index 1ebd65d975bd..0d010bbe2145 100644
--- a/tools/mmp/Makefile
+++ b/tools/mmp/Makefile
@@ -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)
diff --git a/tools/mtouch/Makefile b/tools/mtouch/Makefile
index cc714bc938d8..9502bab26bbc 100644
--- a/tools/mtouch/Makefile
+++ b/tools/mtouch/Makefile
@@ -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