From f391f2656e32d90078806b9d88eb0184e802697d Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 1 Nov 2024 16:05:43 +0100 Subject: [PATCH 1/7] Remove a lot of legacy logic. And there's still a lot more left... but bit by bit we're getting there. --- Make.config | 84 +--- Make.versions | 3 +- Makefile | 19 +- builds/Makefile | 2 +- configure | 12 +- docs/CORECLR.md | 2 +- dotnet/Makefile | 2 - mk/rules.mk | 72 +-- msbuild/Makefile | 2 - runtime/Makefile | 476 +----------------- scripts/versions-check/versions-check.cs | 30 +- src/Makefile | 2 - src/MinimumVersions.cs.in | 15 - system-dependencies.sh | 8 +- tests/Makefile | 19 +- tests/cecil-tests/ApiTest.cs | 1 - tests/cecil-tests/AttributeTest.cs | 8 +- tests/cecil-tests/EnumTest.cs | 1 - tests/cecil-tests/Helper.cs | 90 +--- tests/cecil-tests/MarshalAsTest.cs | 1 - tests/cecil-tests/Test.cs | 5 - tests/common/Configuration.cs | 398 ++------------- tests/common/ConfigurationNUnit.cs | 21 +- tests/common/mac/ProjectTestHelpers.cs | 5 - tests/dotnet/UnitTests/BundleStructureTest.cs | 4 +- tests/dotnet/UnitTests/ProjectTest.cs | 2 +- tests/dotnet/UnitTests/RegistrarTest.cs | 2 +- tests/dotnet/UnitTests/TemplateProjectTest.cs | 1 - tests/dotnet/UnitTests/XcodeProjectTests.cs | 2 +- tests/generator/BGenTool.cs | 19 +- .../AssemblySetup.cs | 3 - .../FrameworkListTest.cs | 185 ------- .../TaskTests/MergeAppBundleTaskTest.cs | 3 +- tests/test-libraries/Makefile | 10 - tests/test-libraries/frameworks/Makefile | 7 - tests/xharness/Jenkins/Jenkins.cs | 15 +- .../Jenkins/NUnitTestTasksEnumerable.cs | 2 +- tests/xharness/Jenkins/TestSelector.cs | 3 +- .../Jenkins/TestTasks/NUnitExecuteTask.cs | 2 +- .../xharness/Jenkins/TestVariationsFactory.cs | 2 - tests/xharness/TestLabel.cs | 3 +- tools/Makefile | 8 - tools/common/Application.cs | 2 - tools/common/Make.common | 13 +- tools/common/ProductConstants.in.cs | 2 - tools/common/SdkVersions.cs | 33 -- tools/common/SdkVersions.in.cs | 33 -- .../scripts/TestConfiguration.Tests.ps1 | 2 - tools/devops/automation/scripts/VSTS.psm1 | 24 - .../scripts/bash/configure-decisions.sh | 3 - .../scripts/bash/configure-platforms.sh | 19 - .../scripts/bash/install-workloads.sh | 9 - .../templates/build/build-mac-tests-stage.yml | 2 - .../automation/templates/build/build-pkgs.yml | 2 +- .../templates/build/build-stage.yml | 6 - .../automation/templates/main-stage.yml | 17 - .../templates/release/vs-insertion-prep.yml | 5 +- .../automation/templates/windows/stage.yml | 4 - tools/mlaunch/Makefile | 24 - 59 files changed, 98 insertions(+), 1653 deletions(-) delete mode 100644 tests/msbuild/Xamarin.MacDev.Tasks.Tests/FrameworkListTest.cs diff --git a/Make.config b/Make.config index 1991abdcf722..7c21be1c55ed 100644 --- a/Make.config +++ b/Make.config @@ -201,14 +201,6 @@ TVOS_NUGET_VERSION_PATCH=$(word 3, $(subst ., ,$(TVOS_NUGET_VERSION))) TVOS_NUGET_VERSION_NO_METADATA=$(TVOS_NUGET_VERSION)$(NUGET_PRERELEASE_IDENTIFIER) TVOS_NUGET_VERSION_FULL=$(TVOS_NUGET_VERSION_NO_METADATA)$(NUGET_BUILD_METADATA) -WATCHOS_NUGET=Microsoft.watchOS -WATCHOS_NUGET_VERSION=$(WATCHOS_NUGET_OS_VERSION).$(WATCHOS_NUGET_COMMIT_DISTANCE) -WATCHOS_NUGET_VERSION_MAJOR=$(word 1, $(subst ., ,$(WATCHOS_NUGET_VERSION))) -WATCHOS_NUGET_VERSION_MINOR=$(word 2, $(subst ., ,$(WATCHOS_NUGET_VERSION))) -WATCHOS_NUGET_VERSION_PATCH=$(word 3, $(subst ., ,$(WATCHOS_NUGET_VERSION))) -WATCHOS_NUGET_VERSION_NO_METADATA=$(WATCHOS_NUGET_VERSION)$(NUGET_PRERELEASE_IDENTIFIER) -WATCHOS_NUGET_VERSION_FULL=$(WATCHOS_NUGET_VERSION_NO_METADATA)$(NUGET_BUILD_METADATA) - MACCATALYST_NUGET=Microsoft.MacCatalyst MACCATALYST_NUGET_VERSION=$(MACCATALYST_NUGET_OS_VERSION).$(MACCATALYST_NUGET_COMMIT_DISTANCE) MACCATALYST_NUGET_VERSION_MAJOR=$(word 1, $(subst ., ,$(MACCATALYST_NUGET_VERSION))) @@ -275,25 +267,19 @@ MIN_OSX_VERSION_FOR_MAC=10.15 # Bump the *_NUGET_VERSION variables in Make.versions instead, because that makes sure the computed commit distance for the version is correct. IOS_SDK_VERSION=$(word 1, $(subst ., ,$(IOS_NUGET_VERSION))).$(word 2, $(subst ., ,$(IOS_NUGET_VERSION))) MACOS_SDK_VERSION=$(word 1, $(subst ., ,$(MACOS_NUGET_VERSION))).$(word 2, $(subst ., ,$(MACOS_NUGET_VERSION))) -WATCH_SDK_VERSION=$(word 1, $(subst ., ,$(WATCHOS_NUGET_VERSION))).$(word 2, $(subst ., ,$(WATCHOS_NUGET_VERSION))) TVOS_SDK_VERSION=$(word 1, $(subst ., ,$(TVOS_NUGET_VERSION))).$(word 2, $(subst ., ,$(TVOS_NUGET_VERSION))) MACCATALYST_SDK_VERSION=$(word 1, $(subst ., ,$(MACCATALYST_NUGET_VERSION))).$(word 2, $(subst ., ,$(MACCATALYST_NUGET_VERSION))) MACCATALYST_MAC_SDK_VERSION=$(MACOS_SDK_VERSION) MAX_IOS_DEPLOYMENT_TARGET=$(IOS_SDK_VERSION) -MAX_WATCH_DEPLOYMENT_TARGET=$(WATCH_SDK_VERSION) MAX_TVOS_DEPLOYMENT_TARGET=$(TVOS_SDK_VERSION) MAX_IOS_SIMULATOR_VERSION=$(IOS_SDK_VERSION) MAX_TVOS_SIMULATOR_VERSION=$(TVOS_SDK_VERSION) -MAX_WATCH_SIMULATOR_VERSION=$(WATCH_SDK_VERSION) # Minimum OS versions for running XI/XM apps. MIN_IOS_SDK_VERSION=12.2 MIN_MACOS_SDK_VERSION=12.0 -MIN_WATCHOS_SDK_VERSION=4.0 -MIN_WATCHOS64_32_SDK_VERSION=5.1 -MIN_WATCH_OS_VERSION=4.0 MIN_TVOS_SDK_VERSION=12.2 MIN_MACCATALYST_SDK_VERSION=15.0 @@ -305,40 +291,17 @@ DOTNET_MIN_MACOS_SDK_VERSION=12.0 # The min simulator version available in the Xcode we're using MIN_IOS_SIMULATOR_VERSION=15.0 -MIN_WATCHOS_SIMULATOR_VERSION=8.0 -# This is the iOS version that matches the watchOS version (i.e same Xcode) -MIN_WATCHOS_COMPANION_SIMULATOR_VERSION=15.0 MIN_TVOS_SIMULATOR_VERSION=15.0 # These are the simulator package ids for the versions above -EXTRA_SIMULATORS=com.apple.pkg.iPhoneSimulatorSDK15_0 com.apple.pkg.AppleTVSimulatorSDK15_0 com.apple.pkg.WatchSimulatorSDK8_0 +EXTRA_SIMULATORS=com.apple.pkg.iPhoneSimulatorSDK15_0 com.apple.pkg.AppleTVSimulatorSDK15_0 INCLUDE_IOS=1 INCLUDE_MAC=1 INCLUDE_TVOS=1 INCLUDE_MACCATALYST=1 INCLUDE_DEVICE=1 -INCLUDE_XAMARIN_LEGACY= INCLUDE_HOTRESTART=1 -ENABLE_DOTNET=1 - -ifeq ($(shell test $(shell echo $(MIN_IOS_SDK_VERSION) | sed 's/[.].*//') -ge 11; echo $$?),0) -IOS_SUPPORTS_32BIT_ARCHITECTURES= -else -IOS_SUPPORTS_32BIT_ARCHITECTURES=1 -endif - -ifeq ($(shell test $(shell echo $(MIN_WATCHOS_SDK_VERSION) | sed 's/[.].*//') -ge 9; echo $$?),0) -WATCHOS_SUPPORTS_32BIT_DEVICE_ARCHITECTURES= -else -WATCHOS_SUPPORTS_32BIT_DEVICE_ARCHITECTURES=1 -endif -ifeq ($(shell test $(shell echo $(MIN_WATCHOS_SDK_VERSION) | sed 's/[.].*//') -ge 4; echo $$?),0) -WATCHOS_SUPPORTS_32BIT_SIMULATOR_ARCHITECTURES= -else -WATCHOS_SUPPORTS_32BIT_SIMULATOR_ARCHITECTURES=1 -endif - -include $(TOP)/Make.config.local -include $(TOP)/configure.inc @@ -381,7 +344,6 @@ MONOTOUCH_PREFIX := $(abspath $(MONOTOUCH_PREFIX)) MONOTOUCH_MONO_PATH?=$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS MONOTOUCH_TV_MONO_PATH?=$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.TVOS -MONOTOUCH_WATCH_MONO_PATH?=$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.WatchOS MONOTOUCH_MACCATALYST_MONO_PATH?=$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.MacCatalyst IOS_PACKAGE_FILENAME=$(IOS_PACKAGE_NAME_LOWER)-$(IOS_PACKAGE_VERSION).pkg @@ -449,7 +411,6 @@ DEVICE_CXX=$(IOS_CXX) IOS_CSC=$(SYSTEM_CSC) -features:strict -nostdlib -noconfig -r:$(MONOTOUCH_MONO_PATH)/System.dll -r:$(MONOTOUCH_MONO_PATH)/System.Core.dll -r:$(MONOTOUCH_MONO_PATH)/System.Xml.dll -r:$(MONOTOUCH_MONO_PATH)/mscorlib.dll -r:$(MONOTOUCH_MONO_PATH)/System.Net.Http.dll -r:$(MONOTOUCH_MONO_PATH)/Facades/System.Drawing.Common.dll -deterministic TV_CSC=$(SYSTEM_CSC) -features:strict -nostdlib -noconfig -r:$(MONOTOUCH_TV_MONO_PATH)/System.dll -r:$(MONOTOUCH_TV_MONO_PATH)/System.Core.dll -r:$(MONOTOUCH_TV_MONO_PATH)/System.Xml.dll -r:$(MONOTOUCH_TV_MONO_PATH)/mscorlib.dll -r:$(MONOTOUCH_TV_MONO_PATH)/System.Net.Http.dll -r:$(MONOTOUCH_TV_MONO_PATH)/Facades/System.Drawing.Common.dll -deterministic -WATCH_CSC=$(SYSTEM_CSC) -features:strict -nostdlib -noconfig -r:$(MONOTOUCH_WATCH_MONO_PATH)/System.dll -r:$(MONOTOUCH_WATCH_MONO_PATH)/System.Core.dll -r:$(MONOTOUCH_WATCH_MONO_PATH)/System.Xml.dll -r:$(MONOTOUCH_WATCH_MONO_PATH)/mscorlib.dll -r:$(MONOTOUCH_WATCH_MONO_PATH)/System.Net.Http.dll -r:$(MONOTOUCH_WATCH_MONO_PATH)/Facades/System.Drawing.Common.dll -deterministic MACCATALYST_CSC=$(SYSTEM_CSC) -features:strict -nostdlib -noconfig -r:$(MONOTOUCH_MACCATALYST_MONO_PATH)/System.dll -r:$(MONOTOUCH_MACCATALYST_MONO_PATH)/System.Core.dll -r:$(MONOTOUCH_MACCATALYST_MONO_PATH)/System.Xml.dll -r:$(MONOTOUCH_MACCATALYST_MONO_PATH)/mscorlib.dll -r:$(MONOTOUCH_MACCATALYST_MONO_PATH)/System.Net.Http.dll -r:$(MONOTOUCH_MACCATALYST_MONO_PATH)/Facades/System.Drawing.Common.dll -deterministic DEVICE_OBJC_CFLAGS=$(OBJC_CFLAGS) @@ -476,23 +437,6 @@ XAMARIN_IPHONEOS_SDK = $(MONOTOUCH_DEVICE_SDK) XAMARIN_MACCATALYST_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.MacCatalyst.sdk -# WatchOS - -XAMARIN_WATCHSIMULATOR_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.WatchSimulator.sdk -XAMARIN_WATCHOS_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.WatchOS.sdk - -SIMULATORWATCH_SDK = $(XCODE_DEVELOPER_ROOT)/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator$(WATCH_SDK_VERSION).sdk -SIMULATORWATCH_CFLAGS = -arch i386 -mwatchos-simulator-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(SIMULATORWATCH_SDK) $(CFLAGS) -g $(IOS_COMMON_DEFINES) -SIMULATORWATCH64_CFLAGS = -arch x86_64 -mwatchos-simulator-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(SIMULATORWATCH_SDK) $(CFLAGS) -g $(IOS_COMMON_DEFINES) -SIMULATORWATCH_OBJC_CFLAGS = $(SIMULATORWATCH_CFLAGS) $(COMMON_SIMULATOR_OBJC_CFLAGS) -SIMULATORWATCH64_OBJC_CFLAGS = $(SIMULATORWATCH64_CFLAGS) $(COMMON_SIMULATOR_OBJC_CFLAGS) - -DEVICEWATCH_SDK = $(XCODE_DEVELOPER_ROOT)/Platforms/WatchOS.platform/Developer/SDKs/WatchOS$(WATCH_SDK_VERSION).sdk -DEVICEWATCH_CFLAGS = -arch armv7k -mwatchos-version-min=$(MIN_WATCHOS_SDK_VERSION) -isysroot $(DEVICEWATCH_SDK) $(CFLAGS) $(IOS_COMMON_DEFINES) -DEVICEWATCH64_32_CFLAGS = -arch arm64_32 -mwatchos-version-min=$(MIN_WATCHOS64_32_SDK_VERSION) -isysroot $(DEVICEWATCH_SDK) $(CFLAGS) $(IOS_COMMON_DEFINES) -DEVICEWATCH_OBJC_CFLAGS = $(DEVICEWATCH_CFLAGS) $(DEVICE_OBJC_CFLAGS) -DEVICEWATCH64_32_OBJC_CFLAGS = $(DEVICEWATCH64_32_CFLAGS) $(DEVICE_OBJC_CFLAGS) - # TVOS XAMARIN_TVSIMULATOR_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.AppleTVSimulator.sdk @@ -544,14 +488,6 @@ TVOS_SIMULATOR_X64_SWIFTFLAGS=$(TVOS_SIMULATOR_COMMON_SWIFTFLAGS) -target x86_64 TVOS_DEVICE_COMMON_SWIFTFLAGS=$(COMMON_SWIFTFLAGS) -sdk $(DEVICETV_SDK) TVOS_DEVICE_ARM64_SWIFTFLAGS=$(TVOS_DEVICE_COMMON_SWIFTFLAGS) -target arm64-apple-tvos$(MIN_TVOS_SDK_VERSION) -WATCHOS_SIMULATOR_COMMON_SWIFTFLAGS=$(COMMON_SWIFTFLAGS) -sdk $(SIMULATORWATCH_SDK) -WATCHOS_SIMULATOR_ARM64_SWIFTFLAGS=$(WATCHOS_SIMULATOR_COMMON_SWIFTFLAGS) -target arm64-apple-watchos$(MIN_WATCHOS_SDK_VERSION)-simulator -WATCHOS_SIMULATOR_X64_SWIFTFLAGS=$(WATCHOS_SIMULATOR_COMMON_SWIFTFLAGS) -target x86_64-apple-watchos$(MIN_WATCHOS_SDK_VERSION)-simulator -WATCHOS_SIMULATOR_X86_SWIFTFLAGS=$(WATCHOS_SIMULATOR_COMMON_SWIFTFLAGS) -target x86-apple-watchos$(MIN_WATCHOS_SDK_VERSION)-simulator -WATCHOS_DEVICE_COMMON_SWIFTFLAGS=$(COMMON_SWIFTFLAGS) -sdk $(DEVICEWATCH_SDK) -WATCHOS_DEVICE_ARM64_32_SWIFTFLAGS=$(WATCHOS_DEVICE_COMMON_SWIFTFLAGS) -target arm64_32-apple-watchos$(MIN_WATCHOS_SDK_VERSION) -WATCHOS_DEVICE_ARMV7K_SWIFTFLAGS=$(WATCHOS_DEVICE_COMMON_SWIFTFLAGS) -target armv7k-apple-watchos$(MIN_WATCHOS_SDK_VERSION) - MACCATALYST_COMMON_SWIFTFLAGS=$(COMMON_SWIFTFLAGS) -sdk $(XCODE_MAC_SDKROOT) -Fsystem $(XCODE_MAC_SDKROOT)/System/iOSSupport/System/Library/Frameworks MACCATALYST_ARM64_SWIFTFLAGS=$(MACCATALYST_COMMON_SWIFTFLAGS) -target arm64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi MACCATALYST_X64_SWIFTFLAGS=$(MACCATALYST_COMMON_SWIFTFLAGS) -target x86_64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi @@ -659,7 +595,6 @@ CP:=$(shell df -t apfs / >/dev/null 2>&1 && echo "cp -c" || echo "cp") MONO_IOS_SDK_DESTDIR:=$(abspath $(TOP)/builds/downloads/mono-ios-sdk-destdir) # This variable includes all the platforms we support, even those that might be disabled in this build. -ALL_PLATFORMS=iOS tvOS watchOS macOS ALL_DOTNET_PLATFORMS=iOS macOS tvOS MacCatalyst # Set this to 1 if the Microsoft.NETCore.App.Ref dependency in eng/Version.Details.xml does *not* specify a CoherentParentDependency on Microsoft.Dotnet.Sdk.Internal. @@ -766,21 +701,11 @@ DOTNET_MACOS_ASSEMBLY_NAME=Microsoft.macOS DOTNET_PLATFORMS= ifdef INCLUDE_IOS -ifdef ENABLE_DOTNET DOTNET_PLATFORMS+=iOS DOTNET_MONOVM_PLATFORMS+=iOS DOTNET_IOS_BITNESSES+=64 DOTNET_NATIVEAOT_PLATFORMS+=iOS -# 32-bit architectures -ifdef IOS_SUPPORTS_32BIT_ARCHITECTURES -DOTNET_IOS_BITNESSES+=32 -ifdef INCLUDE_DEVICE -DOTNET_IOS_RUNTIME_IDENTIFIERS_32=ios-arm -endif # INCLUDE_DEVICE -DOTNET_IOS_RUNTIME_IDENTIFIERS_32+=iossimulator-x86 -endif # IOS_SUPPORTS_32BIT_ARCHITECTURES - # 64-bit architectures ifdef INCLUDE_DEVICE DOTNET_IOS_RUNTIME_IDENTIFIERS_64=ios-arm64 @@ -789,11 +714,9 @@ DOTNET_IOS_RUNTIME_IDENTIFIERS_64+=iossimulator-x64 iossimulator-arm64 # All of them DOTNET_IOS_RUNTIME_IDENTIFIERS=$(DOTNET_IOS_RUNTIME_IDENTIFIERS_32) $(DOTNET_IOS_RUNTIME_IDENTIFIERS_64) -endif # ENABLE_DOTNET endif # INCLUDE_IOS ifdef INCLUDE_TVOS -ifdef ENABLE_DOTNET DOTNET_PLATFORMS+=tvOS DOTNET_MONOVM_PLATFORMS+=tvOS DOTNET_TVOS_BITNESSES+=64 @@ -804,29 +727,24 @@ else DOTNET_TVOS_RUNTIME_IDENTIFIERS=tvossimulator-x64 tvossimulator-arm64 endif DOTNET_TVOS_RUNTIME_IDENTIFIERS_64+=$(DOTNET_TVOS_RUNTIME_IDENTIFIERS) -endif # ENABLE_DOTNET endif ifdef INCLUDE_MACCATALYST -ifdef ENABLE_DOTNET DOTNET_PLATFORMS+=MacCatalyst DOTNET_MONOVM_PLATFORMS+=MacCatalyst DOTNET_MACCATALYST_BITNESSES+=64 DOTNET_NATIVEAOT_PLATFORMS+=MacCatalyst DOTNET_MACCATALYST_RUNTIME_IDENTIFIERS=maccatalyst-x64 maccatalyst-arm64 DOTNET_MACCATALYST_RUNTIME_IDENTIFIERS_64+=$(DOTNET_MACCATALYST_RUNTIME_IDENTIFIERS) -endif # ENABLE_DOTNET endif ifdef INCLUDE_MAC -ifdef ENABLE_DOTNET DOTNET_PLATFORMS+=macOS DOTNET_CORECLR_PLATFORMS+=macOS DOTNET_MACOS_BITNESSES+=64 DOTNET_NATIVEAOT_PLATFORMS+=macOS DOTNET_MACOS_RUNTIME_IDENTIFIERS=osx-x64 osx-arm64 DOTNET_MACOS_RUNTIME_IDENTIFIERS_64=$(DOTNET_MACOS_RUNTIME_IDENTIFIERS) -endif # ENABLE_DOTNET endif ifdef INCLUDE_IOS diff --git a/Make.versions b/Make.versions index f86394b69a29..062655186bd3 100644 --- a/Make.versions +++ b/Make.versions @@ -6,8 +6,8 @@ # # IOS_NUGET_VERSION (major/minor/patch #) # TVOS_NUGET_VERSION (major/minor/patch #) -# WATCHOS_NUGET_VERSION (major/minor/patch #) # MACOS_NUGET_VERSION (major/minor/patch #) +# MACCATALYST_NUGET_VERSION (major/minor/patch #) # # Update version numbers on main as well, to the next version # @@ -67,7 +67,6 @@ MAC_PACKAGE_VERSION=9.99.0.$(MAC_COMMIT_DISTANCE) IOS_NUGET_OS_VERSION=18.1 TVOS_NUGET_OS_VERSION=18.1 -WATCHOS_NUGET_OS_VERSION=11.1 MACOS_NUGET_OS_VERSION=15.1 MACCATALYST_NUGET_OS_VERSION=18.1 diff --git a/Makefile b/Makefile index 80321077195a..37022cb4f2e2 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,7 @@ SUBDIRS=builds runtime src msbuild tools include $(TOP)/Make.config include $(TOP)/mk/versions.mk -ifdef ENABLE_DOTNET SUBDIRS += dotnet -endif # # Common @@ -42,19 +40,8 @@ endif show-versions: @echo "Building:" -ifdef INCLUDE_XAMARIN_LEGACY - @echo " The legacy package(s):" -ifdef INCLUDE_IOS - @echo " Xamarin.iOS $(IOS_PACKAGE_VERSION)" -endif -ifdef INCLUDE_MAC - @echo " Xamarin.Mac $(MAC_PACKAGE_VERSION)" -endif -endif -ifdef ENABLE_DOTNET @echo " The .NET NuGet(s):" @$(foreach platform,$(DOTNET_PLATFORMS),echo " Microsoft.$(platform) $($(shell echo $(platform) | tr 'a-z' 'A-Z')_NUGET_VERSION_FULL)";) -endif check-permissions: ifdef INCLUDE_MAC @@ -189,16 +176,12 @@ git-clean-all: @git submodule foreach -q --recursive 'git clean -xffdq && git reset --hard -q' @for dir in $(DEPENDENCY_DIRECTORIES); do if test -d $(CURDIR)/$$dir; then echo "Cleaning $$dir" && cd $(CURDIR)/$$dir && git clean -xffdq && git reset --hard -q && git submodule foreach -q --recursive 'git clean -xffdq'; else echo "Skipped $$dir (does not exist)"; fi; done - @if [ -n "$(ENABLE_XAMARIN)" ] || [ -n "$(ENABLE_DOTNET)" ]; then \ + @if [ -n "$(ENABLE_XAMARIN)" ]; then \ CONFIGURE_FLAGS=""; \ if [ -n "$(ENABLE_XAMARIN)" ]; then \ echo "Xamarin-specific build has been re-enabled"; \ CONFIGURE_FLAGS="$$CONFIGURE_FLAGS --enable-xamarin"; \ fi; \ - if [ -n "$(ENABLE_DOTNET)" ]; then \ - echo "Dotnet-specific build has been re-enabled"; \ - CONFIGURE_FLAGS="$$CONFIGURE_FLAGS --enable-dotnet"; \ - fi; \ ./configure "$$CONFIGURE_FLAGS"; \ $(MAKE) reset; \ echo "Done"; \ diff --git a/builds/Makefile b/builds/Makefile index 3ce436e95361..85312ccd9844 100644 --- a/builds/Makefile +++ b/builds/Makefile @@ -134,7 +134,7 @@ include $(TOP)/scripts/versions-check/fragment.mk $(VERSIONS_CHECK): downloads/$(DOTNET_INSTALL_NAME) define VersionInfo $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/Versions.plist: $(TOP)/builds/Versions-$(1).plist.in Makefile $(TOP)/Make.config $(VERSIONS_CHECK) | $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME) - $$(Q) $(VERSIONS_CHECK_EXEC) $$< "$(DOTNET_MIN_IOS_SDK_VERSION)" "$(MAX_IOS_DEPLOYMENT_TARGET)" "$(DOTNET_MIN_TVOS_SDK_VERSION)" "$(MAX_TVOS_DEPLOYMENT_TARGET)" "$(MIN_WATCH_OS_VERSION)" "$(MAX_WATCH_DEPLOYMENT_TARGET)" "$(DOTNET_MIN_MACOS_SDK_VERSION)" "$(MACOS_SDK_VERSION)" "$(DOTNET_MIN_MACCATALYST_SDK_VERSION)" "$(MACCATALYST_SDK_VERSION)" + $$(Q) $(VERSIONS_CHECK_EXEC) $$< "$(DOTNET_MIN_IOS_SDK_VERSION)" "$(MAX_IOS_DEPLOYMENT_TARGET)" "$(DOTNET_MIN_TVOS_SDK_VERSION)" "$(MAX_TVOS_DEPLOYMENT_TARGET)" "$(DOTNET_MIN_MACOS_SDK_VERSION)" "$(MACOS_SDK_VERSION)" "$(DOTNET_MIN_MACCATALYST_SDK_VERSION)" "$(MACCATALYST_SDK_VERSION)" $$(QF_GEN) sed -e 's/@XCODE_VERSION@/$(XCODE_VERSION)/g' -e "s/@MONO_VERSION@/$(DOTNET_VERSION)/g" $$< > $$@.tmp $$(Q) mv $$@.tmp $$@ endef diff --git a/configure b/configure index 83f2ec39fb81..95d735a7409d 100755 --- a/configure +++ b/configure @@ -156,12 +156,12 @@ while test "x$1" != x; do shift ;; --enable-dotnet) - echo "ENABLE_DOTNET=1" >> "$CONFIGURED_FILE" + # This is the default, and there's no way do enable it, so ignore this argument shift ;; --disable-dotnet) - echo "ENABLE_DOTNET=" >> "$CONFIGURED_FILE" - shift + echo "It's not possible to disable .NET anymore." + exit 1 ;; --enable-dotnet-windows) echo "$1 is ignored. Use --enable-dotnet instead" @@ -172,11 +172,11 @@ while test "x$1" != x; do shift ;; --enable-legacy-xamarin) - echo "INCLUDE_XAMARIN_LEGACY=1" >> "$CONFIGURED_FILE" - shift + echo "It's not possible to enable legacy Xamarin anymore." + exit 1 ;; --disable-legacy-xamarin) - echo "INCLUDE_XAMARIN_LEGACY=" >> "$CONFIGURED_FILE" + # This is the default, and there's no way do enable it, so ignore this argument shift ;; --custom-dotnet=*) diff --git a/docs/CORECLR.md b/docs/CORECLR.md index d71709b164b7..adae8b4353fe 100644 --- a/docs/CORECLR.md +++ b/docs/CORECLR.md @@ -15,7 +15,7 @@ ```shell cd ~/work/xamarin-macios make git-clean-all # Must start from a clean state when switching between downloaded and custom built dotnet/runtime. - ./configure --custom-dotnet=$HOME/work/runtime --enable-dotnet + ./configure --custom-dotnet=$HOME/work/runtime ``` 3. Build dotnet/runtime using our script that builds everything we need: diff --git a/dotnet/Makefile b/dotnet/Makefile index c7ad6553b89c..a0a4479efce5 100644 --- a/dotnet/Makefile +++ b/dotnet/Makefile @@ -500,9 +500,7 @@ install-system: $(Q) cd $(HOME) && sudo dotnet workload remove $(DOTNET_PLATFORMS_LOWERCASE) $(Q) cd $(HOME) && sudo dotnet workload install --from-rollback-file $(abspath $(TOP)/../WorkloadRollback.json) --source $(abspath $(TOP)/_build/nupkgs) --source https://api.nuget.org/v3/index.json $(DOTNET_PLATFORMS_LOWERCASE) -v diag -ifdef ENABLE_DOTNET all-local:: $(TARGETS) -endif clean-local:: $(Q) rm -Rf $(DOTNET_NUPKG_DIR) diff --git a/mk/rules.mk b/mk/rules.mk index 32f808353331..0dbb9a5c2070 100644 --- a/mk/rules.mk +++ b/mk/rules.mk @@ -176,76 +176,6 @@ define NativeCompilationTemplate .libs/maccatalyst/%$(1).arm64.framework: | .libs/maccatalyst $$(call Q_2,LD, [maccatalyst]) $(XCODE_CC) $(MACCATALYST_ARM64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/Frameworks -fapplication-extension -## watch simulator - -.libs/watchsimulator/%$(1).x86.o: %.m $(EXTRA_DEPENDENCIES) | .libs/watchsimulator - $$(call Q_2,OBJC, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(SIMW_I) -g $(2) -c $$< -o $$@ - -.libs/watchsimulator/%$(1).x86.o: %.c $(EXTRA_DEPENDENCIES) | .libs/watchsimulator - $$(call Q_2,CC, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_CFLAGS) $$(EXTRA_DEFINES) $(SIMW_I) -g $(2) -c $$< -o $$@ - -.libs/watchsimulator/%$(1).x86.o: %.s $(EXTRA_DEPENDENCIES) | .libs/watchsimulator - $$(call Q_2,ASM, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_CFLAGS) $$(EXTRA_DEFINES) $(SIMW_I) -g $(2) -c $$< -o $$@ - -.libs/watchsimulator/%$(1).x86.dylib: %.swift | .libs/watchsimulator - $$(call Q_2,SWIFT, [watchsimulator]) $(SWIFTC) $(WATCHOS_SIMULATOR_X86_SWIFTFLAGS) $$< -o $$@ - -.libs/watchsimulator/%$(1).x86.dylib: | .libs/watchsimulator - $$(call Q_2,LD, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib -fapplication-extension - -.libs/watchsimulator/%$(1).x86.framework: | .libs/watchsimulator - $$(call Q_2,LD, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks -fapplication-extension - -.libs/watchsimulator/%$(1).x86_64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/watchsimulator - $$(call Q_2,OBJC, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH64_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(SIMW64_I) -g $(2) -c $$< -o $$@ - -.libs/watchsimulator/%$(1).x86_64.o: %.c $(EXTRA_DEPENDENCIES) | .libs/watchsimulator - $$(call Q_2,CC, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH64_CFLAGS) $$(EXTRA_DEFINES) $(SIMW64_I) -g $(2) -c $$< -o $$@ - -.libs/watchsimulator/%$(1).x86_64.o: %.s $(EXTRA_DEPENDENCIES) | .libs/watchsimulator - $$(call Q_2,ASM, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH64_CFLAGS) $$(EXTRA_DEFINES) $(SIMW64_I) -g $(2) -c $$< -o $$@ - -.libs/watchsimulator/%$(1).x86_64.dylib: %.swift | .libs/watchsimulator - $$(call Q_2,SWIFT, [watchsimulator]) $(SWIFTC) $(WATCHOS_SIMULATOR_X64_SWIFTFLAGS) $$< -o $$@ - -.libs/watchsimulator/%$(1).x86_64.dylib: | .libs/watchsimulator - $$(call Q_2,LD, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib -fapplication-extension - -.libs/watchsimulator/%$(1).x86_64.framework: | .libs/watchsimulator - $$(call Q_2,LD, [watchsimulator]) $(SIMULATOR_CC) $(SIMULATORWATCH64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks -fapplication-extension - -## watch device - -.libs/watchos/%$(1).armv7k.o: %.m $(EXTRA_DEPENDENCIES) | .libs/watchos - $$(call Q_2,OBJC, [watchos]) $(DEVICE_CC) $(DEVICEWATCH_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(DEVW_I) -g $(2) -c $$< -o $$@ - -.libs/watchos/%$(1).armv7k.o: %.c $(EXTRA_DEPENDENCIES) | .libs/watchos - $$(call Q_2,CC, [watchos]) $(DEVICE_CC) $(DEVICEWATCH_CFLAGS) $$(EXTRA_DEFINES) $(DEVW_I) -g $(2) -c $$< -o $$@ - -.libs/watchos/%$(1).armv7k.dylib: %.swift | .libs/watchsimulator - $$(call Q_2,SWIFT, [watchos]) $(SWIFTC) $(WATCHOS_DEVICE_ARMV7K_SWIFTFLAGS) $$< -o $$@ - -.libs/watchos/%$(1).armv7k.dylib: | .libs/watchos - $$(call Q_2,LD, [watchos]) $(DEVICE_CC) $(DEVICEWATCH_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib -fapplication-extension - -.libs/watchos/%$(1).armv7k.framework: | .libs/watchos - $$(call Q_2,LD, [watchos]) $(DEVICE_CC) $(DEVICEWATCH_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks -fapplication-extension - -.libs/watchos/%$(1).arm64_32.o: %.m $(EXTRA_DEPENDENCIES) | .libs/watchos - $$(call Q_2,OBJC, [watchos]) $(DEVICE_CC) $(DEVICEWATCH64_32_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(DEVW64_32_I) -g $(2) -c $$< -o $$@ - -.libs/watchos/%$(1).arm64_32.o: %.c $(EXTRA_DEPENDENCIES) | .libs/watchos - $$(call Q_2,CC, [watchos]) $(DEVICE_CC) $(DEVICEWATCH64_32_CFLAGS) $$(EXTRA_DEFINES) $(DEVW64_32_I) -g $(2) -c $$< -o $$@ - -.libs/watchos/%$(1).arm64_32.dylib: %.swift | .libs/watchsimulator - $$(call Q_2,SWIFT, [watchos]) $(SWIFTC) $(WATCHOS_DEVICE_ARM64_32_SWIFTFLAGS) $$< -o $$@ - -.libs/watchos/%$(1).arm64_32.dylib: | .libs/watchos - $$(call Q_2,LD, [watchos]) $(DEVICE_CC) $(DEVICEWATCH64_32_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib -fapplication-extension - -.libs/watchos/%$(1).arm64_32.framework: | .libs/watchos - $$(call Q_2,LD, [watchos]) $(DEVICE_CC) $(DEVICEWATCH64_32_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks -fapplication-extension - ## tv simulator ### X64 @@ -390,7 +320,7 @@ $(eval $(call NativeCompilationTemplate,-dotnet-coreclr-debug,$(DEBUG_FLAGS) -DC $(eval $(call NativeCompilationTemplate,-dotnet-nativeaot,$(RELEASE_FLAGS) -DCORECLR_RUNTIME -DDOTNET -DNATIVEAOT)) $(eval $(call NativeCompilationTemplate,-dotnet-nativeaot-debug,$(DEBUG_FLAGS) -DCORECLR_RUNTIME -DDOTNET -DNATIVEAOT)) -.libs/iphoneos .libs/iphonesimulator .libs/watchos .libs/watchsimulator .libs/tvos .libs/tvsimulator .libs/maccatalyst .libs/mac: +.libs/iphoneos .libs/iphonesimulator .libs/tvos .libs/tvsimulator .libs/maccatalyst .libs/mac: $(Q) mkdir -p $@ %.csproj.inc: %.csproj $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/tools/common/create-makefile-fragment.sh diff --git a/msbuild/Makefile b/msbuild/Makefile index 7e07def8f78e..37ed2199d9c1 100644 --- a/msbuild/Makefile +++ b/msbuild/Makefile @@ -417,7 +417,6 @@ $(DOTNET_DESTDIR)/$(MACCATALYST_NUGET_SDK_NAME)/tools/msbuild/MacCatalyst/%: $(I MSBUILD_DIRECTORIES += $(DOTNET_DIRECTORIES) -ifdef ENABLE_DOTNET MSBUILD_PRODUCTS += $(DOTNET_TARGETS) DOTNET_IOS_WINDOWS_OUTPUT_FILES = \ @@ -444,7 +443,6 @@ DOTNET_IOS_WINDOWS_MOBILEDEVICE_TOOLS_X64 = $(foreach file,$(IOS_WINDOWS_MOBILED all-local:: .dotnet-windows dotnet:: .dotnet-windows -endif ## ## Common targets ## diff --git a/runtime/Makefile b/runtime/Makefile index 5c197c474635..02adcd54732d 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -23,19 +23,14 @@ SHIPPED_HEADERS += \ xamarin/coreclr-bridge.h \ SHARED_SOURCES += mono-runtime.m bindings.m bindings-generated.m shared.m runtime.m trampolines.m trampolines-invoke.m xamarin-support.m nsstring-localization.m trampolines-varargs.m monovm-bridge.m coreclr-bridge.m nativeaot-bridge.m swift-functions.swift -SHARED_I386_SOURCES += trampolines-i386.m trampolines-i386-asm.s trampolines-i386-objc_msgSend.s trampolines-i386-objc_msgSendSuper.s trampolines-i386-objc_msgSend_stret.s trampolines-i386-objc_msgSendSuper_stret.s SHARED_X86_64_SOURCES += trampolines-x86_64.m trampolines-x86_64-asm.s trampolines-x86_64-objc_msgSend.s trampolines-x86_64-objc_msgSendSuper.s trampolines-x86_64-objc_msgSend_stret.s trampolines-x86_64-objc_msgSendSuper_stret.s SHARED_ARM64_SOURCES += trampolines-arm64.m trampolines-arm64-asm.s trampolines-arm64-objc_msgSend.s trampolines-arm64-objc_msgSendSuper.s SHARED_HEADERS += shared.h product.h delegates.h runtime-internal.h $(SHARED_INC) $(SHIPPED_HEADERS) trampolines-internal.h slinked-list.h -SHARED_FILES = $(SHARED_SOURCES) $(SHARED_HEADERS) $(SHARED_I386_SOURCES) $(SHARED_X86_64_SOURCES) $(SHARED_ARM64_SOURCES) +SHARED_FILES = $(SHARED_SOURCES) $(SHARED_HEADERS) $(SHARED_X86_64_SOURCES) $(SHARED_ARM64_SOURCES) EXTRA_DEPENDENCIES = $(SHARED_HEADERS) $(TOP)/Make.config $(TOP)/mk/mono.mk -ifdef IOS_SUPPORTS_32BIT_ARCHITECTURES -IOS_SIMULATOR_ARCHITECTURES=x86 -IOS_DEVICE_ARCHITECTURES=armv7 armv7s -endif IOS_SIMULATOR_ARCHITECTURES+=x86_64 IOS_DEVICE_ARCHITECTURES+=arm64 @@ -86,477 +81,10 @@ MONOTOUCH_SOURCES = \ MONOTOUCH_HEADERS = \ monotouch-debug.h \ -MONOTOUCH_LIBS = \ - libextension.a \ - libtvextension.a \ - libapp.a \ - libxamarin.a \ - libxamarin-debug.a \ - libxamarin.dylib \ - libxamarin-debug.dylib \ - -MONOTOUCH_FRAMEWORKS = \ - Xamarin \ - Xamarin-debug \ - MONOTOUCH_SOURCE_STEMS = $(patsubst %.swift,%,$(patsubst %.s,%,$(patsubst %.m,%,$(SHARED_SOURCES) $(MONOTOUCH_SOURCES)))) -MONOTOUCH_I386_SOURCE_STEMS = $(patsubst %.s,%,$(patsubst %.m,%,$(SHARED_I386_SOURCES))) MONOTOUCH_X86_64_SOURCE_STEMS = $(patsubst %.s,%,$(patsubst %.m,%,$(SHARED_X86_64_SOURCES))) MONOTOUCH_ARM64_SOURCE_STEMS = $(patsubst %.s,%,$(patsubst %.m,%,$(SHARED_ARM64_SOURCES))) -MONOTOUCH_X86_SOURCE_STEMS = $(MONOTOUCH_I386_SOURCE_STEMS) - -# -# FrameworkTemplate contains the install targets and sets up some variables for frameworks -# - -define FrameworkTemplate - -$(2)_ARCHITECTURES = $(3) -$(2)_FRAMEWORKS = $(MONOTOUCH_FRAMEWORKS) - -RUNTIME_$(2)_TARGETS_DIRS += \ - $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin.framework \ - $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin-debug.framework \ - -RUNTIME_$(2)_TARGETS += \ - $$(foreach file,$$($(2)_FRAMEWORKS),$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/$$(file).framework/$$(file)) \ - $$(foreach file,$$($(2)_FRAMEWORKS),$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/$$(file).framework/Info.plist) \ - $$(foreach file,$$($(2)_FRAMEWORKS),$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/$$(file).framework.dSYM/Contents/Info.plist) \ - -$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin.framework/Xamarin: .libs/$(1)/Xamarin.framework | $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin.framework - $(Q) $(CP) $$< $$@ - -$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin-debug.framework/Xamarin-debug: .libs/$(1)/Xamarin-debug.framework | $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin-debug.framework - $(Q) $(CP) $$< $$@ - -$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/%.framework/Info.plist: Xamarin.framework-$(1).Info.plist | $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/%.framework - $(Q) sed 's/@BUNDLE_EXECUTABLE@/$$*/' $$< > $$@ - -$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin.framework.dSYM/Contents/Info.plist: $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin.framework/Xamarin $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin.framework/Info.plist - $$(Q_GEN) dsymutil -j 4 $$< -o $$(abspath $$(dir $$<)/..)/Xamarin.framework.dSYM - -$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin-debug.framework.dSYM/Contents/Info.plist: $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin-debug.framework/Xamarin-debug $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/Frameworks/Xamarin-debug.framework/Info.plist - $$(Q_GEN) dsymutil -j 4 $$< -o $$(abspath $$(dir $$<)/..)/Xamarin-debug.framework.dSYM - -.libs/$(1)/Xamarin.framework: $$(foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/Xamarin.$$(arch).framework) - $(Q) rm -f $$@ -ifeq (1,$$(words $$($(2)_ARCHITECTURES))) - $(Q) $(CP) $$^ $$@ -else - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ -endif - -.libs/$(1)/Xamarin-debug.framework: $$(foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/Xamarin-debug.$$(arch).framework) - $(Q) rm -f $$@ -ifeq (1,$$(words $$($(2)_ARCHITECTURES))) - $(Q) $(CP) $$^ $$@ -else - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ -endif -endef - -# 1: platform -# 2: variable prefix -# 3: architectures -ifdef INCLUDE_IOS -ifdef INCLUDE_DEVICE -$(eval $(call FrameworkTemplate,iphoneos,IPHONEOS,$(IOS_DEVICE_ARCHITECTURES))) -endif -$(eval $(call FrameworkTemplate,iphonesimulator,IOSSIMULATOR,$(IOS_SIMULATOR_ARCHITECTURES))) -endif - -ifdef INCLUDE_TVOS -ifdef INCLUDE_DEVICE -$(eval $(call FrameworkTemplate,tvos,TVOS,arm64)) -endif -$(eval $(call FrameworkTemplate,tvsimulator,TVSIMULATOR,x86_64)) -endif - -# -# PlatformTemplate contains the install targets and sets up some variables -# - -define PlatformTemplate - -$(2)_SOURCES = $(MONOTOUCH_SOURCES) -$(2)_HEADERS = $(MONOTOUCH_HEADERS) -$(2)_SOURCE_STEMS = $(MONOTOUCH_SOURCE_STEMS) -$(2)_X86_64_SOURCE_STEMS = $(MONOTOUCH_X86_64_SOURCE_STEMS) -$(2)_I386_SOURCE_STEMS = $(MONOTOUCH_I386_SOURCE_STEMS) -$(2)_ARM64_SOURCE_STEMS = $(MONOTOUCH_ARM64_SOURCE_STEMS) -$(2)_LIBRARIES = $(MONOTOUCH_LIBS) -$(2)_ARCHITECTURES = $(3) - -RUNTIME_$(2)_TARGETS_DIRS += \ - $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/lib \ - $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/include/xamarin \ - -RUNTIME_$(2)_TARGETS += \ - $$(foreach file,$$($(2)_LIBRARIES),$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/lib/$$(file)) \ - $(foreach file,$(SHIPPED_HEADERS),$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/include/$(file)) \ - -$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/lib/%.a: .libs/$(1)/%.a | $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/lib - $(Q) install -m 0644 $$< $$@ - -$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/lib/%.dylib: .libs/$(1)/%.dylib | $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/lib - $$(Q_STRIP) $(DEVICE_BIN_PATH)/bitcode_strip $$< -m -o $$@ - -$(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/include/%.h: %.h | $(IOS_DESTDIR)$$(XAMARIN_$(2)_SDK)/include/xamarin - $(Q) install -m 0644 $$< $$@ - -$$(RUNTIME_$(2)_TARGETS_DIRS): - $(Q) mkdir -p $$@ - -all-$(2):: $$(RUNTIME_$(2)_TARGETS) - -ifdef INCLUDE_XAMARIN_LEGACY -all-local:: $$(RUNTIME_$(2)_TARGETS) -install-local:: $$(RUNTIME_$(2)_TARGETS) -endif - -endef - -# 1: platform -# 2: variable prefix -# 3: architectures -ifdef INCLUDE_IOS -ifdef INCLUDE_DEVICE -$(eval $(call PlatformTemplate,iphoneos,IPHONEOS,$(IOS_DEVICE_ARCHITECTURES))) -endif -$(eval $(call PlatformTemplate,iphonesimulator,IOSSIMULATOR,$(IOS_SIMULATOR_ARCHITECTURES))) -endif -ifdef INCLUDE_MACCATALYST -$(eval $(call PlatformTemplate,maccatalyst,MACCATALYST,x86_64)) -endif - -ifdef INCLUDE_TVOS -ifdef INCLUDE_DEVICE -$(eval $(call PlatformTemplate,tvos,TVOS,arm64)) -endif -$(eval $(call PlatformTemplate,tvsimulator,TVSIMULATOR,x86_64)) -endif - -# -# LibTemplate we build two different libraries from the same source code, -# libapp.a and libextension.a -# -# They're all built from the same soure file (extension-main.m), but with different defines: -# libextension.a has EXTENSION defined. -# - -define LibTemplate -$$(foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/extension-main.$$(arch).o): EXTRA_DEFINES=-DEXTENSION -$$(foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/tvextension-main.$$(arch).o): EXTRA_DEFINES=-DTV_EXTENSION - -.libs/$(1)/libextension.%.a: .libs/$(1)/extension-main.%.o - $(Q) rm -f $$@ - $$(call Q_2,AR, [$1]) $(DEVICE_BIN_PATH)/ar cru $$@ $$^ - -.libs/$(1)/libapp.%.a: .libs/$(1)/app-main.%.o - $(Q) rm -f $$@ - $$(call Q_2,AR, [$1]) $(DEVICE_BIN_PATH)/ar cru $$@ $$^ - -.libs/$(1)/libextension.a: $$(foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/libextension.$$(arch).a) - $(Q) rm -f $$@ - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ - -.libs/$(1)/libapp.a: $$(foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/libapp.$$(arch).a) - $(Q) rm -f $$@ - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ - -.libs/$(1)/libtvextension.%.a: .libs/$(1)/tvextension-main.%.o - $(Q) rm -f $$@ - $$(call Q_2,AR, [$1]) $(DEVICE_BIN_PATH)/ar cru $$@ $$^ - -.libs/$(1)/libtvextension.a: $$(foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/libtvextension.$$(arch).a) - $(Q) rm -f $$@ - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ - -.libs/$(1)/libxamarin.dylib: $$(foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/libxamarin.$$(arch).dylib) - $(Q) rm -f $$@ -ifeq (1,$$(words $$($(2)_ARCHITECTURES))) - $(Q) $(CP) $$^ $$@ -else - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ -endif - $(Q) install_name_tool -id @rpath/libxamarin.dylib $$@ - $(Q) install_name_tool -change @rpath/ @rpath/libmonosgen-2.0.dylib $$@ - -.libs/$(1)/libxamarin-debug.dylib: $$(foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/libxamarin-debug.$$(arch).dylib) - $(Q) rm -f $$@ -ifeq (1,$$(words $$($(2)_ARCHITECTURES))) - $(Q) $(CP) $$^ $$@ -else - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ -endif - $(Q) install_name_tool -id @rpath/libxamarin-debug.dylib $$@ - $(Q) install_name_tool -change @rpath/ @rpath/libmonosgen-2.0.dylib $$@ - -.SECONDARY: $$(foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/app-main.$$(arch).o) -endef - -$(eval $(call LibTemplate,iphoneos,IPHONEOS)) -$(eval $(call LibTemplate,iphonesimulator,IOSSIMULATOR)) -$(eval $(call LibTemplate,maccatalyst,MACCATALYST)) -$(eval $(call LibTemplate,tvos,TVOS)) -$(eval $(call LibTemplate,tvsimulator,TVSIMULATOR)) - -# -# LibXamarinTemplate (and LibXamarinArchTemplate) builds libxamarin.a -# - -define LibXamarinArchTemplate -.libs/$(1)/libxamarin$(4).$(5).a: $$($(5)_$(1)$(3)_OBJECTS) - $$(Q) rm -f $$@ - $$(call Q_2,AR, [$1]) $(DEVICE_BIN_PATH)/ar Scru $$@ $$^ - $$(call Q_2,RANLIB,[$1]) $(DEVICE_BIN_PATH)/ranlib -no_warning_for_no_symbols -q $$@ -endef - -define LibXamarinTemplate - -$(1)$(3)_COMMON_DYLIB_FLAGS = -lmonosgen-2.0 -Wl,-install_name,libxamarin$(4).dylib -framework Foundation -framework CFNetwork -framework UIKit -lz -$(1)$(3)_COMMON_FRAMEWORK_FLAGS = -framework Mono -Wl,-install_name,@rpath/Xamarin$(4).framework/Xamarin$(4) -framework Foundation -framework CFNetwork -framework UIKit -lz - -x86_$(1)$(3)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(4).x86.o,$$($(2)_SOURCE_STEMS)) $$(patsubst %,.libs/$(1)/%$(4).x86.o,$$($(2)_I386_SOURCE_STEMS)) -x86_64_$(1)$(3)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(4).x86_64.o,$$($(2)_SOURCE_STEMS)) $$(patsubst %,.libs/$(1)/%$(4).x86_64.o,$$($(2)_X86_64_SOURCE_STEMS)) -armv7_$(1)$(3)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(4).armv7.o,$$($(2)_SOURCE_STEMS)) -armv7s_$(1)$(3)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(4).armv7s.o,$$($(2)_SOURCE_STEMS)) -armv7k_$(1)$(3)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(4).armv7k.o,$$($(2)_SOURCE_STEMS)) -arm64_$(1)$(3)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(4).arm64.o,$$($(2)_SOURCE_STEMS)) $$(patsubst %,.libs/$(1)/%$(4).arm64.o,$$($(2)_ARM64_SOURCE_STEMS)) -arm64_32_$(1)$(3)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(4).arm64_32.o,$$($(2)_SOURCE_STEMS)) - -$$(foreach arch,$$($(2)_ARCHITECTURES),$$(eval $$(call LibXamarinArchTemplate,$(1),$(2),$(3),$(4),$$(arch)))) - -.libs/$(1)/libxamarin$(4).a: $$(foreach arch,$$($(2)_ARCHITECTURES),.libs/$(1)/libxamarin$(4).$$(arch).a) - $(Q) rm -f $$@ - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ - -.libs/$(1)/libxamarin$(4).x86.dylib: EXTRA_FLAGS=$$($(1)$(3)_COMMON_DYLIB_FLAGS) -.libs/$(1)/libxamarin$(4).x86.dylib: $$(x86_$(1)$(3)_OBJECTS) - -.libs/$(1)/libxamarin$(4).x86_64.dylib: EXTRA_FLAGS=$$($(1)$(3)_COMMON_DYLIB_FLAGS) -.libs/$(1)/libxamarin$(4).x86_64.dylib: $$(x86_64_$(1)$(3)_OBJECTS) - -.libs/$(1)/libxamarin$(4).armv7.dylib: EXTRA_FLAGS=$$($(1)$(3)_COMMON_DYLIB_FLAGS) -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -.libs/$(1)/libxamarin$(4).armv7.dylib: $$(armv7_$(1)$(3)_OBJECTS) - -.libs/$(1)/libxamarin$(4).armv7s.dylib: EXTRA_FLAGS=$$($(1)$(3)_COMMON_DYLIB_FLAGS) -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -.libs/$(1)/libxamarin$(4).armv7s.dylib: $$(armv7s_$(1)$(3)_OBJECTS) - -.libs/$(1)/libxamarin$(4).arm64.dylib: EXTRA_FLAGS=$$($(1)$(3)_COMMON_DYLIB_FLAGS) -.libs/$(1)/libxamarin$(4).arm64.dylib: $$(arm64_$(1)$(3)_OBJECTS) - -.libs/$(1)/libxamarin$(4).armv7k.dylib: EXTRA_FLAGS=$$($(1)$(3)_COMMON_DYLIB_FLAGS) -.libs/$(1)/libxamarin$(4).armv7k.dylib: $$(armv7k_$(1)$(3)_OBJECTS) - -.libs/$(1)/libxamarin$(4).arm64_32.dylib: EXTRA_FLAGS=$$($(1)$(3)_COMMON_DYLIB_FLAGS) -.libs/$(1)/libxamarin$(4).arm64_32.dylib: $$(arm64_32_$(1)$(3)_OBJECTS) - -.libs/$(1)/Xamarin$(4).x86.framework: EXTRA_FLAGS=$$($(1)$(3)_COMMON_FRAMEWORK_FLAGS) -.libs/$(1)/Xamarin$(4).x86.framework: $$(x86_$(1)$(3)_OBJECTS) - -.libs/$(1)/Xamarin$(4).x86_64.framework: EXTRA_FLAGS=$$($(1)$(3)_COMMON_FRAMEWORK_FLAGS) -.libs/$(1)/Xamarin$(4).x86_64.framework: $$(x86_64_$(1)$(3)_OBJECTS) - -.libs/$(1)/Xamarin$(4).armv7.framework: EXTRA_FLAGS=$$($(1)$(3)_COMMON_FRAMEWORK_FLAGS) -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -.libs/$(1)/Xamarin$(4).armv7.framework: $$(armv7_$(1)$(3)_OBJECTS) - -.libs/$(1)/Xamarin$(4).armv7s.framework: EXTRA_FLAGS=$$($(1)$(3)_COMMON_FRAMEWORK_FLAGS) -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -.libs/$(1)/Xamarin$(4).armv7s.framework: $$(armv7s_$(1)$(3)_OBJECTS) - -.libs/$(1)/Xamarin$(4).arm64.framework: EXTRA_FLAGS=$$($(1)$(3)_COMMON_FRAMEWORK_FLAGS) -.libs/$(1)/Xamarin$(4).arm64.framework: $$(arm64_$(1)$(3)_OBJECTS) - -.libs/$(1)/Xamarin$(4).armv7k.framework: EXTRA_FLAGS=$$($(1)$(3)_COMMON_FRAMEWORK_FLAGS) -.libs/$(1)/Xamarin$(4).armv7k.framework: $$(armv7k_$(1)$(3)_OBJECTS) - -.libs/$(1)/Xamarin$(4).arm64_32.framework: EXTRA_FLAGS=$$($(1)$(3)_COMMON_FRAMEWORK_FLAGS) -.libs/$(1)/Xamarin$(4).arm64_32.framework: $$(arm64_32_$(1)$(3)_OBJECTS) -endef - -$(eval $(call LibXamarinTemplate,iphoneos,IPHONEOS)) -$(eval $(call LibXamarinTemplate,iphoneos,IPHONEOS,_DEBUG,-debug)) -$(eval $(call LibXamarinTemplate,iphonesimulator,IOSSIMULATOR)) -$(eval $(call LibXamarinTemplate,iphonesimulator,IOSSIMULATOR,_DEBUG,-debug)) -$(eval $(call LibXamarinTemplate,maccatalyst,MACCATALYST)) -$(eval $(call LibXamarinTemplate,maccatalyst,MACCATALYST,_DEBUG,-debug)) -$(eval $(call LibXamarinTemplate,tvos,TVOS)) -$(eval $(call LibXamarinTemplate,tvos,TVOS,_DEBUG,-debug)) -$(eval $(call LibXamarinTemplate,tvsimulator,TVSIMULATOR)) -$(eval $(call LibXamarinTemplate,tvsimulator,TVSIMULATOR,_DEBUG,-debug)) - -# -# Xamarin.Mac -# - -MAC_ARCHITECTURES = x86_64 arm64 - -CLANG_ARCH = $(addprefix -arch ,$(MAC_ARCHITECTURES)) -MAC_CLANG = DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT) $(MAC_CC) -mmacosx-version-min=$(MIN_MACOS_SDK_VERSION) - -MAC_SHIPPED_HEADERS = xamarin/launch.h - -MAC_STATIC_CFLAGS = $(MAC_CFLAGS) - -MAC_SOURCES = $(SHARED_SOURCES) $(SHARED_X86_64_SOURCES) $(SHARED_ARM64_SOURCES) launcher.m - -ALLOWED_UNDEFINED_SYMBOLS = _xamarin_enable_debug _xammac_setup - -MAC_LIBS = \ - libextension.a \ - libxammac.a \ - libxammac-debug.a \ - libxammac-classic.a \ - libxammac-classic-debug.a\ - libxammac.dylib \ - libxammac-debug.dylib \ - libxammac-system.a \ - libxammac-system-debug.a \ - libxammac-system-classic.a \ - libxammac-system-classic-debug.a \ - -# -# libxammac[-debug].a: (no defines) -# This is linked into the native executable when embedding the Mono runtime. -# -# libxammac[-debug].dylib: -DDYNAMIC_MONO_RUNTIME -DDYLIB -# This is not officially supported. It's used when not wanting to use mmp for -# whatever reason (usually to make build processes easier). There is no good -# reason to keep using it, since mmp now supports creating empty 'shell' apps -# with no assemblies, which the user can fill in as they want. -# -# libxammac-system[-debug].a: -DDYNAMIC_MONO_RUNTIME -# This is used linked into the native executable when using the system Mono (i.e. not) -# embedding the Mono runtime). -# -# libxamarin-coreclr.a: -# This is used when using the CoreCLR runtime instead of Mono. -# CORECLR_RUNTIME is defined for these versions of libxamarin. -# -# libxamarin-nativeaot.a: -# This is used when using NativeAOT. -# CORECLR_RUNTIME is defined for these versions of libxamarin (because the nativeaot bridge shares *a lot* of code with the coreclr bridge) -# NATIVEAOT is defined for these versions of libxamarin -# - -ifdef INCLUDE_XAMARIN_LEGACY -all-local:: $(TARGETS) -endif - -define ObjTemplate -DYNAMIC_DYLIB$(2)_OBJECTS = $$(foreach src,$$(MAC_SOURCES),.libs/mac/$$(basename $$(src))$(3).dylib.$(1).o) -STATIC_LAUNCHER$(2)_OBJECTS = $$(foreach src,$$(MAC_SOURCES),.libs/mac/$$(basename $$(src))$(3).static.$(1).o) -SYSTEM_LAUNCHER$(2)_OBJECTS = $$(foreach src,$$(MAC_SOURCES),.libs/mac/$$(basename $$(src))$(3).system.$(1).o) - -.libs/mac/%$(3).dylib.$(1).o: %.m $$(SHARED_HEADERS) | .libs/mac - $$(call Q_2,OBJC, [mac]) $(MAC_CLANG) -arch $(1) $(4) -c $$(MAC_OBJC_CFLAGS) $$(MAC_CFLAGS) -DDYNAMIC_MONO_RUNTIME -DDYLIB -o $$@ $$< - -.libs/mac/%$(3).dylib.$(1).o: %.s $$(SHARED_HEADERS) | .libs/mac - $$(call Q_2,ASM, [mac]) $(MAC_CLANG) -arch $(1) $(4) -c $$(MAC_CFLAGS) -DDYNAMIC_MONO_RUNTIME -DDYLIB -o $$@ $$< - -.libs/mac/%$(3).static.$(1).o: %.s $$(SHARED_HEADERS) | .libs/mac - $$(call Q_2,ASM, [mac]) $(MAC_CLANG) -arch $(1) $(4) -c $$(MAC_STATIC_CFLAGS) -o $$@ $$< - -.libs/mac/%$(3).static.$(1).o: %.m $$(SHARED_HEADERS) | .libs/mac - $$(call Q_2,OBJC, [mac]) $(MAC_CLANG) -arch $(1) $(4) $$(MAC_OBJC_CFLAGS) -c $$(MAC_STATIC_CFLAGS) -o $$@ $$< - -.libs/mac/%$(3).system.$(1).o: %.m $$(SHARED_HEADERS) | .libs/mac - $$(call Q_2,OBJC, [mac]) $(MAC_CLANG) -arch $(1) $(4) $$(MAC_OBJC_CFLAGS) -c $$(MAC_CFLAGS) -DDYNAMIC_MONO_RUNTIME -o $$@ $$< - -.libs/mac/%$(3).system.$(1).o: %.s $$(SHARED_HEADERS) | .libs/mac - $$(call Q_2,ASM, [mac]) $(MAC_CLANG) -arch $(1) $(4) -c $(MAC_CFLAGS) -DDYNAMIC_MONO_RUNTIME -o $$@ $$< - -.libs/mac/libxammac$(3).$(1).dylib: $$(DYNAMIC_DYLIB$(2)_OBJECTS) - $$(call Q_2,LD, [mac]) $(MAC_CLANG) -arch $(1) -dynamiclib $$(MAC_LDFLAGS) -Wl,-install_name,libxammac$(3).dylib -o $$@ $$^ $$(addprefix -Xlinker -U -Xlinker ,$$(ALLOWED_UNDEFINED_SYMBOLS)) - -.libs/mac/libxammac$(3).$(1).a: $$(STATIC_LAUNCHER$(2)_OBJECTS) - $$(call Q_2,LIB, [mac]) xcrun libtool -no_warning_for_no_symbols -static -o $$@ $$^ - -.libs/mac/libxammac-system$(3).$(1).a: $$(SYSTEM_LAUNCHER$(2)_OBJECTS) - $$(call Q_2,LIB, [mac]) xcrun libtool -no_warning_for_no_symbols -static -o $$@ $$^ - -endef - -$(eval $(call ObjTemplate,x86_64,64,,,64)) -$(eval $(call ObjTemplate,x86_64,DEBUG64,-debug,-DDEBUG,64)) -$(eval $(call ObjTemplate,arm64,64,,,64)) -$(eval $(call ObjTemplate,arm64,DEBUG64,-debug,-DDEBUG,64)) - -$(foreach arch,$(MAC_ARCHITECTURES),.libs/mac/extension-main.$(arch).o): EXTRA_DEFINES=-DEXTENSION - -.libs/mac/extension-main.%.o: | .libs/mac - $(Q) rm -f $@ - $(call Q_2,CC, [mac]) $(MAC_CLANG) -c -DEXTENSION extension-main.m -arch $* -o $@ - -.libs/mac/libextension.%.a: .libs/mac/extension-main.%.o - $(Q) rm -f $@ - $(call Q_2,AR, [mac]) $(DEVICE_BIN_PATH)/ar cru $@ $^ - -.libs/mac/libextension.a: $(foreach arch,$(MAC_ARCHITECTURES),.libs/mac/libextension.$(arch).a) - $(Q) rm -f $@ - $(call Q_2,LIPO, [mac]) $(DEVICE_BIN_PATH)/lipo $^ -create -output $@ - -.libs/mac/libxammac-debug.dylib: .libs/mac/libxammac-debug.x86_64.dylib .libs/mac/libxammac-debug.arm64.dylib - $(call Q_2,LIPO, [mac]) xcrun lipo -create $^ -o $@ - -.libs/mac/libxammac.dylib: .libs/mac/libxammac.x86_64.dylib .libs/mac/libxammac.arm64.dylib - $(call Q_2,LIPO, [mac]) xcrun lipo -create $^ -o $@ - -.libs/mac/libxammac-debug.a: .libs/mac/libxammac-debug.x86_64.a .libs/mac/libxammac-debug.arm64.a - $(call Q_2,LIPO, [mac]) xcrun lipo -create $^ -o $@ - -.libs/mac/libxammac.a: .libs/mac/libxammac.x86_64.a .libs/mac/libxammac.arm64.a - $(call Q_2,LIPO, [mac]) xcrun lipo -create $^ -o $@ - -.libs/mac/libxammac-system-debug.a: .libs/mac/libxammac-system-debug.x86_64.a .libs/mac/libxammac-system-debug.arm64.a - $(call Q_2,LIPO, [mac]) xcrun lipo -create $^ -o $@ - -.libs/mac/libxammac-system.a: .libs/mac/libxammac-system.x86_64.a .libs/mac/libxammac-system.arm64.a - $(call Q_2,LIPO, [mac]) xcrun lipo -create $^ -o $@ - -.libs/mac/libxamarin%.a: .libs/mac/libxamarin%.x86_64.a - $(call Q_2,LIPO, [mac]) xcrun lipo -create $^ -o $@ - -.libs/mac/libxamarin%.dylib: .libs/mac/libxamarin%.x86_64.dylib - $(call Q_2,LIPO, [mac]) xcrun lipo -create $^ -o $@ - -RUNTIME_MAC_TARGETS_DIRS += \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/include/xamarin \ - -RUNTIME_MAC_TARGETS += \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/XamMacLauncher \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/XamMacLauncher \ - $(foreach file,$(SHIPPED_HEADERS),$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/include/$(file)) \ - $(foreach file,$(MAC_SHIPPED_HEADERS),$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/include/$(file)) \ - $(foreach file,$(MAC_LIBS),$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/$(file)) \ - -# The XamMacLauncher file must exist for VSfM to be able to open XM/Classic projects (so that people can use the migration wizard) -$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/XamMacLauncher: | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib - $(Q) touch $@ - -$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/%: .libs/mac/% | $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib - $(Q) $(CP) $< $@ - -$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/XamMacLauncher: | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono - $(Q) ln -sF ../XamMacLauncher $@ - -$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/include/%.h: %.h | $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/include/xamarin - $(Q) install -m 0644 $< $@ - -$(RUNTIME_MAC_TARGETS_DIRS): - $(Q) mkdir -p $@ - -ifdef INCLUDE_XAMARIN_LEGACY -ifdef INCLUDE_MAC -all-local:: $(RUNTIME_MAC_TARGETS) -install-local:: $(RUNTIME_MAC_TARGETS) -endif -endif - # # .NET # @@ -738,10 +266,8 @@ dotnet: $(DOTNET_TARGETS) $(DOTNET_TARGET_DIRS): $(Q) mkdir -p $@ -ifdef ENABLE_DOTNET all-local:: $(DOTNET_TARGETS) install-local:: $(DOTNET_TARGETS) -endif # # Common diff --git a/scripts/versions-check/versions-check.cs b/scripts/versions-check/versions-check.cs index 5c21d54666c3..e4250b12da2c 100755 --- a/scripts/versions-check/versions-check.cs +++ b/scripts/versions-check/versions-check.cs @@ -1,28 +1,27 @@ // this script is to make sure our versions.plist files are not out of date with our min/max supported OS versions. -// arguments are: plistPath iOSMinVersion iOSMaxVersion tvOSMinVersion tvOSMaxVersion watchOSMinVersion watchOSMaxVersion macOSMinVersion macOSMaxVersion MacCatalystOSMinVersion MacCatalystOSMaxVersion +// arguments are: plistPath iOSMinVersion iOSMaxVersion tvOSMinVersion tvOSMaxVersion macOSMinVersion macOSMaxVersion MacCatalystOSMinVersion MacCatalystOSMaxVersion using System.IO; using System.Xml; try { - var expectedArgumentCount = 11; + var expectedArgumentCount = 9; if (args.Length != expectedArgumentCount) { - Console.WriteLine ("Need 11 arguments, got {0}", args.Length); + Console.WriteLine ($"Need {expectedArgumentCount} arguments, got {0}", args.Length); return 1; } - var plistPath = args [0]; - var iOSMin = args [1]; - var iOSMax = args [2]; - var tvOSMin = args [3]; - var tvOSMax = args [4]; - var watchOSMin = args [5]; - var watchOSMax = args [6]; - var macOSMin = args [7]; - var macOSMax = args [8]; - var MacCatalystMin = args [9]; - var MacCatalystMax = args [10]; + var idx = 0; + var plistPath = args [idx++]; + var iOSMin = args [idx++]; + var iOSMax = args [idx++]; + var tvOSMin = args [idx++]; + var tvOSMax = args [idx++]; + var macOSMin = args [idx++]; + var macOSMax = args [idx++]; + var MacCatalystMin = args [idx++]; + var MacCatalystMax = args [idx++]; var doc = new System.Xml.XmlDocument (); doc.Load (plistPath); @@ -36,7 +35,7 @@ var foundMin = false; var versions = doc.SelectNodes ($"/plist/dict/key[text()='KnownVersions']/following-sibling::dict[1]/key[text()='{product}']/following-sibling::array[1]/string")!; if (versions.Count == 0) { - // Skip this (iOS/tvOS/watchOS versions for macOS, or vice versa) + // Skip this (iOS/tvOS versions for macOS, or vice versa) return; } var versionsHashSet = new HashSet (versions.Cast ().Select (v => v.InnerText)); @@ -82,7 +81,6 @@ check ("iOS", iOSMin, iOSMax); check ("tvOS", tvOSMin, tvOSMax); - check ("watchOS", watchOSMin, watchOSMax); check ("macOS", macOSMin, macOSMax); check ("MacCatalyst", MacCatalystMin, MacCatalystMax); diff --git a/src/Makefile b/src/Makefile index ad760b12f24f..7546f94903c5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -76,7 +76,6 @@ DOTNET_BINDING_ATTRIBUTES=$(DOTNET_BUILD_DIR)/Xamarin.Apple.BindingAttributes.dl NULLABILITY_WARNINGS=nullable GENERATOR_WARNASERROR=-warnaserror: IOS_GENERATOR_WARNASERROR=$(GENERATOR_WARNASERROR) -WATCH_GENERATOR_WARNASERROR=$(GENERATOR_WARNASERROR) TVOS_GENERATOR_WARNASERROR=$(GENERATOR_WARNASERROR) MACOS_GENERATOR_WARNASERROR=$(GENERATOR_WARNASERROR) MACCATALYST_GENERATOR_WARNASERROR=$(GENERATOR_WARNASERROR) @@ -580,7 +579,6 @@ MinimumVersions.cs: MinimumVersions.cs.in Makefile $(TOP)/Make.config \ -e 's/@MIN_IOS_SDK_VERSION@/$(subst .,$(COMMA) ,$(MIN_IOS_SDK_VERSION))/g' \ -e 's/@MIN_MACOS_SDK_VERSION@/$(subst .,$(COMMA) ,$(MIN_MACOS_SDK_VERSION))/g' \ - -e 's/@MIN_WATCHOS_SDK_VERSION@/$(subst .,$(COMMA) ,$(MIN_WATCHOS_SDK_VERSION))/g' \ -e 's/@MIN_TVOS_SDK_VERSION@/$(subst .,$(COMMA) ,$(MIN_TVOS_SDK_VERSION))/g' \ -e 's/@MIN_MACCATALYST_SDK_VERSION@/$(subst .,$(COMMA) ,$(MIN_MACCATALYST_SDK_VERSION))/g' \ $< > $@ diff --git a/src/MinimumVersions.cs.in b/src/MinimumVersions.cs.in index 35b43afa3897..0d34ea143a2b 100644 --- a/src/MinimumVersions.cs.in +++ b/src/MinimumVersions.cs.in @@ -1,7 +1,6 @@ using System.Runtime.Versioning; using ObjCRuntime; -#if NET #if __IOS__ && !__MACCATALYST__ [assembly: TargetPlatform ("ios")] #elif __TVOS__ @@ -10,9 +9,6 @@ using ObjCRuntime; [assembly: TargetPlatform ("maccatalyst")] #elif MONOMAC [assembly: TargetPlatform ("macos")] -#elif __WATCHOS__ -// unsupported on dotnet but we're still building it right now -[assembly: TargetPlatform ("watchos")] #else #error Unsupported Platform #endif @@ -22,14 +18,3 @@ using ObjCRuntime; [assembly: SupportedOSPlatform ("tvos@DOTNET_MIN_TVOS_SDK_VERSION@")] [assembly: SupportedOSPlatform ("macos@DOTNET_MIN_MACOS_SDK_VERSION@")] [assembly: SupportedOSPlatform ("maccatalyst@DOTNET_MIN_MACCATALYST_SDK_VERSION@")] -[assembly: UnsupportedOSPlatform ("watchos")] - -#else - -[assembly: Introduced (PlatformName.iOS, @MIN_IOS_SDK_VERSION@)] -[assembly: Introduced (PlatformName.TvOS, @MIN_TVOS_SDK_VERSION@)] -[assembly: Introduced (PlatformName.WatchOS, @MIN_WATCHOS_SDK_VERSION@)] -[assembly: Introduced (PlatformName.MacCatalyst, @MIN_MACCATALYST_SDK_VERSION@)] -[assembly: Introduced (PlatformName.MacOSX, @MIN_MACOS_SDK_VERSION@)] - -#endif // NET diff --git a/system-dependencies.sh b/system-dependencies.sh index 886f493a4d81..361d179dcc2b 100755 --- a/system-dependencies.sh +++ b/system-dependencies.sh @@ -586,10 +586,9 @@ function check_xcode () { local XCODE_DEVELOPER_ROOT=`grep ^XCODE_DEVELOPER_ROOT= Make.config | sed 's/.*=//'` IOS_SDK_VERSION=$(grep ^IOS_NUGET_OS_VERSION= Make.versions | sed -e 's/.*=//') MACOS_SDK_VERSION=$(grep ^MACOS_NUGET_OS_VERSION= Make.versions | sed -e 's/.*=//') - WATCH_SDK_VERSION=$(grep ^WATCHOS_NUGET_OS_VERSION= Make.versions | sed -e 's/.*=//') TVOS_SDK_VERSION=$(grep ^TVOS_NUGET_OS_VERSION= Make.versions | sed -e 's/.*=//') - download_xcode_platforms "$XCODE_DEVELOPER_ROOT" "$TVOS_SDK_VERSION" "$WATCH_SDK_VERSION" + download_xcode_platforms "$XCODE_DEVELOPER_ROOT" "$TVOS_SDK_VERSION" local D=$XCODE_DEVELOPER_ROOT/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator${IOS_SDK_VERSION}.sdk if test ! -d $D -a -z "$FAIL"; then @@ -605,11 +604,6 @@ function check_xcode () { if test ! -d $D -a -z "$FAIL"; then fail "The directory $D does not exist. If you've updated the Xcode location it means you also need to update TVOS_SDK_VERSION in Make.config." fi - - local D=$XCODE_DEVELOPER_ROOT/Platforms/WatchOS.platform/Developer/SDKs/WatchOS${WATCH_SDK_VERSION}.sdk - if test ! -d $D -a -z "$FAIL"; then - fail "The directory $D does not exist. If you've updated the Xcode location it means you also need to update WATCH_SDK_VERSION in Make.config." - fi } function check_mono () { diff --git a/tests/Makefile b/tests/Makefile index e3a0ef28c1bc..956a29e568ac 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,26 +1,15 @@ TOP = .. -SUBDIRS=test-libraries +SUBDIRS=test-libraries dotnet # disabled for now: mac-test include $(TOP)/Make.config include $(TOP)/mk/rules.mk -ifdef ENABLE_DOTNET -SUBDIRS += dotnet -endif - MTOUCH=$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/mtouch XHARNESS_EXECUTABLE=xharness/bin/Debug/xharness.dll -export MD_MTOUCH_SDK_ROOT=$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX) -export MSBUILD_EXE_PATH=$(MONO_PREFIX)/lib/mono/msbuild/15.0/bin/MSBuild.dll -export TargetFrameworkFallbackSearchPaths=$(IOS_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild-frameworks -export MSBuildExtensionsPathFallbackPathsOverride=$(IOS_DESTDIR)/Library/Frameworks/Mono.framework/External/xbuild -export XAMMAC_FRAMEWORK_PATH=$(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current -export XamarinMacFrameworkRoot=$(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current - ifneq ($(RELEASE),) CONFIG=Release else @@ -68,8 +57,6 @@ test.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.De @echo "WATCH_SDK_VERSION=$(WATCH_SDK_VERSION)" >> $@ @echo "MACOS_SDK_VERSION=$(MACOS_SDK_VERSION)" >> $@ @echo "DOTNET_BCL_DIR=$(DOTNET_BCL_DIR)" >> $@ - @echo "ENABLE_DOTNET=$(ENABLE_DOTNET)" >> $@ - @echo "INCLUDE_XAMARIN_LEGACY=$(INCLUDE_XAMARIN_LEGACY)" >> $@ @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),DOTNET_$(platform)_RUNTIME_IDENTIFIERS='$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS)'\\n)" | sed 's/^ //' >> $@ @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),DOTNET_$(rid)_ARCHITECTURES='$(DOTNET_$(rid)_ARCHITECTURES)'\\n))" | sed 's/^ //' >> $@ @echo "DOTNET_CSC_COMMAND='$(DOTNET_CSC)'" >> $@ @@ -79,7 +66,6 @@ test.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.De @echo "DOTNET_DIR=$(DOTNET_DIR)" >> $@ @echo "INCLUDE_MAC=$(INCLUDE_MAC)" >> $@ @echo "INCLUDE_MACCATALYST=$(INCLUDE_MACCATALYST)" >> $@ - @echo "IOS_SUPPORTS_32BIT_ARCHITECTURES=$(IOS_SUPPORTS_32BIT_ARCHITECTURES)" >> $@ @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_SDK_NAME=$($(platform)_NUGET_SDK_NAME)\\n)" | sed 's/^ //' >> $@ @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_REF_NAME=$($(platform)_NUGET_REF_NAME)\\n)" | sed 's/^ //' >> $@ @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(rid)_NUGET_RUNTIME_NAME=$($(rid)_NUGET_RUNTIME_NAME)\\n))" | sed 's/^ //' >> $@ @@ -103,8 +89,6 @@ test-system.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Ver @echo "MACOS_SDK_VERSION=$(MACOS_SDK_VERSION)" >> $@ @echo "DOTNET_TFM=$(DOTNET_TFM)" >> $@ @echo "DOTNET_BCL_DIR=$(DOTNET_BCL_DIR)" >> $@ - @echo "ENABLE_DOTNET=$(ENABLE_DOTNET)" >> $@ - @echo "INCLUDE_XAMARIN_LEGACY=$(INCLUDE_XAMARIN_LEGACY)" >> $@ @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),DOTNET_$(platform)_RUNTIME_IDENTIFIERS='$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS)'\\n)" | sed 's/^ //' >> $@ @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),DOTNET_$(rid)_ARCHITECTURES='$(DOTNET_$(rid)_ARCHITECTURES)'\\n))" | sed 's/^ //' >> $@ @echo "DOTNET_CSC_COMMAND='$(DOTNET_CSC)'" >> $@ @@ -113,7 +97,6 @@ test-system.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Ver @echo "DOTNET_DIR=$(DOTNET_DIR)" >> $@ @echo "INCLUDE_MAC=$(INCLUDE_MAC)" >> $@ @echo "INCLUDE_MACCATALYST=$(INCLUDE_MACCATALYST)" >> $@ - @echo "IOS_SUPPORTS_32BIT_ARCHITECTURES=$(IOS_SUPPORTS_32BIT_ARCHITECTURES)" >> $@ @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_SDK_NAME=$($(platform)_NUGET_SDK_NAME)\\n)" | sed 's/^ //' >> $@ @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_REF_NAME=$($(platform)_NUGET_REF_NAME)\\n)" | sed 's/^ //' >> $@ @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(rid)_NUGET_RUNTIME_NAME=$($(rid)_NUGET_RUNTIME_NAME)\\n))" | sed 's/^ //' >> $@ diff --git a/tests/cecil-tests/ApiTest.cs b/tests/cecil-tests/ApiTest.cs index 300c972a26e4..a415684f9881 100644 --- a/tests/cecil-tests/ApiTest.cs +++ b/tests/cecil-tests/ApiTest.cs @@ -18,7 +18,6 @@ namespace Cecil.Tests { [TestFixture] public partial class ApiTest { - [TestCaseSource (typeof (Helper), nameof (Helper.PlatformAssemblyDefinitions))] [TestCaseSource (typeof (Helper), nameof (Helper.NetPlatformAssemblyDefinitions))] public void ARConfiguration_GetSupportedVideoFormats (AssemblyInfo info) { diff --git a/tests/cecil-tests/AttributeTest.cs b/tests/cecil-tests/AttributeTest.cs index 220bdf8a6768..50f729610700 100644 --- a/tests/cecil-tests/AttributeTest.cs +++ b/tests/cecil-tests/AttributeTest.cs @@ -511,13 +511,13 @@ bool IgnoreCurrentPlatform (string fullName) string AssemblyToAttributeName (AssemblyDefinition assembly) { var baseName = assembly.Name.Name + ".dll"; - if (Configuration.GetBaseLibraryName (TargetFramework.DotNet_iOS.Platform, true) == baseName) + if (Configuration.GetBaseLibraryName (TargetFramework.DotNet_iOS.Platform) == baseName) return "ios"; - if (Configuration.GetBaseLibraryName (TargetFramework.DotNet_tvOS.Platform, true) == baseName) + if (Configuration.GetBaseLibraryName (TargetFramework.DotNet_tvOS.Platform) == baseName) return "tvos"; - if (Configuration.GetBaseLibraryName (TargetFramework.DotNet_macOS.Platform, true) == baseName) + if (Configuration.GetBaseLibraryName (TargetFramework.DotNet_macOS.Platform) == baseName) return "macos"; - if (Configuration.GetBaseLibraryName (TargetFramework.DotNet_MacCatalyst.Platform, true) == baseName) + if (Configuration.GetBaseLibraryName (TargetFramework.DotNet_MacCatalyst.Platform) == baseName) return "maccatalyst"; throw new NotImplementedException (); } diff --git a/tests/cecil-tests/EnumTest.cs b/tests/cecil-tests/EnumTest.cs index 5935bac9ec42..16ee14d4768c 100644 --- a/tests/cecil-tests/EnumTest.cs +++ b/tests/cecil-tests/EnumTest.cs @@ -13,7 +13,6 @@ namespace Cecil.Tests { [TestFixture] public class EnumTest { - [TestCaseSource (typeof (Helper), nameof (Helper.PlatformAssemblyDefinitions))] [TestCaseSource (typeof (Helper), nameof (Helper.NetPlatformAssemblyDefinitions))] // https://github.com/xamarin/xamarin-macios/issues/9724 public void NoAvailabilityOnError (AssemblyInfo info) diff --git a/tests/cecil-tests/Helper.cs b/tests/cecil-tests/Helper.cs index 67b01aaaecf4..012f2336c297 100644 --- a/tests/cecil-tests/Helper.cs +++ b/tests/cecil-tests/Helper.cs @@ -29,7 +29,6 @@ public static AssemblyDefinition GetAssembly (string assembly, ReaderParameters? if (!cache.TryGetValue (assembly, out var ad)) { if (parameters is null) { var resolver = new DefaultAssemblyResolver (); - resolver.AddSearchDirectory (GetBCLDirectory (assembly)); parameters = new ReaderParameters () { AssemblyResolver = resolver, ReadSymbols = readSymbols, @@ -409,71 +408,6 @@ public static IEnumerable EnumerateAttributeProviders yield return item; } - public static string GetBCLDirectory (string assembly) - { - var rv = string.Empty; - var isDotNet = !assembly.Contains ("Library/Frameworks/Xamarin.iOS.framework") && !assembly.Contains ("Library/Frameworks/Xamarin.Mac.framework"); - - switch (Configuration.GetPlatform (assembly, isDotNet)) { - case ApplePlatform.iOS: - rv = Path.GetDirectoryName (Configuration.XamarinIOSDll); - break; - case ApplePlatform.WatchOS: - rv = Path.GetDirectoryName (Configuration.XamarinWatchOSDll); - break; - case ApplePlatform.TVOS: - rv = Path.GetDirectoryName (Configuration.XamarinTVOSDll); - break; - case ApplePlatform.MacOSX: - rv = Path.GetDirectoryName (assembly); - break; - case ApplePlatform.MacCatalyst: - rv = Path.GetDirectoryName (Configuration.XamarinCatalystDll); - break; - default: - throw new NotImplementedException (assembly); - } - - return rv!; - } - - static IEnumerable PlatformAssemblies { - get { - if (!Configuration.include_legacy_xamarin) - yield break; - - if (Configuration.include_ios) { - // we want to process 32/64 bits individually since their content can differ - if (Configuration.iOSSupports32BitArchitectures) - yield return Path.Combine (Configuration.MonoTouchRootDirectory, "lib", "32bits", "iOS", "Xamarin.iOS.dll"); - yield return Path.Combine (Configuration.MonoTouchRootDirectory, "lib", "64bits", "iOS", "Xamarin.iOS.dll"); - } - - if (Configuration.include_tvos) { - // XamarinTVOSDll is stripped of it's IL - yield return Path.Combine (Configuration.MonoTouchRootDirectory, "lib", "64bits", "tvOS", "Xamarin.TVOS.dll"); - } - - if (Configuration.include_mac) { - yield return Configuration.XamarinMacMobileDll; - yield return Configuration.XamarinMacFullDll; - } - } - } - - static IList? platform_assembly_definitions; - public static IEnumerable PlatformAssemblyDefinitions { - get { - if (platform_assembly_definitions is null) { - platform_assembly_definitions = PlatformAssemblies - .Select (v => new AssemblyInfo (v, GetAssembly (v, readSymbols: true), false)) - .ToArray (); - } - return platform_assembly_definitions; - } - } - - static IEnumerable NetPlatformAssemblies => Configuration.GetRefLibraries (); static IList? net_platform_assembly_definitions; @@ -481,7 +415,7 @@ public static IEnumerable NetPlatformAssemblyDefinitions { get { if (net_platform_assembly_definitions is null) { net_platform_assembly_definitions = NetPlatformAssemblies - .Select (v => new AssemblyInfo (v, GetAssembly (v, readSymbols: false), true)) + .Select (v => new AssemblyInfo (v, GetAssembly (v, readSymbols: false))) .ToArray (); } return net_platform_assembly_definitions; @@ -495,7 +429,7 @@ public static IEnumerable NetPlatformImplementationAssemblyDefinit get { if (net_platform_assembly_implemnetation_assembly_definitions is null) { net_platform_assembly_implemnetation_assembly_definitions = NetPlatformImplementationAssemblies - .Select (v => new AssemblyInfo (v, GetAssembly (v, readSymbols: true), true)) + .Select (v => new AssemblyInfo (v, GetAssembly (v, readSymbols: true))) .ToArray (); } return net_platform_assembly_implemnetation_assembly_definitions; @@ -529,22 +463,6 @@ public static Dictionary> MappedNetApi { } } - public static IEnumerable TaskAssemblies { - get { - if (Configuration.include_ios) - yield return CreateTestFixtureDataFromPath (Path.Combine (Configuration.SdkRootXI, "lib", "msbuild", "iOS", "Xamarin.iOS.Tasks.dll")); - if (Configuration.include_mac) - yield return CreateTestFixtureDataFromPath (Path.Combine (Configuration.SdkRootXM, "lib", "msbuild", "Xamarin.Mac.Tasks.dll")); - } - } - - static TestFixtureData CreateTestFixtureDataFromPath (string path) - { - var rv = new TestFixtureData (path); - rv.SetArgDisplayNames (Path.GetFileName (path)); - return rv; - } - // This method renders a string that sorts well - methods in the same // type are sorted next to eachother (the default MethodDefinition.FullName // implementation starts with the return type, so sorting the results @@ -712,11 +630,11 @@ public class AssemblyInfo { public string Path; public ApplePlatform Platform; - public AssemblyInfo (string path, AssemblyDefinition assembly, bool isDotNet) + public AssemblyInfo (string path, AssemblyDefinition assembly) { Assembly = assembly; Path = path; - Platform = Configuration.GetPlatform (path, isDotNet); + Platform = Configuration.GetPlatform (path); } public override string ToString () diff --git a/tests/cecil-tests/MarshalAsTest.cs b/tests/cecil-tests/MarshalAsTest.cs index e189451bde2c..017a98856ed1 100644 --- a/tests/cecil-tests/MarshalAsTest.cs +++ b/tests/cecil-tests/MarshalAsTest.cs @@ -18,7 +18,6 @@ public class MarshalAsTest { HashSet knownIssues = new HashSet { }; - [TestCaseSource (typeof (Helper), nameof (Helper.PlatformAssemblyDefinitions))] [TestCaseSource (typeof (Helper), nameof (Helper.NetPlatformAssemblyDefinitions))] public void TestAssembly (AssemblyInfo info) { diff --git a/tests/cecil-tests/Test.cs b/tests/cecil-tests/Test.cs index 3999328f85b3..753959db84f8 100644 --- a/tests/cecil-tests/Test.cs +++ b/tests/cecil-tests/Test.cs @@ -14,7 +14,6 @@ namespace Cecil.Tests { [TestFixture] public class Test { - [TestCaseSource (typeof (Helper), nameof (Helper.PlatformAssemblyDefinitions))] [TestCaseSource (typeof (Helper), nameof (Helper.NetPlatformImplementationAssemblyDefinitions))] // ref: https://github.com/xamarin/xamarin-macios/pull/7760 public void IdentifyBackingFieldAssignation (AssemblyInfo info) @@ -50,7 +49,6 @@ public void IdentifyBackingFieldAssignation (AssemblyInfo info) } } - [TestCaseSource (typeof (Helper), nameof (Helper.PlatformAssemblyDefinitions))] [TestCaseSource (typeof (Helper), nameof (Helper.NetPlatformImplementationAssemblyDefinitions))] // ref: https://github.com/xamarin/xamarin-macios/issues/8249 public void EnsureUIThreadOnInit (AssemblyInfo info) @@ -85,7 +83,6 @@ public void EnsureUIThreadOnInit (AssemblyInfo info) } } - [TestCaseSource (typeof (Helper), nameof (Helper.PlatformAssemblyDefinitions))] [TestCaseSource (typeof (Helper), nameof (Helper.NetPlatformAssemblyDefinitions))] public void NoSystemConsoleReference (AssemblyInfo info) { @@ -127,7 +124,6 @@ public void NoSystemConsoleReference (AssemblyInfo info) // keep up-to-date with the 'bannedCApi' list in tests/mtouch/MiscTests.cs }; - [TestCaseSource (typeof (Helper), nameof (Helper.PlatformAssemblyDefinitions))] [TestCaseSource (typeof (Helper), nameof (Helper.NetPlatformAssemblyDefinitions))] public void NoBannedApi (AssemblyInfo info) { @@ -153,7 +149,6 @@ public enum PlatformName : byte { MacCatalyst, } - [TestCaseSource (typeof (Helper), nameof (Helper.PlatformAssemblyDefinitions))] [TestCaseSource (typeof (Helper), nameof (Helper.NetPlatformAssemblyDefinitions))] // ref: https://github.com/xamarin/xamarin-macios/issues/4835 public void Unavailable (AssemblyInfo info) diff --git a/tests/common/Configuration.cs b/tests/common/Configuration.cs index 33ae563173bc..88c1edb946cb 100644 --- a/tests/common/Configuration.cs +++ b/tests/common/Configuration.cs @@ -42,9 +42,6 @@ static partial class Configuration { public static bool include_tvos; public static bool include_maccatalyst; public static bool include_device; - public static bool include_dotnet; - public static bool include_legacy_xamarin; - public static bool iOSSupports32BitArchitectures; public static bool EnableXamarin; public static bool XcodeIsStable; @@ -297,13 +294,10 @@ static Configuration () include_tvos = !string.IsNullOrEmpty (GetVariable ("INCLUDE_TVOS", "")); include_maccatalyst = !string.IsNullOrEmpty (GetVariable ("INCLUDE_MACCATALYST", "")); include_device = !string.IsNullOrEmpty (GetVariable ("INCLUDE_DEVICE", "")); - include_dotnet = !string.IsNullOrEmpty (GetVariable ("ENABLE_DOTNET", "")); - include_legacy_xamarin = !string.IsNullOrEmpty (GetVariable ("INCLUDE_XAMARIN_LEGACY", "")); DotNetBclDir = GetVariable ("DOTNET_BCL_DIR", null); DotNetCscCommand = GetVariable ("DOTNET_CSC_COMMAND", null)?.Trim ('\''); DotNetExecutable = GetVariable ("DOTNET", null); DotNetTfm = GetVariable ("DOTNET_TFM", null); - iOSSupports32BitArchitectures = !string.IsNullOrEmpty (GetVariable ("IOS_SUPPORTS_32BIT_ARCHITECTURES", "")); EnableXamarin = !string.IsNullOrEmpty (GetVariable ("ENABLE_XAMARIN", "")); XcodeIsStable = string.Equals (GetVariable ("XCODE_IS_STABLE", ""), "true", StringComparison.OrdinalIgnoreCase); @@ -328,7 +322,6 @@ static Configuration () Console.WriteLine (" INCLUDE_MAC={0}", include_mac); Console.WriteLine (" INCLUDE_TVOS={0}", include_tvos); Console.WriteLine (" INCLUDE_MACCATALYST={0}", include_maccatalyst); - Console.WriteLine (" ENABLE_DOTNET={0}", include_dotnet); } public static string RootPath { @@ -385,84 +378,12 @@ public static string SourceRoot { } } - public static string XamarinIOSDll { - get { - return Path.Combine (mt_root, "lib", "mono", "Xamarin.iOS", "Xamarin.iOS.dll"); - } - } - - public static string XamarinCatalystDll { - get { - return Path.Combine (mt_root, "lib", "mono", "Xamarin.MacCatalyst", "Xamarin.MacCatalyst.dll"); - } - } - - public static string XamarinWatchOSDll { - get { - return Path.Combine (mt_root, "lib", "mono", "Xamarin.WatchOS", "Xamarin.WatchOS.dll"); - } - } - - public static string XamarinTVOSDll { - get { - return Path.Combine (mt_root, "lib", "mono", "Xamarin.TVOS", "Xamarin.TVOS.dll"); - } - } - - public static string XamarinMacMobileDll { - get { - return Path.Combine (SdkRootXM, "lib", "mono", "Xamarin.Mac", "Xamarin.Mac.dll"); - } - } - - public static string XamarinMacFullDll { - get { - return Path.Combine (SdkRootXM, "lib", "mono", "4.5", "Xamarin.Mac.dll"); - } - } - - public static string SdkBinDir { - get { -#if MONOMAC - return BinDirXM; -#else - return BinDirXI; -#endif - } - } - - public static string TargetDirectoryXI { - get { - if (UseSystem) - return "/"; - return make_config ["IOS_DESTDIR"]; - } - } - - public static string TargetDirectoryXM { - get { - if (UseSystem) - return "/"; - return make_config ["MAC_DESTDIR"]; - } - } - public static string TestProjectsDirectory { get { return Path.Combine (RootPath, "tests", "common", "TestProjects"); } } - public static string SdkRoot { - get { -#if MONOMAC - return SdkRootXM; -#else - return SdkRootXI; -#endif - } - } - static string GetRefNuGetName (TargetFramework targetFramework) => GetRefNuGetName (targetFramework.Platform); static string GetRefNuGetName (ApplePlatform platform) @@ -514,11 +435,7 @@ public static string GetRefDirectory (ApplePlatform platform) public static string GetRefDirectory (TargetFramework targetFramework) { - if (targetFramework.IsDotNet) - return GetRefDirectory (targetFramework.Platform); - - // This is only applicable for .NET - throw new InvalidOperationException (targetFramework.ToString ()); + return GetRefDirectory (targetFramework.Platform); } public static string GetNuGetVersionNoMetadata (TargetFramework framework) @@ -542,34 +459,9 @@ public static string GetRuntimeDirectory (ApplePlatform platform, string runtime return Path.Combine (rv, "runtimes", runtimeIdentifier); } - public static string GetTargetDirectory (ApplePlatform platform) - { - switch (platform) { - case ApplePlatform.iOS: - case ApplePlatform.TVOS: - case ApplePlatform.WatchOS: - return TargetDirectoryXI; - case ApplePlatform.MacOSX: - return TargetDirectoryXM; - default: - throw new InvalidOperationException (platform.ToString ()); - } - } - public static string GetSdkRoot (TargetFramework targetFramework) { - if (targetFramework.IsDotNet) - return GetSdkRoot (targetFramework.Platform); - switch (targetFramework.Platform) { - case ApplePlatform.iOS: - case ApplePlatform.TVOS: - case ApplePlatform.WatchOS: - return SdkRootXI; - case ApplePlatform.MacOSX: - return SdkRootXM; - default: - throw new InvalidOperationException (); - } + return GetSdkRoot (targetFramework.Platform); } // Only valid for .NET @@ -581,196 +473,57 @@ public static string GetSdkRoot (ApplePlatform platform) return Path.Combine (rv, "tools"); } - public static string SdkRootXI { - get { - return Path.Combine (TargetDirectoryXI, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current"); - } - } - - public static string SdkRootXM { - get { - return Path.Combine (TargetDirectoryXM, "Library", "Frameworks", "Xamarin.Mac.framework", "Versions", "Current"); - } - } - - public static string BinDirXI { - get { - return Path.Combine (SdkRootXI, "bin"); - } - } - - public static string BinDirXM { - get { - return Path.Combine (SdkRootXM, "bin"); - } - } - - public static string BtouchPath { - get { - return Path.Combine (SdkBinDir, "btouch-native"); - } - } - - public static string BGenPath { - get { - return Path.Combine (SdkBinDir, "bgen"); - } - } - - public static string BGenClassicPath { - get { - return Path.Combine (BinDirXM, "bgen-classic"); - } - } - public static string GetBindingAttributePath (TargetFramework targetFramework) { - if (targetFramework.IsDotNet) - return Path.Combine (GetSdkRoot (targetFramework), "lib", "Xamarin.Apple.BindingAttributes.dll"); - - switch (targetFramework.Platform) { - case ApplePlatform.iOS: - return Path.Combine (GetSdkRoot (targetFramework), "lib", "bgen", "Xamarin.iOS.BindingAttributes.dll"); - case ApplePlatform.TVOS: - return Path.Combine (GetSdkRoot (targetFramework), "lib", "bgen", "Xamarin.TVOS.BindingAttributes.dll"); - case ApplePlatform.WatchOS: - return Path.Combine (GetSdkRoot (targetFramework), "lib", "bgen", "Xamarin.WatchOS.BindingAttributes.dll"); - case ApplePlatform.MacOSX: - if (targetFramework == TargetFramework.Xamarin_Mac_2_0_Mobile) { - return Path.Combine (GetSdkRoot (targetFramework), "lib", "bgen", "Xamarin.Mac-mobile.BindingAttributes.dll"); - } else if (targetFramework == TargetFramework.Xamarin_Mac_4_5_Full) { - return Path.Combine (GetSdkRoot (targetFramework), "lib", "bgen", "Xamarin.Mac-full.BindingAttributes.dll"); - } - goto default; - default: - throw new InvalidOperationException (); - } - } - - public static string MmpPath { - get { - return Path.Combine (BinDirXM, "mmp"); - } - } - - public static string MtouchPath { - get { - return Path.Combine (BinDirXI, "mtouch"); - } - } - - public static string MlaunchPath { - get { - var env = Environment.GetEnvironmentVariable ("MLAUNCH_PATH"); - if (!string.IsNullOrEmpty (env)) - return env; - return Path.Combine (BinDirXI, "mlaunch"); - } + return Path.Combine (GetSdkRoot (targetFramework), "lib", "Xamarin.Apple.BindingAttributes.dll"); } #if !XAMMAC_TESTS - - public static string GetBaseLibrary (Profile profile) + public static string GetBaseLibrary (ApplePlatform platform) { - switch (profile) { - case Profile.iOS: - return XamarinIOSDll; - case Profile.tvOS: - return XamarinTVOSDll; - case Profile.watchOS: - return XamarinWatchOSDll; - case Profile.macOSMobile: - return XamarinMacMobileDll; - case Profile.macOSFull: - case Profile.macOSSystem: - return XamarinMacFullDll; - default: - throw new NotImplementedException (); - } - } - - public static string GetBaseLibrary (ApplePlatform platform, bool isDotNet) - { - if (isDotNet) - return Path.Combine (GetRefDirectory (platform), GetBaseLibraryName (platform, isDotNet)); - return GetBaseLibrary (platform.AsProfile ()); + return Path.Combine (GetRefDirectory (platform), GetBaseLibraryName (platform)); } static string GetBaseLibraryName (TargetFramework targetFramework) { - return GetBaseLibraryName (targetFramework.Platform, targetFramework.IsDotNet); + return GetBaseLibraryName (targetFramework.Platform); } - public static string GetBaseLibraryName (ApplePlatform platform, bool isDotNet) + public static string GetBaseLibraryName (ApplePlatform platform) { switch (platform) { case ApplePlatform.iOS: - return isDotNet ? "Microsoft.iOS.dll" : "Xamarin.iOS.dll"; + return "Microsoft.iOS.dll"; case ApplePlatform.TVOS: - return isDotNet ? "Microsoft.tvOS.dll" : "Xamarin.TVOS.dll"; - case ApplePlatform.WatchOS: - return isDotNet ? "Microsoft.watchOS.dll" : "Xamarin.WatchOS.dll"; + return "Microsoft.tvOS.dll"; case ApplePlatform.MacOSX: - return isDotNet ? "Microsoft.macOS.dll" : "Xamarin.Mac.dll"; + return "Microsoft.macOS.dll"; case ApplePlatform.MacCatalyst: - return isDotNet ? "Microsoft.MacCatalyst.dll" : "Xamarin.MacCatalyst.dll"; + return "Microsoft.MacCatalyst.dll"; default: throw new InvalidOperationException (platform.ToString ()); } } - public static ApplePlatform GetPlatform (string assemblyName, bool isDotNet) + public static ApplePlatform GetPlatform (string assemblyName) { - if (isDotNet) { - switch (Path.GetFileNameWithoutExtension (assemblyName)) { - case "Microsoft.iOS": - return ApplePlatform.iOS; - case "Microsoft.MacCatalyst": - return ApplePlatform.MacCatalyst; - case "Microsoft.tvOS": - return ApplePlatform.TVOS; - case "Microsoft.macOS": - return ApplePlatform.MacOSX; - default: - throw new NotSupportedException ($"Unknown assembly: {assemblyName}"); - } - } else { - switch (Path.GetFileNameWithoutExtension (assemblyName)) { - case "Xamarin.iOS": - return ApplePlatform.iOS; - case "Xamarin.WatchOS": - return ApplePlatform.WatchOS; - case "Xamarin.TVOS": - return ApplePlatform.TVOS; - case "Xamarin.Mac": - return ApplePlatform.MacOSX; - default: - throw new NotSupportedException ($"Unknown assembly: {assemblyName}"); - } + switch (Path.GetFileNameWithoutExtension (assemblyName)) { + case "Microsoft.iOS": + return ApplePlatform.iOS; + case "Microsoft.MacCatalyst": + return ApplePlatform.MacCatalyst; + case "Microsoft.tvOS": + return ApplePlatform.TVOS; + case "Microsoft.macOS": + return ApplePlatform.MacOSX; + default: + throw new NotSupportedException ($"Unknown assembly: {assemblyName}"); } } public static string GetBaseLibrary (TargetFramework targetFramework) { - if (targetFramework.IsDotNet) - return Path.Combine (GetRefDirectory (targetFramework), GetBaseLibraryName (targetFramework)); - - switch (targetFramework.Platform) { - case ApplePlatform.iOS: - return XamarinIOSDll; - case ApplePlatform.TVOS: - return XamarinTVOSDll; - case ApplePlatform.WatchOS: - return XamarinWatchOSDll; - } - - if (targetFramework == TargetFramework.Xamarin_Mac_2_0_Mobile) { - return XamarinMacMobileDll; - } else if (targetFramework == TargetFramework.Xamarin_Mac_4_5_Full) { - return XamarinMacFullDll; - } - - throw new InvalidOperationException (targetFramework.ToString ()); + return Path.Combine (GetRefDirectory (targetFramework), GetBaseLibraryName (targetFramework)); } public static IList GetRuntimeIdentifiers (ApplePlatform platform) @@ -793,7 +546,7 @@ public static IList GetArchitectures (string runtimeIdentifier) public static IEnumerable GetBaseLibraryImplementations () { - foreach (var platform in GetIncludedPlatforms (true)) + foreach (var platform in GetIncludedPlatforms ()) foreach (var lib in GetBaseLibraryImplementations (platform)) yield return lib; } @@ -803,91 +556,25 @@ public static IEnumerable GetBaseLibraryImplementations (ApplePlatform p var runtimeIdentifiers = GetRuntimeIdentifiers (platform); foreach (var rid in runtimeIdentifiers) { var libdir = Path.Combine (GetRuntimeDirectory (platform, rid), "lib", DotNetTfm); - yield return Path.Combine (libdir, GetBaseLibraryName (platform, true)); + yield return Path.Combine (libdir, GetBaseLibraryName (platform)); } } public static IEnumerable GetRefLibraries () { - foreach (var platform in GetIncludedPlatforms (true)) - yield return Path.Combine (GetRefDirectory (platform), GetBaseLibraryName (platform, true)); + foreach (var platform in GetIncludedPlatforms ()) + yield return Path.Combine (GetRefDirectory (platform), GetBaseLibraryName (platform)); } public static string GetRefLibrary (ApplePlatform platform) { - return GetBaseLibrary (platform, true); - } - - public static string GetTargetFramework (Profile profile) - { - switch (profile) { - case Profile.iOS: - return "Xamarin.iOS,v1.0"; - case Profile.tvOS: - return "Xamarin.TVOS,v1.0"; - case Profile.watchOS: - return "Xamarin.WatchOS,v1.0"; - case Profile.macOSMobile: - return "Xamarin.Mac,Version=v2.0,Profile=Mobile"; - case Profile.macOSFull: - return "Xamarin.Mac,Version=v4.5,Profile=Full"; - case Profile.macOSSystem: - return "Xamarin.Mac,Version=v4.5,Profile=System"; - default: - throw new NotImplementedException (); - } - } - - public static string GetSdkVersion (Profile profile) - { - switch (profile) { - case Profile.iOS: - return Configuration.sdk_version; - case Profile.tvOS: - return Configuration.tvos_sdk_version; - case Profile.watchOS: - return Configuration.watchos_sdk_version; - case Profile.macOSFull: - case Profile.macOSMobile: - case Profile.macOSSystem: - return Configuration.macos_sdk_version; - default: - throw new NotImplementedException (); - } - } - - public static string GetSdkPath (Profile profile, bool is_device) - { - switch (profile) { - case Profile.iOS: - return Path.Combine (MonoTouchRootDirectory, "SDKs", "MonoTouch." + (is_device ? "iphoneos" : "iphonesimulator") + ".sdk"); - case Profile.tvOS: - return Path.Combine (MonoTouchRootDirectory, "SDKs", "Xamarin.AppleTV" + (is_device ? "OS" : "Simulator") + ".sdk"); - case Profile.watchOS: - return Path.Combine (MonoTouchRootDirectory, "SDKs", "Xamarin.Watch" + (is_device ? "OS" : "Simulator") + ".sdk"); - case Profile.macOSFull: - case Profile.macOSMobile: - case Profile.macOSSystem: - return Path.Combine (SdkRootXM, "lib"); - default: - throw new NotImplementedException (profile.ToString ()); - } - } - - public static string GetCompiler (Profile profile, IList args) - { - args.Add ($"-lib:{Path.GetDirectoryName (GetBaseLibrary (profile))}"); - return "/Library/Frameworks/Mono.framework/Commands/csc"; + return GetBaseLibrary (platform); } - #endif // !XAMMAC_TESTS - public static IEnumerable GetIncludedPlatforms (bool dotnet) + public static IEnumerable GetIncludedPlatforms () { - if (dotnet && !include_dotnet) - yield break; - if (include_ios) yield return ApplePlatform.iOS; if (include_tvos) @@ -898,15 +585,12 @@ public static IEnumerable GetIncludedPlatforms (bool dotnet) yield return ApplePlatform.MacCatalyst; } - public static IEnumerable GetAllPlatforms (bool dotnet) + public static IEnumerable GetAllPlatforms () { yield return ApplePlatform.iOS; yield return ApplePlatform.TVOS; yield return ApplePlatform.MacOSX; - if (dotnet) - yield return ApplePlatform.MacCatalyst; - if (!dotnet) - yield return ApplePlatform.WatchOS; + yield return ApplePlatform.MacCatalyst; } public static string NuGetPackagesDirectory { @@ -976,14 +660,10 @@ public static Dictionary GetBuildEnvironment (ApplePlatform plat public static void SetBuildVariables (ApplePlatform platform, ref Dictionary environment) { - var rootDirectory = GetTargetDirectory (platform); - if (environment is null) environment = new Dictionary (); environment ["MD_APPLE_SDK_ROOT"] = Path.GetDirectoryName (Path.GetDirectoryName (xcode_root)); - environment ["TargetFrameworkFallbackSearchPaths"] = Path.Combine (rootDirectory, "Library", "Frameworks", "Mono.framework", "External", "xbuild-frameworks"); - environment ["MSBuildExtensionsPathFallbackPathsOverride"] = Path.Combine (rootDirectory, "Library", "Frameworks", "Mono.framework", "External", "xbuild"); // This is set by `dotnet test` and can cause building legacy projects to fail to build with: // Microsoft.NET.Build.Extensions.ConflictResolution.targets(30,5): @@ -991,20 +671,6 @@ public static void SetBuildVariables (ApplePlatform platform, ref Dictionary declaration is correct, that the assembly and all its dependencies are available, // and that the task contains a public class that implements Microsoft.Build.Framework.ITask. environment ["MSBuildExtensionsPath"] = null; - - switch (platform) { - case ApplePlatform.iOS: - case ApplePlatform.TVOS: - case ApplePlatform.WatchOS: - environment ["MD_MTOUCH_SDK_ROOT"] = Path.Combine (rootDirectory, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current"); - break; - case ApplePlatform.MacOSX: - environment ["XAMMAC_FRAMEWORK_PATH"] = Path.Combine (rootDirectory, "Library", "Frameworks", "Xamarin.Mac.framework", "Versions", "Current"); - environment ["XamarinMacFrameworkRoot"] = Path.Combine (rootDirectory, "Library", "Frameworks", "Xamarin.Mac.framework", "Versions", "Current"); - break; - default: - throw new NotImplementedException (platform.ToString ()); - } } public static bool IsBuildingRemotely { diff --git a/tests/common/ConfigurationNUnit.cs b/tests/common/ConfigurationNUnit.cs index 885d91cf844b..47d45bdc26a4 100644 --- a/tests/common/ConfigurationNUnit.cs +++ b/tests/common/ConfigurationNUnit.cs @@ -45,8 +45,6 @@ public static void AssertRuntimeIdentifiersAvailable (ApplePlatform platform, st public static void AssertiOS32BitAvailable () { - if (iOSSupports32BitArchitectures) - return; Assert.Ignore ($"32-bit iOS support is not available in the current build."); } #endif // !XAMMAC_TESTS @@ -60,15 +58,10 @@ public static void AssertDeviceAvailable () public static void AssertDotNetAvailable () { - if (include_dotnet) - return; - Assert.Ignore (".NET tests not enabled"); } public static void AssertLegacyXamarinAvailable () { - if (include_legacy_xamarin) - return; Assert.Ignore ("Legacy xamarin build not enabled"); } @@ -116,22 +109,22 @@ public static void IgnoreIfIgnoredPlatform (string platform) } } - public static bool AnyIgnoredPlatforms (bool dotnet = true) + public static bool AnyIgnoredPlatforms () { - return AnyIgnoredPlatforms (dotnet, out var _); + return AnyIgnoredPlatforms (out var _); } - public static bool AnyIgnoredPlatforms (bool dotnet, out IEnumerable notIncluded) + public static bool AnyIgnoredPlatforms (out IEnumerable notIncluded) { - var allPlatforms = GetAllPlatforms (dotnet); - var includedPlatforms = GetIncludedPlatforms (dotnet); + var allPlatforms = GetAllPlatforms (); + var includedPlatforms = GetIncludedPlatforms (); notIncluded = allPlatforms.Where (v => !includedPlatforms.Contains (v)).ToArray (); return notIncluded.Any (); } - public static void IgnoreIfAnyIgnoredPlatforms (bool dotnet = true) + public static void IgnoreIfAnyIgnoredPlatforms () { - if (AnyIgnoredPlatforms (dotnet, out var notIncluded)) + if (AnyIgnoredPlatforms (out var notIncluded)) Assert.Ignore ($"This test requires all platforms to be included, but the following platforms aren't included: {string.Join (", ", notIncluded.Select (v => v.AsString ()))}"); } diff --git a/tests/common/mac/ProjectTestHelpers.cs b/tests/common/mac/ProjectTestHelpers.cs index ec76c115812b..330dfcfaa489 100644 --- a/tests/common/mac/ProjectTestHelpers.cs +++ b/tests/common/mac/ProjectTestHelpers.cs @@ -492,11 +492,6 @@ static void Main (string[] args) s.Write (testCase); } - public static string FindRootDirectory () - { - return Configuration.TargetDirectoryXM; - } - static string GenerateOutputCommand (string tmpDir, Guid guid) { return string.Format ("System.IO.File.Create(\"{0}\").Dispose();", Path.Combine (tmpDir, guid.ToString ())); diff --git a/tests/dotnet/UnitTests/BundleStructureTest.cs b/tests/dotnet/UnitTests/BundleStructureTest.cs index 3e366ba60772..1a4b70d0e6c6 100644 --- a/tests/dotnet/UnitTests/BundleStructureTest.cs +++ b/tests/dotnet/UnitTests/BundleStructureTest.cs @@ -11,7 +11,7 @@ static bool IsPlatformAssembly (string assemblyName) foreach (var platform in Enum.GetValues ()) { if (platform == ApplePlatform.None) continue; - var platformAssembly = Path.GetFileNameWithoutExtension (Configuration.GetBaseLibraryName (platform, true)); + var platformAssembly = Path.GetFileNameWithoutExtension (Configuration.GetBaseLibraryName (platform)); if (platformAssembly == assemblyName) return true; } @@ -308,7 +308,7 @@ internal static void CheckAppBundleContents (ApplePlatform platform, IEnumerable expectedFiles.Add (Path.Combine (assemblyDirectory, "nunitlite.dll")); bool forceSingleRid = (platform == ApplePlatform.MacCatalyst && !isReleaseBuild) || platform == ApplePlatform.MacOSX; AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, "Touch.Client", runtimeIdentifiers, forceSingleRid, includeDebugFiles: includeDebugFiles); - AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, Path.GetFileNameWithoutExtension (Configuration.GetBaseLibraryName (platform, true)), runtimeIdentifiers, forceSingleRid, includeDebugFiles: includeDebugFiles); + AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, Path.GetFileNameWithoutExtension (Configuration.GetBaseLibraryName (platform)), runtimeIdentifiers, forceSingleRid, includeDebugFiles: includeDebugFiles); expectedFiles.Add (Path.Combine (assemblyDirectory, "runtimeconfig.bin")); switch (platform) { diff --git a/tests/dotnet/UnitTests/ProjectTest.cs b/tests/dotnet/UnitTests/ProjectTest.cs index 22d65faed0e6..3943699a9fbe 100644 --- a/tests/dotnet/UnitTests/ProjectTest.cs +++ b/tests/dotnet/UnitTests/ProjectTest.cs @@ -427,7 +427,7 @@ public void IsNotMacBuild (ApplePlatform platform, string runtimeIdentifiers, bo var appExecutable = Path.Combine (appPath, Path.GetFileName (project_path)); Assert.That (appPath, Does.Not.Exist, "There is an .app"); Assert.That (appExecutable, Does.Not.Empty, "There is no executable"); - Assert.That (Path.Combine (appPath, Configuration.GetBaseLibraryName (platform, true)), Does.Not.Exist, "Platform assembly is in the bundle"); + Assert.That (Path.Combine (appPath, Configuration.GetBaseLibraryName (platform)), Does.Not.Exist, "Platform assembly is in the bundle"); break; case ApplePlatform.MacCatalyst: break; diff --git a/tests/dotnet/UnitTests/RegistrarTest.cs b/tests/dotnet/UnitTests/RegistrarTest.cs index b9c87ba414c9..8cc13fb9fc40 100644 --- a/tests/dotnet/UnitTests/RegistrarTest.cs +++ b/tests/dotnet/UnitTests/RegistrarTest.cs @@ -86,7 +86,7 @@ public void ClassRewriterTest (ApplePlatform platform, bool rewriteHandles) var asmDir = Path.Combine (appDir, GetRelativeAssemblyDirectory (platform)); var appExecutable = Path.Combine (asmDir, project + ".dll"); - var platformDll = Path.Combine (asmDir, Configuration.GetBaseLibraryName (platform, true)); + var platformDll = Path.Combine (asmDir, Configuration.GetBaseLibraryName (platform)); Assert.That (File.Exists (platformDll), "No platform dll."); var module = ModuleDefinition.ReadModule (platformDll); var classHandlesMaybe = AllTypes (module).FirstOrDefault (t => t.FullName == "ObjCRuntime.Runtime/ClassHandles"); diff --git a/tests/dotnet/UnitTests/TemplateProjectTest.cs b/tests/dotnet/UnitTests/TemplateProjectTest.cs index d0f18aef7fcd..3e76a2d28540 100644 --- a/tests/dotnet/UnitTests/TemplateProjectTest.cs +++ b/tests/dotnet/UnitTests/TemplateProjectTest.cs @@ -98,7 +98,6 @@ public void VeryManyRegisteredAssemblies (ApplePlatform platform) var tmpdir = Cache.CreateTemporaryDirectory (); var assemblies = 200; - var xm = Configuration.XamarinMacMobileDll; var csc = Configuration.DotNetCscCommand; var references = new List (); diff --git a/tests/dotnet/UnitTests/XcodeProjectTests.cs b/tests/dotnet/UnitTests/XcodeProjectTests.cs index a3a7362f34e5..ecff4fbcd85c 100644 --- a/tests/dotnet/UnitTests/XcodeProjectTests.cs +++ b/tests/dotnet/UnitTests/XcodeProjectTests.cs @@ -306,7 +306,7 @@ public void BuildMultipleProjectsiOS () [Category ("Multiplatform")] public void BuildMultiTargeting () { - var enabledPlatforms = Configuration.GetIncludedPlatforms (dotnet: true); + var enabledPlatforms = Configuration.GetIncludedPlatforms (); var templatePlatform = enabledPlatforms.First (); var testDir = Cache.CreateTemporaryDirectory (TestName); var proj = Path.Combine (testDir, $"{TestName}.csproj"); diff --git a/tests/generator/BGenTool.cs b/tests/generator/BGenTool.cs index 4326c98f24b0..644dc404703d 100644 --- a/tests/generator/BGenTool.cs +++ b/tests/generator/BGenTool.cs @@ -52,20 +52,13 @@ class BGenTool : Tool { public string? Out; public int Verbosity = 1; - protected override string ToolPath { get { return Profile == Profile.macOSClassic ? Configuration.BGenClassicPath : Configuration.BGenPath; } } + protected override string ToolPath { get => throw new InvalidOperationException (); } protected override string MessagePrefix { get { return "BI"; } } - protected override string MessageToolName { get { return Profile == Profile.macOSClassic ? "bgen-classic" : "bgen"; } } + protected override string MessageToolName { get { return "bgen"; } } public BGenTool () { - if (Environment.OSVersion.Platform == PlatformID.Win32NT) { - EnvironmentVariables = new Dictionary (); - } else { - EnvironmentVariables = new Dictionary { - { "MD_MTOUCH_SDK_ROOT", Configuration.SdkRootXI }, - { "XamarinMacFrameworkRoot", Configuration.SdkRootXM }, - }; - } + EnvironmentVariables = new Dictionary (); } public void AddTestApiDefinition (string filename) @@ -435,11 +428,7 @@ AssemblyDefinition LoadAssembly () if (assembly is null) { var parameters = new ReaderParameters (); var resolver = new DefaultAssemblyResolver (); -#if NET - var searchdir = Path.GetDirectoryName (Configuration.GetBaseLibrary (Profile.AsPlatform (), true)); -#else - var searchdir = Path.GetDirectoryName (Configuration.GetBaseLibrary (Profile)); -#endif + var searchdir = Path.GetDirectoryName (Configuration.GetBaseLibrary (Profile.AsPlatform ())); resolver.AddSearchDirectory (searchdir); parameters.AssemblyResolver = resolver; var tmpDirectory = EnsureTempDir (); diff --git a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/AssemblySetup.cs b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/AssemblySetup.cs index c48fad5d318e..4c485e135bee 100644 --- a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/AssemblySetup.cs +++ b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/AssemblySetup.cs @@ -18,9 +18,6 @@ public void AssemblyInitialization () if (is_in_vsmac) { var env = new Dictionary { { "MD_APPLE_SDK_ROOT", Path.GetDirectoryName (Path.GetDirectoryName (Configuration.xcode_root)) }, - { "TargetFrameworkFallbackSearchPaths", Path.Combine (Configuration.TargetDirectoryXI, "Library", "Frameworks", "Mono.framework", "External", "xbuild-frameworks") }, - { "MSBuildExtensionsPathFallbackPathsOverride", Path.Combine (Configuration.TargetDirectoryXI, "Library", "Frameworks", "Mono.framework", "External", "xbuild") }, - { "MD_MTOUCH_SDK_ROOT", Path.Combine (Configuration.TargetDirectoryXI, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current") }, { "MSBUILD_EXE_PATH", msbuild_exe_path }, }; diff --git a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/FrameworkListTest.cs b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/FrameworkListTest.cs deleted file mode 100644 index 45d50c328686..000000000000 --- a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/FrameworkListTest.cs +++ /dev/null @@ -1,185 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Text; -using System.Xml; -using NUnit.Framework; -using Xamarin.Tests; -using System.Linq; - -namespace Xamarin.MacDev.Tasks { - [TestFixture] - public class FrameworkListTests { - [TestCase ("Xamarin.iOS-FrameworkList.xml.in")] - [TestCase ("Xamarin.TVOS-FrameworkList.xml.in")] - [TestCase ("Xamarin.Mac-Full-FrameworkList.xml.in")] - [TestCase ("Xamarin.Mac-Mobile-FrameworkList.xml.in")] - public void CheckFrameworkListFile (string frameworkListFile) - { - Configuration.AssertLegacyXamarinAvailable (); - - var fameworkListFileParts = frameworkListFile.Split ('-'); - string frameworkName = fameworkListFileParts [0]; - switch (frameworkName) { - case "Xamarin.iOS": - if (!Configuration.include_ios) - Assert.Inconclusive ("include_ios is disabled"); - break; - case "Xamarin.TVOS": - if (!Configuration.include_tvos) - Assert.Inconclusive ("include_tvos is disabled"); - break; - case "Xamarin.Mac": - if (!Configuration.include_mac) - Assert.Inconclusive ("include_mac is disabled"); - break; - } - var isMac = frameworkName == "Xamarin.Mac"; - var isFull = fameworkListFileParts [1] == "Full"; - var frameworkListAssemblies = ScanFrameworkListXml (frameworkListFile); - var installedAssemblies = ScanAssemblyDirectory (frameworkName, isMac, isFull); - - foreach (var assembly in frameworkListAssemblies) { - if (!installedAssemblies.Any (a => a.Name == assembly.Name)) - ReportAssemblies (assembly, $"One or more assemblies listed in '{frameworkListFile}' were not found in the final SDK root folder. Update the list if an assembly was intentionally removed."); - } - - foreach (var assembly in installedAssemblies) { - if (!frameworkListAssemblies.Any (a => a.Name == assembly.Name)) - ReportAssemblies (assembly, $"One or more assemblies in the the SDK root folder are not listed in '{frameworkListFile}'. Update the list if an assembly was intentionally added."); - else if (!frameworkListAssemblies.Single (a => a.Name == assembly.Name).Equals (assembly)) - ReportAssemblies (assembly, $"One or more assemblies in the the SDK root folder do not match the entry in '{frameworkListFile}'. Update the list if an assembly was intentionally modified."); - } - } - - void ReportAssemblies (AssemblyInfo assembly, string message) - { - var errorCount = 0; - using (var sw = new StringWriter ()) { - using (var writer = XmlWriter.Create (sw, new XmlWriterSettings { Encoding = Encoding.UTF8, ConformanceLevel = ConformanceLevel.Fragment, Indent = true })) { - writer.WriteStartElement ("File"); - writer.WriteAttributeString ("AssemblyName", assembly.Name); - WriteNonEmptyAttribute ("Version", assembly.Version); - WriteNonEmptyAttribute ("PublicKeyToken", assembly.PublicKeyToken); - WriteNonEmptyAttribute ("Culture", assembly.Culture); - if (assembly.ProcessorArchitecture != ProcessorArchitecture.None) - writer.WriteAttributeString ("ProcessorArchitecture", assembly.ProcessorArchitecture.ToString ()); - if (assembly.InGac) - writer.WriteAttributeString ("InGac", "true"); - writer.WriteEndElement (); - errorCount++; - - void WriteNonEmptyAttribute (string name, string val) - { - if (!string.IsNullOrEmpty (val)) - writer.WriteAttributeString (name, val); - } - } - Assert.AreEqual (0, errorCount, $"{message}\n{sw.ToString ()}"); - } - } - - List ScanFrameworkListXml (string frameworkListFile) - { - var assemblies = new List (); - var path = Path.GetFullPath (Path.Combine (Configuration.SourceRoot, "msbuild", "Xamarin.Shared", frameworkListFile)); - using (var reader = XmlReader.Create (path)) { - while (reader.Read ()) { - if (reader.IsStartElement ()) { - switch (reader.LocalName) { - case "File": - assemblies.Add (ReadFileElement (reader)); - break; - } - } - } - } - return assemblies; - } - - List ScanAssemblyDirectory (string frameworkName, bool isMac, bool isFull) - { - var assemblies = new List (); - var assembliesPath = Path.GetFullPath (Path.Combine (isMac ? Configuration.SdkRootXM : Configuration.MonoTouchRootDirectory, "lib", "mono", isFull ? "4.5" : frameworkName)); - AddAssemblies (assembliesPath); - AddAssemblies (Path.Combine (assembliesPath, "Facades")); - - void AddAssemblies (string path) - { - foreach (var f in Directory.EnumerateFiles (path, "*.dll")) { - try { - var an = AssemblyName.GetAssemblyName (f); - assemblies.Add (new AssemblyInfo (an)); - } catch (Exception ex) { - Assert.Fail ("Error reading assembly '{0}' in framework '{1}':{2}{3}", f, frameworkName, Environment.NewLine, ex); - } - } - } - - return assemblies; - } - - static AssemblyInfo ReadFileElement (XmlReader reader) - { - var ainfo = new AssemblyInfo (); - if (reader.MoveToAttribute ("AssemblyName") && reader.ReadAttributeValue ()) - ainfo.Name = reader.ReadContentAsString (); - if (string.IsNullOrEmpty (ainfo.Name)) - throw new Exception ("Missing AssemblyName attribute"); - if (reader.MoveToAttribute ("Version") && reader.ReadAttributeValue ()) - ainfo.Version = reader.ReadContentAsString (); - if (reader.MoveToAttribute ("PublicKeyToken") && reader.ReadAttributeValue ()) - ainfo.PublicKeyToken = reader.ReadContentAsString (); - if (reader.MoveToAttribute ("Culture") && reader.ReadAttributeValue ()) - ainfo.Culture = reader.ReadContentAsString (); - if (reader.MoveToAttribute ("ProcessorArchitecture") && reader.ReadAttributeValue ()) - ainfo.ProcessorArchitecture = (ProcessorArchitecture) - Enum.Parse (typeof (ProcessorArchitecture), reader.ReadContentAsString (), true); - if (reader.MoveToAttribute ("InGac") && reader.ReadAttributeValue ()) - ainfo.InGac = reader.ReadContentAsBoolean (); - return ainfo; - } - } - - class AssemblyInfo { - public string Name; - - public string Version; - - public string PublicKeyToken; - - public string Culture; - - public ProcessorArchitecture ProcessorArchitecture = ProcessorArchitecture.MSIL; - - public bool InGac; - - public AssemblyInfo () - { - } - - public AssemblyInfo (AssemblyName aname) - { - Name = aname.Name; - Version = aname.Version.ToString (); - ProcessorArchitecture = aname.ProcessorArchitecture; - Culture = aname.CultureInfo.Name; - string fn = aname.ToString (); - string key = "publickeytoken="; - int i = fn.IndexOf (key, StringComparison.OrdinalIgnoreCase) + key.Length; - int j = fn.IndexOf (',', i); - if (j == -1) j = fn.Length; - PublicKeyToken = fn.Substring (i, j - i); - } - - public bool Equals (AssemblyInfo other) - { - // ignore Culture and InGac for equality since those are not mentioned in the FrameworkList.xml - return other.Name == this.Name && - other.Version == this.Version && - other.PublicKeyToken == this.PublicKeyToken && - other.ProcessorArchitecture == this.ProcessorArchitecture; - } - } -} diff --git a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs index f74137996492..d99670d24726 100644 --- a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs +++ b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs @@ -23,8 +23,7 @@ public void SetUp () }; RunMake (Path.Combine (Configuration.RootPath, "tests", "test-libraries"), environment: env); - if (Configuration.include_dotnet) - RunMake (Path.Combine (Configuration.RootPath, "tests", "common", "TestProjects", "ComplexAssembly"), environment: env); + RunMake (Path.Combine (Configuration.RootPath, "tests", "common", "TestProjects", "ComplexAssembly"), environment: env); } static void RunMake (string directory, Dictionary environment = null) diff --git a/tests/test-libraries/Makefile b/tests/test-libraries/Makefile index 6a6a7a27a518..1b1c188866d6 100644 --- a/tests/test-libraries/Makefile +++ b/tests/test-libraries/Makefile @@ -216,10 +216,6 @@ $$($(1)_DIRECTORIES): endef -ifdef IOS_SUPPORTS_32BIT_ARCHITECTURES -IOS_SIMULATOR_ARCHITECTURES=x86 -IOS_DEVICE_ARCHITECTURES=armv7 armv7s -endif IOS_SIMULATOR_ARCHITECTURES+=x86_64 arm64 IOS_DEVICE_ARCHITECTURES+=arm64 @@ -254,12 +250,6 @@ $(5)_TARGETS += .libs/$(4)/libtest.$(1).a all-local:: $$($(5)_TARGETS) endef -ifdef IOS_SUPPORTS_32BIT_ARCHITECTURES -$(eval $(call LibTemplate,armv7+7s,.libs/iphoneos/libtest.armv7.o,.libs/iphoneos/libtest.armv7s.o,ios-fat,IOS)) -$(eval $(call LibTemplate,armv7+x86,.libs/iphoneos/libtest.armv7.o,.libs/iphonesimulator/libtest.x86.o,ios-fat,IOS)) -$(eval $(call LibTemplate,armv7s+x86,.libs/iphoneos/libtest.armv7s.o,.libs/iphonesimulator/libtest.x86.o,ios-fat,IOS)) -endif - ifdef INCLUDE_TVOS $(eval $(call LibTemplate,arm64+x86_64,.libs/tvos/libtest.arm64.o,.libs/tvsimulator/libtest.x86_64.o,tvos-fat,TVOS)) endif diff --git a/tests/test-libraries/frameworks/Makefile b/tests/test-libraries/frameworks/Makefile index 1fc6a5e265e1..296de8d449ea 100644 --- a/tests/test-libraries/frameworks/Makefile +++ b/tests/test-libraries/frameworks/Makefile @@ -50,13 +50,8 @@ maccatalyst_INFO_PLIST_INFIX=/Versions/A/Resources maccatalyst_BINARY_INFIX=/Versions/A # For XCFrameworks, we have to lipo some of the RID-specific frameworks together (the ones with multiple RIDs below) -ifdef IOS_SUPPORTS_32BIT_ARCHITECTURES -iphonesimulator_XC_RUNTIMEIDENTIFIERS=iossimulator-x86 iossimulator-x64 iossimulator-arm64 -iphoneos_XC_RUNTIMEIDENTIFIERS=ios-arm ios-arm64 -else iphonesimulator_XC_RUNTIMEIDENTIFIERS=iossimulator-x64 iossimulator-arm64 iphoneos_XC_RUNTIMEIDENTIFIERS=ios-arm64 -endif tvsimulator_XC_RUNTIMEIDENTIFIERS=tvossimulator-x64 tvossimulator-arm64 tvos_XC_RUNTIMEIDENTIFIERS=tvos-arm64 mac_XC_RUNTIMEIDENTIFIERS=osx-x64 osx-arm64 @@ -200,9 +195,7 @@ ZIPPED_TARGETS += .libs/$(1).xcframework.zip all-local:: .libs/$(1).xcframework.stamp endef -ifdef ENABLE_DOTNET $(foreach name,$(NAMES),$(eval $(call XCFrameworkTemplate,$(name)))) -endif zip: $(ZIPPED_TARGETS) all-local:: $(ZIPPED_TARGETS) diff --git a/tests/xharness/Jenkins/Jenkins.cs b/tests/xharness/Jenkins/Jenkins.cs index 5661bc2b907a..564c975d64fe 100644 --- a/tests/xharness/Jenkins/Jenkins.cs +++ b/tests/xharness/Jenkins/Jenkins.cs @@ -101,11 +101,6 @@ public bool IsIncluded (TestProject project) return false; } - if (project.IsDotNetProject && !TestSelection.IsEnabled (PlatformLabel.Dotnet)) { - MainLog.WriteLine ($"Ignoring {project.Name} with label {project.Label} because it's a .NET project and .NET is not included."); - return false; - } - var rv = TestSelection.IsEnabled (project.Label); MainLog.WriteLine ($"Including {project.Name} with label {project.Label.ToString ()}: {rv}"); return rv; @@ -154,7 +149,7 @@ Task PopulateTasksAsync () TestName = "Xtro", Target = "dotnet-wrench", WorkingDirectory = Path.Combine (HarnessConfiguration.RootDirectory, "xtro-sharpie"), - Ignored = !(TestSelection.IsEnabled (TestLabel.Xtro) && TestSelection.IsEnabled (PlatformLabel.Dotnet)), + Ignored = !TestSelection.IsEnabled (TestLabel.Xtro), Timeout = TimeSpan.FromMinutes (15), SupportsParallelExecution = false, }; @@ -183,7 +178,7 @@ Task PopulateTasksAsync () Platform = TestPlatform.iOS, TestName = "Generator tests", Mode = ".NET", - Ignored = !TestSelection.IsEnabled (TestLabel.Generator) || !TestSelection.IsEnabled (PlatformLabel.Dotnet), + Ignored = !TestSelection.IsEnabled (TestLabel.Generator), }; Tasks.Add (runDotNetGenerator); @@ -201,7 +196,7 @@ Task PopulateTasksAsync () Platform = TestPlatform.iOS, TestName = "Roslyn Generator tests", Mode = ".NET", - Ignored = !TestSelection.IsEnabled (TestLabel.Generator) || !TestSelection.IsEnabled (PlatformLabel.Dotnet), + Ignored = !TestSelection.IsEnabled (TestLabel.Generator), }; Tasks.Add (runDotNetRoslynGenerator); @@ -219,7 +214,7 @@ Task PopulateTasksAsync () Platform = TestPlatform.iOS, TestName = "Roslyn Analyzer tests", Mode = ".NET", - Ignored = !TestSelection.IsEnabled (TestLabel.Generator) || !TestSelection.IsEnabled (PlatformLabel.Dotnet), + Ignored = !TestSelection.IsEnabled (TestLabel.Generator), }; Tasks.Add (runDotNetRoslynAnalyzer); @@ -238,7 +233,7 @@ Task PopulateTasksAsync () TestName = "DotNet tests", Filter = "Category!=Windows", Timeout = TimeSpan.FromMinutes (360), - Ignored = !TestSelection.IsEnabled (TestLabel.DotnetTest) || !TestSelection.IsEnabled (PlatformLabel.Dotnet), + Ignored = !TestSelection.IsEnabled (TestLabel.DotnetTest), }; Tasks.Add (runDotNetTests); diff --git a/tests/xharness/Jenkins/NUnitTestTasksEnumerable.cs b/tests/xharness/Jenkins/NUnitTestTasksEnumerable.cs index 7fdc30573980..13809c45353a 100644 --- a/tests/xharness/Jenkins/NUnitTestTasksEnumerable.cs +++ b/tests/xharness/Jenkins/NUnitTestTasksEnumerable.cs @@ -80,7 +80,7 @@ public IEnumerator GetEnumerator () Platform = TestPlatform.iOS, TestName = "Cecil-based tests", Timeout = TimeSpan.FromMinutes (10), - Ignored = !jenkins.TestSelection.IsEnabled (TestLabel.Cecil) || !jenkins.TestSelection.IsEnabled (PlatformLabel.Dotnet), + Ignored = !jenkins.TestSelection.IsEnabled (TestLabel.Cecil), }; yield return runCecilTests; diff --git a/tests/xharness/Jenkins/TestSelector.cs b/tests/xharness/Jenkins/TestSelector.cs index 2df4c53e1cf5..a3d82d6a7817 100644 --- a/tests/xharness/Jenkins/TestSelector.cs +++ b/tests/xharness/Jenkins/TestSelector.cs @@ -22,8 +22,7 @@ class TestSelection { PlatformLabel.tvOS | PlatformLabel.iOS | PlatformLabel.iOSSimulator | - PlatformLabel.MacCatalyst | - PlatformLabel.Dotnet; + PlatformLabel.MacCatalyst; public bool ForceExtensionBuildOnly { get; set; } diff --git a/tests/xharness/Jenkins/TestTasks/NUnitExecuteTask.cs b/tests/xharness/Jenkins/TestTasks/NUnitExecuteTask.cs index 9b6048eb17e7..6adac729dbaa 100644 --- a/tests/xharness/Jenkins/TestTasks/NUnitExecuteTask.cs +++ b/tests/xharness/Jenkins/TestTasks/NUnitExecuteTask.cs @@ -132,7 +132,7 @@ public override string Mode { } } - public override async Task RunTestAsync () + public override Task RunTestAsync () { throw new NotSupportedException ("Legacy projects not supported anymore"); } diff --git a/tests/xharness/Jenkins/TestVariationsFactory.cs b/tests/xharness/Jenkins/TestVariationsFactory.cs index 3b8c2d1165a6..f7aca9bb6224 100644 --- a/tests/xharness/Jenkins/TestVariationsFactory.cs +++ b/tests/xharness/Jenkins/TestVariationsFactory.cs @@ -274,8 +274,6 @@ public IEnumerable CreateTestVariations (IEnumerable tests, Func variable specifying whether that platform is enabled or not. $dotnetPlatforms = $configuration.DOTNET_PLATFORMS.Split(' ', [StringSplitOptions]::RemoveEmptyEntries) foreach ($platform in $dotnetPlatforms) { @@ -483,25 +478,6 @@ class BuildConfiguration { } } - # store all the variables needed when classic xamarin has been enabled - $configuration | Add-Member -NotePropertyName "INCLUDE_XAMARIN_LEGACY" -NotePropertyValue $Env:INCLUDE_XAMARIN_LEGACY - - # if xamarin legacy has been included, check if we need to include the xamarin sdk for each of the platforms, otherewise it will be - # false for all - $xamarinPlatforms = @("ios", "macos", "tvos", "maccatalyst") - if ($configuration.INCLUDE_XAMARIN_LEGACY -eq "true") { - foreach ($platform in $xamarinPlatforms) { - $variableName = "INCLUDE_LEGACY_$($platform.ToUpper())" - $variableValue = [Environment]::GetEnvironmentVariable("$variableName") - $configuration | Add-Member -NotePropertyName $variableName -NotePropertyValue $variableValue - } - } else { - foreach ($platform in $xamarinPlatforms) { - $variableName = "INCLUDE_LEGACY_$($platform.ToUpper())" - $configuration | Add-Member -NotePropertyName $variableName -NotePropertyValue "false" - } - } - # add all the include platforms as well as the nuget os version foreach ($platform in $xamarinPlatforms) { $variableName = "INCLUDE_$($platform.ToUpper())" diff --git a/tools/devops/automation/scripts/bash/configure-decisions.sh b/tools/devops/automation/scripts/bash/configure-decisions.sh index 9100784e1965..669cbc6d3f15 100755 --- a/tools/devops/automation/scripts/bash/configure-decisions.sh +++ b/tools/devops/automation/scripts/bash/configure-decisions.sh @@ -26,9 +26,6 @@ elif [[ "${LABELS_SKIP_ALL_TESTS:-}" == "True" ]]; then elif [[ "${CONFIGURE_PLATFORMS_INCLUDE_DOTNET_MACOS:-}" != "" ]]; then # Run mac tests if a .NET desktop platform is enabled RUN_MAC_TESTS=true -elif [[ "${CONFIGURE_PLATFORMS_INCLUDE_LEGACY_MAC:-}" != "" ]]; then - # Run mac tests if a legacy desktop platform is enabled - RUN_MAC_TESTS=true else # Otherwise don't run mac tests RUN_MAC_TESTS=false diff --git a/tools/devops/automation/scripts/bash/configure-platforms.sh b/tools/devops/automation/scripts/bash/configure-platforms.sh index e8d525389f72..f4aa55b06e63 100755 --- a/tools/devops/automation/scripts/bash/configure-platforms.sh +++ b/tools/devops/automation/scripts/bash/configure-platforms.sh @@ -13,13 +13,6 @@ DOTNET_PLATFORMS=$(cat "$FILE") make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable-value-to-file FILE="$FILE" VARIABLE=ALL_DOTNET_PLATFORMS ALL_DOTNET_PLATFORMS=$(cat "$FILE") -make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable-value-to-file FILE="$FILE" VARIABLE=ENABLE_DOTNET -ENABLE_DOTNET=$(cat "$FILE") - - -make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable-value-to-file FILE="$FILE" VARIABLE=INCLUDE_XAMARIN_LEGACY -INCLUDE_XAMARIN_LEGACY=$(cat "$FILE") - make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable-value-to-file FILE="$FILE" VARIABLE=INCLUDE_IOS INCLUDE_IOS=$(cat "$FILE") @@ -47,7 +40,6 @@ MACCATALYST_NUGET_OS_VERSION=$(cat "$FILE") # print it out, so turn off echoing since that confuses Azure DevOps set +x -echo "##vso[task.setvariable variable=ENABLE_DOTNET;isOutput=true]$ENABLE_DOTNET" echo "##vso[task.setvariable variable=DOTNET_PLATFORMS;isOutput=true]$DOTNET_PLATFORMS" DISABLED_DOTNET_PLATFORMS=" $ALL_DOTNET_PLATFORMS " for platform in $DOTNET_PLATFORMS; do @@ -88,17 +80,6 @@ for platform in $DISABLED_DOTNET_PLATFORMS; do echo "##vso[task.setvariable variable=INCLUDE_DOTNET_$PLATFORM_UPPER;isOutput=true]" done -echo "##vso[task.setvariable variable=INCLUDE_XAMARIN_LEGACY;isOutput=true]$INCLUDE_XAMARIN_LEGACY" -if test -n "$INCLUDE_XAMARIN_LEGACY"; then - echo "##vso[task.setvariable variable=INCLUDE_LEGACY_IOS;isOutput=true]$INCLUDE_IOS" - echo "##vso[task.setvariable variable=INCLUDE_LEGACY_TVOS;isOutput=true]$INCLUDE_TVOS" - echo "##vso[task.setvariable variable=INCLUDE_LEGACY_MAC;isOutput=true]$INCLUDE_MAC" -else - echo "##vso[task.setvariable variable=INCLUDE_LEGACY_IOS;isOutput=true]" - echo "##vso[task.setvariable variable=INCLUDE_LEGACY_TVOS;isOutput=true]" - echo "##vso[task.setvariable variable=INCLUDE_LEGACY_MAC;isOutput=true]" -fi - echo "##vso[task.setvariable variable=INCLUDE_IOS;isOutput=true]$INCLUDE_IOS" echo "##vso[task.setvariable variable=INCLUDE_TVOS;isOutput=true]$INCLUDE_TVOS" echo "##vso[task.setvariable variable=INCLUDE_MAC;isOutput=true]$INCLUDE_MAC" diff --git a/tools/devops/automation/scripts/bash/install-workloads.sh b/tools/devops/automation/scripts/bash/install-workloads.sh index c3249512f4df..4ee3436bba9e 100755 --- a/tools/devops/automation/scripts/bash/install-workloads.sh +++ b/tools/devops/automation/scripts/bash/install-workloads.sh @@ -42,15 +42,6 @@ make global.json make -C builds dotnet -# Check if .NET is even enabled -# Note that we do this after downloading .NET, because we need .NET to build some of our tests that may contain legacy tests (such as the MSBuild tests). -var=$(make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable VARIABLE=ENABLE_DOTNET) -ENABLE_DOTNET=${var#*=} -if test -z "$ENABLE_DOTNET"; then - echo "Not installing anything, because .NET is not enabled." - exit 0 -fi - var=$(make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable VARIABLE=DOTNET) DOTNET=${var#*=} echo "Using dotnet found at $DOTNET" diff --git a/tools/devops/automation/templates/build/build-mac-tests-stage.yml b/tools/devops/automation/templates/build/build-mac-tests-stage.yml index b365553f4a5d..1d3310e3dfe8 100644 --- a/tools/devops/automation/templates/build/build-mac-tests-stage.yml +++ b/tools/devops/automation/templates/build/build-mac-tests-stage.yml @@ -42,8 +42,6 @@ jobs: timeoutInMinutes: 180 variables: DOTNET_PLATFORMS: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.DOTNET_PLATFORMS'] ] - ENABLE_DOTNET: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.ENABLE_DOTNET'] ] - INCLUDE_XAMARIN_LEGACY: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_XAMARIN_LEGACY'] ] ${{ if eq(parameters.pool, 'automatic') }}: AgentPoolComputed: $[ stageDependencies.configure_build.AgentPoolSelector.outputs['setAgentPool.AgentPoolComputed'] ] ${{ if eq(parameters.pool, 'ci') }}: diff --git a/tools/devops/automation/templates/build/build-pkgs.yml b/tools/devops/automation/templates/build/build-pkgs.yml index d841163a1a75..1b2062a606a2 100644 --- a/tools/devops/automation/templates/build/build-pkgs.yml +++ b/tools/devops/automation/templates/build/build-pkgs.yml @@ -49,7 +49,7 @@ steps: # build nugets - bash: $(Build.SourcesDirectory)/xamarin-macios/tools/devops/automation/scripts/bash/build-nugets.sh displayName: 'Build Nugets' - condition: and(succeeded(), contains(variables['configuration.BuildNugets'], 'True'), ne(variables['ENABLE_DOTNET'], '')) + condition: and(succeeded(), contains(variables['configuration.BuildNugets'], 'True'))) timeoutInMinutes: 180 - bash: $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/automation/scripts/bash/generate-workload-rollback.sh diff --git a/tools/devops/automation/templates/build/build-stage.yml b/tools/devops/automation/templates/build/build-stage.yml index a9abc74ee9d5..2cf94db56128 100644 --- a/tools/devops/automation/templates/build/build-stage.yml +++ b/tools/devops/automation/templates/build/build-stage.yml @@ -42,16 +42,10 @@ jobs: timeoutInMinutes: 1000 variables: DOTNET_PLATFORMS: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.DOTNET_PLATFORMS'] ] - ENABLE_DOTNET: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.ENABLE_DOTNET'] ] INCLUDE_DOTNET_IOS: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_DOTNET_IOS'] ] INCLUDE_DOTNET_MACCATALYST: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_DOTNET_MACCATALYST'] ] INCLUDE_DOTNET_MACOS: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_DOTNET_MACOS'] ] INCLUDE_DOTNET_TVOS: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_DOTNET_TVOS'] ] - INCLUDE_LEGACY_IOS: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_LEGACY_IOS'] ] - INCLUDE_LEGACY_MAC: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_LEGACY_MAC'] ] - INCLUDE_LEGACY_TVOS: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_LEGACY_TVOS'] ] - INCLUDE_LEGACY_WATCH: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_LEGACY_WATCH'] ] - INCLUDE_XAMARIN_LEGACY: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_XAMARIN_LEGACY'] ] ${{ if eq(parameters.pool, 'automatic') }}: AgentPoolComputed: $[ stageDependencies.configure_build.AgentPoolSelector.outputs['setAgentPool.AgentPoolComputed'] ] ${{ if eq(parameters.pool, 'ci') }}: diff --git a/tools/devops/automation/templates/main-stage.yml b/tools/devops/automation/templates/main-stage.yml index 1481d120804c..19bf8b49d751 100644 --- a/tools/devops/automation/templates/main-stage.yml +++ b/tools/devops/automation/templates/main-stage.yml @@ -155,23 +155,6 @@ parameters: - name: macTestsConfigurations type: object - - name: legacyPackageJobs - type: object - default: [ - { - job: 'xamarin_ios_sign_notarize', - name: 'Xamarin.iOS', - pattern: 'xamarin.ios-*', - conditionVariable: "INCLUDE_LEGACY_IOS", - }, - { - job: 'xamarin_mac_sing_notarie', - name: 'Xamarin.Mac', - pattern: 'xamarin.mac-*', - conditionVariable: "INCLUDE_LEGACY_MAC", - } - ] - - name: stageDisplayNamePrefix type: string default: '' diff --git a/tools/devops/automation/templates/release/vs-insertion-prep.yml b/tools/devops/automation/templates/release/vs-insertion-prep.yml index a51d2d5f7f5d..7aa7f82c959d 100644 --- a/tools/devops/automation/templates/release/vs-insertion-prep.yml +++ b/tools/devops/automation/templates/release/vs-insertion-prep.yml @@ -61,7 +61,6 @@ stages: artifactName: '${{ parameters.uploadPrefix }}not-signed-package' signType: Real usePipelineArtifactTasks: true - condition: "ne(stageDependencies.configure_build.configure.outputs['configure_platforms.ENABLE_DOTNET'],'')" setupSteps: - template: tools/devops/automation/templates/common/checkout.yml@${{ parameters.repositoryAlias }} parameters: @@ -84,7 +83,6 @@ stages: propsArtifactName: ${{ parameters.uploadPrefix }}not-signed-package binlogsArtifactName: ${{ parameters.uploadPrefix }}nuget-msi-convert-binlogs signType: Real - condition: "ne(stageDependencies.configure_build.configure.outputs['configure_platforms.ENABLE_DOTNET'],'')" preConvertSteps: - pwsh: | New-Item "$(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/governance" -ItemType Directory -ea 0 @@ -122,8 +120,7 @@ stages: or( eq(dependencies.nuget_convert.result, 'Succeeded'), eq(dependencies.nuget_convert.result, 'SucceededWithIssues') - ), - ne(stageDependencies.configure_build.configure.outputs['configure_platforms.ENABLE_DOTNET'],'') + ) ) variables: - name: skipNugetSecurityAnalysis diff --git a/tools/devops/automation/templates/windows/stage.yml b/tools/devops/automation/templates/windows/stage.yml index cbe843878af1..a87f4c707141 100644 --- a/tools/devops/automation/templates/windows/stage.yml +++ b/tools/devops/automation/templates/windows/stage.yml @@ -56,7 +56,6 @@ stages: dependsOn: displayName: "Reserve macOS bot for tests" timeoutInMinutes: 120 - condition: ne(stageDependencies.configure_build.configure.outputs['configure_platforms.ENABLE_DOTNET'],'') workspace: clean: all pool: @@ -81,7 +80,6 @@ stages: - mac_reservation displayName: 'Dotnet tests' timeoutInMinutes: 120 - condition: and(succeeded(),ne(stageDependencies.configure_build.configure.outputs['configure_platforms.ENABLE_DOTNET'],'')) workspace: clean: all @@ -115,8 +113,6 @@ stages: - run_tests displayName: "Re-enable macOS bot for tests" timeoutInMinutes: 120 - # the condition must be exactly the same as for the mac_reservation job (or if no condition there, then 'always ()') - condition: ne(stageDependencies.configure_build.configure.outputs['configure_platforms.ENABLE_DOTNET'],'') workspace: clean: all pool: diff --git a/tools/mlaunch/Makefile b/tools/mlaunch/Makefile index c465c35fd8b8..7335cd392193 100644 --- a/tools/mlaunch/Makefile +++ b/tools/mlaunch/Makefile @@ -7,28 +7,12 @@ DOTNET_PLATFORMS_MOBILE=$(filter-out macOS MacCatalyst,$(DOTNET_PLATFORMS)) DOWNLOAD_STAMP_FILE=.download-$(MLAUNCH_NUGET_VERSION).stamp -ifdef INCLUDE_XAMARIN_LEGACY -ifdef INCLUDE_IOS -TARGETS += $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch -endif -endif - TARGETS += $(foreach platform,$(DOTNET_PLATFORMS_MOBILE),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/bin/mlaunch) $(DOWNLOAD_STAMP_FILE): $(Q) $(DOTNET) restore download-mlaunch.csproj /bl:$@.binlog $(MSBUILD_VERBOSITY) /p:MlaunchNuGetVersion=$(MLAUNCH_NUGET_VERSION) $(Q) touch $@ -$(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch: $(DOWNLOAD_STAMP_FILE) - $(Q) rm -Rf $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch - $(Q) rm -Rf $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mlaunch - $(Q) mkdir -p $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/ - $(Q) mkdir -p $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/ - $(Q) $(CP) -R $(TOP)/packages/microsoft.tools.mlaunch/$(MLAUNCH_NUGET_VERSION)/mlaunch/bin/mlaunch $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/ - $(Q) $(CP) -R $(TOP)/packages/microsoft.tools.mlaunch/$(MLAUNCH_NUGET_VERSION)/mlaunch/lib/mlaunch $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/ - $(Q) chmod a+x $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch - $(Q) chmod a+x $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mlaunch/mlaunch.app/Contents/MacOS/mlaunch - define DotNetInstall $$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/tools/bin/mlaunch: $$(DOWNLOAD_STAMP_FILE) $$(Q) rm -rf $$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/bin/mlaunch @@ -44,16 +28,8 @@ endef $(foreach platform,$(DOTNET_PLATFORMS_MOBILE),$(eval $(call DotNetInstall,$(platform)))) clean-local:: -ifdef INCLUDE_XAMARIN_LEGACY -ifdef INCLUDE_IOS - $(Q) rm -rf $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch - $(Q) rm -rf $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mlaunch -endif -endif -ifdef ENABLE_DOTNET $(Q) rm -rf $(foreach platform,$(DOTNET_PLATFORMS_MOBILE),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/bin/mlaunch) $(Q) rm -rf $(foreach platform,$(DOTNET_PLATFORMS_MOBILE),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/lib/mlaunch) -endif $(Q) rm -rf .*.stamp obj .*.binlog all-local:: $(TARGETS) From e011309ff901b9be4e57b54a4061d09563c25edb Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 5 Nov 2024 09:39:02 +0100 Subject: [PATCH 2/7] Deleted a bit too much. --- tools/devops/automation/scripts/VSTS.psm1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/devops/automation/scripts/VSTS.psm1 b/tools/devops/automation/scripts/VSTS.psm1 index f99b9fcb5b50..10e51bd062d2 100644 --- a/tools/devops/automation/scripts/VSTS.psm1 +++ b/tools/devops/automation/scripts/VSTS.psm1 @@ -478,6 +478,8 @@ class BuildConfiguration { } } + $xamarinPlatforms = @("ios", "macos", "tvos", "maccatalyst") + # add all the include platforms as well as the nuget os version foreach ($platform in $xamarinPlatforms) { $variableName = "INCLUDE_$($platform.ToUpper())" From d7472172f78699e565ddda21f28b82466d1ecae9 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 5 Nov 2024 11:51:33 +0100 Subject: [PATCH 3/7] Syntax fix --- tools/devops/automation/templates/build/build-pkgs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/devops/automation/templates/build/build-pkgs.yml b/tools/devops/automation/templates/build/build-pkgs.yml index 1b2062a606a2..2492c247d458 100644 --- a/tools/devops/automation/templates/build/build-pkgs.yml +++ b/tools/devops/automation/templates/build/build-pkgs.yml @@ -49,7 +49,7 @@ steps: # build nugets - bash: $(Build.SourcesDirectory)/xamarin-macios/tools/devops/automation/scripts/bash/build-nugets.sh displayName: 'Build Nugets' - condition: and(succeeded(), contains(variables['configuration.BuildNugets'], 'True'))) + condition: and(succeeded(), contains(variables['configuration.BuildNugets'], 'True')) timeoutInMinutes: 180 - bash: $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/automation/scripts/bash/generate-workload-rollback.sh From eb815b4d4e077576396e6c38b00c0bec549a39de Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 5 Nov 2024 13:09:46 +0100 Subject: [PATCH 4/7] Delete more --- .../devops/automation/scripts/TestResults.Tests.ps1 | 12 ++++++------ tools/devops/automation/templates/api-diff-stage.yml | 2 +- tools/devops/automation/templates/main-stage.yml | 2 +- .../automation/templates/pipelines/run-api-scan.yml | 2 +- .../templates/pipelines/run-macos-tests-pipeline.yml | 2 +- tools/devops/automation/templates/tests-stage.yml | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/devops/automation/scripts/TestResults.Tests.ps1 b/tools/devops/automation/scripts/TestResults.Tests.ps1 index bf9c580358be..f36860ae7b89 100644 --- a/tools/devops/automation/scripts/TestResults.Tests.ps1 +++ b/tools/devops/automation/scripts/TestResults.Tests.ps1 @@ -18,7 +18,7 @@ Describe "TestResults tests" { { "dotnettests_ios": { "LABEL": "dotnettests", - "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-dotnettests-tests", + "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-system-permission-tests,run-dotnettests-tests", "LABEL_WITH_PLATFORM": "dotnettests_iOS", "STATUS_CONTEXT": "VSTS: simulator tests - dotnettests - iOS", "TEST_simulator_tests": "simulator_dotnettests_ios", @@ -27,7 +27,7 @@ Describe "TestResults tests" { }, "dotnettests_tvos": { "LABEL": "dotnettests", - "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-dotnettests-tests", + "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-system-permission-tests,run-dotnettests-tests", "LABEL_WITH_PLATFORM": "dotnettests_tvOS", "STATUS_CONTEXT": "VSTS: simulator tests - dotnettests - tvOS", "TEST_simulator_tests": "simulator_dotnettests_tvos", @@ -36,7 +36,7 @@ Describe "TestResults tests" { }, "dotnettests_maccatalyst": { "LABEL": "dotnettests", - "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-dotnettests-tests", + "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-system-permission-tests,run-dotnettests-tests", "LABEL_WITH_PLATFORM": "dotnettests_MacCatalyst", "STATUS_CONTEXT": "VSTS: simulator tests - dotnettests - MacCatalyst", "TEST_simulator_tests": "simulator_dotnettests_maccatalyst", @@ -45,7 +45,7 @@ Describe "TestResults tests" { }, "dotnettests_macos": { "LABEL": "dotnettests", - "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-dotnettests-tests", + "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-system-permission-tests,run-dotnettests-tests", "LABEL_WITH_PLATFORM": "dotnettests_macOS", "STATUS_CONTEXT": "VSTS: simulator tests - dotnettests - macOS", "TEST_simulator_tests": "simulator_dotnettests_macos", @@ -54,7 +54,7 @@ Describe "TestResults tests" { }, "dotnettests_multiple": { "LABEL": "dotnettests", - "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-dotnettests-tests", + "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-system-permission-tests,run-dotnettests-tests", "LABEL_WITH_PLATFORM": "dotnettests_Multiple", "STATUS_CONTEXT": "VSTS: simulator tests - dotnettests - Multiple", "TEST_simulator_tests": "simulator_dotnettests_multiple", @@ -64,7 +64,7 @@ Describe "TestResults tests" { "cecil": { "LABEL": "cecil", - "TESTS_LABELS": "--label=skip-all-tests,run-ios-64-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-cecil-tests", + "TESTS_LABELS": "--label=skip-all-tests,run-ios-64-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-system-permission-tests,run-cecil-tests", "LABEL_WITH_PLATFORM": "cecil", "STATUS_CONTEXT": "VSTS: simulator tests - cecil", "TEST_simulator_tests": "simulator_cecil", diff --git a/tools/devops/automation/templates/api-diff-stage.yml b/tools/devops/automation/templates/api-diff-stage.yml index 33496b6eb59a..295e018dd15d 100644 --- a/tools/devops/automation/templates/api-diff-stage.yml +++ b/tools/devops/automation/templates/api-diff-stage.yml @@ -67,7 +67,7 @@ stages: parameters: repositoryAlias: ${{ parameters.repositoryAlias }} commit: ${{ parameters.commit }} - testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests' + testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-system-permission-tests' statusContext: 'VSTS: simulator tests' uploadArtifacts: true use1ES: false diff --git a/tools/devops/automation/templates/main-stage.yml b/tools/devops/automation/templates/main-stage.yml index 19bf8b49d751..8a4f39f018f9 100644 --- a/tools/devops/automation/templates/main-stage.yml +++ b/tools/devops/automation/templates/main-stage.yml @@ -211,7 +211,7 @@ stages: commit: ${{ parameters.commit }} testConfigurations: ${{ parameters.testConfigurations }} supportedPlatforms: ${{ parameters.supportedPlatforms }} - testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests' + testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-system-permission-tests' statusContext: 'VSTS: simulator tests' uploadArtifacts: true use1ES: true diff --git a/tools/devops/automation/templates/pipelines/run-api-scan.yml b/tools/devops/automation/templates/pipelines/run-api-scan.yml index 3b493eb6a157..246ee77f4129 100644 --- a/tools/devops/automation/templates/pipelines/run-api-scan.yml +++ b/tools/devops/automation/templates/pipelines/run-api-scan.yml @@ -119,7 +119,7 @@ stages: commit: HEAD testConfigurations: ${{ parameters.testConfigurations }} supportedPlatforms: ${{ parameters.supportedPlatforms }} - testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests' + testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-system-permission-tests' statusContext: 'VSTS: simulator tests' uploadArtifacts: true diff --git a/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml b/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml index c596c8ebdab9..59b1c38fdf2d 100644 --- a/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml +++ b/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml @@ -238,7 +238,7 @@ stages: commit: ${{ parameters.commit }} testConfigurations: ${{ parameters.testConfigurations }} supportedPlatforms: ${{ parameters.supportedPlatforms }} - testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests' + testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-system-permission-tests' statusContext: 'VSTS: simulator tests' uploadArtifacts: true diff --git a/tools/devops/automation/templates/tests-stage.yml b/tools/devops/automation/templates/tests-stage.yml index f9f4eca20bb1..951605b7ccb2 100644 --- a/tools/devops/automation/templates/tests-stage.yml +++ b/tools/devops/automation/templates/tests-stage.yml @@ -202,7 +202,7 @@ stages: commit: ${{ parameters.commit }} testConfigurations: ${{ parameters.testConfigurations }} supportedPlatforms: ${{ parameters.supportedPlatforms }} - testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests' + testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-system-permission-tests' statusContext: 'VSTS: simulator tests' uploadArtifacts: true From 05d387ddb2fb80242179edffbd81ba30e60795fc Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 5 Nov 2024 18:14:15 +0100 Subject: [PATCH 5/7] Fix condition --- tools/devops/automation/templates/windows/stage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/devops/automation/templates/windows/stage.yml b/tools/devops/automation/templates/windows/stage.yml index a87f4c707141..c315fadef3f8 100644 --- a/tools/devops/automation/templates/windows/stage.yml +++ b/tools/devops/automation/templates/windows/stage.yml @@ -113,6 +113,7 @@ stages: - run_tests displayName: "Re-enable macOS bot for tests" timeoutInMinutes: 120 + condition: always() workspace: clean: all pool: From 93d417c8e56fbc45dd0661d84c7fbdf405d6ada4 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 6 Nov 2024 08:34:13 +0100 Subject: [PATCH 6/7] Not all values are valid anymore --- tests/dotnet/UnitTests/BundleStructureTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dotnet/UnitTests/BundleStructureTest.cs b/tests/dotnet/UnitTests/BundleStructureTest.cs index 1a4b70d0e6c6..44ba3e996f4f 100644 --- a/tests/dotnet/UnitTests/BundleStructureTest.cs +++ b/tests/dotnet/UnitTests/BundleStructureTest.cs @@ -9,7 +9,7 @@ static bool IsPlatformAssembly (string assemblyName) if (assemblyName.EndsWith (".dll", StringComparison.Ordinal) || assemblyName.EndsWith (".pdb", StringComparison.Ordinal)) assemblyName = Path.GetFileNameWithoutExtension (assemblyName); foreach (var platform in Enum.GetValues ()) { - if (platform == ApplePlatform.None) + if (platform == ApplePlatform.None || platform == ApplePlatform.WatchOS) continue; var platformAssembly = Path.GetFileNameWithoutExtension (Configuration.GetBaseLibraryName (platform)); if (platformAssembly == assemblyName) From cb5d3a2e3987d4fa59a67e4d597416fef6aabe41 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 6 Nov 2024 08:35:27 +0100 Subject: [PATCH 7/7] Fix build --- tests/common/ConfigurationXUnit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/common/ConfigurationXUnit.cs b/tests/common/ConfigurationXUnit.cs index 73e59dee9b6d..3ebf8caf643e 100644 --- a/tests/common/ConfigurationXUnit.cs +++ b/tests/common/ConfigurationXUnit.cs @@ -60,7 +60,7 @@ public AllSupportedPlatformsAttribute (params object [] parameters) public override IEnumerable GetData (MethodInfo testMethod) { return Configuration. - GetIncludedPlatforms (true). + GetIncludedPlatforms (). Select (platform => dataValues.Prepend (platform).ToArray ()); } }