diff --git a/Make.config b/Make.config index 94ff5ebebd52..0c4f1cbb3dc0 100644 --- a/Make.config +++ b/Make.config @@ -650,21 +650,13 @@ XCODE_IOS_ARCHIVE_VERSION=xcode-12D4e XCODE_MACOS_ARCHIVE_VERSION=xcode-12D4e MONO_IOS_FILENAME:=ios-release-Darwin-$(MONO_HASH).7z MONO_IOS_URL:=https://download.mono-project.com/mono-sdks/$(XCODE_IOS_ARCHIVE_VERSION)/$(MONO_IOS_FILENAME) -MONO_MAC_FILENAME:=mac-release-Darwin-$(MONO_HASH).7z -MONO_MAC_URL:=https://download.mono-project.com/mono-sdks/$(XCODE_MACOS_ARCHIVE_VERSION)/$(MONO_MAC_FILENAME) -MONO_MACCATALYST_FILENAME:=maccat-release-Darwin-$(MONO_HASH).7z -MONO_MACCATALYST_URL:=https://download.mono-project.com/mono-sdks/$(XCODE_MACOS_ARCHIVE_VERSION)/$(MONO_MACCATALYST_FILENAME) # Setup various variables depending on whether mono is downloaded or built from source ifeq ($(MONO_BUILD_FROM_SOURCE),) MONO_IOS_SDK_DESTDIR:=$(abspath $(TOP)/builds/downloads/$(basename $(MONO_IOS_FILENAME))) -MONO_MAC_SDK_DESTDIR:=$(abspath $(TOP)/builds/downloads/$(basename $(MONO_MAC_FILENAME))) -MONO_MACCATALYST_SDK_DESTDIR:=$(abspath $(TOP)/builds/downloads/$(basename $(MONO_MACCATALYST_FILENAME))) MONO_BUILD_MODE=download-mono else MONO_IOS_SDK_DESTDIR:=$(abspath $(MONO_PATH)/sdks/out) -MONO_MAC_SDK_DESTDIR:=$(abspath $(MONO_PATH)/sdks/out) -MONO_MACCATALYST_SDK_DESTDIR:=$(abspath $(MONO_PATH)/sdks/out) MONO_BUILD_MODE=compile-mono endif diff --git a/builds/Makefile b/builds/Makefile index 2b050d2ed04e..3a33d9754283 100644 --- a/builds/Makefile +++ b/builds/Makefile @@ -1,8 +1,6 @@ TOP=.. include $(TOP)/Make.config -PREFIX=$(abspath $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/) - # Keep all intermediate files always. .SECONDARY: @@ -19,19 +17,13 @@ endif download: download-mono download-mono: \ downloads/$(basename $(MONO_IOS_FILENAME)) \ - downloads/$(basename $(MONO_MAC_FILENAME)) \ - downloads/$(basename $(MONO_MACCATALYST_FILENAME)) \ downloads/$(basename $(MONO_IOS_FILENAME)): MONO_URL=$(MONO_IOS_URL) -downloads/$(basename $(MONO_MAC_FILENAME)): MONO_URL=$(MONO_MAC_URL) -downloads/$(basename $(MONO_MACCATALYST_FILENAME)): MONO_URL=$(MONO_MACCATALYST_URL) include $(TOP)/mk/colors.mk DOWNLOADS = \ downloads/$(MONO_IOS_FILENAME) \ - downloads/$(MONO_MAC_FILENAME) \ - downloads/$(MONO_MACCATALYST_FILENAME) \ # This target downloads the mono archives, there's one for Xamarin.iOS and one for Xamarin.Mac. # If doing many clean builds, it's possible to copy the downloaded zip file to ~/Library/Caches/xamarin-macios @@ -178,959 +170,16 @@ all-local:: $(DOTNET_DOWNLOADS) clean-local:: $(Q) rm -Rf downloads .stamp-download-mono -ifeq ($(MONO_BUILD_FROM_SOURCE),) - -all-local:: .stamp-download-mono .stamp-mono-ios-sdk-destdir - -else - -# this is a list of all the files from mono we care about, so that we -# can use that list as dependencies for our makefile targets --include .deps.mono.mk -.deps.mono.mk: $(TOP)/Make.config $(TOP)/mk/mono.mk - $(Q) printf 'MONO_DEPENDENCIES += Makefile \\\n' > $@.tmp - $(Q) cd $(MONO_PATH) && git ls-files --recurse-submodules 'mcs/class/*.cs' 'mcs/build/*.cs' 'external/*.cs' '*.h' '*.c' '*.cpp' | sed 's/ /\\ /g' | sed 's@^\(.*\)$$@ $(MONO_PATH)/\1 \\@' >> $(abspath $@).tmp - $(Q) mv $@.tmp $@ - -# -# Configuration for the mono sdk makefiles -# -SDK_ARGS= \ - XCODE_DIR=$(XCODE_DEVELOPER_ROOT) \ - IOS_VERSION=$(IOS_SDK_VERSION) IOS_VERSION_MIN=$(MIN_IOS_SDK_VERSION) \ - TVOS_VERSION=$(TVOS_SDK_VERSION) TVOS_VERSION_MIN=$(MIN_TVOS_SDK_VERSION) \ - WATCHOS_VERSION=$(WATCH_SDK_VERSION) WATCHOS_VERSION_MIN=$(MIN_WATCHOS_SDK_VERSION) \ - WATCHOS64_32_VERSION=$(WATCH_SDK_VERSION) WATCHOS64_32_VERSION_MIN=$(MIN_WATCHOS64_32_SDK_VERSION) \ - MACOS_VERSION=$(MACOS_SDK_VERSION) MACOS_VERSION_MIN=$(MIN_MACOS_SDK_VERSION) - -SDK_CONFIG = $(MONO_PATH)/sdks/Make.config -SDK_BUILDDIR = $(MONO_PATH)/sdks/builds - -$(SDK_CONFIG): - echo "ENABLE_IOS=1" >> $@ - echo "ENABLE_MAC=1" >> $@ - echo "ENABLE_MACCAT=1" >> $@ - - -ifdef DISABLE_BUILDS_MAKEFILE_DEP -BUILDS_MAKEFILE_DEP = -else -BUILDS_MAKEFILE_DEP = Makefile -endif - -.stamp-configure-mono: $(SDK_CONFIG) - ulimit -n 4096 && $(MAKE) -C $(SDK_BUILDDIR) configure-ios configure-mac $(SDK_ARGS) - $(Q) touch $@ - -.stamp-compile-mono: .stamp-configure-mono $(MONO_DEPENDENCIES) $(BUILDS_MAKEFILE_DEP) $(TOP)/Make.config $(TOP)/mk/mono.mk - $(MAKE) -C $(SDK_BUILDDIR) package-ios package-ios-bcl $(SDK_ARGS) - $(MAKE) -C $(SDK_BUILDDIR) package-mac package-mac-bcl $(SDK_ARGS) - $(MAKE) -C $(SDK_BUILDDIR) package-maccat package-maccat-bcl $(SDK_ARGS) - $(Q) touch $@ - -clean-local:: - $(MAKE) -C $(SDK_BUILDDIR) clean $(SDK_ARGS) - $(Q) rm -f .stamp-compile-mono - -all-local:: .stamp-compile-mono .stamp-mono-ios-sdk-destdir - -endif +all-local:: .stamp-mono-ios-sdk-destdir .stamp-mono-ios-sdk-destdir: .stamp-$(MONO_BUILD_MODE) ln -sf $(MONO_IOS_SDK_DESTDIR) mono-ios-sdk-destdir $(Q) touch $@ -ifndef DISABLE_STRIP -INSTALL_STRIP_FLAG=-s -endif - -# -# Xamarin.iOS/WatchOS/TVOS/Mac/MacCatalyst BCL assemblies -# -install-local:: install-bcl -all-local:: install-bcl - -$(MONO_IOS_SDK_DESTDIR)/ios-bcl/%: .stamp-$(MONO_BUILD_MODE) -$(MONO_MAC_SDK_DESTDIR)/mac-bcl/%: .stamp-$(MONO_BUILD_MODE) - -IOS_ASSEMBLIES = \ - I18N \ - I18N.CJK \ - I18N.MidEast \ - I18N.Other \ - I18N.Rare \ - I18N.West \ - Microsoft.CSharp \ - Mono.CSharp \ - Mono.Data.Sqlite \ - Mono.Data.Tds \ - Mono.Security \ - mscorlib \ - System \ - System.ComponentModel.Composition \ - System.ComponentModel.DataAnnotations \ - System.Core \ - System.Data \ - System.Data.Services.Client \ - System.Data.DataSetExtensions \ - System.IdentityModel \ - System.IO.Compression \ - System.IO.Compression.FileSystem \ - System.Json \ - System.Net \ - System.Net.Http \ - System.Net.Http.WinHttpHandler \ - System.Numerics \ - System.Numerics.Vectors \ - System.Reflection.Context \ - System.Runtime.Serialization \ - System.Security \ - System.ServiceModel \ - System.ServiceModel.Internals \ - System.ServiceModel.Web \ - System.Transactions \ - System.Web.Services \ - System.Windows \ - System.Xml \ - System.Xml.Linq \ - System.Xml.Serialization - -MAC_ASSEMBLIES = \ - I18N \ - I18N.CJK \ - I18N.MidEast \ - I18N.Other \ - I18N.Rare \ - I18N.West \ - mscorlib \ - Microsoft.CSharp \ - Mono.CSharp \ - Mono.CompilerServices.SymbolWriter \ - Mono.Data.Sqlite \ - Mono.Data.Tds \ - Mono.Security \ - System.ComponentModel.Composition \ - System.ComponentModel.DataAnnotations \ - System.Core \ - System.Data.Services.Client \ - System.Data.DataSetExtensions \ - System.Data \ - System.IdentityModel \ - System.IO.Compression.FileSystem \ - System.IO.Compression \ - System.Json \ - System.Net.Http \ - System.Net \ - System.Numerics \ - System.Runtime.Serialization \ - System.ServiceModel.Web \ - System.ServiceModel \ - System.ServiceModel.Internals \ - System.Transactions \ - System.Web.Services \ - System.Windows \ - System.Xml.Linq \ - System.Xml.Serialization \ - System.Xml \ - System \ - System.Security \ - System.Reflection.Context \ - System.Net.Http.WinHttpHandler \ - System.Numerics.Vectors - -MAC_4_5_ASSEMBLIES = \ - $(MAC_ASSEMBLIES) \ - Mono.Messaging \ - Mono.Posix \ - System.Configuration \ - System.Configuration.Install \ - System.Data.Linq \ - System.EnterpriseServices \ - System.IdentityModel.Selectors \ - System.Messaging \ - System.Runtime.Serialization.Formatters.Soap - -COMMON_FACADE_ASSEMBLIES = \ - Microsoft.Win32.Primitives \ - Microsoft.Win32.Registry \ - Microsoft.Win32.Registry.AccessControl \ - System.AppContext \ - System.Collections \ - System.Collections.Concurrent \ - System.Collections.NonGeneric \ - System.Collections.Specialized \ - System.ComponentModel \ - System.ComponentModel.Annotations \ - System.ComponentModel.EventBasedAsync \ - System.ComponentModel.Primitives \ - System.ComponentModel.TypeConverter \ - System.Console \ - System.Data.Common \ - System.Data.SqlClient \ - System.Diagnostics.Contracts \ - System.Diagnostics.Debug \ - System.Diagnostics.FileVersionInfo \ - System.Diagnostics.Process \ - System.Diagnostics.StackTrace \ - System.Diagnostics.TextWriterTraceListener \ - System.Diagnostics.Tools \ - System.Diagnostics.TraceEvent \ - System.Diagnostics.TraceSource \ - System.Diagnostics.Tracing \ - System.Drawing.Common \ - System.Drawing.Primitives \ - System.Dynamic.Runtime \ - System.Globalization \ - System.Globalization.Calendars \ - System.Globalization.Extensions \ - System.IO \ - System.IO.Compression.ZipFile \ - System.IO.FileSystem \ - System.IO.FileSystem.AccessControl \ - System.IO.FileSystem.DriveInfo \ - System.IO.FileSystem.Primitives \ - System.IO.FileSystem.Watcher \ - System.IO.IsolatedStorage \ - System.IO.MemoryMappedFiles \ - System.IO.Pipes \ - System.IO.UnmanagedMemoryStream \ - System.Linq \ - System.Linq.Expressions \ - System.Linq.Parallel \ - System.Linq.Queryable \ - System.Net.AuthenticationManager \ - System.Net.Cache \ - System.Net.HttpListener \ - System.Net.Mail \ - System.Net.NameResolution \ - System.Net.NetworkInformation \ - System.Net.Ping \ - System.Net.Primitives \ - System.Net.Requests \ - System.Net.Security \ - System.Net.ServicePoint \ - System.Net.Sockets \ - System.Net.Utilities \ - System.Net.WebHeaderCollection \ - System.Net.WebSockets \ - System.Net.WebSockets.Client \ - System.ObjectModel \ - System.Reflection \ - System.Reflection.Emit \ - System.Reflection.Emit.ILGeneration \ - System.Reflection.Emit.Lightweight \ - System.Reflection.Extensions \ - System.Reflection.Primitives \ - System.Reflection.TypeExtensions \ - System.Resources.Reader \ - System.Resources.ReaderWriter \ - System.Resources.ResourceManager \ - System.Resources.Writer \ - System.Runtime \ - System.Runtime.CompilerServices.VisualC \ - System.Runtime.Extensions \ - System.Runtime.Handles \ - System.Runtime.InteropServices \ - System.Runtime.InteropServices.RuntimeInformation \ - System.Runtime.InteropServices.WindowsRuntime \ - System.Runtime.Numerics \ - System.Runtime.Serialization.Formatters \ - System.Runtime.Serialization.Json \ - System.Runtime.Serialization.Primitives \ - System.Runtime.Serialization.Xml \ - System.Security.AccessControl \ - System.Security.Claims \ - System.Security.Cryptography.Algorithms \ - System.Security.Cryptography.Csp \ - System.Security.Cryptography.DeriveBytes \ - System.Security.Cryptography.Encoding \ - System.Security.Cryptography.Encryption \ - System.Security.Cryptography.Encryption.Aes \ - System.Security.Cryptography.Encryption.ECDiffieHellman \ - System.Security.Cryptography.Encryption.ECDsa \ - System.Security.Cryptography.Hashing \ - System.Security.Cryptography.Hashing.Algorithms \ - System.Security.Cryptography.Primitives \ - System.Security.Cryptography.ProtectedData \ - System.Security.Cryptography.RandomNumberGenerator \ - System.Security.Cryptography.RSA \ - System.Security.Cryptography.X509Certificates \ - System.Security.Principal \ - System.Security.Principal.Windows \ - System.Security.SecureString \ - System.ServiceModel.Duplex \ - System.ServiceModel.Http \ - System.ServiceModel.NetTcp \ - System.ServiceModel.Primitives \ - System.ServiceModel.Security \ - System.ServiceProcess.ServiceController \ - System.Text.Encoding \ - System.Text.Encoding.CodePages \ - System.Text.Encoding.Extensions \ - System.Text.RegularExpressions \ - System.Threading \ - System.Threading.AccessControl \ - System.Threading.Overlapped \ - System.Threading.Tasks \ - System.Threading.Tasks.Parallel \ - System.Threading.Thread \ - System.Threading.ThreadPool \ - System.Threading.Timer \ - System.ValueTuple \ - System.Xml.ReaderWriter \ - System.Xml.XDocument \ - System.Xml.XmlDocument \ - System.Xml.XmlSerializer \ - System.Xml.XPath \ - System.Xml.XPath.XDocument \ - System.Xml.Xsl.Primitives \ - netstandard - -MOBILE_ADDITIONAL_FACADE_ASSEMBLIES = \ - System.Buffers \ - System.Memory \ - System.Reflection.DispatchProxy \ - System.Runtime.Loader \ - System.Security.Cryptography.Cng \ - System.Security.Cryptography.OpenSsl \ - System.Security.Cryptography.Pkcs \ - System.Threading.Tasks.Extensions \ - System.Xml.XPath.XmlDocument - -TVOS_ASSEMBLIES = $(IOS_ASSEMBLIES) -WATCHOS_ASSEMBLIES = $(filter-out Mono.Security Mono.Data.Tds,$(IOS_ASSEMBLIES)) -MACCATALYST_ASSEMBLIES = $(IOS_ASSEMBLIES) - -IOS_REPL_ASSEMBLIES = mscorlib System System.Core System.Xml Mono.CSharp -TVOS_REPL_ASSEMBLIES = $(IOS_REPL_ASSEMBLIES) -WATCHOS_REPL_ASSEMBLIES = $(IOS_REPL_ASSEMBLIES) -MACCATALYST_REPL_ASSEMBLIES = $(IOS_REPL_ASSEMBLIES) - -IOS_FACADE_ASSEMBLIES = $(COMMON_FACADE_ASSEMBLIES) $(MOBILE_ADDITIONAL_FACADE_ASSEMBLIES) -TVOS_FACADE_ASSEMBLIES = $(COMMON_FACADE_ASSEMBLIES) $(MOBILE_ADDITIONAL_FACADE_ASSEMBLIES) -WATCHOS_FACADE_ASSEMBLIES = $(COMMON_FACADE_ASSEMBLIES) $(MOBILE_ADDITIONAL_FACADE_ASSEMBLIES) -MAC_FACADE_ASSEMBLIES = $(COMMON_FACADE_ASSEMBLIES) $(MOBILE_ADDITIONAL_FACADE_ASSEMBLIES) -MAC_4_5_FACADE_ASSEMBLIES = $(COMMON_FACADE_ASSEMBLIES) System.Net.Http.Rtc -MACCATALYST_FACADE_ASSEMBLIES = $(COMMON_FACADE_ASSEMBLIES) $(MOBILE_ADDITIONAL_FACADE_ASSEMBLIES) - -IOS_BCL_DIRECTORIES = \ - $(PREFIX)/lib/mono/2.1 \ - $(PREFIX)/lib/mono/2.1/Facades \ - $(PREFIX)/lib/mono/2.1/repl \ - $(PREFIX)/lib/mono/Xamarin.iOS \ - $(PREFIX)/lib/mono/Xamarin.iOS/Facades \ - $(PREFIX)/lib/mono/Xamarin.iOS/repl - -WATCHOS_BCL_DIRECTORIES = \ - $(PREFIX)/lib/mono/Xamarin.WatchOS \ - $(PREFIX)/lib/mono/Xamarin.WatchOS/Facades \ - $(PREFIX)/lib/mono/Xamarin.WatchOS/repl - -TVOS_BCL_DIRECTORIES = \ - $(PREFIX)/lib/mono/Xamarin.TVOS \ - $(PREFIX)/lib/mono/Xamarin.TVOS/Facades \ - $(PREFIX)/lib/mono/Xamarin.TVOS/repl - -MACCATALYST_BCL_DIRECTORIES = \ - $(PREFIX)/lib/mono/Xamarin.MacCatalyst \ - $(PREFIX)/lib/mono/Xamarin.MacCatalyst/Facades \ - $(PREFIX)/lib/mono/Xamarin.MacCatalyst/repl - -MAC_BCL_DIRECTORIES = \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/Xamarin.Mac \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/Xamarin.Mac/Facades \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/4.5 \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/4.5/Facades - -NO_PDB_ASSEMBLIES = System.Windows System.Xml.Serialization -MAC_NO_PDB_ASSEMBLIES = System.Windows System.Xml.Serialization - -IOS_BCL_TARGETS = \ - $(foreach file,$(IOS_ASSEMBLIES),$(PREFIX)/lib/mono/2.1/$(file).dll) \ - $(foreach file,$(filter-out $(NO_PDB_ASSEMBLIES),$(IOS_ASSEMBLIES)),$(PREFIX)/lib/mono/2.1/$(file).pdb) \ - $(foreach file,$(IOS_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.iOS/$(file).dll) \ - $(foreach file,$(filter-out $(NO_PDB_ASSEMBLIES),$(IOS_ASSEMBLIES)),$(PREFIX)/lib/mono/Xamarin.iOS/$(file).pdb) \ - $(foreach file,$(IOS_FACADE_ASSEMBLIES),$(PREFIX)/lib/mono/2.1/Facades/$(file).dll) \ - $(foreach file,$(IOS_FACADE_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.iOS/Facades/$(file).dll) \ - $(foreach file,$(IOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/2.1/repl/$(file).dll) \ - $(foreach file,$(IOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/2.1/repl/$(file).pdb) \ - $(foreach file,$(IOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.iOS/repl/$(file).dll) \ - $(foreach file,$(IOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.iOS/repl/$(file).pdb) \ - -WATCHOS_BCL_TARGETS = \ - $(foreach file,$(WATCHOS_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.WatchOS/$(file).dll) \ - $(foreach file,$(filter-out $(NO_PDB_ASSEMBLIES),$(WATCHOS_ASSEMBLIES)),$(PREFIX)/lib/mono/Xamarin.WatchOS/$(file).pdb) \ - $(foreach file,$(WATCHOS_FACADE_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.WatchOS/Facades/$(file).dll) \ - $(foreach file,$(WATCHOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.WatchOS/repl/$(file).dll) \ - $(foreach file,$(WATCHOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.WatchOS/repl/$(file).pdb) \ - -TVOS_BCL_TARGETS = \ - $(foreach file,$(TVOS_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.TVOS/$(file).dll) \ - $(foreach file,$(filter-out $(NO_PDB_ASSEMBLIES),$(TVOS_ASSEMBLIES)),$(PREFIX)/lib/mono/Xamarin.TVOS/$(file).pdb) \ - $(foreach file,$(TVOS_FACADE_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.TVOS/Facades/$(file).dll) \ - $(foreach file,$(TVOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.TVOS/repl/$(file).dll) \ - $(foreach file,$(TVOS_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.TVOS/repl/$(file).pdb) \ - -MACCATALYST_BCL_TARGETS = \ - $(foreach file,$(MACCATALYST_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.MacCatalyst/$(file).dll) \ - $(foreach file,$(filter-out $(NO_PDB_ASSEMBLIES),$(MACCATALYST_ASSEMBLIES)),$(PREFIX)/lib/mono/Xamarin.MacCatalyst/$(file).pdb) \ - $(foreach file,$(MACCATALYST_FACADE_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.MacCatalyst/Facades/$(file).dll) \ - -# the mono archive doesn't have the repl assemblies yet -MACCATALYST_BCL_TARGETS_DISABLED = \ - $(foreach file,$(MACCATALYST_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.MacCatalyst/repl/$(file).dll) \ - $(foreach file,$(MACCATALYST_REPL_ASSEMBLIES),$(PREFIX)/lib/mono/Xamarin.MacCatalyst/repl/$(file).pdb) \ - -MAC_BCL_TARGETS = \ - $(foreach file,$(MAC_ASSEMBLIES),$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/Xamarin.Mac/$(file).dll) \ - $(foreach file,$(filter-out $(MAC_NO_PDB_ASSEMBLIES),$(MAC_ASSEMBLIES)),$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/Xamarin.Mac/$(file).pdb) \ - $(foreach file,$(MAC_FACADE_ASSEMBLIES),$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/Xamarin.Mac/Facades/$(file).dll) \ - $(foreach file,$(MAC_4_5_ASSEMBLIES),$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/4.5/$(file).dll) \ - $(foreach file,$(filter-out $(MAC_NO_PDB_ASSEMBLIES),$(MAC_4_5_ASSEMBLIES)),$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/4.5/$(file).pdb) \ - $(foreach file,$(MAC_4_5_FACADE_ASSEMBLIES),$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/4.5/Facades/$(file).dll) \ - -$(PREFIX)/lib/mono/Xamarin.iOS/Facades/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/Xamarin.iOS/Facades - $(Q) install -m 0755 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch/Facades/$(notdir $@) $@ - -$(PREFIX)/lib/mono/Xamarin.iOS/repl/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/Xamarin.iOS/repl - $(Q) install -m 0755 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_runtime/$(notdir $@) $@ - -$(PREFIX)/lib/mono/Xamarin.iOS/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/Xamarin.iOS - $(Q) install -m 0755 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch/$(notdir $@) $@ - -$(PREFIX)/lib/mono/2.1/Facades/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/2.1/Facades - $(Q) install -m 0755 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch/Facades/$(notdir $@) $@ - -$(PREFIX)/lib/mono/2.1/repl/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/2.1/repl - $(Q) install -m 0755 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_runtime/$(notdir $@) $@ - -$(PREFIX)/lib/mono/2.1/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/2.1 - $(Q) install -m 0755 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch/$(notdir $@) $@ - -$(PREFIX)/lib/mono/Xamarin.WatchOS/Facades/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/Xamarin.WatchOS/Facades - $(Q) install -m 0755 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_watch/Facades/$(notdir $@) $@ - -$(PREFIX)/lib/mono/Xamarin.WatchOS/repl/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/Xamarin.WatchOS/repl - $(Q) install -m 0755 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_watch_runtime/$(notdir $@) $@ - -$(PREFIX)/lib/mono/Xamarin.WatchOS/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/Xamarin.WatchOS - $(Q) install -m 0755 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_watch/$(notdir $@) $@ - -$(PREFIX)/lib/mono/Xamarin.TVOS/Facades/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/Xamarin.TVOS/Facades - $(Q) install -m 0755 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_tv/Facades/$(notdir $@) $@ - -$(PREFIX)/lib/mono/Xamarin.TVOS/repl/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/Xamarin.TVOS/repl - $(Q) install -m 0755 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_tv_runtime/$(notdir $@) $@ - -$(PREFIX)/lib/mono/Xamarin.TVOS/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/Xamarin.TVOS - $(Q) install -m 0755 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_tv/$(notdir $@) $@ - -$(PREFIX)/lib/mono/Xamarin.MacCatalyst/Facades/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/Xamarin.MacCatalyst/Facades - $(Q) install -m 0755 $(MONO_MACCATALYST_SDK_DESTDIR)/maccat-bcl/monotouch/Facades/$(notdir $@) $@ - -$(PREFIX)/lib/mono/Xamarin.MacCatalyst/repl/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/Xamarin.MacCatalyst/repl - $(Q) install -m 0755 $(MONO_MACCATALYST_SDK_DESTDIR)/maccat-bcl/monotouch_runtime/$(notdir $@) $@ - -$(PREFIX)/lib/mono/Xamarin.MacCatalyst/%: .stamp-$(MONO_BUILD_MODE) | $(PREFIX)/lib/mono/Xamarin.MacCatalyst - $(Q) install -m 0755 $(MONO_MACCATALYST_SDK_DESTDIR)/maccat-bcl/monotouch/$(notdir $@) $@ - -$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/Xamarin.Mac/Facades/%: .stamp-$(MONO_BUILD_MODE) | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/Xamarin.Mac/Facades - $(Q) install -m 0755 $(MONO_MAC_SDK_DESTDIR)/mac-bcl/xammac/Facades/$(notdir $@) $@ - -$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/Xamarin.Mac/%: .stamp-$(MONO_BUILD_MODE) | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/Xamarin.Mac - $(Q) install -m 0755 $(MONO_MAC_SDK_DESTDIR)/mac-bcl/xammac/$(notdir $@) $@ - -$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/4.5/Facades/%: .stamp-$(MONO_BUILD_MODE) | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/4.5/Facades - $(Q) install -m 0755 $(MONO_MAC_SDK_DESTDIR)/mac-bcl/xammac_net_4_5/Facades/$(notdir $@) $@ - -$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/4.5/%: .stamp-$(MONO_BUILD_MODE) | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/4.5 - $(Q) install -m 0755 $(MONO_MAC_SDK_DESTDIR)/mac-bcl/xammac_net_4_5/$(notdir $@) $@ - -$(IOS_BCL_DIRECTORIES) $(WATCHOS_BCL_DIRECTORIES) $(TVOS_BCL_DIRECTORIES) $(MAC_BCL_DIRECTORIES) $(MACCATALYST_BCL_DIRECTORIES): - $(Q) mkdir -p $@ - -MONO_ARCHIVE_IOS_IGNORED_ASSEMBLIES = Mono.Simd System.Runtime.CompilerServices.Unsafe nunitlite # TODO check if we should add them -MONO_ARCHIVE_MAC_IGNORED_ASSEMBLIES = System.Runtime.CompilerServices.Unsafe nunitlite # TODO check if we should add them -MONO_ARCHIVE_MAC_4_5_IGNORED_ASSEMBLIES = SMDiagnostics System.Net.Http.WebRequest System.Runtime.CompilerServices.Unsafe nunitlite # TODO check if we should add them - -ios-assemblies-check: $(IOS_BCL_TARGETS) - $(Q) rm -f .$@* - $(Q) echo $(IOS_ASSEMBLIES) $(IOS_FACADE_ASSEMBLIES) $(MONO_ARCHIVE_IOS_IGNORED_ASSEMBLIES) | tr ' ' '\n' | sort > .$@1 - $(Q) ls -1 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch/Facades | grep dll$$ | sed 's/[.]dll//' | sort > .$@2 - $(Q) if ! diff -u .$@1 .$@2; then echo "\n*** There are assemblies in "$(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch" not defined in IOS_ASSEMBLIES or IOS_FACADE_ASSEMBLIES ***\n"; exit 1; fi - $(Q) rm -f .$@* - -watchos-assemblies-check: $(WATCHOS_BCL_TARGETS) - $(Q) rm -f .$@* - $(Q) echo $(WATCHOS_ASSEMBLIES) $(WATCHOS_FACADE_ASSEMBLIES) $(MONO_ARCHIVE_IOS_IGNORED_ASSEMBLIES) | tr ' ' '\n' | sort > .$@1 - $(Q) ls -1 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_watch $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_watch/Facades | grep dll$$ | sed 's/[.]dll//' | sort > .$@2 - $(Q) if ! diff -u .$@1 .$@2; then echo "\n*** There are assemblies in "$(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_watch" not defined in WATCHOS_ASSEMBLIES or WATCHOS_FACADE_ASSEMBLIES ***\n"; exit 1; fi - $(Q) rm -f .$@* - -tvos-assemblies-check: $(TVOS_BCL_TARGETS) - $(Q) rm -f .$@* - $(Q) echo $(TVOS_ASSEMBLIES) $(TVOS_FACADE_ASSEMBLIES) $(MONO_ARCHIVE_IOS_IGNORED_ASSEMBLIES) | tr ' ' '\n' | sort > .$@1 - $(Q) ls -1 $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_tv $(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_tv/Facades | grep dll$$ | sed 's/[.]dll//' | sort > .$@2 - $(Q) if ! diff -u .$@1 .$@2; then echo "\n*** There are assemblies in "$(MONO_IOS_SDK_DESTDIR)/ios-bcl/monotouch_tv" not defined in TVOS_ASSEMBLIES or TVOS_FACADE_ASSEMBLIES ***\n"; exit 1; fi - $(Q) rm -f .$@* - -mac-assemblies-check: $(MAC_BCL_TARGETS) - $(Q) rm -f .$@* - $(Q) echo $(MAC_ASSEMBLIES) $(MAC_FACADE_ASSEMBLIES) $(MONO_ARCHIVE_MAC_IGNORED_ASSEMBLIES) | tr ' ' '\n' | sort > .$@1 - $(Q) ls -1 $(MONO_MAC_SDK_DESTDIR)/mac-bcl/xammac $(MONO_MAC_SDK_DESTDIR)/mac-bcl/xammac/Facades | grep dll$$ | sed 's/[.]dll//' | sort > .$@2 - $(Q) if ! diff -u .$@1 .$@2; then echo "\n*** There are assemblies in "$(MONO_MAC_SDK_DESTDIR)/mac-bcl/xammac " not defined in MAC_ASSEMBLIES or MAC_FACADE_ASSEMBLIES ***\n"; exit 1; fi - $(Q) rm -f .$@* - -mac-45-assemblies-check: $(MAC_BCL_TARGETS) - $(Q) rm -f .$@* - $(Q) echo $(MAC_4_5_ASSEMBLIES) $(MAC_4_5_FACADE_ASSEMBLIES) $(MONO_ARCHIVE_MAC_4_5_IGNORED_ASSEMBLIES) | tr ' ' '\n' | sort > .$@1 - $(Q) ls -1 $(MONO_MAC_SDK_DESTDIR)/mac-bcl/xammac_net_4_5 $(MONO_MAC_SDK_DESTDIR)/mac-bcl/xammac_net_4_5/Facades | grep dll$$ | sed 's/[.]dll//' | sort > .$@2 - $(Q) if ! diff -u .$@1 .$@2; then echo "\n*** There are assemblies in "$(MONO_MAC_SDK_DESTDIR)/mac-bcl/xammac_net_4_5 " not defined in MAC_4_5_ASSEMBLIES or MAC_4_5_FACADE_ASSEMBLIES ***\n"; exit 1; fi - $(Q) rm -f .$@* - -maccatalyst-assemblies-check: $(MACCATALYST_BCL_TARGETS) - $(Q) rm -f .$@* - $(Q) echo $(MACCATALYST_ASSEMBLIES) $(MACCATALYST_FACADE_ASSEMBLIES) $(MONO_ARCHIVE_IOS_IGNORED_ASSEMBLIES) | tr ' ' '\n' | sort > .$@1 - $(Q) ls -1 $(MONO_MACCATALYST_SDK_DESTDIR)/maccat-bcl/monotouch $(MONO_MACCATALYST_SDK_DESTDIR)/maccat-bcl/monotouch/Facades | grep dll$$ | sed 's/[.]dll//' | sort > .$@2 - $(Q) if ! diff -u .$@1 .$@2; then echo "\n*** There are assemblies in "$(MONO_MACCATALYST_SDK_DESTDIR)/maccat-bcl/monotouch" not defined in MACCATALYST_ASSEMBLIES or MACCATALYST_FACADE_ASSEMBLIES ***\n"; exit 1; fi - $(Q) rm -f .$@* - -install-bcl-ios: $(IOS_BCL_TARGETS) ios-assemblies-check -install-bcl-tvos: $(TVOS_BCL_TARGETS) tvos-assemblies-check -install-bcl-watchos: $(WATCHOS_BCL_TARGETS) watchos-assemblies-check -install-bcl-mac: $(MAC_BCL_TARGETS) mac-assemblies-check mac-45-assemblies-check -install-bcl-maccatalyst: $(MACCATALYST_BCL_TARGETS) maccatalyst-assemblies-check - -install-bcl:: install-bcl-ios -install-bcl:: install-bcl-watchos -install-bcl:: install-bcl-tvos -install-bcl:: install-bcl-mac -install-bcl:: install-bcl-maccatalyst -### TODO END - -verify-signature: - for file in $(PREFIX)/lib/mono/2.1/*.dll; do \ - MONO_CFG_DIR=$(TOP) $(SYSTEM_SN) -q -v $$file; \ - done - @MONO_CFG_DIR=$(TOP) $(SYSTEM_SN) -q -v $(PREFIX)/lib/mono/2.1/monotouch.dll \ - @MONO_CFG_DIR=$(TOP) $(SYSTEM_SN) -q -v $(PREFIX)/lib/mono/2.1/MonoTouch.Dialog.dll \ - @MONO_CFG_DIR=$(TOP) $(SYSTEM_SN) -q -v $(PREFIX)/lib/mono/2.1/MonoTouch.NUnitLite.dll \ - @MONO_CFG_DIR=$(TOP) $(SYSTEM_SN) -q -v $(PREFIX)/lib/mono/2.1/OpenTK.dll \ - @MONO_CFG_DIR=$(TOP) $(SYSTEM_SN) -q -v $(PREFIX)/lib/mono/2.1/OpenTK-10.dll - for file in $$(find $(PREFIX)/lib/mono/2.1/Facades -name "*.dll"); do \ - MONO_CFG_DIR=$(TOP) $(SYSTEM_SN) -q -v $$file; \ - done - -# -# smcs -# FIXME: Needed because of broken MonoDevelop assumptions -# -install-local:: install-smcs -all-local:: install-smcs - -$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/smcs: - @mkdir -p $(dir $@) - @echo Installing smcs script - @echo "#!/bin/bash" > $@ - @echo >> $@ - @echo "echo 'This script ($$0) is obsolete. Use csc to compile instead.'" >> $@ - @echo "exit 1" >> $@ - @chmod +x $@ - -install-smcs: $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/smcs - -# -# Xamarin.Mac common pieces -# -install-local:: install-mac-common -all-local:: install-mac-common - -MAC_COMMON_DIRECTORIES = \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_DIR)/Versions \ - $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR) \ - -MAC_COMMON_TARGETS = \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_DIR)/Versions/Current \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_DIR)/Commands \ - $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/buildinfo \ - $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/Version \ - $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/updateinfo \ - $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/Versions.plist \ - -$(MAC_DESTDIR)$(MAC_FRAMEWORK_DIR)/Versions/Current: | $(MAC_DESTDIR)$(MAC_FRAMEWORK_DIR)/Versions - $(Q_LN) ln -hfs $(MAC_INSTALL_VERSION) $@ - -$(MAC_DESTDIR)$(MAC_FRAMEWORK_DIR)/Commands: - $(Q_LN) ln -hfs $(MAC_TARGETDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/bin $@ - -$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/buildinfo: $(TOP)/Make.config.inc $(GIT_DIRECTORY)/index | $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR) - $(Q_GEN) echo "Version: $(MAC_PACKAGE_VERSION)" > $@ - $(Q) echo "Hash: $(shell git log --oneline -1 --pretty=%h)" >> $@ - $(Q) echo "Branch: $(CURRENT_BRANCH)" >> $@ - $(Q) echo "Build date: $(shell date '+%Y-%m-%d %H:%M:%S%z')" >> $@ - -$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/updateinfo: $(TOP)/Make.config.inc - $(Q) echo "0ab364ff-c0e9-43a8-8747-3afb02dc7731 $(MAC_PACKAGE_UPDATE_ID)" > $@ - -$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/Version: $(TOP)/Make.config.inc - $(Q) echo $(MAC_PACKAGE_VERSION) > $@ - -$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/Versions.plist: $(TOP)/Versions-mac.plist.in Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/versions-check.csharp .stamp-$(MONO_BUILD_MODE) - $(Q) $(TOP)/versions-check.csharp $< "$(MIN_IOS_SDK_VERSION)" "$(MAX_IOS_DEPLOYMENT_TARGET)" "$(MIN_TVOS_SDK_VERSION)" "$(MAX_TVOS_DEPLOYMENT_TARGET)" "$(MIN_WATCH_OS_VERSION)" "$(MAX_WATCH_DEPLOYMENT_TARGET)" "$(MIN_MACOS_SDK_VERSION)" "$(MACOS_SDK_VERSION)" "$(MIN_MACCATALYST_SDK_VERSION)" "$(MACCATALYST_SDK_VERSION)" - $(Q_GEN) sed -e 's/@XCODE_VERSION@/$(XCODE_VERSION)/g' -e "s/@MONO_VERSION@/$(shell cat $(MONO_MAC_SDK_DESTDIR)/mac-mono-version.txt)/g" -e "s/@MIN_XM_MONO_VERSION@/$(MIN_XM_MONO_VERSION)/g" $< > $@ - -$(MAC_COMMON_DIRECTORIES): - $(Q) mkdir -p $@ - -install-mac-common: $(MAC_COMMON_TARGETS) - -# -# Xamarin.Mac Mono runtime pieces -# -install-local:: install-mac -all-local:: install-mac - -MAC_DIRECTORIES = \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/etc/mono/assemblies/System \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/Frameworks \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/pkgconfig \ - -MAC_TARGETS = \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/libmonosgen-2.0.a \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/libmono-profiler-log.a \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/libmono-native-compat.a \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/libmono-native-unified.a \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/libmonosgen-2.0.dylib \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/libMonoPosixHelper.dylib \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/libmono-native-compat.dylib \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/libmono-native-unified.dylib \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/libmono-2.0.dylib \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/libmono-2.0.a \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/pkgconfig/mono-2.pc \ - $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/etc/mono/assemblies/System/System.config \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/mono-sgen \ - $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/aarch64-darwin-mono-sgen \ - -$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/%: .stamp-$(MONO_BUILD_MODE) | $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib - $(Q) $(CP) $(MONO_MAC_SDK_DESTDIR)/mac-libs/$(notdir $@) $@ - -$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/libmono-2.0.dylib $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/libmono-2.0.a: | $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib - $(Q) ln -sf libmonosgen-2.0$(suffix $@) $@ - -$(MONO_MAC_SDK_DESTDIR)/mac-pkgconfig/mono-2.pc: .stamp-$(MONO_BUILD_MODE) - -$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/pkgconfig/mono-2.pc: $(MONO_MAC_SDK_DESTDIR)/mac-pkgconfig/mono-2.pc | $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib/pkgconfig - $(Q) $(CP) $< $@ - -$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/etc/mono/assemblies/System/System.config: mac-System.config | $(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/etc/mono/assemblies/System - $(Q) $(CP) $< $@ - -$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/mono-sgen: .stamp-$(MONO_BUILD_MODE) | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin - $(Q) install -m 0755 $(MONO_MAC_SDK_DESTDIR)/mac-bin/mono-sgen $@ - -$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/aarch64-darwin-mono-sgen: .stamp-$(MONO_BUILD_MODE) | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin - $(Q) install -m 0755 $(MONO_MAC_SDK_DESTDIR)/mac-bin/aarch64-darwin-mono-sgen $@ - -$(MAC_DIRECTORIES): - $(Q) mkdir -p $@ - -install-mac: $(MAC_TARGETS) - -# -# Xamarin.iOS/WatchOS/TVOS common pieces -# -install-local:: install-ios-common -all-local:: install-ios-common - -IOS_COMMON_DIRECTORIES = \ - $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions \ - $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX) \ - -IOS_COMMON_TARGETS = \ - $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current \ - $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/buildinfo \ - $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/Version \ - $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/updateinfo \ - $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/Versions.plist \ - -$(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current: | $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions - $(Q_LN) ln -hfs $(IOS_INSTALL_VERSION) $@ - -$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/buildinfo: $(TOP)/Make.config.inc $(GIT_DIRECTORY)/index | $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX) - $(Q_GEN) echo "Version: $(IOS_PACKAGE_VERSION)" > $@ - $(Q) echo "Hash: $(shell git log --oneline -1 --pretty=%h)" >> $@ - $(Q) echo "Branch: $(CURRENT_BRANCH)" >> $@ - $(Q) echo "Build date: $(shell date '+%Y-%m-%d %H:%M:%S%z')" >> $@ - -$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/Version: $(TOP)/Make.config.inc | $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX) - $(Q) echo $(IOS_PACKAGE_VERSION) > $@ - -$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/updateinfo: $(TOP)/Make.config.inc - $(Q) echo "4569c276-1397-4adb-9485-82a7696df22e $(IOS_PACKAGE_UPDATE_ID)" > $@ - -$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/Versions.plist: $(TOP)/Versions-ios.plist.in Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/versions-check.csharp .stamp-$(MONO_BUILD_MODE) - $(Q) $(TOP)/versions-check.csharp $< "$(MIN_IOS_SDK_VERSION)" "$(MAX_IOS_DEPLOYMENT_TARGET)" "$(MIN_TVOS_SDK_VERSION)" "$(MAX_TVOS_DEPLOYMENT_TARGET)" "$(MIN_WATCH_OS_VERSION)" "$(MAX_WATCH_DEPLOYMENT_TARGET)" "$(MIN_MACOS_SDK_VERSION)" "$(MACOS_SDK_VERSION)" "$(MIN_MACCATALYST_SDK_VERSION)" "$(MACCATALYST_SDK_VERSION)" - $(Q_GEN) sed -e 's/@XCODE_VERSION@/$(XCODE_VERSION)/g' -e "s/@MONO_VERSION@/$(shell cat $(MONO_IOS_SDK_DESTDIR)/ios-mono-version.txt)/g" $< > $@ - -$(IOS_COMMON_DIRECTORIES): - $(Q) mkdir -p $@ - -install-ios-common: $(IOS_COMMON_TARGETS) - -# -# iPhone simulator Mono runtime pieces -# -install-local:: install-iphonesimulator -all-local:: install-iphonesimulator - -IPHONESIMULATOR_DIRECTORIES = \ - $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/Frameworks \ - $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib - -IPHONESIMULATOR_TARGETS = \ - $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib/libmonosgen-2.0.a \ - $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib/libmono-profiler-log.a \ - $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib/libmono-native-compat.a \ - $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib/libmono-native-unified.a \ - $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib/libmonosgen-2.0.dylib \ - $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib/libmono-native-compat.dylib \ - $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib/libmono-native-unified.dylib \ - $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib/libmono-profiler-log.dylib \ - $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/Frameworks/Mono.framework/Mono \ - -$(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib/%: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib - $(Q) $(CP) $(MONO_IOS_SDK_DESTDIR)/ios-libs/ios-sim/$(notdir $@) $@ - $(Q) if test -d $(MONO_IOS_SDK_DESTDIR)/ios-libs/ios-sim/$(notdir $@).dSYM; then $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-libs/ios-sim/$(notdir $@).dSYM $(dir $@); fi - -$(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/Frameworks/Mono.framework/Mono: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-frameworks/ios-sim/Mono.framework $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-frameworks/ios-sim/Mono.framework.dSYM $(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/Frameworks - -$(IPHONESIMULATOR_DIRECTORIES): - $(Q) mkdir -p $@ - -install-iphonesimulator:: $(IPHONESIMULATOR_TARGETS) - -# -# Watch simulator Mono runtime pieces -# -install-local:: install-watchsimulator -all-local:: install-watchsimulator - -WATCHSIMULATOR_DIRECTORIES = \ - $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks \ - $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib - -WATCHSIMULATOR_TARGETS = \ - $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib/libmonosgen-2.0.a \ - $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib/libmono-profiler-log.a \ - $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib/libmono-native-compat.a \ - $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib/libmono-native-unified.a \ - $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib/libmonosgen-2.0.dylib \ - $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib/libmono-native-compat.dylib \ - $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib/libmono-native-unified.dylib \ - $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib/libmono-profiler-log.dylib \ - $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks/Mono.framework/Mono \ - -$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib/%: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/lib - $(Q) $(CP) $(MONO_IOS_SDK_DESTDIR)/ios-libs/watchos-sim/$(notdir $@) $@ - $(Q) if test -d $(MONO_IOS_SDK_DESTDIR)/ios-libs/watchos-sim/$(notdir $@).dSYM; then $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-libs/watchos-sim/$(notdir $@).dSYM $(dir $@); fi - -$(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks/Mono.framework/Mono: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-frameworks/watchos-sim/Mono.framework $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-frameworks/watchos-sim/Mono.framework.dSYM $(IOS_DESTDIR)$(XAMARIN_WATCHSIMULATOR_SDK)/Frameworks - -$(WATCHSIMULATOR_DIRECTORIES): - $(Q) mkdir -p $@ - -install-watchsimulator: $(WATCHSIMULATOR_TARGETS) - -# -# TV simulator Mono runtime pieces -# -install-local:: install-tvsimulator -all-local:: install-tvsimulator - -TVSIMULATOR_DIRECTORIES = \ - $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/Frameworks \ - $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib - -TVSIMULATOR_TARGETS = \ - $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib/libmonosgen-2.0.a \ - $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib/libmono-profiler-log.a \ - $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib/libmono-native-compat.a \ - $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib/libmono-native-unified.a \ - $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib/libmonosgen-2.0.dylib \ - $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib/libmono-native-compat.dylib \ - $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib/libmono-native-unified.dylib \ - $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib/libmono-profiler-log.dylib \ - $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/Frameworks/Mono.framework/Mono \ - -$(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib/%: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib - $(Q) $(CP) $(MONO_IOS_SDK_DESTDIR)/ios-libs/tvos-sim/$(notdir $@) $@ - $(Q) if test -d $(MONO_IOS_SDK_DESTDIR)/ios-libs/tvos-sim/$(notdir $@).dSYM; then $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-libs/tvos-sim/$(notdir $@).dSYM $(dir $@); fi - -$(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/Frameworks/Mono.framework/Mono: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-frameworks/tvos-sim/Mono.framework $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-frameworks/tvos-sim/Mono.framework.dSYM $(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/Frameworks - -$(TVSIMULATOR_DIRECTORIES): - $(Q) mkdir -p $@ - -install-tvsimulator: $(TVSIMULATOR_TARGETS) - -# -# Mac Catalyst Mono runtime pieces -# -install-local:: install-maccatalyst -all-local:: install-maccatalyst - -MACCATALYST_DIRECTORIES = \ - $(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/Frameworks \ - $(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/lib \ - -MACCATALYST_TARGETS = \ - $(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/lib/libmonosgen-2.0.a \ - $(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/lib/libmono-profiler-log.a \ - $(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/lib/libmono-native.a \ - $(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/lib/libmonosgen-2.0.dylib \ - $(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/lib/libmono-native.dylib \ - -$(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/lib/%: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/lib - $(Q) $(CP) $(MONO_MACCATALYST_SDK_DESTDIR)/maccat-libs/$(notdir $@) $@ - $(Q) if test -d $(MONO_MACCATALYST_SDK_DESTDIR)/maccat-libs/$(notdir $@).dSYM; then $(CP) -R $(MONO_MACCATALYST_SDK_DESTDIR)/maccat-libs/$(notdir $@).dSYM $(dir $@); fi - -$(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/Frameworks/Mono.framework/Mono: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_MACCATALYST_SDK_DESTDIR)/maccat-frameworks/ios-sim/Mono.framework $(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_MACCATALYST_SDK_DESTDIR)/maccat-frameworks/ios-sim/Mono.framework.dSYM $(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/Frameworks - -$(XAMARIN_MACCATALYST_SDK_DIRECTORIES): - $(Q) mkdir -p $@ - -$(MACCATALYST_DIRECTORIES): - $(Q) mkdir -p $@ - -install-maccatalyst:: $(MACCATALYST_TARGETS) - -# -# iPhone device Mono runtime pieces -# -install-local:: install-iphoneos -all-local:: install-iphoneos - -IPHONEOS_DIRECTORIES = \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/Frameworks \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib - -IPHONEOS_TARGETS = \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib/libmonosgen-2.0.a \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib/libmono-profiler-log.a \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib/libmono-ee-interp.a \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib/libmono-icall-table.a \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib/libmono-ilgen.a \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib/libmono-native-compat.a \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib/libmono-native-unified.a \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib/libmonosgen-2.0.dylib \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib/libmono-native-compat.dylib \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib/libmono-native-unified.dylib \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib/libmono-profiler-log.dylib \ - $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/Frameworks/Mono.framework/Mono \ - -$(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib/%: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib - $(Q) $(CP) $(MONO_IOS_SDK_DESTDIR)/ios-libs/ios/$(notdir $@) $@ - $(Q) if test -d $(MONO_IOS_SDK_DESTDIR)/ios-libs/ios/$(notdir $@).dSYM; then $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-libs/ios/$(notdir $@).dSYM $(dir $@); fi - -$(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/Frameworks/Mono.framework/Mono: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-frameworks/ios/Mono.framework $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-frameworks/ios/Mono.framework.dSYM $(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/Frameworks - -$(IPHONEOS_DIRECTORIES): - $(Q) mkdir -p $@ - -install-iphoneos: $(IPHONEOS_TARGETS) - -# -# Watch device Mono runtime pieces -# -install-local:: install-watchos -all-local:: install-watchos - -WATCHOS_DIRECTORIES = \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib - -WATCHOS_TARGETS = \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib/libmonosgen-2.0.a \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib/libmono-profiler-log.a \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib/libmono-ee-interp.a \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib/libmono-icall-table.a \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib/libmono-ilgen.a \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib/libmono-native-compat.a \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib/libmono-native-unified.a \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib/libmonosgen-2.0.dylib \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib/libmono-native-compat.dylib \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib/libmono-native-unified.dylib \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib/libmono-profiler-log.dylib \ - $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks/Mono.framework/Mono \ - -$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib/%: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/lib - $(Q) $(CP) $(MONO_IOS_SDK_DESTDIR)/ios-libs/watchos/$(notdir $@) $@ - $(Q) if test -d $(MONO_IOS_SDK_DESTDIR)/ios-libs/watchos/$(notdir $@).dSYM; then $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-libs/watchos/$(notdir $@).dSYM $(dir $@); fi - -$(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks/Mono.framework/Mono: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-frameworks/watchos/Mono.framework $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-frameworks/watchos/Mono.framework.dSYM $(IOS_DESTDIR)$(XAMARIN_WATCHOS_SDK)/Frameworks - -$(WATCHOS_DIRECTORIES): - $(Q) mkdir -p $@ - -install-watchos: $(WATCHOS_TARGETS) - -# -# TV device Mono runtime pieces -# -install-local:: install-tvos -all-local:: install-tvos - -TVOS_DIRECTORIES = \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/Frameworks \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib - -TVOS_TARGETS = \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/libmonosgen-2.0.a \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/libmono-profiler-log.a \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/libmono-ee-interp.a \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/libmono-icall-table.a \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/libmono-ilgen.a \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/libmono-native-compat.a \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/libmono-native-unified.a \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/libmonosgen-2.0.dylib \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/libmono-native-compat.dylib \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/libmono-native-unified.dylib \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/libmono-profiler-log.dylib \ - $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/Frameworks/Mono.framework/Mono \ - -$(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/%: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib - $(Q) $(CP) $(MONO_IOS_SDK_DESTDIR)/ios-libs/tvos/$(notdir $@) $@ - $(Q) if test -d $(MONO_IOS_SDK_DESTDIR)/ios-libs/tvos/$(notdir $@).dSYM; then $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-libs/tvos/$(notdir $@).dSYM $(dir $@); fi - -$(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/Frameworks/Mono.framework/Mono: .stamp-$(MONO_BUILD_MODE) | $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-frameworks/tvos/Mono.framework $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/Frameworks - $(Q) $(CP) -R $(MONO_IOS_SDK_DESTDIR)/ios-frameworks/tvos/Mono.framework.dSYM $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/Frameworks - -$(TVOS_DIRECTORIES): - $(Q) mkdir -p $@ - -install-tvos: $(TVOS_TARGETS) - # # .NET # - DOTNET_COMMON_DIRECTORIES += \ $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)) \ $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools) \ @@ -1164,57 +213,3 @@ install-dotnet: $(DOTNET_COMMON_TARGETS) install-local:: install-dotnet all-local:: install-dotnet -# -# Cross compilers -# -# This is the cross aot version of mono. runs on x86 but the jit/aot spits out arm. -# -# There are two versions of the cross compiler, a 32 bit version targeting arm, and a 64 -# bit version targeting arm64. -# These are compiled using the mono sdk makefiles -# -install-local:: install-cross - -$(MONO_IOS_SDK_DESTDIR)/ios-cross32-release/bin/arm-darwin-mono-sgen: .stamp-$(MONO_BUILD_MODE) -$(MONO_IOS_SDK_DESTDIR)/ios-cross64-release/bin/aarch64-darwin-mono-sgen: .stamp-$(MONO_BUILD_MODE) -$(MONO_IOS_SDK_DESTDIR)/ios-crosswatch-release/bin/armv7k-unknown-darwin-mono-sgen: .stamp-$(MONO_BUILD_MODE) -$(MONO_IOS_SDK_DESTDIR)/ios-crosswatch-release/bin/aarch64-apple-darwin10_ilp32-mono-sgen: .stamp-$(MONO_BUILD_MODE) - -$(PREFIX)/bin/arm-darwin-mono-sgen: $(MONO_IOS_SDK_DESTDIR)/ios-cross32-release/bin/arm-darwin-mono-sgen | $(PREFIX)/bin - $(call Q_2,INSTALL ,[CROSS]) install -c -m 0755 $(INSTALL_STRIP_FLAG) $^ $@ - -$(PREFIX)/bin/arm64-darwin-mono-sgen: $(MONO_IOS_SDK_DESTDIR)/ios-cross64-release/bin/aarch64-darwin-mono-sgen | $(PREFIX)/bin - $(call Q_2,INSTALL ,[CROSS]) install -c -m 0755 $(INSTALL_STRIP_FLAG) $^ $@ - -$(PREFIX)/bin/armv7k-unknown-darwin-mono-sgen: $(MONO_IOS_SDK_DESTDIR)/ios-crosswatch-release/bin/armv7k-unknown-darwin-mono-sgen | $(PREFIX)/bin - $(call Q_2,INSTALL ,[CROSS]) install -c -m 0755 $(INSTALL_STRIP_FLAG) $^ $@ - -$(PREFIX)/bin/arm64_32-darwin-mono-sgen: $(MONO_IOS_SDK_DESTDIR)/ios-crosswatch64_32-release/bin/aarch64-apple-darwin10_ilp32-mono-sgen | $(PREFIX)/bin - $(call Q_2,INSTALL ,[CROSS]) install -c -m 0755 $(INSTALL_STRIP_FLAG) $^ $@ - -$(PREFIX)/bin: - $(Q) mkdir -p $@ - -.PHONY: install-cross -install-cross: $(PREFIX)/bin/arm-darwin-mono-sgen $(PREFIX)/bin/arm64-darwin-mono-sgen $(PREFIX)/bin/armv7k-unknown-darwin-mono-sgen $(PREFIX)/bin/arm64_32-darwin-mono-sgen - -# -# LLVM -# -install-local:: install-llvm - -LLVM64_TARGETS = \ - $(PREFIX)/LLVM/bin/opt \ - $(PREFIX)/LLVM/bin/llc \ - -$(MONO_IOS_SDK_DESTDIR)/llvm-llvm64/bin/%: .stamp-$(MONO_BUILD_MODE) - -$(PREFIX)/LLVM/bin/%: $(MONO_IOS_SDK_DESTDIR)/llvm-llvm64/bin/% | $(PREFIX)/LLVM/bin - $(call Q_2,INSTALL ,[LLVM64]) install -c -m 0755 $(INSTALL_STRIP_FLAG) $^ $@ - -$(PREFIX)/LLVM/bin: - $(Q) mkdir -p $@ - -.PHONY: install-llvm64 install-llvm -install-llvm: install-llvm64 -install-llvm64: $(LLVM64_TARGETS) diff --git a/dotnet/Workloads/SignList.xml b/dotnet/Workloads/SignList.xml index 755a6c5268dc..fae12d42c701 100644 --- a/dotnet/Workloads/SignList.xml +++ b/dotnet/Workloads/SignList.xml @@ -122,7 +122,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1e2ae7fd263c..70438f62d6e0 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,26 +1,26 @@ - + https://github.com/dotnet/sdk - 42b2349ec272dbb8bbc5d8df29adb7b77e3450cd + f59e9ca09cb4d5b903b276c0d3d7825b6ddbc3a0 https://github.com/dotnet/runtime cf47d9ff6827a3e1d6f2acbf925cd618418f20dd - + https://github.com/dotnet/runtime - 3d9da91a9720f7bda3e4cef127b8195441fb2580 + 2c4266c134aa02718179818098a11e825c9d1362 - + https://github.com/dotnet/runtime - 3d9da91a9720f7bda3e4cef127b8195441fb2580 + 2c4266c134aa02718179818098a11e825c9d1362 - + https://github.com/dotnet/aspnetcore - 91ef755ae08f27b395d73be00d245d8095f90143 + afe2857bffef08213d6f3c7688647c60d5d5e7bd https://github.com/dotnet/emsdk diff --git a/eng/Versions.props b/eng/Versions.props index 84ae54441252..fca800893758 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,17 +2,17 @@ - 9.0.100-rc.2.24474.4 - 9.0.0-rtm.24473.2 + 9.0.100-rc.2.24475.4 + 9.0.0-rtm.24475.3 9.0.0-alpha.1.23556.4 9.0.0-beta.24408.2 8.0.0-beta.24413.2 - 9.0.0-rtm.24473.2 + 9.0.0-rtm.24475.3 8.0.0-rtm.23511.3 9.0.0-rc.2.24462.10 7.0.100-alpha.1.21601.1 0.11.5-alpha.24467.1 - 10.0.0-prerelease.24466.1 + 10.0.0-prerelease.24467.4 $(MicrosoftNETWorkloadEmscriptenCurrentManifest80100Version) $(MicrosoftNETWorkloadEmscriptenCurrentManifest80100Version) diff --git a/global.json b/global.json index e269bf2b2ff9..39529c36264e 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "9.0.100-rc.2.24474.4" + "version": "9.0.100-rc.2.24475.4" } } diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/UnpackLibraryResources.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/UnpackLibraryResources.cs index a82dff8a8e43..52c9b5357cd7 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/UnpackLibraryResources.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/UnpackLibraryResources.cs @@ -251,6 +251,8 @@ IEnumerable GetAssemblyManifestResources (string fileName) } foreach (var resourceName in assembly.GetManifestResourceNames ()) { + if (string.IsNullOrEmpty (resourceName)) + continue; var info = assembly.GetManifestResourceInfo (resourceName); if (!info.ResourceLocation.HasFlag (ResourceLocation.Embedded)) continue; diff --git a/release/Makefile b/release/Makefile index b883fee8cd94..493e73a7c045 100644 --- a/release/Makefile +++ b/release/Makefile @@ -1,150 +1,9 @@ TOP=../../xamarin-macios include $(TOP)/Make.config -IOS_PACKAGE_DESTDIR=$(abspath .)/_ios-install -MAC_PACKAGE_DESTDIR=$(abspath .)/_mac-install - -IOS_PAYLOAD=$(abspath $(IOS_PACKAGE_DESTDIR)) -MAC_PAYLOAD=$(abspath $(MAC_PACKAGE_DESTDIR)) - -MAC_INSTALL_PKG=xamarin.mac-$(MAC_PACKAGE_VERSION).pkg -MAC_UNINSTALL_PKG=xamarin.mac-uninstall-$(MAC_PACKAGE_VERSION).pkg - -MAC_SED_PROCESS_IN = sed \ - -e "s/@INSTALLKBYTES@/`du -sk $(MAC_PAYLOAD) | awk '{print $$1}'`/g" \ - -e "s/@NUMFILES@/`lsbom mac-tmp-package/$(MAC_INSTALL_PKG)/Bom 2>/dev/null | wc -l | awk '{print $$1}'`/g" \ - -e "s/@INSTALL_PKG@/$(MAC_INSTALL_PKG)/g" \ - -e "s/@UNINSTALL_PKG@/$(MAC_UNINSTALL_PKG)/g" \ - -e "s,@PACKAGE_INSTALL_LOCATION@,$(MAC_PACKAGE_INSTALL_LOCATION),g" \ - -e "s/@PACKAGE_VERSION@/$(MAC_PACKAGE_VERSION)/g" \ - -e "s/@PRODUCT@/$(MAC_PRODUCT)/g" \ - -e "s,@XAMMAC_PREFIX@,$(MAC_FRAMEWORK_CURRENT_DIR),g" - -ifdef INCLUDE_MAC -ALL_PACKAGES+=$(MAC_PACKAGE_FILENAME) -endif -ifdef INCLUDE_IOS -ALL_PACKAGES+=$(IOS_PACKAGE_FILENAME) -endif - -build-for-package: - @# make sure we start with a clean slate - $(Q) git clean -xfd - $(Q) $(MAKE) -C $(TOP) install USE_SOURCE_LINKS=0 DEVMODE=0 \ - IOS_DESTDIR=$(IOS_PACKAGE_DESTDIR) IOS_TARGETDIR=/ IOS_INSTALL_VERSION=$(IOS_PACKAGE_VERSION) \ - MAC_DESTDIR=$(MAC_PACKAGE_DESTDIR) MAC_TARGETDIR=/ MAC_INSTALL_VERSION=$(MAC_PACKAGE_VERSION) - release package: - $(Q) $(MAKE) build-for-package - $(Q) $(MAKE) $(ALL_PACKAGES) - @# updateinfo, uploaded to wrench -ifdef INCLUDE_MAC - $(Q) cp $(MAC_PACKAGE_DESTDIR)/$(MAC_FRAMEWORK_DIR)/Versions/Current/updateinfo mac-updateinfo -endif -ifdef INCLUDE_IOS - $(Q) cp $(IOS_PACKAGE_DESTDIR)/$(IOS_FRAMEWORK_DIR)/Versions/Current/updateinfo ios-updateinfo -endif $(MAKE) bundle.zip msbuild.zip -# this are just a useful targets to run locally if you're not interested in the XI/XM package -# it should be almost identical to the normal 'package' target (only difference should be that the XM/XI -# bits aren't built/packaged) -ifdef INCLUDE_MAC -mac-package: - $(Q) $(MAKE) build-for-package - $(Q) $(MAKE) $(MAC_PACKAGE_FILENAME) -endif -ifdef INCLUDE_IOS -ios-package: - $(Q) $(MAKE) build-for-package - $(Q) $(MAKE) $(IOS_PACKAGE_FILENAME) -endif - -prechecks: -ifdef CROSS_BUILD_CFLAGS - echo "CROSS_BUILD_CFLAGS can't be set when building a package. Please fix Make.local.config" && exit 1 -endif -ifdef DEVICE_BUILD_CFLAGS - echo "DEVICE_BUILD_CFLAGS can't be set when building a package. Please fix Make.local.config" && exit 1 -endif - @echo Package prechecks completed successfully. - -monotouch.pkg: Makefile - @echo Building $@ - $(Q) $(MAKE) prechecks - $(Q) mkdir -p ios-work/commercial - $(Q) cp postflight-ios ios-work/commercial/postinstall - $(Q) chmod a+x ios-work/commercial/postinstall - $(Q) mkdir -p ios-tmp-package/Resources/en.lproj - $(Q) mkdir -p ios-tmp-package/monotouch.pkg - $(Q) cp $(TOP)/tools/scripts/License.txt ios-tmp-package/Resources/en.lproj/License.txt - $(Q) mkbom $(IOS_PAYLOAD) ios-tmp-package/monotouch.pkg/Bom - $(Q) (cd $(IOS_PAYLOAD); lsbom -p f $(abspath ./ios-tmp-package/monotouch.pkg/Bom) | cpio -o | gzip -9 -n > $(abspath ios-tmp-package/monotouch.pkg/Payload)) 2>/dev/null - $(Q) (cd ios-work/commercial; ls -d . ./postinstall | cpio -o | gzip -9 -n > ../../ios-tmp-package/monotouch.pkg/Scripts) 2>/dev/null - $(Q) INSTALLKBYTES=`du -sk $(IOS_PAYLOAD) | awk '{print $$1}'`; NUMFILES=`lsbom ios-tmp-package/monotouch.pkg/Bom | wc -l | awk '{print $$1}'`; sed -e "s/@INSTALLKBYTES@/$$INSTALLKBYTES/g" -e "s/@NUMFILES@/$$NUMFILES/g" -e "s/@FULL_PACKAGE_UTI@/$(IOS_PACKAGE_UTI)/g" -e "s,@MONOTOUCH_PREFIX@,$(MONOTOUCH_PREFIX),g" PackageInfo.ios.in > ios-tmp-package/monotouch.pkg/PackageInfo - @echo Built $@ - -$(IOS_PACKAGE_FILENAME): delete-xma-build-host.pkg monotouch.pkg - @echo Building $@ - @rm -Rf ios-meta-package - @cp -R ios-tmp-package ios-meta-package - @cp -R xma-tmp-package/delete-xma-build-host.pkg ios-meta-package - @$(Q) INSTALLBYTES_MTVS=`grep installKBytes ios-meta-package/delete-xma-build-host.pkg/PackageInfo | sed 's/.*installKBytes="\([0-9]*\)".*/\1/'` INSTALLKBYTES=`du -sk $(IOS_PAYLOAD) | awk '{print $$1}'`; sed -e s/@INSTALLKBYTES@/$$INSTALLKBYTES/ -e s/@INSTALLBYTES_MTVS@/$$INSTALLBYTES_MTVS/ Distribution.ios.in > ios-meta-package/Distribution - @$(Q_GEN) (cd ios-meta-package; xar --no-compress monotouch.pkg/Payload --no-compress monotouch.pkg/Scripts --no-compress delete-xma-build-host.pkg/Payload --no-compress delete-xma-build-host.pkg/Scripts -c -f ../$@ *) - @echo Built $@ - -# delete-xma-build-host is a package with the same id as the old MTVS installer, but with 0 files to install. -# This makes OSX remove all files installed by the old MTVS installer. -delete-xma-build-host.pkg: - @echo Building $@ - $(Q) rm -rf xma-work xma-tmp-package - $(Q) mkdir -p xma-work/commercial/payload - $(Q) cp preinstall.xma.in xma-work/commercial/preinstall - $(Q) chmod a+x xma-work/commercial/preinstall - $(Q) mkdir -p xma-tmp-package/$@ - $(Q) mkbom xma-work/commercial/payload xma-tmp-package/$@/Bom - $(Q) (cd xma-work/commercial/payload; lsbom -p f $(abspath ./xma-tmp-package/$@/Bom) | cpio -o | gzip -9 -n > $(abspath xma-tmp-package/$@/Payload)) 2>/dev/null - $(Q) (cd xma-work/commercial; ls -d . ./preinstall | cpio -o | gzip -9 -n > ../../xma-tmp-package/$@/Scripts) 2>/dev/null - $(Q) cp PackageInfo.xma.in xma-tmp-package/$@/PackageInfo - $(Q) cp Distribution.xma.in xma-tmp-package/Distribution - $(Q) (cd xma-tmp-package; xar --no-compress $@/Payload --no-compress $@/Scripts -c -f ../$@ *) - @echo Built $@ - -$(MAC_PACKAGE_FILENAME): - @echo Building $@ - $(Q) $(MAKE) prechecks -# xamarin.mac-v.v.v.pkg meta package - $(Q) mkdir -p mac-work/commercial - $(Q) cp postflight-mac mac-work/commercial/postflight-mac - $(Q) chmod a+x mac-work/commercial/postflight-mac - $(Q) mkdir -p mac-tmp-package/$(MAC_INSTALL_PKG) - $(Q) mkdir -p mac-tmp-package/Resources/en.lproj - $(Q) cp $(TOP)/tools/scripts/License.txt mac-tmp-package/Resources/en.lproj/License.txt - $(Q) mkbom $(MAC_PAYLOAD) mac-tmp-package/$(MAC_INSTALL_PKG)/Bom - $(Q) (cd $(MAC_PAYLOAD); lsbom -p f $(abspath ./mac-tmp-package/$(MAC_INSTALL_PKG)/Bom) | cpio -o | gzip -9 -n > $(abspath ./mac-tmp-package/$(MAC_INSTALL_PKG)/Payload)) 2>/dev/null - $(Q) (cd mac-work/commercial; ls -d . ./postflight-mac | cpio -o | gzip -9 -n > ../../mac-tmp-package/$(MAC_INSTALL_PKG)/Scripts) 2>/dev/null - $(Q) ls -d ./mono-check.sh | cpio -o | gzip -9 -n > mac-tmp-package/Scripts 2>/dev/null - $(Q) $(MAC_SED_PROCESS_IN) PackageInfo.mac.in > mac-tmp-package/$(MAC_INSTALL_PKG)/PackageInfo -# xamarin.mac-uninstall-v.v.v.pkg meta package - $(Q) mkdir -p mac-work-uninstall/commercial - $(Q) $(MAC_SED_PROCESS_IN) uninstall.in > mac-work-uninstall/commercial/uninstall - $(Q) chmod a+x mac-work-uninstall/commercial/uninstall - $(Q) mkdir -p mac-work-uninstall/payload - $(Q) mkdir -p mac-tmp-package/$(MAC_UNINSTALL_PKG) - $(Q) mkbom mac-work-uninstall/payload mac-tmp-package/$(MAC_UNINSTALL_PKG)/Bom - $(Q) (cd mac-work-uninstall/payload; lsbom -p f ../../mac-tmp-package/$(MAC_UNINSTALL_PKG)/Bom | cpio -o | gzip -9 -n > ../../mac-tmp-package/$(MAC_UNINSTALL_PKG)/Payload) 2>/dev/null - $(Q) (cd mac-work-uninstall/commercial; ls -d . ./uninstall | cpio -o | gzip -9 -n > ../../mac-tmp-package/$(MAC_UNINSTALL_PKG)/Scripts) 2>/dev/null - $(Q) $(MAC_SED_PROCESS_IN) UninstallPackageInfo.mac.in > mac-tmp-package/$(MAC_UNINSTALL_PKG)/PackageInfo -# final package - $(Q) $(MAC_SED_PROCESS_IN) Distribution.mac.in > mac-tmp-package/Distribution - $(Q_GEN) (cd mac-tmp-package; xar --no-compress Scripts --no-compress $(MAC_INSTALL_PKG)/Payload --no-compress $(MAC_INSTALL_PKG)/Scripts --no-compress $(MAC_UNINSTALL_PKG)/Payload --no-compress $(MAC_UNINSTALL_PKG)/Scripts -c -f ../$(MAC_PACKAGE_FILENAME) *) - @echo Built $@ - -clean-local:: - rm -rf ios-tmp-package ios-work ios-meta-package - rm -rf mac-tmp-package mac-work mac-work-uninstall - rm -rf *.pkg - # msbuild.zip and bundle.zip are uploaded to wrench and packaged into the VS plugin msbuild.zip: rm -Rf msbuild $@ @@ -165,21 +24,12 @@ endif cp -R $(TOP)/msbuild/Xamarin.iOS.Tasks.Windows/bin/Release/netstandard2.0/win/ msbuild/iOS $(SYSTEM_MSBUILD) $(TOP)/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Tasks.csproj -r /p:Configuration=Release cp -R $(TOP)/msbuild/Xamarin.Mac.Tasks/bin/Release/netstandard2.0/ msbuild/Mac -ifdef INCLUDE_WATCH - mv -f msbuild/iOS/*WatchOS*.* msbuild/WatchOS - mv -f msbuild/iOS/NoCode.cs msbuild/WatchOS -endif mv -f msbuild/iOS/*TVOS*.* msbuild/TVOS cd msbuild && zip -9 -r $(abspath $@) . rm -rf msbuild bundle.zip: Version Version.rev rm -f $@ -ifdef INCLUDE_XAMARIN_LEGACY - if test -d $(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono; then cd $(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono && zip -9 -r $(CURDIR)/bundle.zip .; fi - if test -d $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono; then cd $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono && zip -9 -r $(CURDIR)/bundle.zip .; fi -endif -ifdef ENABLE_DOTNET $(foreach platform,$(DOTNET_PLATFORMS),export $(platform)_NUGET_REF_NAME=$($(platform)_NUGET_REF_NAME);) \ for platform in $(DOTNET_PLATFORMS); do \ cd $(CURDIR); \ @@ -191,7 +41,6 @@ ifdef ENABLE_DOTNET zip -9 -r $(CURDIR)/bundle.zip ./Microsoft.$$platform.Ref/ref/; \ rm -rf tmpdir; \ done -endif zip -9 $@ Version Version.rev Version: diff --git a/src/Foundation/NSUrlSessionHandler.cs b/src/Foundation/NSUrlSessionHandler.cs index 868e6ad2a33c..6e7788210a48 100644 --- a/src/Foundation/NSUrlSessionHandler.cs +++ b/src/Foundation/NSUrlSessionHandler.cs @@ -571,15 +571,20 @@ public DecompressionMethods AutomaticDecompression { [EditorBrowsable (EditorBrowsableState.Never)] public bool CheckCertificateRevocationList { get; set; } = false; - // We're ignoring this property, just like Xamarin.Android does: - // https://github.com/xamarin/xamarin-android/blob/09e8cb5c07ea6c39383185a3f90e53186749b802/src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs#L150 - // Note: we can't return null (like Xamarin.Android does), because the return type isn't nullable. - [UnsupportedOSPlatform ("ios")] - [UnsupportedOSPlatform ("maccatalyst")] - [UnsupportedOSPlatform ("tvos")] - [UnsupportedOSPlatform ("macos")] - [EditorBrowsable (EditorBrowsableState.Never)] - public X509CertificateCollection ClientCertificates { get { return new X509CertificateCollection (); } } + + X509CertificateCollection? _clientCertificates; + + /// Gets the collection of security certificates that are associated with requests to the server. + /// Client certificates are only supported when ClientCertificateOptions is set to ClientCertificateOptions.Manual. + public X509CertificateCollection ClientCertificates { + get { + if (ClientCertificateOptions != ClientCertificateOption.Manual) { + throw new InvalidOperationException ($"Enable manual options first on {nameof (ClientCertificateOptions)}"); + } + + return _clientCertificates ?? (_clientCertificates = new X509CertificateCollection ()); + } + } // We're ignoring this property, just like Xamarin.Android does: // https://github.com/xamarin/xamarin-android/blob/09e8cb5c07ea6c39383185a3f90e53186749b802/src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs#L148 @@ -1092,6 +1097,19 @@ void DidReceiveChallengeImpl (NSUrlSession session, NSUrlSessionTask task, NSUrl } return; } +#if NET + if (sessionHandler.ClientCertificateOptions == ClientCertificateOption.Manual && challenge.ProtectionSpace.AuthenticationMethod == NSUrlProtectionSpace.AuthenticationMethodClientCertificate) { + var certificate = CertificateHelper.GetEligibleClientCertificate (sessionHandler.ClientCertificates); + if (certificate is not null) { + var cert = new SecCertificate (certificate); + var identity = SecIdentity.Import (certificate); + var credential = new NSUrlCredential (identity, new SecCertificate [] { cert }, NSUrlCredentialPersistence.ForSession); + completionHandler (NSUrlSessionAuthChallengeDisposition.UseCredential, credential); + return; + } + } +#endif + // case for the basic auth failing up front. As per apple documentation: // The URL Loading System is designed to handle various aspects of the HTTP protocol for you. As a result, you should not modify the following headers using // the addValue(_:forHTTPHeaderField:) or setValue(_:forHTTPHeaderField:) methods: @@ -1596,5 +1614,73 @@ protected override void Dispose (bool disposing) stream?.Dispose (); } } + +#if NET + static class CertificateHelper { + // Based on https://github.com/dotnet/runtime/blob/c2848c582f5d6ae42c89f5bfe0818687ab3345f0/src/libraries/Common/src/System/Net/Security/CertificateHelper.cs + // with the NetEventSource code removed and namespace changed. + const string ClientAuthenticationOID = "1.3.6.1.5.5.7.3.2"; + + internal static X509Certificate2? GetEligibleClientCertificate (X509CertificateCollection? candidateCerts) + { + if (candidateCerts is null || candidateCerts.Count == 0) { + return null; + } + + var certs = new X509Certificate2Collection (); + certs.AddRange (candidateCerts); + + return GetEligibleClientCertificate (certs); + } + + internal static X509Certificate2? GetEligibleClientCertificate (X509Certificate2Collection? candidateCerts) + { + if (candidateCerts is null || candidateCerts.Count == 0) { + return null; + } + + foreach (X509Certificate2 cert in candidateCerts) { + if (!cert.HasPrivateKey) { + continue; + } + + if (IsValidClientCertificate (cert)) { + return cert; + } + } + return null; + } + + static bool IsValidClientCertificate (X509Certificate2 cert) + { + foreach (X509Extension extension in cert.Extensions) { + if ((extension is X509EnhancedKeyUsageExtension eku) && !IsValidForClientAuthenticationEKU (eku)) { + return false; + } else if ((extension is X509KeyUsageExtension ku) && !IsValidForDigitalSignatureUsage (ku)) { + return false; + } + } + + return true; + } + + static bool IsValidForClientAuthenticationEKU (X509EnhancedKeyUsageExtension eku) + { + foreach (System.Security.Cryptography.Oid oid in eku.EnhancedKeyUsages) { + if (oid.Value == ClientAuthenticationOID) { + return true; + } + } + + return false; + } + + static bool IsValidForDigitalSignatureUsage (X509KeyUsageExtension ku) + { + const X509KeyUsageFlags RequiredUsages = X509KeyUsageFlags.DigitalSignature; + return (ku.KeyUsages & RequiredUsages) == RequiredUsages; + } + } +#endif } } diff --git a/src/Makefile b/src/Makefile index d21c1b00fd29..19c2027a39d3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -84,7 +84,7 @@ DOTNET_REFERENCES = \ /r:$(DOTNET_BCL_DIR)/System.Xml.ReaderWriter.dll \ DOTNET_OR_GREATER_DEFINES:=$(foreach version,$(shell seq 6 $(firstword $(subst ., ,$(subst net,,$(DOTNET_TFM))))),/define:NET$(version)_0_OR_GREATER) -DOTNET_FLAGS=/noconfig /nostdlib+ /deterministic /features:strict /nologo /target:library /debug /unsafe /define:NET /define:NET_TODO /define:XAMCORE_3_0 $(DOTNET_OR_GREATER_DEFINES) $(DOTNET_REFERENCES) +DOTNET_FLAGS=/warnaserror+ /noconfig /nostdlib+ /deterministic /features:strict /nologo /target:library /debug /unsafe /define:NET /define:NET_TODO /define:XAMCORE_3_0 $(DOTNET_OR_GREATER_DEFINES) $(DOTNET_REFERENCES) ifeq ($(XCODE_IS_STABLE),true) DOTNET_FLAGS+=/define:XCODE_IS_STABLE diff --git a/src/Security/Certificate.cs b/src/Security/Certificate.cs index ac764914e3ba..7ead363012a6 100644 --- a/src/Security/Certificate.cs +++ b/src/Security/Certificate.cs @@ -587,6 +587,13 @@ public SecCertificate Certificate { } } + /// Create a from PKCS #12 data. + /// The PKCS #12 blob data as a byte array. + /// The password for the private key in the PKCS #12 data. An empty password is not supported. + /// + /// On macOS 14 or earlier this method requires access to the default keychain,where the private key + certificate will be stored. + /// On macOS 15 or later, as well as all other platforms (iOS, tvOS, Mac Catalyst), calling this method will not affect any keychains (a temporary, in-memory keychain is created for the duration of the import). + /// public static SecIdentity Import (byte [] data, string password) { if (data is null) @@ -594,8 +601,82 @@ public static SecIdentity Import (byte [] data, string password) if (string.IsNullOrEmpty (password)) // SecPKCS12Import() doesn't allow empty passwords. throw new ArgumentException (nameof (password)); using (var pwstring = new NSString (password)) - using (var options = NSDictionary.FromObjectAndKey (pwstring, SecImportExport.Passphrase)) { + using (var options = NSMutableDictionary.FromObjectAndKey (pwstring, SecImportExport.Passphrase)) { NSDictionary [] array; +#if __MACOS__ + /* There are unfortunate platform differences for SecPKCS12Import: + * + * `SecPKCS12Import` will, _on macOS only, not other platforms_, add the imported certificate + private key into the default keychain. + * + * Apple's documentation for [`SecPKCS12Import`](https://developer.apple.com/documentation/security/1396915-secpkcs12import?language=objc) + * implies importing into the keychain is optional ("[...] You can then use the Keychain Services API + * (see [Keychain services](https://developer.apple.com/documentation/security/keychain_services?language=objc)) + * to put the identities and associated certificates in the keychain."), but that doesn't match the behavior we're seeing, + * either on the bots nor locally (if I lock the keychain before running the unit test on macOS, I get a dialog asking for + * my password to unlock the keychain when this method is called). Other people on StackOverflow has run into the same issue + * (https://stackoverflow.com/q/33181127), where one of the answers points to the source code (https://stackoverflow.com/a/66846609), + * confirming this behavior. + * + * StackOverflow also suggests using [`SecItemImport`](https://developer.apple.com/documentation/security/1395728-secitemimport) + * instead, which works, with a few caveats: + * + * 1. Importing a PKCS#12 blob only returns the certificate, not the private key. This is a bug, as [confirmed](https://forums.developer.apple.com/forums/thread/31711) by Quinn "The Eskimo!": + * + * > `SecItemImport` really does support importing private keys without putting them in the keychain, + * > and that code all runs and works in the PKCS#12 case; internally I see both the certificate and + * > the private key extracted from the PKCS#12. The problem arises when the code tries to match up + * > the certificate and private key to form an identity. That code is failing in the no-keychain case, + * > so you end up getting back just the certificate. Notably, in the PEM case no matching occurs and + * > thus you get back both the certificate and the private key. + * > + * > This is clearly a bug and I’ve filed it as such (r. 25,140,029). + * + * That was 8 years ago, and 6 years later it still hasn't been fixed (as confirmed by Quinn in the same thread), so it's unlikely it'll ever be fixed. + * + * 2. So I tried exporting the X509Certificate into a PEM string instead, and that works, I successfully + * get back a `SecKey` instance and a `SecCertificate` instance! Success? + * + * 3. Nope, because there's no way to create a `SecIdentity` from `SecKey`+`SecCertificate`. You have to put + * the `SecKey` into a keychain, and then pass the `SecCertificate` to [`SecIdentityCreateWithCertificate`](https://developer.apple.com/documentation/security/1401160-secidentitycreatewithcertificate?language=objc), + * and we're back to where we started. + * + * 4. OK, what about creating a temporary `SecKeychain`, add the `SecKey` there, create the `SecIdentity`, then delete the `SecKeychain`? + * + * * [`SecKeyChain`](https://developer.apple.com/documentation/security/1401214-seckeychaincreate) was deprecated in macOS 10.10 :/ + * * curl had the same problem: + * * https://github.com/curl/curl/issues/10038 + * * https://github.com/curl/curl/issues/5403) + * + * There was PR to use a temporary keychain (https://github.com/curl/curl/pull/10059), with a number of good reasons why it was a bad idea, so it was eventually rejected: + * + * * The temporary keychain is stored on disk, which isn't particularly fast. + * * The ownership/rights of the file must be considered to ensure there are no security issues. + * * Concurrency would have to be considered with regards to cleanup - what if there are multiple threads trying to use the same location on disk. + * + * + * In [this Apple forum thread](https://forums.developer.apple.com/forums/thread/31711) a user gripes about this exact problem: + * + * > I've resorted to using a private API to created a SecIdentity from a SecCertificate and a SecKey that I already have in memory. + * + * Quinn answers: + * + * > On the macOS front, there’s nothing stopping a command-line tool running on a CI machine using the keychain. + * There are some pain points but no showstoppers. + * + * FWIW Quinn “The Eskimo!” wrote a document explaining how to find and fix problems with regards to the keychain on CI machines + * (https://developer.apple.com/forums/thread/712005). The last sentence is a gem: "Resetting trust settings is more of a challenge. + * It’s probably possible to do this with the security tool but, honestly, if you think that your CI system has messed up trust settings + * it’s easiest to throw it away and start again from scratch." - in other words if something goes wrong, the easiest is to wipe the + * machine and start over again. + * + * "some pain points" is somewhat of an understatement... + * + * The good news is that on macOS 15+, Apple added an option to use a temporary, in-memory only keychain, avoiding the whole problem, + * so let's use that! + */ + if (OperatingSystem.IsMacOSVersionAtLeast (15, 0)) + options.Add (SecImportExport.ToMemoryOnly, NSNumber.FromBoolean (true)); +#endif SecStatusCode result = SecImportExport.ImportPkcs12 (data, options, out array); if (result != SecStatusCode.Success) throw new InvalidOperationException (result.ToString ()); diff --git a/src/foundation.cs b/src/foundation.cs index 93ecc3f89fa0..e0966fa0714d 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -2776,8 +2776,10 @@ interface NSFormatter : NSCoding, NSCopying { bool IsPartialStringValid (ref string partialString, out NSRange proposedSelRange, string origString, NSRange origSelRange, [NullAllowed] out string error); } +#if !XAMCORE_5_0 [BaseType (typeof (NSObject))] [Model] +#endif [Protocol] interface NSCoding { // [Abstract] @@ -2794,8 +2796,10 @@ interface NSSecureCoding : NSCoding { // note: +supportsSecureCoding being static it is not a good "generated" binding candidate } +#if !XAMCORE_5_0 [BaseType (typeof (NSObject))] [Model] +#endif [Protocol] interface NSCopying { [Abstract] @@ -2804,8 +2808,10 @@ interface NSCopying { NSObject Copy ([NullAllowed] NSZone zone); } +#if !XAMCORE_5_0 [BaseType (typeof (NSObject))] [Model] +#endif [Protocol] interface NSMutableCopying : NSCopying { [Abstract] diff --git a/src/passkit.cs b/src/passkit.cs index 91857ff5a6c2..5fc29b480d05 100644 --- a/src/passkit.cs +++ b/src/passkit.cs @@ -2739,10 +2739,10 @@ interface PKShareablePassMetadataPreview // : NSCoding, NSCopying, NSSecureCodin PKShareablePassMetadataPreview PreviewWithTemplateIdentifier (string templateIdentifier); [NullAllowed, Export ("passThumbnailImage", ArgumentSemantic.Assign)] - new CGImage PassThumbnailImage { get; } + CGImage PassThumbnailImage { get; } [NullAllowed, Export ("localizedDescription", ArgumentSemantic.Strong)] - new string LocalizedDescription { get; } + string LocalizedDescription { get; } [NullAllowed, Export ("ownerDisplayName", ArgumentSemantic.Strong)] string OwnerDisplayName { get; set; } diff --git a/src/uikit.cs b/src/uikit.cs index 99ce4fdac069..f3587f754824 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -24485,8 +24485,6 @@ interface UIFontPickerViewControllerConfiguration : NSCopying { [Export ("displayUsingSystemFont")] bool DisplayUsingSystemFont { get; set; } - [Deprecated (PlatformName.iOS, 18, 0, message: "Use the 'LanguageFilter' property instead.")] - [Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use the 'LanguageFilter' property instead.")] [Export ("filteredTraits", ArgumentSemantic.Assign)] UIFontDescriptorSymbolicTraits FilteredTraits { get; set; } diff --git a/tests/Makefile b/tests/Makefile index 09d0d0efb559..b242791bc3ff 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -63,7 +63,6 @@ test.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.De @echo "INCLUDE_DEVICE=$(INCLUDE_DEVICE)" >> $@ @echo "XCODE_DEVELOPER_ROOT=$(XCODE_DEVELOPER_ROOT)" >> $@ @echo "MONO_IOS_SDK_DESTDIR=$(MONO_IOS_SDK_DESTDIR)" >> $@ - @echo "MONO_MAC_SDK_DESTDIR=$(MONO_MAC_SDK_DESTDIR)" >> $@ @echo "DOTNET=$(DOTNET)" >> $@ @echo "IOS_SDK_VERSION=$(IOS_SDK_VERSION)" >> $@ @echo "TVOS_SDK_VERSION=$(TVOS_SDK_VERSION)" >> $@ @@ -98,7 +97,6 @@ test-system.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Ver @echo "JENKINS_RESULTS_DIRECTORY=$(abspath $(JENKINS_RESULTS_DIRECTORY))" >> $@ @echo "INCLUDE_DEVICE=$(INCLUDE_DEVICE)" >> $@ @echo "MONO_IOS_SDK_DESTDIR=$(MONO_IOS_SDK_DESTDIR)" >> $@ - @echo "MONO_MAC_SDK_DESTDIR=$(MONO_MAC_SDK_DESTDIR)" >> $@ @echo "DOTNET=$(DOTNET)" >> $@ @echo "IOS_SDK_VERSION=$(IOS_SDK_VERSION)" >> $@ @echo "TVOS_SDK_VERSION=$(TVOS_SDK_VERSION)" >> $@ diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt index 9ad4d29db89a..56aca8bf163d 100644 --- a/tests/cecil-tests/Documentation.KnownFailures.txt +++ b/tests/cecil-tests/Documentation.KnownFailures.txt @@ -47220,7 +47220,6 @@ M:Security.SecCertificate.ToX509Certificate M:Security.SecCertificate.ToX509Certificate2 M:Security.SecCertificate2.#ctor(Security.SecCertificate) M:Security.SecIdentity.GetTypeID -M:Security.SecIdentity.Import(System.Byte[],System.String) M:Security.SecIdentity.Import(System.Security.Cryptography.X509Certificates.X509Certificate2) M:Security.SecIdentity2.#ctor(Security.SecIdentity,Security.SecCertificate[]) M:Security.SecIdentity2.#ctor(Security.SecIdentity) diff --git a/tests/generator/BGenTests.cs b/tests/generator/BGenTests.cs index 772cfe351a37..f13ef8f40a4c 100644 --- a/tests/generator/BGenTests.cs +++ b/tests/generator/BGenTests.cs @@ -408,6 +408,7 @@ public void Bug35176 () [TestCase (Profile.iOS)] public void INativeObjectsInBlocks (Profile profile) { + Configuration.IgnoreIfIgnoredPlatform (profile.AsPlatform ()); var bgen = new BGenTool (); bgen.Profile = profile; bgen.Defines = BGenTool.GetDefaultDefines (bgen.Profile); diff --git a/tests/monotouch-test/System.Net.Http/MessageHandlers.cs b/tests/monotouch-test/System.Net.Http/MessageHandlers.cs index bdf402f4ac8e..487ab0db12d0 100644 --- a/tests/monotouch-test/System.Net.Http/MessageHandlers.cs +++ b/tests/monotouch-test/System.Net.Http/MessageHandlers.cs @@ -673,6 +673,41 @@ public void RejectSslCertificatesWithCustomValidationCallbackNSUrlSessionHandler Assert.IsNull (ex2, "Callback asserts"); } } + + [Test] + public void TestNSUrlSessionHandlerSendClientCertificate () + { + string certificate_base64 = "MIITeQIBAzCCEzUGCSqGSIb3DQEHAaCCEyYEghMiMIITHjCCA2cGCSqGSIb3DQEHAaCCA1gEggNUMIIDUDCCA0wGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAgR6LmAi6bpbAICB9AEggKQ0R2ocTYCEFyVeS1lvN/Bt+NwhIO/bNgwCAgvidrk0AP4YIGxU71NSsEi6AJ1Leop8H0Lfo8PuKditMqmM2D59yylhGdxmApvriZDzUEubkoQFiU3G71IzG4tJRkdJWtTGwbbfNrATfPhDG3FVtX+kHq/MvKWalYcmIpUTBm0bfG+UxkG8swiY6MBMCqFcHXHqcSKOVJBklxqNptg0XZBnXXjIACNXv2RUlexYPbNZDlT6F8Z6+Tk9yubeHz5PpX4GdHkPvAcz6dI8OcmBzTqm8YDm6dVe+YyjAFJcYodns8zVQgt5pe2zWMKnCJNgxt3hsfpBPHvLZ0ATg6CXddKxKV2zfynzs0U2OLmzKo6MChxrgupebslVZIV13H65keQWHjnl7up/GJQ8w9RioAI9aErNc5SbjEDK1bv5aQSHh453HM5oM6AIyTN236Ul7o32Ln42Cb5AcUnCJNbTKWw1NdgqfszsEQtAIRE1a6xblwyGHxwOPKRYN0aLU2x+emmwDXPW87UUofF3rqxh0Oq+Q53IB/qZ0hbo7vOkM6kGAxEfuWIrBnIVWOLlVLUeTPSdgNRF02cNJPczpcIs+/kvjmLpkBRv1K3wdykTS0O1abPsRbdpBmV+pk3PCVPPz6/DwBJ8RWainZM/p+cxWxUid0PTpJBWMmxtiYDDLSSSJ9q0Kncrz4UHbTUghstijhBELawtSL2Kp3AwTFaKnOn8l+WxTDi9wD5hoKag5uUSuZ1i43Roeklf5HBYIeKJV4pnBhCTrmYPt5t0cX01UU91aVqyH2x76CAbj2/8QqWI/uqC681L1CrXbFqsRcRRYYNIeKrILRciGW0g5CmYFfeOhq+ReplN272qW/jYoXCMowxgYIwEwYJKoZIhvcNAQkVMQYEBAEAAAAwawYJKwYBBAGCNxEBMV4eXABNAGkAYwByAG8AcwBvAGYAdAAgAEUAbgBoAGEAbgBjAGUAZAAgAEMAcgB5AHAAdABvAGcAcgBhAHAAaABpAGMAIABQAHIAbwB2AGkAZABlAHIAIAB2ADEALgAwMIIPrwYJKoZIhvcNAQcGoIIPoDCCD5wCAQAwgg+VBgkqhkiG9w0BBwEwHAYKKoZIhvcNAQwBBjAOBAj/zEH9jIQU9gICB9CAgg9oCSxgEIc8+exU1Gdrz7X6X1I9A8mBy0o9wJYHTn0ENl3dHoC/NmuPnsS8BW6M4Mq1FrnCjRe1Xh63RMQ4KdDgYheFL6mcz1SWF23vmkiWfB7rSjhNt3g+ZD41tbmlBTO3a41TWB8CCGt4KJUJeGDWylElFOENAEFlyF5WHfX5rv0tibZPF4pzhcf6QOzKiZtLCa5A7mDa5lsx/y0e4gRmnv8wmhx8jXsHUa5XJ20dD7PoNEqAGsUibqTtl/zZOZpOsud4kYuBsX/k9ltQJZUZXHnmsON+uLo22xJDVYfhADfTEXMoXUUwT2sAVlErPhR9e1w5dwmmTh109QXSvXLtmQVRYbxXtiAPL0jPEoIp776/wnB2eMCoxR48NzJxy0/Y7zShNFaWvzlQ6M6YMfZn1oGE9n/k0wMy4k5cQplXaUryNiDqd0LwijjJpRenSRCDo2ezHGB0jWl9+iljVUjGBfiYtkVRpIMRyyoFsayoAzEo1I5KWqJj2XD+WfukkBfykEnPgP/b0ZKVtCH+/2A2s30vjcim42xPXXB/sFJ0zA2NlK/MjGr1RqDPSfvTpn+20guf5v2mMh6Kv198x5TPzEYAXcV6e6+omVTkMjBALIEAeJ8RJ32fBceN8FCez786hRFP019PF+eY1gwACAZOJVe6e/C2+GY6bAFOAiBpOuKeKrS95UGLYQiJ7AL/VIC9GzRMh9c+bk25jHP4gbIsfSmAWf6detohkrtsh/jSXzI6cNI044L2wzL+8xuxHDfkGQO5pZrepeDLqwbfuDUlerwXmol96tnxm334Yb6UxlXcc/Yo4GX5IeXemP/L3ypUrAHmd+Nl3YuTK1vadhoAMs4hJ6sqK53LY/HqilH8Ngq1vArUNfIfm2hCmA15Wmc0/bJ6T6ggn3Ni3WMvxfsfbediRz1upov8S8+YOGXmbm2TFZ76zECrMaoXiAbPiTp2yqoyecmIgkozr3NPr44hAg2YhkD6ttsQ3yHZPQF3bupdrs9pXgxpDtJ604bm8tnJSC6jiUYAjMuPC9CPnVBYz4BXyjrVC7U3EWoRDzs6zZNgMi200kLMGm4V+iqVGS/GWIa+JnIDHQSk+wsfQ66Eds+CY4thtBaql5JaARC3NrTYPXl3RW812Uez1slXHY4toOne4eZlqEQlnBfgHgRPq4mKoXD5kVf3tSXVJLAb0HENI6dommFXA4oGl71I/+AlOr1vhiCTV0svybo44absYK8YfxDXn/cffFDoegfMClEJmJn3M2/nQq3vJecguOD4eB7HlX1BTPXUTWmY5+NdJDOv2GRCzKY3oVE74wILUzRhQnezEB7XrSKv5Q3pmirQ5pBZbJO4geKWLX5S7gp3D69pFxBqj/ApjfONbekmwwg0xdloVP/QU72wIPeCf7ga0EyLwsdzsqWf3W3fcpigUrNIbgP+ylqpCUed3H/tlyGSeSiI9JxA85EBQMW+Jk09B76/MnURevUagMn2bHAoosMVVBTPk5mXJoofCqkFnMOqfIu++IAYfj0bqJeMuwRuQyiaAgyuEbJRQOIkfBWjLPcMeqGGy7aLJYzyOX0pcfFjL268SEZETeRFZzuULx8RDH1Ya2co7KWwpi13aWvyXiHtkZYiblvaWoDszHhb7t6Rfrxv/cL3Ek/o9xmwqTfjXppyC7ntctISE+aPBY2A6fjXFiYls1zsSGO9R7wtjYDpuQSIEb3Yy7cKshWWLNnEDVauULcANjCuJjQcbiQ7PRLVkz9z948VsBTFscNrbJ9BCnfKmXkxyL1cy5TDMvZyPVOkzMYwv8nelu+n/bZvpRn5Z9ai2xtImLsYjeuYpB/6eQeudgHd4jDiQXeaD99VH7hNgKruPZefBRDNAm1K4u0u+3RoQYzNs70qKc18fcZBm0Y3QSME1dotwXjAtGacqDMLlxOoEuZS6BITXYB+NhFn8qaBTO8qipWR7+LBghalF0c7nDvyt1HkeESJPaMPfc1CItGlXVcMG29qma0fkhO6j4TAsUpt7Wom6v+Pid9zPutEEX3w/TVxhrpKFb1cZp9g1tTDQCgyLU3fA1MCExq2/QhoOATMkMF5EYLxrjKB7mndu8wSuB5glC/QgihrFr4n3BHjuw8YwoHgLzumbkjF/Y6Oo7cxvbEqSj8tnh+DPdIENyADUy4bsRKYvfUJLylZ/EOea9LcbDfj53XcvoIbnLsC6V2EwV5zbOov3a1j9c1HEVtK1VInwqAohs0nAFQOv9W/GNxflMWHSXL9VCT+YrMFALGodSHqN5jRGXAiCyvn78kV/LemuJYvCaugBYYeg5gT7aPln3DR+cJ3tzko3/yEobew94qLABFk6wgk8lEIhcomn9y7LDrpG96RqLvGSCmaPrYm5vQjbM554UyANJhWK61gKPW2GRJfgJJaLTsaVnkHldBPQXADqOnlMyC4nToxCbGbsXs0zJcA2hOPq7WZfsNNCkSiZVMVPbz/j2obVDKxUFj3rYfGs3U3eWyVNp2tU75VQ9htlAiS+TmDFTtAMdT6sl2rAsEJGswdriEYq9JtGUNc1PGgK94YliNsF0dDvKajP7VCnmJ+s/2fUT6B970gW4Gq5ifGnPInsENyL6BRQTk0fSAsm3tOVWEvwnFk87Xyh/KcRDeT4i9u1tLzU+2CqfM+26j18bKVjx1qOUOpYU50Ef28pZeWXNCKgEIwcIG6xaBwtGflLVuRylj5hsWjNQIja1uubbYTsaQI0Wsp01YPHpSthAz6k+g0EpN6EVq/aDIlONqAgvAZLRnqqkHJKZcp1IepQE7Ntjlt2hU0hB6uHniE+kNXTiE65lYRbZ73WRqnveK0RzPf4nqlmUnl3A7gD99CEwp0jd0PsAU8GlWYaYPIuc6sAjytft/6HCDTxDfA7w/Jho2EVITYvmU46q2mNl1Iundu4jntBFZnsQHjeY/lPh1LmirLvmrx5ciKP7A61hZAQBPiSew0RY86fJNj53chURGf4Fi9CTm6t2Si5UWwsv2qZQt+hJyN1AM5IrLK5G0EYcBKLIdlfLTA/7oj3tadCXEJ7Iv9wlu2RBf+6zKELePv7yv0pH8IufzRkHvImcqdpgT1Ey+0IMjRQtEy5+e1pL0O9KVtnpsKzYjw6GLT+PBECVSHn/46p6qQVzxr/cbWR0xgasoc2UwcNAQ0ndg6Y5t4avzeoXeYYMBUAOBHlwj0qaDdUUKaPzX71fubaM7MHVhfPjW3u/xGnz6u64AgpvDI5NGASj6zLrOQnoCwpBVxsjkx4WTg4dDQU3n5/Tv1GvBNK+eL24S9eH1BnoViYpfLNfz7btZAQurS68F7tlZ3oaM6XEit0oAjf7JFHQ77OjwyNUIix6t3o8kvekW1+xAJJpjYhyWGSjaF+90Nx0FCT8zYoAuSjzY4FQiSyqtTXMKBPRMCZhW5mXf3uCQOkUrKD/LcsaknS6H1XfDSTM0rq3dByeqLHs3pdHfEX4jwNP33MCNQKUSu4f83AmDFdpkoJsSy5c6ZJITjuFFw/MrDQT3A/28JNZMhnmN/aZqYvSno7kVQwSjKGCaA/aOxC8B2JXNO6KgnS0OxcPw67JqljNknCdOI4WarSt/VpIdtxHwX3lH91Coyr2clFbaoHnq+z+dIkSsyGv0Mv0iAKY3XlAOQCkACtbQ2Iw625JGS30n64Pa2Drp1pUWSWHwUGtOzGRKQBjZ+lTKGHCiT56LQ0oMt9Dd8MYRcsCodAgKCw9K393Ih9x/qf/CpiP7xXEsvZjcVnuxXUtin9KuXERdmapdzcOdUpOsNxS1uiQHcYPzYe1tu+aka+Nmk4R4v/atV/BGvbutbNlV/yJRaHikbf/iTG+Sle45o8EudSpoC/GGukT8uLdvuQsBl9NMPVog01bsV/a9pHxl+9sJa6H2OloxtFTUQk6rEgTqOexkfd+axkUb4OaQ+L0Dei+KOsiwCclRbrfO9OW04O42oOIFHEAs0eZndxBJasKoRWbxndr0r9RU0wbQFItQUZvQUveMzImlzutHm1XY50wrZS+ofapjAR/HOEpTwBnt3F3jVnnxyLHPC/xAOE2AyBqaUvw7QcwO+BlXcmEyimJP9CgiLEitnqr3IA+c+VynoaLHKJvXQXIGNmDLHD1mS59FeFPl3XGrSSQfPLyEc+HFnhh+U3Pnj02XLYAszbZOtRLi4nKJOWcH3gSyE2+PuV6U27Q1L+Uj3Zi5by7s4jHIkPPzrcghS1aSlLwGMLAh+TbQ0EP6aujqO9ze26P/bGrmDLr9gbtXkvWKoa7yuEVxnaC7eqT54RdDWliwUa0Efd4RUWFHS8ye+x+Q0TWjxN82iF6Pw/zt1KjTDtTOcecuOGsaQwDjoXW/BM3kJAZjTVVOU16IVmiO9Xu8G6wvMcpuym1vpEdAtp4/aVvA15QjHIhOa1vJabIS+0OmIkzcBZLAzorUrxA2b9RY6+WUKtV6rsjNwSSp9OofhfBG00Hpylic/Mwacg1/SCLqPmJo8+GWQVOLMz7DJg1MdxlkPJ8Sh0sOngP6UX35Su5/9LjJGQOPjSFQaYgzWJgW72yhK+XxiGgDV0dLDHWvWEUkTe4oCULxCZBepJEWlJXTpmfuRAsFmcZFKFULpLd5UGyoEVxEq+TbahHB8rf6kO/7a5fWIWZCGQEIJSAhuV//RuGfCQdQBl8sNStWLtps3JHcuAHlAahJyhYqqYgZo9paVUQJjnz6Vz/xjfq+KtU8LWyExqykkONBuFfOCY1Le3GU9paSqziu5cGGkmPO2eJojEEcbMvkaa3qZRN27cDFSWzrjhyFNyFocd0npFo9BJyaA0LPDMdYRdfI7Yj7sQPmEw1yDEmgDZoDeCCHl3uW7JQxphHddSbevlAVzcdty+B0rApX8alG80AppdknUNG/dWawN+vIb/MlCwjxhNP+6Krq8FB/3ALUsWyZJa/P0JmWltxusfwwZhwvZhziQI5xXjN3Y4IobCkKTEvsk8VGhHk0YA1mn+gQ+gVVFP2cmXLKBKxyYwUTnZ1z8hkE7QONURa53ECJ9E9wLVVDIcBCzY8SS2jFvtA05KFcL9xv0djjxQBVJNpsSVdsIDl36GOpma57L5cl2jAaz/xJdDpS5i7JLT9ROdwt417M24CFP1y53wdC+nzE+3NFHlX40Y8YudTwQu5hYTIWHGq6p0fOX/p8aY5reMdQOqzkbA7WIuLAxvKxsg3xhsG5LdFBSR00zUxCGUZw57dYxDzB561rIMomm7cuj3JfjboNxNPcwOzAfMAcGBSsOAwIaBBRyVmOEQyn4v23spYc93YyWqoyl1AQU3x2QzRiz+8ciJrPGbsLLGrNR1NICAgfQ"; + // make the cert exportable so that the tests pass: ref: https://github.com/dotnet/runtime/issues/21581 + +#if __MACOS__ + // The test requires access to the default system keychain on macOS 14 or earlier, which is really + // annoying on bots (a password dialog will pop up, blocking the tests). So just not run this test + // on anything earlier than macOS 15.0, + TestRuntime.AssertXcodeVersion (16, 0); + var storageFlags = X509KeyStorageFlags.Exportable; +#else + var storageFlags = X509KeyStorageFlags.DefaultKeySet; +#endif + + X509Certificate2 certificate = X509CertificateLoader.LoadPkcs12 (global::System.Convert.FromBase64String (certificate_base64), "test", storageFlags); + string content = ""; + var done = TestRuntime.TryRunAsync (TimeSpan.FromSeconds (30), async () => { + using var handler = new NSUrlSessionHandler (); + handler.ClientCertificates.Add (certificate); + using var client = new HttpClient (handler); + var response = await client.GetAsync (NetworkResources.EchoClientCertificateUrl); + content = await response.EnsureSuccessStatusCode ().Content.ReadAsStringAsync (); + }, out var ex); + if (!done) { // timeouts happen in the bots due to dns issues, connection issues etc.. we do not want to fail + Assert.Inconclusive ("Request timedout."); + } else { + Assert.IsNull (ex, "Exception wasn't expected."); + X509Certificate2 certificate2 = X509CertificateLoader.LoadCertificate (global::System.Convert.FromBase64String (content)); + Assert.AreEqual (certificate.Thumbprint, certificate2.Thumbprint); + } + } + #endif [Test] diff --git a/tests/monotouch-test/System.Net.Http/NetworkResources.cs b/tests/monotouch-test/System.Net.Http/NetworkResources.cs index b4a53e376182..e0483022c32f 100644 --- a/tests/monotouch-test/System.Net.Http/NetworkResources.cs +++ b/tests/monotouch-test/System.Net.Http/NetworkResources.cs @@ -19,6 +19,7 @@ public static class NetworkResources { public static string XamarinHttpUrl => AssertNetworkConnection ("http://dotnet.microsoft.com/apps/xamarin"); public static Uri XamarinUri => new Uri (XamarinUrl); public static string StatsUrl => AssertNetworkConnection ("https://api.imgur.com/2/stats"); + public static string EchoClientCertificateUrl = "https://corefx-net-tls.azurewebsites.net/EchoClientCertificate.ashx"; public static string [] HttpsUrls => new [] { MicrosoftUrl, diff --git a/tests/sampletester/.gitignore b/tests/sampletester/.gitignore deleted file mode 100644 index 8e972cb58de2..000000000000 --- a/tests/sampletester/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -TestResult*.html -TestResult*.xml -.failed-stamp diff --git a/tests/sampletester/BaseTester.cs b/tests/sampletester/BaseTester.cs deleted file mode 100644 index 6a5d579f8b3a..000000000000 --- a/tests/sampletester/BaseTester.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.Reflection; - -using NUnit.Framework; - -namespace Xamarin.Tests { - [TestFixture] - [Parallelizable (ParallelScope.Self)] - public abstract class BaseTester { - string repository; - public virtual string Repository { - get { - if (repository is null) - repository = (string) GetType ().GetField ("REPO", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static).GetValue (null); - return repository; - } - protected set { - repository = value; - } - } - - string hash; - public virtual string Hash { - get { - if (hash is null) - hash = (string) GetType ().GetField ("HASH", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static).GetValue (null); - return hash; - } - protected set { - hash = value; - } - } - - string org; - public virtual string Org { - get { - if (org is null) - org = (string) GetType ().GetField ("ORG", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static)?.GetValue (null) ?? "xamarin"; - return org; - } - protected set { - org = value; - } - } - - string default_branch; - public virtual string DefaultBranch { - get { - if (default_branch is null) - default_branch = (string) GetType ().GetField ("DEFAULT_BRANCH", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static)?.GetValue (null); - return default_branch; - - } - set { - default_branch = value; - } - } - - protected BaseTester () - { - } - - protected BaseTester (string repository, string hash) - { - this.repository = repository; - this.hash = hash; - } - } -} diff --git a/tests/sampletester/BaselineTest/AppDelegate.cs b/tests/sampletester/BaselineTest/AppDelegate.cs deleted file mode 100644 index 3acc74202cd8..000000000000 --- a/tests/sampletester/BaselineTest/AppDelegate.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Foundation; -using UIKit; - -namespace BaselineTest { - [Register ("AppDelegate")] - public class AppDelegate : UIResponder, IUIApplicationDelegate { - UIWindow window; - UIViewController vc; - - [Export ("application:didFinishLaunchingWithOptions:")] - public bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) - { - window = new UIWindow (UIScreen.MainScreen.Bounds); - vc = new UIViewController (); - vc.View.BackgroundColor = UIColor.Green; - window.RootViewController = vc; - window.MakeKeyAndVisible (); - - return true; - } - - static void Main (string [] args) - { - UIApplication.Main (args, null, typeof (AppDelegate)); - } - } -} diff --git a/tests/sampletester/BaselineTest/BaselineTest.csproj b/tests/sampletester/BaselineTest/BaselineTest.csproj deleted file mode 100644 index 2625d2f87735..000000000000 --- a/tests/sampletester/BaselineTest/BaselineTest.csproj +++ /dev/null @@ -1,73 +0,0 @@ - - - - Debug - iPhoneSimulator - {E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F} - {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {edc1b0fa-90cd-4038-8fad-98fe74adb368} - Exe - BaselineTest - BaselineTest - Resources - true - NSUrlSessionHandler - PackageReference - latest - - - true - full - false - bin\iPhoneSimulator\Debug - DEBUG - prompt - 4 - x86_64 - None - true - - - none - true - bin\iPhoneSimulator\Release - prompt - 4 - None - x86_64 - - - true - full - false - bin\iPhone\Debug - DEBUG - prompt - 4 - ARM64 - iPhone Developer - true - - - none - true - bin\iPhone\Release - prompt - 4 - ARM64 - iPhone Developer - - - - - - - - - - - - - - - diff --git a/tests/sampletester/BaselineTest/BaselineTest.sln b/tests/sampletester/BaselineTest/BaselineTest.sln deleted file mode 100644 index b2b66729db02..000000000000 --- a/tests/sampletester/BaselineTest/BaselineTest.sln +++ /dev/null @@ -1,23 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaselineTest", "BaselineTest.csproj", "{E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|iPhoneSimulator = Debug|iPhoneSimulator - Release|iPhoneSimulator = Release|iPhoneSimulator - Debug|iPhone = Debug|iPhone - Release|iPhone = Release|iPhone - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Debug|iPhone.ActiveCfg = Debug|iPhone - {E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Debug|iPhone.Build.0 = Debug|iPhone - {E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Release|iPhone.ActiveCfg = Release|iPhone - {E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Release|iPhone.Build.0 = Release|iPhone - EndGlobalSection -EndGlobal diff --git a/tests/sampletester/BaselineTest/Info.plist b/tests/sampletester/BaselineTest/Info.plist deleted file mode 100644 index beb4ca8a76ea..000000000000 --- a/tests/sampletester/BaselineTest/Info.plist +++ /dev/null @@ -1,48 +0,0 @@ - - - - - CFBundleDisplayName - BaselineTest - CFBundleIdentifier - com.xamarin.BaselineTest - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - MinimumOSVersion - 12.2 - UIDeviceFamily - - 1 - 2 - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile~ipad - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - XSAppIconAssets - Assets.xcassets/AppIcon.appiconset - CFBundleName - BaselineTest - - diff --git a/tests/sampletester/BaselineTest/LaunchScreen.storyboard b/tests/sampletester/BaselineTest/LaunchScreen.storyboard deleted file mode 100644 index f18534b49b24..000000000000 --- a/tests/sampletester/BaselineTest/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/sampletester/Configuration.cs b/tests/sampletester/Configuration.cs deleted file mode 100644 index 696a337a87e5..000000000000 --- a/tests/sampletester/Configuration.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.IO; -using System.Reflection; - -namespace Xamarin.Tests { - public partial class Configuration { - static object lock_obj = new object (); - static string sample_root_directory; - public static string SampleRootDirectory { - get { - lock (lock_obj) { - if (sample_root_directory is null) { - sample_root_directory = Path.Combine (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "repositories"); - Directory.CreateDirectory (sample_root_directory); - CreateNugetConfig (sample_root_directory); - CreateGlobalConfig (sample_root_directory); - } - } - return sample_root_directory; - } - } - - static void CreateNugetConfig (string root) - { - var nuget_conf = Path.Combine (root, "NuGet.config"); - // We're cloning into a subdirectory of xamarin-macios, which already has a NuGet.config - // So create a Nuget.config that clears out any previous configuration and adds nuget.org as - // single nuget source so that none of the sample tests pick up xamarin-macios' NuGet.config. - File.WriteAllText (nuget_conf, -@" - - - - - - - - - - - - -"); - } - - static void CreateGlobalConfig (string root) - { - var global_json = Path.Combine (root, "global.json"); - // Workaround for https://github.com/NuGet/Home/issues/7956 - // See also: - // * https://github.com/mono/mono/issues/13537 - // * https://github.com/xamarin/maccore/issues/1811 - // The version number here must match the version in tools/devops/build-samples.csx - File.WriteAllText (global_json, - @"{ -""sdk"": { - ""version"": ""2.2.204"" -} - } -"); - } - - static string tested_hash; - public static string TestedHash { - get { - lock (lock_obj) { - if (tested_hash is not null) - return tested_hash; - - tested_hash = GetCurrentHash (Environment.CurrentDirectory); - return tested_hash; - } - } - } - - public static string GetCurrentHash (string directory) - { - return ProcessHelper.RunProcess ("git", "log -1 --pretty=%H", directory).Trim (); - } - - public static string GetCurrentRemoteUrl (string directory) - { - return ProcessHelper.RunProcess ("git", "remote get-url origin", directory).Trim (); - } - - static string mono_version; - public static string MonoVersion { - get { - lock (lock_obj) { - if (mono_version is not null) - return mono_version; - - // We only care about the first line - mono_version = ProcessHelper.RunProcess ("mono", "--version").Split (new char [] { '\n' }, StringSplitOptions.RemoveEmptyEntries) [0].Trim (); - } - - return mono_version; - } - } - - static string sw_version; - public static string OSVersion { - get { - lock (lock_obj) { - if (sw_version is not null) - return sw_version; - - sw_version = ProcessHelper.RunProcess ("sw_vers").Replace ('\n', ';').Replace ((char) 9, ' '); - } - - return sw_version; - } - } - } -} diff --git a/tests/sampletester/GitHub.cs b/tests/sampletester/GitHub.cs deleted file mode 100644 index ff0f8dcb4b55..000000000000 --- a/tests/sampletester/GitHub.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -using NUnit.Framework; - -using Xamarin.Tests; - -public static class GitHub { - public static string [] GetProjects (string user, string repo, string hash, string default_branch) - { - IEnumerable files; - - var dir = CloneRepository (user, repo, hash, default_branch); - files = Directory.GetFiles (dir, "*.*", SearchOption.AllDirectories); - files = files.Select ((v) => v.Substring (dir.Length).TrimStart ('/')); - - return files - .Where ((v) => { - var ext = Path.GetExtension (v).ToLowerInvariant (); - return ext == ".csproj" || ext == ".fsproj"; - }).ToArray (); - } - - public static string CloneRepository (string org, string repo, string hash, string default_branch, bool clean = true) - { - var repo_dir = Path.Combine (Configuration.SampleRootDirectory, repo); - - if (!Directory.Exists (repo_dir)) { - Console.WriteLine ($"Cloning https://github.com/{org}/{repo} (hash: {hash})"); - Directory.CreateDirectory (repo_dir); - Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "init" }, working_directory: repo_dir, timeout: TimeSpan.FromSeconds (10)), "git init"); - Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "remote", "add", "origin", $"https://github.com/{org}/{repo}" }, working_directory: repo_dir, timeout: TimeSpan.FromSeconds (10)), "git remote add"); - Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "fetch" }, working_directory: repo_dir, timeout: TimeSpan.FromMinutes (10)), "git fetch"); - Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "checkout", "-b", "temporary-sample-testing-branch", hash }, working_directory: repo_dir, timeout: TimeSpan.FromMinutes (1)), "git checkout"); - Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "submodule", "update", "--init", "--recursive" }, working_directory: repo_dir, timeout: TimeSpan.FromMinutes (10)), "git submodule update"); - - ExecutionHelper.Execute ("git", new string [] { "log", "--oneline", "--pretty=* @%h %s", "HEAD", $"^origin/{default_branch}" }, out var output1, working_directory: repo_dir, timeout: TimeSpan.FromSeconds (10)); - if (output1.Length > 0) { - Console.WriteLine ($"Commits not in origin/{default_branch}:"); - Console.WriteLine (output1.ToString ().TrimEnd ('\n')); - } - ExecutionHelper.Execute ("git", new string [] { "log", "--oneline", "--pretty=* %h %s", $"origin/{default_branch}", "^HEAD" }, out var output2, working_directory: repo_dir, timeout: TimeSpan.FromSeconds (10)); - if (output2.Length > 0) { - Console.WriteLine ($"Commits in origin/{default_branch} not being tested:"); - Console.WriteLine (output2.ToString ().TrimEnd ('\n')); - } - - } else if (clean) { - Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "reset", "--hard", hash }, working_directory: repo_dir, timeout: TimeSpan.FromMinutes (1)), "git checkout"); - CleanRepository (repo_dir); - } - - return repo_dir; - } - - public static void CleanRepository (string directory, bool submodules = true) - { - ExecutionHelper.Execute ("git", new string [] { "clean", "-xffdq" }, working_directory: directory, timeout: TimeSpan.FromSeconds (30)); - if (submodules) - ExecutionHelper.Execute ("git", new string [] { "submodule", "foreach", "--recursive", "clean -xffdq" }, working_directory: directory, timeout: TimeSpan.FromSeconds (60)); - } -} diff --git a/tests/sampletester/HtmlReport.xslt b/tests/sampletester/HtmlReport.xslt deleted file mode 100644 index 671bfb1b34f8..000000000000 --- a/tests/sampletester/HtmlReport.xslt +++ /dev/null @@ -1,284 +0,0 @@ - - - - - <!DOCTYPE html> - - - Test results - - - - - - - - - - - -

Command Line

-
-      
-    
- - -

Runtime Environment

- - - - - - - - - - - - - - - - - -
OS Version: - -
CLR Version: - -
- -
NUnit Version: - -
- - -
-

Test Files

- -
    - -
  1. - -
  2. -
    -
-
-
- - - -
- Successes -
    - -
-
-
- - - -
- Tests Not Run -
    - -
-
-
- - - -
- Errors and Failures -
    - -
-
-
- - - - -

Run Settings

-
    -
  • - DefaultTimeout: -
  • -
  • - WorkDirectory: -
  • -
  • - ImageRuntimeVersion: -
  • -
  • - ImageTargetFrameworkName: -
  • -
  • - ImageRequiresX86: -
  • -
  • - ImageRequiresDefaultAppDomainAssemblyResolver: -
  • -
  • - NumberOfTestWorkers: -
  • -
- -

Test Run Summary

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  • - -
    -
    -        
    -
    -        
    -          
    -            
    -
    - -
    -
    - -
    -
    -
    - - - - - -
    - - -
      - -
    • -
      -
    -
    -
  • -
    -
    \ No newline at end of file diff --git a/tests/sampletester/Makefile b/tests/sampletester/Makefile deleted file mode 100644 index c22c841f43f4..000000000000 --- a/tests/sampletester/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -TOP=../.. - -include $(TOP)/Make.config - -all-local:: run-tests - -ifneq ($(TEST_CATEGORY),) -WHERE_CONDITION=/where "cat == $(TEST_CATEGORY)" -endif - -TEST_RESULT:=TestResult-$(shell date "+%Y%m%d-%H%M%S") - -build: bin/Debug/sampletester.dll - -run-tests: bin/Debug/sampletester.dll - $(Q) rm -f .failed-stamp - $(Q) $(TOP)/tools/nunit3-console-3.11.1 $(WHERE_CONDITION) $(abspath $(CURDIR)/bin/Debug/sampletester.dll) "--result=$(abspath $(CURDIR)/$(TEST_RESULT).xml)" $${TEST_FIXTURE:+"$$TEST_FIXTURE"} --labels=After --inprocess || touch $(CURDIR)/.failed-stamp - $(Q) xsltproc HtmlReport.xslt "$(TEST_RESULT).xml" > "$(TEST_RESULT).html" - $(Q) $(CP) "$(TEST_RESULT).html" index.html - @[[ ! -e .failed-stamp ]] - -run-tests-system: bin/Debug/sampletester.dll - $(MAKE) TESTS_USE_SYSTEM=1 - -bin/Debug/sampletester.dll: $(wildcard *.cs */*.cs *.csproj Makefile) - $(Q) $(SYSTEM_MONO) /Library/Frameworks//Mono.framework/Versions/Current/lib/mono/nuget/NuGet.exe restore - $(Q_BUILD) $(SYSTEM_MSBUILD) sampletester.csproj $(MSBUILD_VERBOSITY) diff --git a/tests/sampletester/ProcessHelper.cs b/tests/sampletester/ProcessHelper.cs deleted file mode 100644 index 216939afc415..000000000000 --- a/tests/sampletester/ProcessHelper.cs +++ /dev/null @@ -1,308 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Threading; -using System.Text; -using System.Text.RegularExpressions; -using System.Xml; - -using NUnit.Framework; - -using Xamarin; -using Xamarin.Tests; -using Xamarin.Utils; - -public static class ProcessHelper { - static int counter; - - static string log_directory; - static string LogDirectory { - get { - if (log_directory is null) - log_directory = Cache.CreateTemporaryDirectory ("execution-logs"); - return log_directory; - } - - } - - public static void AssertRunProcess (string filename, string [] arguments, TimeSpan timeout, string workingDirectory, Dictionary environment_variables, string message) - { - AssertRunProcess (filename, arguments, timeout, workingDirectory, environment_variables, message, out _); - } - - public static void AssertRunProcess (string filename, string [] arguments, TimeSpan timeout, string workingDirectory, Dictionary environment_variables, string message, out string logfile) - { - var exitCode = 0; - var output = new List (); - - Action output_callback = (v) => { - lock (output) - output.Add ($"{DateTime.Now.ToString ("HH:mm:ss.fffffff")}: {v}"); - }; - - if (environment_variables is null) - environment_variables = new Dictionary (); - environment_variables ["XCODE_DEVELOPER_DIR_PATH"] = null; - environment_variables ["DEVELOPER_DIR"] = Configuration.XcodeLocation; - - var watch = Stopwatch.StartNew (); - exitCode = ExecutionHelper.Execute (filename, arguments, out var timed_out, workingDirectory, environment_variables, output_callback, output_callback, timeout); - watch.Stop (); - - output_callback ($"Exit code: {exitCode} Timed out: {timed_out} Total duration: {watch.Elapsed.ToString ()}"); - - // Write execution log to disk (and print the path) - logfile = Path.Combine (LogDirectory, $"{filename}-{Interlocked.Increment (ref counter)}.log"); - File.WriteAllLines (logfile, output); - TestContext.AddTestAttachment (logfile, $"Execution log for {filename}"); - Console.WriteLine ("Execution log for {0}: {1}", filename, logfile); - - var errors = new List (); - var errorMessage = ""; - if ((!timed_out || exitCode != 0) && output.Count > 0) { - var regex = new Regex (@"error\s*(MSB....)?(CS....)?(MT....)?(MM....)?:", RegexOptions.IgnoreCase | RegexOptions.Singleline); - foreach (var line in output) { - if (regex.IsMatch (line) && !errors.Contains (line)) - errors.Add (line); - } - if (errors.Count > 0) - errorMessage = "\n\t[Summary of errors from the build output below]\n\t" + string.Join ("\n\t", errors); - } - Assert.IsFalse (timed_out, $"{message} timed out after {timeout.TotalMinutes} minutes{errorMessage}"); - Assert.AreEqual (0, exitCode, $"{message} failed (unexpected exit code){errorMessage}"); - } - - public static void BuildSolution (string solution, string platform, string configuration, Dictionary environment_variables, TimeSpan timeout, string target = "", string codesignKey = null) - { - // nuget restore - var solution_dir = string.Empty; - var solutions = new string [] { solution }; - var nuget_args = new List (); - nuget_args.Add ("restore"); - nuget_args.Add ("sln"); // replaced later - nuget_args.Add ("-Verbosity"); - nuget_args.Add ("detailed"); - var slndir = Path.GetDirectoryName (solution); - if (!solution.EndsWith (".sln", StringComparison.Ordinal)) { - while ((solutions = Directory.GetFiles (slndir, "*.sln", SearchOption.TopDirectoryOnly)).Length == 0 && slndir.Length > 1) - slndir = Path.GetDirectoryName (slndir); - nuget_args.Add ("-SolutionDir"); - nuget_args.Add (slndir); - } - - foreach (var sln in solutions) { - nuget_args [1] = sln; // replacing here - AssertRunProcess ("nuget", nuget_args.ToArray (), timeout, Configuration.SampleRootDirectory, environment_variables, "nuget restore"); - } - - // msbuild - var sb = new List (); - sb.Add ("/verbosity:diag"); - if (!string.IsNullOrEmpty (platform)) - sb.Add ($"/p:Platform={platform}"); - if (!string.IsNullOrEmpty (configuration)) - sb.Add ($"/p:Configuration={configuration}"); - sb.Add (solution); - if (!string.IsNullOrEmpty (target)) - sb.Add ($"/t:{target}"); - if (!string.IsNullOrEmpty (codesignKey)) - sb.Add ($"/p:CodesignKey={codesignKey}"); - - environment_variables ["MTOUCH_ENV_OPTIONS"] = "--time --time --time --time -vvvv"; - environment_variables ["MMP_ENV_OPTIONS"] = "--time --time --time --time -vvvv"; - - var watch = Stopwatch.StartNew (); - var failed = false; - string msbuild_logfile; - try { - AssertRunProcess ("msbuild", sb.ToArray (), timeout, Configuration.SampleRootDirectory, environment_variables, "build", out msbuild_logfile); - } catch { - failed = true; - throw; - } finally { - watch.Stop (); - } - - // Write performance data to disk - var subdirs = Directory.GetDirectories (slndir, "*", SearchOption.AllDirectories); - - // First figure out which .app subdirectory is the actual .app. This is a bit more complicated than it would seem... - var apps = subdirs.Where ((v) => { - var names = v.Substring (slndir.Length).Split (Path.DirectorySeparatorChar); - if (names.Length < 2) - return false; - - if (!names [names.Length - 1].EndsWith (".app", StringComparison.Ordinal)) - return false; - - if (names.Any ((v2) => v2 == "copySceneKitAssets")) - return false; - - var bin_idx = Array.IndexOf (names, "bin"); - var conf_idx = Array.IndexOf (names, configuration); - if (bin_idx < 0 || conf_idx < 0) - return false; - - if (bin_idx > conf_idx) - return false; - - if (platform.Length > 0) { - var platform_idx = Array.IndexOf (names, platform); - if (platform_idx < 0) - return false; - - if (bin_idx > platform_idx) - return false; - } - - return true; - }).ToArray (); - - if (apps.Length > 1) { - // Found more than one .app subdirectory, use additional logic to choose between them. - var filtered_apps = apps.Where ((v) => { - // If one .app is a subdirectory of another .app, we don't care about the former. - if (apps.Any ((v2) => v2.Length < v.Length && v.StartsWith (v2, StringComparison.Ordinal))) - return false; - - // If one .app is contained within another .app, we don't care about the former. - var vname = Path.GetFileName (v); - var otherApps = apps.Where ((v2) => v != v2); - if (otherApps.Any ((v2) => { - var otherSubdirs = subdirs.Where ((v3) => v3.StartsWith (v2, StringComparison.Ordinal)); - return otherSubdirs.Any ((v3) => Path.GetFileName (v3) == vname); - })) - return false; - - return true; - }).ToArray (); - if (apps.Length == 0) - Assert.Fail ($"Filtered away all the .apps, from:\n\t{string.Join ("\n\t", apps)}"); - apps = filtered_apps; - } - - if (apps.Length > 1) { - Assert.Fail ($"Found more than one .app directory:\n\t{string.Join ("\n\t", apps)}"); - } else if (apps.Length == 0) { - Assert.Fail ($"Found no .app directories for platform: {platform} configuration: {configuration} target: {target}. All directories:\n\t{string.Join ("\n\t", subdirs)}"); - } - - var logfile = Path.Combine (LogDirectory, $"{Path.GetFileNameWithoutExtension (solution)}-perfdata-{Interlocked.Increment (ref counter)}.xml"); - - var xmlSettings = new XmlWriterSettings { - Indent = true, - }; - var xml = XmlWriter.Create (logfile, xmlSettings); - xml.WriteStartDocument (true); - xml.WriteStartElement ("performance"); - xml.WriteStartElement ("sample-build"); - xml.WriteAttributeString ("mono-version", Configuration.MonoVersion); - xml.WriteAttributeString ("os-version", Configuration.OSVersion); - xml.WriteAttributeString ("xamarin-macios-hash", Configuration.TestedHash); - xml.WriteAttributeString ("sample-repository", Configuration.GetCurrentRemoteUrl (slndir)); - xml.WriteAttributeString ("sample-hash", Configuration.GetCurrentHash (slndir)); - xml.WriteAttributeString ("agent-machinename", Environment.GetEnvironmentVariable ("AGENT_MACHINENAME")); - xml.WriteAttributeString ("agent-name", Environment.GetEnvironmentVariable ("AGENT_NAME")); - foreach (var app in apps) { - xml.WriteStartElement ("test"); - xml.WriteAttributeString ("name", TestContext.CurrentContext.Test.FullName); - xml.WriteAttributeString ("result", failed ? "failed" : "success"); - if (platform.Length > 0) - xml.WriteAttributeString ("platform", platform); - xml.WriteAttributeString ("configuration", configuration); - if (!failed) { - xml.WriteAttributeString ("duration", watch.ElapsedTicks.ToString ()); - xml.WriteAttributeString ("duration-formatted", watch.Elapsed.ToString ()); - - var files = Directory.GetFiles (app, "*", SearchOption.AllDirectories).OrderBy ((v) => v).ToArray (); - var lengths = files.Select ((v) => new FileInfo (v).Length).ToArray (); - var total_size = lengths.Sum (); - - xml.WriteAttributeString ("total-size", total_size.ToString ()); - var appstart = Path.GetDirectoryName (app).Length; - for (var i = 0; i < files.Length; i++) { - xml.WriteStartElement ("file"); - xml.WriteAttributeString ("name", files [i].Substring (appstart + 1)); - xml.WriteAttributeString ("size", lengths [i].ToString ()); - xml.WriteEndElement (); - } - - if (File.Exists (msbuild_logfile)) { - var lines = File.ReadAllLines (msbuild_logfile); - var target_perf_summary = new List (); - var task_perf_summary = new List (); - var timestamps = new List (); - for (var i = lines.Length - 1; i >= 0; i--) { - if (lines [i].EndsWith ("Target Performance Summary:", StringComparison.Ordinal)) { - for (var k = i + 1; k < lines.Length && lines [k].EndsWith ("calls", StringComparison.Ordinal); k++) { - target_perf_summary.Add (lines [k].Substring (18).Trim ()); - } - } else if (lines [i].EndsWith ("Task Performance Summary:", StringComparison.Ordinal)) { - for (var k = i + 1; k < lines.Length && lines [k].EndsWith ("calls", StringComparison.Ordinal); k++) { - task_perf_summary.Add (lines [k].Substring (18).Trim ()); - } - } else if (lines [i].Contains ("!Timestamp")) { - timestamps.Add (lines [i]); - } - } - foreach (var tps in target_perf_summary) { - var split = tps.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - xml.WriteStartElement ("target"); - xml.WriteAttributeString ("name", split [2]); - xml.WriteAttributeString ("ms", split [0]); - xml.WriteAttributeString ("calls", split [3]); - xml.WriteEndElement (); - } - foreach (var tps in task_perf_summary) { - var split = tps.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - xml.WriteStartElement ("task"); - xml.WriteAttributeString ("name", split [2]); - xml.WriteAttributeString ("ms", split [0]); - xml.WriteAttributeString ("calls", split [3]); - xml.WriteEndElement (); - } - foreach (var ts in timestamps) { - // Sample line: - // 15:04:50.4609520: !Timestamp Setup: 28 ms (TaskId:137) - var splitFirst = ts.Split (new char [] { ':' }, StringSplitOptions.RemoveEmptyEntries); - var splitSecondA = splitFirst [3].Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - var splitSecondB = splitFirst [4].Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - var name = string.Join (" ", splitSecondA.Skip (1)); - var level = splitSecondA [0].Count ((v) => v == '!').ToString (); - var ms = splitSecondB [0]; - xml.WriteStartElement ("timestamp"); - xml.WriteAttributeString ("name", name); - xml.WriteAttributeString ("level", level); - xml.WriteAttributeString ("ms", ms); - xml.WriteEndElement (); - } - } - - xml.WriteEndElement (); - } - - xml.WriteEndElement (); // sample-build - xml.WriteEndElement (); // performance - xml.WriteEndDocument (); - xml.Dispose (); - - TestContext.AddTestAttachment (logfile, $"Performance data"); - } - } - - internal static string RunProcess (string filename, string arguments = "", string working_directory = null) - { - using (var p = Process.Start (filename, arguments)) { - p.StartInfo.RedirectStandardOutput = true; - p.StartInfo.UseShellExecute = false; - if (!string.IsNullOrEmpty (working_directory)) - p.StartInfo.WorkingDirectory = working_directory; - p.Start (); - var output = p.StandardOutput.ReadToEnd (); - p.WaitForExit (); - return output; - } - } -} diff --git a/tests/sampletester/Properties/AssemblyInfo.cs b/tests/sampletester/Properties/AssemblyInfo.cs deleted file mode 100644 index 56f844cb81ba..000000000000 --- a/tests/sampletester/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,4 +0,0 @@ -using NUnit.Framework; - -// Two tests at the same time is enough: mtouch already parallelizes things, so we don't want to overload the bots either. -[assembly: LevelOfParallelism (2)] diff --git a/tests/sampletester/README.md b/tests/sampletester/README.md deleted file mode 100644 index fa561e44abc4..000000000000 --- a/tests/sampletester/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Sample testing - -These unit tests clone a series of known repositories that contain sample -projects, and build all the relevant projects in those repositories. - -It is executed automatically in [Azure DevOps][1] every [Saturday][2] for the listed branches. This includes: - -* `main` -* `d16-x` - i.e. one or many active release branches -* `xcodeY` - i.e. the current xcode *beta* feature branch -* `mono-202z-zz` - i.e. the mono integration branches (new one every two months) - -where `x`, `Y` and `z` needs to be periodically updated as new branches are created (e.g. `d16-x`) and old ones are merged into `main` (e.g. `xcodeY` and `mono-202z-zz`). - -It can also be triggered manually, but have in mind that the commit in -question must already have packages (as GitHub statuses). - -It's also possible to use the sample tests from one commit, and then test with -Xamarin.iOS/Xamarin.Mac a completely different commit, by setting the -`PROVISION_FROM_COMMIT` variable to the commit that's to be tested: - -![screenshot](images/provision_from_commit.png) - -The previous point is still required: the commit to provision from must have -packages. - -There are two ways to run these tests locally: - -* Launching xharness in server mode and execute the "Sample tests" (they're - disabled by default). -* Executing `make` in this directory. - -[1]: https://dev.azure.com/xamarin/internal/_build?definitionId=23 -[2]: https://dev.azure.com/xamarin/internal/_apps/hub/ms.vss-ciworkflow.build-ci-hub?_a=edit-build-definition&id=23&view=Tab_Triggers diff --git a/tests/sampletester/SampleTester.cs b/tests/sampletester/SampleTester.cs deleted file mode 100644 index d180095ce0f3..000000000000 --- a/tests/sampletester/SampleTester.cs +++ /dev/null @@ -1,319 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.IO; -using System.Text.RegularExpressions; - -using NUnit.Framework; - -using Xamarin.Tests; - -namespace Samples { - public class SampleTest { - public ProjectInfo Project; - public string Solution; - public bool BuildSolution; - public string KnownFailure; - public string CodesignKey; - public string [] DebugConfigurations; - public string [] ReleaseConfigurations; - public string [] Platforms; - - // for various reasons (build'ability, compatibility, performance) it can be - // better to build a subset of a solution - // e.g. `nuget restore` requires removing the projects from the .sln - public string [] RemoveProjects; - } - - public class SampleTestData { - public SampleTest SampleTest; - public string Configuration; - public string Platform; - public TimeSpan Timeout; - - public override string ToString () - { - if (string.IsNullOrEmpty (Platform)) - return $"{SampleTest.Project.Title}: {Configuration}"; - return $"{SampleTest.Project.Title}: {Configuration}|{Platform}"; - } - } - - public class ProjectInfo { - public string Title; - public string RelativePath; - public string FullPath; - public bool IsExecutable; - public string [] Imports; - public TestPlatform Platform; - - public bool IsApplicable (bool assert) - { - if (!IsExecutable) { - if (assert) - Assert.Ignore ("Project is not an executable project"); - return false; - } - - if (Platform == TestPlatform.None) { - if (assert) - Assert.Ignore ("Project is not an Xamarin.iOS/Xamarin.Mac/Xamarin.WatchOS/Xamarin.TVOS project. Imports:\n\t{0}", string.Join ("\t\n", Imports)); - return false; - } - - if (Platform == TestPlatform.watchOS) { - if (assert) - Assert.Ignore ("Project is a watchOS app"); // no need to build watchOS apps, they're built as part of their containing iOS project. - - return false; - } - - return true; - } - } - - public abstract class SampleTester : BaseTester { - - public static TimeSpan DefaultTimeout { get; } = TimeSpan.FromMinutes (5); - - protected SampleTester () - { - } - - protected SampleTester (string repo, string hash) - : base (repo, hash) - { - } - - static ProjectInfo GetProjectInfo (string relative_path, string full_path) - { - var xml = File.ReadAllText (full_path); - var info = new ProjectInfo (); - info.FullPath = full_path; - info.RelativePath = relative_path; - info.IsExecutable = xml.Contains ("Exe"); - - var xml_lines = xml.Split ('\n'); - var xml_imports = xml_lines. - Where ((v) => v.Contains (" v.Contains ("Xamarin.iOS"))) { - test_platform = TestPlatform.iOS; - } else if (xml_imports.Any ((v) => v.Contains ("Xamarin.TVOS"))) { - test_platform = TestPlatform.tvOS; - } else if (xml_imports.Any ((v) => v.Contains ("Xamarin.WatchOS"))) { - test_platform = TestPlatform.watchOS; - } else if (xml_imports.Any ((v) => v.Contains ("Xamarin.Mac"))) { - test_platform = TestPlatform.macOS; - } else { - test_platform = TestPlatform.None; - } - info.Platform = test_platform; - - return info; - } - - public static Dictionary GetEnvironmentVariables (TestPlatform platform) - { - var environment_variables = new Dictionary (); - environment_variables ["MD_APPLE_SDK_ROOT"] = Path.GetDirectoryName (Path.GetDirectoryName (Configuration.XcodeLocation)); - switch (platform) { - case TestPlatform.iOS: - case TestPlatform.tvOS: - case TestPlatform.watchOS: - environment_variables ["MD_MTOUCH_SDK_ROOT"] = Path.Combine (Configuration.IOS_DESTDIR, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current"); - environment_variables ["TargetFrameworkFallbackSearchPaths"] = Path.Combine (Configuration.IOS_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild-frameworks"); - environment_variables ["MSBuildExtensionsPathFallbackPathsOverride"] = Path.Combine (Configuration.IOS_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild"); - break; - case TestPlatform.macOS: - environment_variables ["TargetFrameworkFallbackSearchPaths"] = Path.Combine (Configuration.MAC_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild-frameworks"); - environment_variables ["MSBuildExtensionsPathFallbackPathsOverride"] = Path.Combine (Configuration.MAC_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild"); - environment_variables ["XamarinMacFrameworkRoot"] = Path.Combine (Configuration.MAC_DESTDIR, "Library", "Frameworks", "Xamarin.Mac.framework", "Versions", "Current"); - environment_variables ["XAMMAC_FRAMEWORK_PATH"] = Path.Combine (Configuration.MAC_DESTDIR, "Library", "Frameworks", "Xamarin.Mac.framework", "Versions", "Current"); - break; - default: - throw new NotImplementedException (platform.ToString ()); - } - return environment_variables; - } - - [Test] - public void BuildSample ([ValueSource ("GetSampleData")] SampleTestData sampleTestData) - { - try { - var data = sampleTestData.SampleTest; - if (!string.IsNullOrEmpty (data.KnownFailure)) - Assert.Ignore (data.KnownFailure); - - switch (data.Project.Platform) { - case TestPlatform.iOS: - if (!Configuration.include_ios) - Assert.Ignore ("iOS support has been disabled."); - break; - case TestPlatform.tvOS: - if (!Configuration.include_tvos) - Assert.Ignore ("tvOS support has been disabled"); - break; - case TestPlatform.watchOS: - if (!Configuration.include_watchos) - Assert.Ignore ("watchOS support has been disabled"); - break; - case TestPlatform.macOS: - if (!Configuration.include_mac) - Assert.Ignore ("macOS support has been disabled"); - break; - default: - throw new NotImplementedException (sampleTestData.Platform.ToString ()); - } - - var file_to_build = sampleTestData.SampleTest.Project.RelativePath; - var target = string.Empty; - if (data.BuildSolution) { - file_to_build = data.Solution; - target = Path.GetFileNameWithoutExtension (data.Project.RelativePath).Replace ('.', '_'); - } - - var repo = CloneRepo (); - file_to_build = Path.Combine (repo, file_to_build); - - if (data.RemoveProjects is not null) { - if (String.IsNullOrEmpty (data.Solution)) - Assert.Fail ("'RemoveProjects' used without a 'Solution' path!"); - var sln_path = Path.Combine (repo, data.Solution); - var filtered_sln = new List (File.ReadAllLines (sln_path)); - foreach (var p in data.RemoveProjects) { - for (int i = 0; i < filtered_sln.Count; i++) { - var line = filtered_sln [i]; - if (line.StartsWith ("Project(", StringComparison.Ordinal)) { - if (line.Contains ($") = \"{p}\", \"")) { - filtered_sln.RemoveAt (i); - filtered_sln.RemoveAt (i); // EndProject (same `i` as things moved up) - break; - } - } - } - } - File.WriteAllLines (sln_path, filtered_sln); - } - - ProcessHelper.BuildSolution (file_to_build, sampleTestData.Platform, sampleTestData.Configuration, GetEnvironmentVariables (data.Project.Platform), sampleTestData.Timeout, target, data.CodesignKey); - Console.WriteLine ("✅ {0} succeeded.", TestContext.CurrentContext.Test.FullName); - } catch (Exception e) { - Console.WriteLine ("❌ {0} failed: {1}", TestContext.CurrentContext.Test.FullName, e.Message); - throw; - } - } - - static Dictionary projects = new Dictionary (); - protected static ProjectInfo [] GetExecutableProjects (string org, string repo, string hash, string default_branch) - { - if (!projects.TryGetValue (repo, out var rv)) { - var project_paths = GitHub.GetProjects (org, repo, hash, default_branch); - - // We can filter out project we don't care about. - rv = project_paths. - Select ((v) => GetProjectInfo (v, Path.Combine (GitHub.CloneRepository (org, repo, hash, default_branch, false), v))). - Where ((v) => v.IsApplicable (false)). - ToArray (); - - projects [repo] = rv; - } - return rv; - } - - protected static IEnumerable GetSampleTestData (Dictionary samples, string org, string repo, string hash, string default_branch, TimeSpan timeout) - { - var defaultDebugConfigurations = new string [] { "Debug" }; - var defaultReleaseConfigurations = new string [] { "Release" }; - - if (samples is null) { - samples = new Dictionary (); - } else { - samples = new Dictionary (samples); - } - - // If a project's filename is unique in this repo, use the filename (without extension) as the name of the test. - // Otherwise use the project's relative path. - var executable_projects = GetExecutableProjects (org, repo, hash, default_branch); - var duplicateProjects = executable_projects.GroupBy ((v) => Path.GetFileNameWithoutExtension (v.RelativePath)).Where ((v) => v.Count () > 1); - foreach (var group in duplicateProjects) { - foreach (var proj in group) { - proj.Title = proj.RelativePath; - } - } - foreach (var proj in executable_projects) { - if (proj.Title is null) { - proj.Title = Path.GetFileNameWithoutExtension (proj.RelativePath); - } - } - - var platform_filter = Environment.GetEnvironmentVariable ("TEST_PLATFORM_FILTER_EXPRESSION"); - var config_filter = Environment.GetEnvironmentVariable ("TEST_CONFIG_FILTER_EXPRESSION"); - var name_filter = Environment.GetEnvironmentVariable ("TEST_NAME_FILTER_EXPRESSION"); - - IEnumerable filter (string name, string proj, IEnumerable input, string filter_expression, Func tostring) - { - if (string.IsNullOrEmpty (filter_expression)) - return input; - - var filtered = input.Where ((v) => Regex.IsMatch (tostring (v), filter_expression)); - var removed = input.Where ((v) => !filtered.Contains (v)); - if (removed.Any ()) { - return filtered; - } - return input; - } - - // Create the test variations for each project. - foreach (var proj in filter ("name", "*", executable_projects, name_filter, (v) => Path.GetFileName (v.RelativePath))) { - if (!samples.TryGetValue (proj.RelativePath, out var sample)) - samples [proj.RelativePath] = sample = new SampleTest (); - sample.Project = proj; - IEnumerable platforms = sample.Platforms; - if (platforms is null) { - switch (proj.Platform) { - case TestPlatform.iOS: - case TestPlatform.tvOS: - platforms = new string [] { "iPhone", "iPhoneSimulator" }; - break; - case TestPlatform.macOS: - platforms = new string [] { "" }; - break; - case TestPlatform.watchOS: - default: - throw new NotImplementedException (proj.Platform.ToString ()); - } - } - - foreach (var platform in filter ("platform", proj.Title, platforms, platform_filter, (v) => v)) { - var configs = new List (); - configs.AddRange (sample.DebugConfigurations ?? defaultDebugConfigurations); - configs.AddRange (sample.ReleaseConfigurations ?? defaultReleaseConfigurations); - foreach (var config in filter ("config", proj.Title, configs, config_filter, (v) => v)) { - yield return new SampleTestData { SampleTest = sample, Configuration = config, Platform = platform, Timeout = timeout }; - } - } - } - } - - string CloneRepo () - { - return GitHub.CloneRepository (Org, Repository, Hash, DefaultBranch); - } - } - - [TestFixture] - public class BaselineTester { - [Test] - public void DeviceDebug () - { - var sln = Path.Combine (Configuration.SourceRoot, "tests", "sampletester", "BaselineTest", "BaselineTest.sln"); - GitHub.CleanRepository (Path.GetDirectoryName (sln)); - ProcessHelper.BuildSolution (sln, "iPhone", "Debug", SampleTester.GetEnvironmentVariables (TestPlatform.iOS), SampleTester.DefaultTimeout); - } - - } -} diff --git a/tests/sampletester/Samples.cs b/tests/sampletester/Samples.cs deleted file mode 100644 index 31c59cc77e63..000000000000 --- a/tests/sampletester/Samples.cs +++ /dev/null @@ -1,254 +0,0 @@ -using System; -using System.Collections.Generic; - -using NUnit.Framework; - -namespace Samples { - [Category (CATEGORY)] - public class IosSampleTester : SampleTester { - const string ORG = "xamarin"; - const string REPO = "ios-samples"; // monotouch-samples redirects to ios-samples - const string CATEGORY = "iossamples"; // categories can't contain dashes - const string HASH = "0a6947d766ad71a711b62e10c2eee08b411057e4"; - const string DEFAULT_BRANCH = "main"; - - static Dictionary test_data = new Dictionary { - // Build solution instead of csproj - { "BindingSample/XMBindingLibrarySample/XMBindingLibrarySample.csproj", new SampleTest { BuildSolution = true, Solution = "BindingSample/BindingSample.sln" } }, - { "BouncingGameCompleteiOS/BouncingGame.iOS/BouncingGame.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "BouncingGameCompleteiOS/BouncingGame.sln" } }, - { "BouncingGameEmptyiOS/BouncingGame.iOS/BouncingGame.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "BouncingGameEmptyiOS/BouncingGame.sln" } }, - { "FileSystemSampleCode/FileSystem/FileSystem.csproj", new SampleTest { BuildSolution = true, Solution = "FileSystemSampleCode/WorkingWithTheFileSystem.sln" } }, - { "InfColorPicker/InfColorPickerBinding/InfColorPickerSample/InfColorPickerSample.csproj", new SampleTest { BuildSolution = true, Solution = "InfColorPicker/InfColorPickerBinding/InfColorPickerBinding.sln" } }, - { "ios10/ElizaChat/ElizaChat/ElizaChat.csproj", new SampleTest { BuildSolution = true, Solution = "ios10/ElizaChat/ElizaChat.sln" } }, - { "ios10/IceCreamBuilder/IceCreamBuilder/IceCreamBuilder.csproj", new SampleTest { BuildSolution = true, Solution = "ios10/IceCreamBuilder/IceCreamBuilder.sln" } }, - { "ios11/ARKitPlacingObjects/PlacingObjects/PlacingObjects.csproj", new SampleTest { BuildSolution = true, Solution = "ios11/ARKitPlacingObjects/PlacingObjects.sln" } }, - { "ios11/WeatherWidget/WeatherWidget/WeatherWidget.csproj", new SampleTest { BuildSolution = true, Solution = "ios11/WeatherWidget/WeatherWidget.sln" } }, - { "ios12/SoupChef/SoupChef/SoupChef.csproj", new SampleTest { BuildSolution = true, Solution = "ios12/SoupChef/SoupChef.sln" } }, - { "ios12/XamarinShot/XamarinShot/XamarinShot.csproj", new SampleTest { BuildSolution = true, Solution = "ios12/XamarinShot/XamarinShot.sln", Platforms = new string [] { "iPhone" } } }, // Requires Metal, which doesn't work/build in the simulator. - { "ios8/Lister/Lister/Lister.csproj", new SampleTest { BuildSolution = true, Solution = "ios8/Lister/Lister.sln" } }, - { "ios8/MetalBasic3D/MetalBasic3D/MetalBasic3D.csproj", new SampleTest { Platforms = new string [] { "iPhone" } } }, // Requires Metal, which doesn't work/build in the simulator. - { "ios8/MetalImageProcessing/MetalImageProcessing/MetalImageProcessing.csproj", new SampleTest { Platforms = new string [] { "iPhone" } } }, // Requires Metal, which doesn't work/build in the simulator. - { "ios8/MetalTexturedQuad/MetalTexturedQuad/MetalTexturedQuad.csproj", new SampleTest { Platforms = new string [] { "iPhone" } } }, // Requires Metal, which doesn't work/build in the simulator. - { "ios9/iTravel/iTravel/iTravel.csproj", new SampleTest { BuildSolution = true, Solution = "ios9/iTravel/iTravel.sln" } }, - { "Profiling/MemoryDemo/MemoryDemo/MemoryDemo.csproj", new SampleTest { BuildSolution = true, Solution = "Profiling/MemoryDemo/MemoryDemo.sln", DebugConfigurations = new string [] { "Before-Debug", "After-Debug" }, ReleaseConfigurations = new string [] { "Before-Release", "After-Release" } } }, - { "WalkingGameCompleteiOS/WalkingGame.iOS/WalkingGame.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "WalkingGameCompleteiOS/WalkingGame.sln" } }, - { "WalkingGameEmptyiOS/WalkingGame.iOS/WalkingGame.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "WalkingGameEmptyiOS/WalkingGame.sln" } }, - { "watchOS/WatchConnectivity/WatchConnectivity/WatchConnectivity.csproj", new SampleTest { BuildSolution = true, Solution = "watchOS/WatchConnectivity/WatchConnectivity.sln" } }, - { "watchOS/WatchKitCatalog/WatchKitCatalog/WatchKitCatalog.csproj", new SampleTest { BuildSolution = true, Solution = "watchOS/WatchKitCatalog/WatchKitCatalog.sln" } }, - - // known failures - { "ios9/Emporium/Emporium/Emporium.csproj", new SampleTest { BuildSolution = true, Solution = "ios9/Emporium/Emporium.sln", KnownFailure = "error : Xcode 10 does not support watchOS 1 apps. Either upgrade to watchOS 2 apps, or use an older version of Xcode." } }, - { "WatchKit/GpsWatch/GpsWatch/MainApp.csproj", new SampleTest { KnownFailure = "error : Xcode 10 does not support watchOS 1 apps. Either upgrade to watchOS 2 apps, or use an older version of Xcode." } }, - { "WatchKit/WatchNotifications/WatchNotifications_iOS/WatchNotifications_iOS.csproj", new SampleTest { KnownFailure = "error : Xcode 10 does not support watchOS 1 apps. Either upgrade to watchOS 2 apps, or use an older version of Xcode." } }, - { "PassKit/PassLibrary/PassLibrary.csproj", new SampleTest { BuildSolution = true, Solution = "PassKit/PassLibrary/PassLibrary.sln", KnownFailure = "Requires custom provisioning to get a proper pass." } }, - - }; - - static IEnumerable GetSampleData () - { - return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout); - } - } - - [Category (CATEGORY)] - public class MacIosSampleTester : SampleTester { - const string ORG = "xamarin"; - const string REPO = "mac-ios-samples"; - const string CATEGORY = "maciossamples"; // categories can't contain dashes - const string HASH = "2ab4faf9254cecdf5766af573e508f9ac8691663"; - const string DEFAULT_BRANCH = "main"; - - static Dictionary test_data = new Dictionary { - // Build solution instead of csproj - { "ExceptionMarshaling/ExceptionMarshaling.Mac.csproj", new SampleTest { BuildSolution = true, Solution = "ExceptionMarshaling/ExceptionMarshaling.sln" } }, - { "Fox2/Fox2.macOS/Fox2.macOS.csproj", new SampleTest { BuildSolution = true, Solution = "Fox2/Fox2.sln" } }, - { "MetalKitEssentials/MetalKitEssentials.iOS/MetalKitEssentials.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "MetalKitEssentials/MetalKitEssentials.sln", Platforms = new string [] { "iPhone" } } }, // Requires Metal, which doesn't work/build in the simulator. - { "SceneKitReel/SceneKitReelMac/SceneKitReelMac.csproj", new SampleTest { BuildSolution = true, Solution = "SceneKitReel/SceneKitReel.sln" } }, - }; - - static IEnumerable GetSampleData () - { - return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout); - } - } - - [Category (CATEGORY)] - public class MacSampleTester : SampleTester { - const string ORG = "xamarin"; - const string REPO = "mac-samples"; - const string CATEGORY = "macsamples"; // categories can't contain dashes - const string HASH = "6f905972c98e64759ff84a25e4e2b42366fa197b"; - const string DEFAULT_BRANCH = "main"; - - static Dictionary test_data = new Dictionary { - // Known failures - { "QTRecorder/QTRecorder.csproj", new SampleTest { KnownFailure = "The sample uses deprecated QTKit types (and .xib fails building)." } }, - { "StillMotion/StillMotion/StillMotion.csproj", new SampleTest { KnownFailure = "The sample uses deprecated QTKit types (and .xib fails building)." } }, - }; - - static IEnumerable GetSampleData () - { - return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout); - } - } - - [Category (CATEGORY)] - public class MobileSampleTester : SampleTester { - const string ORG = "xamarin"; - const string REPO = "mobile-samples"; - const string CATEGORY = "mobilesamples"; // categories can't contain dashes - const string HASH = "257f7fe81e70b412d6a6b42e97019ecc2c46ed40"; - const string DEFAULT_BRANCH = "master"; - - static Dictionary test_data = new Dictionary { - // Build solution instead of csproj - { "BouncingGame/BouncingGame/BouncingGame.iOS/BouncingGame.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "BouncingGame/BouncingGame.sln" } }, - { "CCAction/ActionProject/ActionProject.iOS/ActionProject.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "CCAction/ActionProject.sln" } }, - { "CCRenderTexture/RenderTextureExample/RenderTextureExample.iOS/RenderTextureExample.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "CCRenderTexture/RenderTextureExample.sln" } }, - { "EmbeddedResources/EmbeddedResources/EmbeddedResources.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "EmbeddedResources/EmbeddedResources.sln" } }, - { "FruityFalls/FruityFalls/FruityFalls.iOS/FruityFalls.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "FruityFalls/FruityFalls.sln" } }, - { "LivePlayer/BasicCalculator/Calculator.iOS/Calculator.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "LivePlayer/BasicCalculator/Calculator.sln" } }, - { "MonoGameTvOs/MonoGameTvOs/MonoGameTvOs.csproj", new SampleTest { BuildSolution = true, Solution = "MonoGameTvOs/MonoGameTvOs.sln" } }, - { "SpriteSheetDemo/iOS/SpriteSheetDemo.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "SpriteSheetDemo/SpriteSheetDemo.sln" } }, - { "TaskyPortable/TaskyiOS/TaskyiOS.csproj", new SampleTest { BuildSolution = true, Solution = "TaskyPortable/TaskyPortable.sln" } }, - { "TipCalc/TipCalc-UI-iOS/TipCalc-UI-iOS.csproj", new SampleTest { BuildSolution = true, Solution = "TipCalc/TipCalc.sln" } }, - - // Known failures - { "RazorTodo/RazorNativeTodo/RazorNativeTodo.iOS/RazorNativeTodo.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "RazorTodo/RazorNativeTodo/RazorNativeTodo.sln", KnownFailure = "There's a Xamarin.Android project in the solution, and I can't figure out how to build only the Xamarin.iOS project." } }, - { "RazorTodo/RazorTodo/RazorTodo.iOS/RazorTodo.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "RazorTodo/RazorTodo/RazorTodo.sln", KnownFailure = "There's a Xamarin.Android project in the solution, and I can't figure out how to build only the Xamarin.iOS project." } }, - { "VisualBasic/TaskyPortableVB/TaskyiOS/TaskyiOS.csproj", new SampleTest { KnownFailure = "VisualBasic not supported on macOS: error MSB4057: The target \"Build\" does not exist in the project." } }, - { "VisualBasic/XamarinFormsVB/XamarinForms.iOS/XamarinForms.iOS.csproj", new SampleTest { KnownFailure = "VisualBasic not supported on macOS." } }, - { "WebServices/WebServiceSamples/WebServices.RxNorm/src/WebServices.RxNormSample/WebServices.RxNormSample.csproj", new SampleTest { KnownFailure = "Xamarin.iOS Classic isn't supported anymore." } }, - }; - - static IEnumerable GetSampleData () - { - return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout); - } - } - - [Category (CATEGORY)] - public class PrebuiltAppTester : SampleTester { - const string ORG = "xamarin"; - const string REPO = "prebuilt-apps"; - const string CATEGORY = "prebuiltapps"; // categories can't contain dashes - const string HASH = "f111672bc6915ceb402abb47dedfe3480e111720"; - const string DEFAULT_BRANCH = "master"; - - static Dictionary test_data = new Dictionary { - // Known failures - { "FieldService/FieldService.iOS/FieldService.iOS.csproj", new SampleTest { KnownFailure = "The sample uses Xamarin Components which don't work anymore." } }, - }; - - static IEnumerable GetSampleData () - { - return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout); - } - } - - [Category (CATEGORY)] - public class XamarinFormsTester : SampleTester { - const string ORG = "xamarin"; - const string REPO = "xamarin-forms-samples"; - const string CATEGORY = "xamarinformssamples"; // categories can't contain dashes - const string HASH = "d196d3f7ba418d06ef799074eb4f6120e26a9cf4"; - const string DEFAULT_BRANCH = "master"; - - static Dictionary test_data = new Dictionary { - // avoid building unneeded projects since they require a lot of nuget packages (and cause a lot of unrelated/network build issues) - { "WebServices/TodoREST/iOS/TodoREST.iOS.csproj", new SampleTest { Solution = "WebServices/TodoREST/TodoREST.sln", RemoveProjects = new [] { "TodoAPI", "TodoREST.Droid" } } }, - { "WorkingWithMaps/iOS/WorkingWithMaps.iOS.csproj", new SampleTest { Solution = "WorkingWithMaps/WorkingWithMaps.sln", RemoveProjects = new [] { "WorkingWithMaps.Android", "WorkingWithMaps.UWP" } } }, - // Build solution instead of csproj. - { "WebServices/TodoWCF/iOS/TodoWCF.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "WebServices/TodoWCF/TodoWCF.sln" } }, - }; - - static IEnumerable GetSampleData () - { - // Samples.XamarinFormsTester.BuildSample(MarkupExtensions.iOS: Debug|iPhone) needs some extra time 10 minutes - return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, TimeSpan.FromMinutes (10)); - } - } - - [Category (CATEGORY)] - public class XamarinFormsBooksTester : SampleTester { - const string ORG = "xamarin"; - const string REPO = "xamarin-forms-book-samples"; - const string CATEGORY = "xamarinformsbookssamples"; // categories can't contain dashes - const string HASH = "c215bab3324d77e13bd80a0c20e60786d2bd344b"; - const string DEFAULT_BRANCH = "master"; - - static Dictionary test_data = new Dictionary { - // Build solution instead of csproj, - { "Chapter20/TextFileAsync/TextFileAsync/TextFileAsync.iOS/TextFileAsync.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter20/TextFileAsync/TextFileAsync.sln" } }, - { "Chapter24/NoteTaker/NoteTaker/NoteTaker.iOS/NoteTaker.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter24/NoteTaker/NoteTaker.sln" } }, - { "Chapter27/BouncingBall/BouncingBall/BouncingBall.iOS/BouncingBall.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter27/BouncingBall/BouncingBall.sln" } }, - { "Chapter27/EllipseDemo/EllipseDemo/EllipseDemo.iOS/EllipseDemo.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter27/EllipseDemo/EllipseDemo.sln" } }, - { "Chapter27/StepSliderDemo/StepSliderDemo/StepSliderDemo.iOS/StepSliderDemo.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter27/StepSliderDemo/StepSliderDemo.sln" } }, - { "Chapter28/MapDemos/MapDemos/MapDemos.iOS/MapDemos.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter28/MapDemos/MapDemos.sln" } }, - { "Chapter28/WhereAmI/WhereAmI/WhereAmI.iOS/WhereAmI.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter28/WhereAmI/WhereAmI.sln" } }, - }; - - static IEnumerable GetSampleData () - { - // Samples.XamarinFormsBooksTester.BuildSample(FormattedTextToggle.iOS: Release|iPhone) needs some extra time 10 minutes - return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, TimeSpan.FromMinutes (10)); - } - } - - [Category (CATEGORY)] - public class EmbeddedFrameworksTester : SampleTester { - const string ORG = "rolfbjarne"; - const string REPO = "embedded-frameworks"; - const string CATEGORY = "embeddedframeworks"; // categories can't contain dashes - const string HASH = "faaad6f9dcda53b2c49cec567eca769cb534307f"; - const string DEFAULT_BRANCH = "main"; - - static Dictionary test_data = new Dictionary { - // Known failures - { "simpleapp-with-framework/simpleapp-with-framework/simpleapp-with-framework.csproj", new SampleTest { BuildSolution = true, Solution = "simpleapp-with-framework/simpleapp-with-framework.sln" } }, - }; - - static IEnumerable GetSampleData () - { - return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout); - } - } - - [Category (CATEGORY)] - public class XappyTester : SampleTester { - const string ORG = "davidortinau"; - const string REPO = "Xappy"; - const string CATEGORY = "davidortinauxappy"; // categories can't contain dashes - const string HASH = "46e5897bac974e000fcc7e1d10d01ab8d3072eb2"; - const string DEFAULT_BRANCH = "master"; - - static Dictionary test_data = new Dictionary { - { "Xappy/Xappy.iOS/Xappy.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Xappy.sln", RemoveProjects = new [] { "Xappy.Android", "Xappy.UWP" } } }, - }; - - static IEnumerable GetSampleData () - { - return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout); - } - } - - [Category (CATEGORY)] - public class SmartHotelTester : SampleTester { - const string ORG = "microsoft"; - const string REPO = "SmartHotel360-Mobile"; - const string CATEGORY = "microsoftsmarthotel"; // categories can't contain dashes - const string HASH = "4004b32c955f8340a0306bad2b180ecf5adaf117"; - const string DEFAULT_BRANCH = "master"; - - static Dictionary test_data = new Dictionary { - // Override CodesignKey key - { "Source/SmartHotel.Clients/SmartHotel.Clients.iOS/SmartHotel.Clients.iOS.csproj", new SampleTest { CodesignKey = "iPhone Developer" } }, - { "Source/SmartHotel.Clients.Maintenance/SmartHotel.Clients.Maintenance.iOS/SmartHotel.Clients.Maintenance.iOS.csproj", new SampleTest { CodesignKey = "iPhone Developer" } }, - }; - - static IEnumerable GetSampleData () - { - return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, timeout: TimeSpan.FromMinutes (10)); - } - } -} diff --git a/tests/sampletester/TestPlatform.cs b/tests/sampletester/TestPlatform.cs deleted file mode 100644 index 86f907489996..000000000000 --- a/tests/sampletester/TestPlatform.cs +++ /dev/null @@ -1,7 +0,0 @@ -public enum TestPlatform { - None, - iOS, - macOS, - watchOS, - tvOS, -} diff --git a/tests/sampletester/images/provision_from_commit.png b/tests/sampletester/images/provision_from_commit.png deleted file mode 100644 index b41db7250740..000000000000 Binary files a/tests/sampletester/images/provision_from_commit.png and /dev/null differ diff --git a/tests/sampletester/sampletester.csproj b/tests/sampletester/sampletester.csproj deleted file mode 100644 index 4627e6bd64b9..000000000000 --- a/tests/sampletester/sampletester.csproj +++ /dev/null @@ -1,79 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62} - Library - sampletester - sampletester - v4.7.2 - latest - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - - - true - bin\Release - prompt - 4 - - - - - - - - - - - - - - - - - external\Cache.cs - - - external\StringUtils.cs - - - external\Configuration.cs - - - external\Profile.cs - - - external\ExecutionHelper.cs - - - - - external\Execution.cs - - - external\ApplePlatform.cs - - - external\SdkVersions.cs - - - external\TargetFramework.cs - - - - - - - \ No newline at end of file diff --git a/tests/sampletester/sampletester.sln b/tests/sampletester/sampletester.sln deleted file mode 100644 index 42f569df45cc..000000000000 --- a/tests/sampletester/sampletester.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sampletester", "sampletester.csproj", "{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Release|Any CPU.Build.0 = Release|Any CPU - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Debug|iPhone.Build.0 = Debug|Any CPU - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Release|iPhone.ActiveCfg = Release|Any CPU - {7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Release|iPhone.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index f3a472a520e1..2d6f5b1bc2d0 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -230,7 +230,6 @@ string GetVariable (string variable, string @default = null) public string MAC_DESTDIR { get; } public string IOS_DESTDIR { get; } public string MONO_IOS_SDK_DESTDIR { get; } - public string MONO_MAC_SDK_DESTDIR { get; } public bool ENABLE_DOTNET { get; } public bool INCLUDE_XAMARIN_LEGACY { get; } public string SYSTEM_MONO { get; set; } @@ -307,7 +306,6 @@ public Harness (IResultParser resultParser, HarnessAction action, HarnessConfigu MAC_DESTDIR = GetVariable (nameof (MAC_DESTDIR)); IOS_DESTDIR = GetVariable (nameof (IOS_DESTDIR)); MONO_IOS_SDK_DESTDIR = GetVariable (nameof (MONO_IOS_SDK_DESTDIR)); - MONO_MAC_SDK_DESTDIR = GetVariable (nameof (MONO_MAC_SDK_DESTDIR)); ENABLE_DOTNET = IsVariableSet (nameof (ENABLE_DOTNET)); SYSTEM_MONO = GetVariable (nameof (SYSTEM_MONO)); DOTNET_DIR = GetVariable (nameof (DOTNET_DIR)); diff --git a/tests/xharness/IHarness.cs b/tests/xharness/IHarness.cs index 6a30ba5cbbd3..4c2ba87a8faf 100644 --- a/tests/xharness/IHarness.cs +++ b/tests/xharness/IHarness.cs @@ -41,7 +41,6 @@ public interface IHarness { string MAC_DESTDIR { get; } string IOS_DESTDIR { get; } string MONO_IOS_SDK_DESTDIR { get; } - string MONO_MAC_SDK_DESTDIR { get; } bool ENABLE_DOTNET { get; } bool INCLUDE_XAMARIN_LEGACY { get; } string SYSTEM_MONO { get; set; } diff --git a/tools/devops/add-summaries.sh b/tools/devops/add-summaries.sh deleted file mode 100755 index e97cee10f1a8..000000000000 --- a/tools/devops/add-summaries.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -e - -set +x - -X="#vso" - -FILE=$PWD/xamarin-macios/tests/TestSummary.md -if ! test -f "$FILE"; then -echo ":fire: Tests failed catastrophically (no summary found)" > "$FILE" -fi - -echo "#${X}[task.addattachment type=Distributedtask.Core.Summary;name=Test results;]$FILE" - -echo "[Jenkins build]($WRENCH_URL)" > Wrench.md -echo "#${X}[task.addattachment type=Distributedtask.Core.Summary;name=Jenkins;]$PWD/Wrench.md" diff --git a/tools/devops/automation/build-pipeline.yml b/tools/devops/automation/build-pipeline.yml index eeb88f0df7fc..a7d0d72d8484 100644 --- a/tools/devops/automation/build-pipeline.yml +++ b/tools/devops/automation/build-pipeline.yml @@ -88,20 +88,6 @@ parameters: displayName: macOS test configurations to run type: object default: [ - { - stageName: 'mac_11_m1', - displayName: 'M1 - Mac Big Sur (11)', - macPool: 'VSEng-VSMac-Xamarin-Shared', - useImage: false, - statusContext: 'M1 - Mac Big Sur (11)', - demands: [ - "Agent.OS -equals Darwin", - "macOS.Name -equals BigSur", - "macOS.Architecture -equals arm64", - "Agent.HasDevices -equals False", - "Agent.IsPaired -equals False" - ] - }, { stageName: 'mac_12_m1', displayName: 'M1 - Mac Ventura (12)', diff --git a/tools/devops/automation/run-post-ci-build-macos-tests.yml b/tools/devops/automation/run-post-ci-build-macos-tests.yml new file mode 100644 index 000000000000..bbdb367de5d7 --- /dev/null +++ b/tools/devops/automation/run-post-ci-build-macos-tests.yml @@ -0,0 +1,20 @@ +# YAML pipeline for post build operations. +# This pipeline will execute the tests for the CI as soon as the workloads have been complited. + +trigger: none +pr: none + + +# we cannot use a template in a pipeline context +resources: + pipelines: + - pipeline: macios + source: xamarin-macios-ci + trigger: + stages: + - build_macos_tests + +extends: + template: templates/pipelines/run-macos-tests-pipeline.yml + parameters: + isPR: false diff --git a/tools/devops/automation/run-post-ci-build-tests.yml b/tools/devops/automation/run-post-ci-build-tests.yml index a8a20442aa95..5ffbfa0917f6 100644 --- a/tools/devops/automation/run-post-ci-build-tests.yml +++ b/tools/devops/automation/run-post-ci-build-tests.yml @@ -13,7 +13,6 @@ resources: trigger: stages: - build_packages - - build_macos_tests extends: template: templates/pipelines/run-tests-pipeline.yml diff --git a/tools/devops/automation/run-post-pr-build-macos-tests.yml b/tools/devops/automation/run-post-pr-build-macos-tests.yml new file mode 100644 index 000000000000..e324fe5d8b3e --- /dev/null +++ b/tools/devops/automation/run-post-pr-build-macos-tests.yml @@ -0,0 +1,19 @@ +# YAML pipeline for post build operations. +# This pipeline will execute the tests for the CI on PR as soon as the workloads have been complited. + +trigger: none +pr: none + +# we cannot use a template in a pipeline context +resources: + pipelines: + - pipeline: macios + source: xamarin-macios-pr + trigger: + stages: + - build_macos_tests + +extends: + template: templates/pipelines/run-macos-tests-pipeline.yml + parameters: + isPR: true diff --git a/tools/devops/automation/run-post-pr-build-tests.yml b/tools/devops/automation/run-post-pr-build-tests.yml index 84d8d1e58e72..45a676699994 100644 --- a/tools/devops/automation/run-post-pr-build-tests.yml +++ b/tools/devops/automation/run-post-pr-build-tests.yml @@ -12,7 +12,6 @@ resources: trigger: stages: - build_packages - - build_macos_tests extends: template: templates/pipelines/run-tests-pipeline.yml diff --git a/tools/devops/automation/scripts/TestResults.Tests.ps1 b/tools/devops/automation/scripts/TestResults.Tests.ps1 index e3e47a2ff656..f73f03020875 100644 --- a/tools/devops/automation/scripts/TestResults.Tests.ps1 +++ b/tools/devops/automation/scripts/TestResults.Tests.ps1 @@ -212,7 +212,6 @@ Describe "TestResults tests" { "configuration.BuildNugets": "True", "configuration.BuildPkgs": "True", "configuration.PR_ID": "20434", - "configuration.RunSampleTests": "", "configuration.SignPkgs": "True", "build.TESTS_BOT": "XAMBOT-1001.Sonoma" }, diff --git a/tools/devops/automation/scripts/VSTS.psm1 b/tools/devops/automation/scripts/VSTS.psm1 index 655df55a6600..716e2f070986 100644 --- a/tools/devops/automation/scripts/VSTS.psm1 +++ b/tools/devops/automation/scripts/VSTS.psm1 @@ -302,7 +302,6 @@ class BuildConfiguration { "skip-packages", "skip-nugets", "skip-signing", - "run-sample-tests", "skip-packaged-macos-tests", "run-packaged-macos-tests", "skip-api-comparison", diff --git a/tools/devops/automation/scripts/generate_agent_logs.ps1 b/tools/devops/automation/scripts/generate_agent_logs.ps1 index 089a65511e1a..3294e9138cc5 100644 --- a/tools/devops/automation/scripts/generate_agent_logs.ps1 +++ b/tools/devops/automation/scripts/generate_agent_logs.ps1 @@ -46,8 +46,7 @@ try { log show --predicate $Predicate --style $Style --start "$start" --end "$end" > $Output } } catch { - Write-Host "Exception occurred: $_" # Create the output file, because we later try to upload it as an artifact, and *not* uploading # if there's *no* file is much harder than just creating the file. - New-Item -Path $Output -Value "$_" + Write-Host "Exception occurred: $_" | Tee-Object -FilePath $Output -Append } diff --git a/tools/devops/automation/scripts/parse_pr_labels.ps1 b/tools/devops/automation/scripts/parse_pr_labels.ps1 index b637e99e4df4..eb730c236dc8 100644 --- a/tools/devops/automation/scripts/parse_pr_labels.ps1 +++ b/tools/devops/automation/scripts/parse_pr_labels.ps1 @@ -46,17 +46,12 @@ if ($BuildReason -eq "PullRequest" -or (($BuildReason -eq "Manual" -or $BuildRea $configVars.Add("SignPkgs", "True") } - $configVars.Add("RunSampleTests", $Env:RunSampleTests) - } else { # set the defaults, all the things! o/ # build pkg, nugets and sign them $configVars.Add("BuildPkgs", "True") $configVars.Add("BuildNugets", "True") $configVars.Add("SignPkgs", "True") - - # tests, run all of them, internal, external, mac but not sample tests - $configVars.Add("RunSampleTests", "False") } # write debugging and process of the vars foreach($key in $configVars.Keys) { 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 a87b5dca3598..b365553f4a5d 100644 --- a/tools/devops/automation/templates/build/build-mac-tests-stage.yml +++ b/tools/devops/automation/templates/build/build-mac-tests-stage.yml @@ -39,7 +39,7 @@ jobs: # This job builds the macOS tests. - job: build_macos_tests_job displayName: 'Build macOS tests' - timeoutInMinutes: 120 + 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'] ] diff --git a/tools/devops/automation/templates/build/build-stage.yml b/tools/devops/automation/templates/build/build-stage.yml index 8970b68b71e8..950196987a92 100644 --- a/tools/devops/automation/templates/build/build-stage.yml +++ b/tools/devops/automation/templates/build/build-stage.yml @@ -68,12 +68,10 @@ jobs: # skip-packages # skip-nugets # skip-signing - # run-sample-tests BuildPackage: $[ stageDependencies.configure_build.configure.outputs['labels.build_package'] ] SkipPackages: $[ stageDependencies.configure_build.configure.outputs['labels.skip_packages'] ] SkipNugets: $[ stageDependencies.configure_build.configure.outputs['labels.skip_nugets'] ] SkipSigning: $[ stageDependencies.configure_build.configure.outputs['labels.skip_signing'] ] - RunSampleTests: $[ stageDependencies.configure_build.configure.outputs['labels.run_sample_tests'] ] SkipApiComparison: $[ stageDependencies.configure_build.configure.outputs['labels.skip_api_comparison'] ] # old and ugly env var use by jenkins, we do have parts of the code that use it, contains the PR number PR_ID: $[ stageDependencies.configure_build.configure.outputs['labels.pr_number'] ] diff --git a/tools/devops/automation/templates/build/build.yml b/tools/devops/automation/templates/build/build.yml index a3d0648dae20..7838afd4894c 100644 --- a/tools/devops/automation/templates/build/build.yml +++ b/tools/devops/automation/templates/build/build.yml @@ -181,18 +181,6 @@ steps: key: "$(MONO_IOS_FILENAME)" path: "$(Build.SourcesDirectory)/xamarin-macios/builds/downloads/$(MONO_IOS_FILENAME)" - - task: Cache@2 - displayName: 'Cache macOS Mono download' - inputs: - key: "$(MONO_MAC_FILENAME)" - path: "$(Build.SourcesDirectory)/xamarin-macios/builds/downloads/$(MONO_MAC_FILENAME)" - - - task: Cache@2 - displayName: 'Cache MacCatalsyt Mono download' - inputs: - key: "$(MONO_MACCATALYST_FILENAME)" - path: "$(Build.SourcesDirectory)/xamarin-macios/builds/downloads/$(MONO_MACCATALYST_FILENAME)" - # Actual build of the project - bash: $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/automation/scripts/bash/build-macios.sh name: build diff --git a/tools/devops/automation/templates/mac/build.yml b/tools/devops/automation/templates/mac/build.yml index 94ca35e2b3ba..00e08489a799 100644 --- a/tools/devops/automation/templates/mac/build.yml +++ b/tools/devops/automation/templates/mac/build.yml @@ -144,9 +144,8 @@ steps: # Go get the tests!, this depends on how the test was triggered - ${{ if or(contains(variables['Build.Reason'], 'ResourceTrigger'), contains(variables['Build.Reason'], 'BuildCompletion'), contains(variables['Build.DefinitionName'], 'xamarin-macios-ci-tests'), contains(variables['Build.DefinitionName'], 'xamarin-macios-pr-tests')) }}: - download: macios - artifact: mac-test-package displayName: Download Mac tests - patterns: '**/mac-test-package.7z' + artifact: 'mac-test-package' # the default location when downloading is $(Pipeline.Workspace)// - pwsh: | @@ -162,7 +161,7 @@ steps: - task: DownloadPipelineArtifact@2 displayName: Download Mac tests inputs: - patterns: '**/mac-test-package.7z' + artifact: 'mac-test-package' allowFailedBuilds: true path: $(Build.SourcesDirectory)/artifacts/tmp diff --git a/tools/devops/automation/templates/mac/stage.yml b/tools/devops/automation/templates/mac/stage.yml index e2629e587a5a..957435e1ea61 100644 --- a/tools/devops/automation/templates/mac/stage.yml +++ b/tools/devops/automation/templates/mac/stage.yml @@ -39,7 +39,13 @@ parameters: type: boolean default: false +- name: stageDisplayNamePrefix + type: string + default: '' + + stages: + - stage: ${{ parameters.stageName }} displayName: ${{ parameters.displayName }} dependsOn: diff --git a/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml b/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml new file mode 100644 index 000000000000..1bf2a4b2c6d3 --- /dev/null +++ b/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml @@ -0,0 +1,268 @@ +# template to be extended by those pipelines that will run tests after a build. +parameters: + + - name: isPR + displayName: State if the tests are ran for a PR build + type: boolean + default: false + + - name: repositoryAlias + type: string + default: self + + - name: commit + type: string + default: HEAD + + - name: stageDisplayNamePrefix + type: string + default: '' + + - name: macTestsConfigurations + displayName: macOS test configurations to run + type: object + default: [ + { + stageName: 'mac_12_m1', + displayName: 'M1 - Mac Ventura (12)', + macPool: 'VSEng-VSMac-Xamarin-Shared', + useImage: false, + statusContext: 'M1 - Mac Monterey (12)', + demands: [ + "Agent.OS -equals Darwin", + "macOS.Name -equals Monterey", + "macOS.Architecture -equals arm64", + "Agent.HasDevices -equals False", + "Agent.IsPaired -equals False" + ] + }, + { + stageName: 'mac_13_m1', + displayName: 'M1 - Mac Ventura (13)', + macPool: 'VSEng-VSMac-Xamarin-Shared', + useImage: false, + statusContext: 'M1 - Mac Ventura (13)', + demands: [ + "Agent.OS -equals Darwin", + "macOS.Name -equals Ventura", + "macOS.Architecture -equals arm64", + "Agent.HasDevices -equals False", + "Agent.IsPaired -equals False" + ] + }, + { + stageName: 'mac_14_x64', + displayName: 'X64 - Mac Sonoma (14)', + macPool: 'VSEng-Xamarin-RedmondMacBuildPool-iOS-Untrusted', + useImage: false, + statusContext: 'X64 - Mac Sonoma (14)', + demands: [ + "Agent.OS -equals Darwin", + "macOS.Name -equals Sonoma", + "macOS.Architecture -equals x64", + "Agent.HasDevices -equals False", + "Agent.IsPaired -equals False" + ] + }] + + - name: pool + type: string + default: automatic + values: + - pr + - ci + - automatic + + - name: supportedPlatforms + type: object + default: [ + { + platform: iOS, + isDotNetPlatform: true, + }, + { + platform: macOS, + isDotNetPlatform: true, + }, + { + platform: tvOS, + isDotNetPlatform: true, + }, + { + platform: MacCatalyst, + isDotNetPlatform: true, + }, + { + # when running platform-specific test runs, we also need a special test run that executes tests that only runs when multiple platforms are enabled + platform: Multiple, + isDotNetPlatform: true, + } + ] + + + - name: testConfigurations + type: object + default: [ + # Disabled by default # + # { + # label: bcl, + # splitByPlatforms: false, + # }, + { + label: cecil, + splitByPlatforms: false, + testPrefix: 'simulator_tests', + }, + { + label: dotnettests, + splitByPlatforms: true, + needsMultiplePlatforms: true, + testPrefix: 'simulator_tests', + }, + { + label: fsharp, + splitByPlatforms: false, + testPrefix: 'simulator_tests', + }, + { + label: framework, + splitByPlatforms: false, + testPrefix: 'simulator_tests', + }, + { + label: generator, + splitByPlatforms: false, + testPrefix: 'simulator_tests', + }, + { + label: interdependent-binding-projects, + splitByPlatforms: false, + testPrefix: 'simulator_tests', + }, + { + label: introspection, + splitByPlatforms: false, + testPrefix: 'simulator_tests', + }, + { + label: linker, + splitByPlatforms: false, + testPrefix: 'simulator_tests', + }, + { + label: mmp, + splitByPlatforms: false, + testPrefix: 'simulator_tests', + }, + { + label: monotouch, + splitByPlatforms: true, + needsMultiplePlatforms: false, + testPrefix: 'simulator_tests', + }, + { + label: msbuild, + splitByPlatforms: false, + testPrefix: 'simulator_tests', + }, + { + label: xcframework, + splitByPlatforms: false, + testPrefix: 'simulator_tests', + }, + { + label: xtro, + splitByPlatforms: false, + testPrefix: 'simulator_tests', + }, + ] + +resources: + repositories: + - repository: self + checkoutOptions: + submodules: true + + - repository: yaml-templates + type: github + name: xamarin/yaml-templates + ref: refs/heads/main + endpoint: xamarin + + - repository: maccore + type: github + name: xamarin/maccore + ref: refs/heads/main + endpoint: xamarin + + - repository: release-scripts + type: github + name: xamarin/release-scripts + ref: refs/heads/only_codesign + endpoint: xamarin + +variables: + - ${{ if contains(variables['Build.DefinitionName'], 'private') }}: + - template: ../vsts-variables.yml + - template: ../variables.yml + - name: MaciosUploadPrefix + value: '' + - name: DisablePipelineConfigDetector + value: true + +stages: + + - stage: configure_build + displayName: '${{ parameters.stageDisplayNamePrefix }}Configure' + jobs: + + - ${{ if eq(parameters.pool, 'automatic') }}: + - job: AgentPoolSelector # https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml + pool: # Consider using an agentless (server) job here, but would need to host selection logic as an Azure function: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#server + vmImage: ubuntu-latest + steps: + - checkout: none # https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#checkout + + # Selects appropriate agent pool based on trigger type (PR or CI); manually triggered builds target the PR pool + - template: azure-devops-pools/agent-pool-selector.yml@yaml-templates + parameters: + agentPoolPR: $(PRBuildPool) + agentPoolPRUrl: $(PRBuildPoolUrl) + agentPoolCI: $(CIBuildPool) + agentPoolCIUrl: $(CIBuildPoolUrl) + + - job: configure + displayName: 'Configure build' + pool: + vmImage: windows-latest + + variables: + isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')] + isScheduled: $[eq(variables['Build.Reason'], 'Schedule')] + BRANCH_NAME: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ] + + steps: + - template: ../common/load_configuration.yml + parameters: + repositoryAlias: ${{ parameters.repositoryAlias }} + 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-watchos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-legacy-xamarin-tests' + statusContext: 'VSTS: simulator tests' + uploadArtifacts: true + + - ${{ each config in parameters.macTestsConfigurations }}: + - template: ../mac/stage.yml + parameters: + isPR: ${{ parameters.isPR }} + repositoryAlias: ${{ parameters.repositoryAlias }} + commit: ${{ parameters.commit }} + stageName: ${{ config.stageName }} + displayName: ' ${{ parameters.stageDisplayNamePrefix }}${{ config.displayName }}' + macPool: ${{ config.macPool }} + useImage: ${{ config.useImage }} + statusContext: ${{ config.statusContext }} + keyringPass: $(pass--lab--mac--builder--keychain) + demands: ${{ config.demands }} + postPipeline: true diff --git a/tools/devops/automation/templates/pipelines/run-tests-pipeline.yml b/tools/devops/automation/templates/pipelines/run-tests-pipeline.yml index b780a26da544..1fde3871aaa4 100644 --- a/tools/devops/automation/templates/pipelines/run-tests-pipeline.yml +++ b/tools/devops/automation/templates/pipelines/run-tests-pipeline.yml @@ -45,11 +45,6 @@ parameters: type: boolean default: true - - name: runSamples - displayName: Run Samples - type: boolean - default: false - - name: testConfigurations displayName: Test configurations to run type: object @@ -84,54 +79,6 @@ parameters: ] }] - - name: macTestsConfigurations - displayName: macOS test configurations to run - type: object - default: [ - { - stageName: 'mac_12_m1', - displayName: 'M1 - Mac Ventura (12)', - macPool: 'VSEng-VSMac-Xamarin-Shared', - useImage: false, - statusContext: 'M1 - Mac Monterey (12)', - demands: [ - "Agent.OS -equals Darwin", - "macOS.Name -equals Monterey", - "macOS.Architecture -equals arm64", - "Agent.HasDevices -equals False", - "Agent.IsPaired -equals False" - ] - }, - { - stageName: 'mac_13_m1', - displayName: 'M1 - Mac Ventura (13)', - macPool: 'VSEng-VSMac-Xamarin-Shared', - useImage: false, - statusContext: 'M1 - Mac Ventura (13)', - demands: [ - "Agent.OS -equals Darwin", - "macOS.Name -equals Ventura", - "macOS.Architecture -equals arm64", - "Agent.HasDevices -equals False", - "Agent.IsPaired -equals False" - ] - }, - { - stageName: 'mac_14_x64', - displayName: 'X64 - Mac Sonoma (14)', - macPool: 'VSEng-Xamarin-RedmondMacBuildPool-iOS-Untrusted', - useImage: false, - statusContext: 'X64 - Mac Sonoma (14)', - demands: [ - "Agent.OS -equals Darwin", - "macOS.Name -equals Sonoma", - "macOS.Architecture -equals x64", - "Agent.HasDevices -equals False", - "Agent.IsPaired -equals False" - ] - }] - - resources: repositories: - repository: self @@ -175,11 +122,8 @@ stages: pool: ${{ parameters.pool }} runTests: ${{ parameters.runTests }} runDeviceTests: ${{ parameters.runDeviceTests }} - runOldMacOSTests: ${{ parameters.runOldMacOSTests }} runWindowsIntegration: ${{ parameters.runWindowsIntegration }} - runSamples: ${{ parameters.runSamples }} ${{ if ne(length(parameters.testConfigurations), 0)}}: testConfigurations: ${{ parameters.testConfigurations }} deviceTestsConfigurations: ${{ parameters.deviceTestsConfigurations }} - macTestsConfigurations: ${{ parameters.macTestsConfigurations }} diff --git a/tools/devops/automation/templates/tests-stage.yml b/tools/devops/automation/templates/tests-stage.yml index 7d69332b8591..e54a23ee9cd7 100644 --- a/tools/devops/automation/templates/tests-stage.yml +++ b/tools/devops/automation/templates/tests-stage.yml @@ -20,18 +20,10 @@ parameters: type: boolean default: false -- name: runOldMacOSTests - type: boolean - default: true - - name: runWindowsIntegration type: boolean default: true -- name: runSamples - type: boolean - default: false - - name: isPR type: boolean @@ -157,9 +149,6 @@ parameters: - name: deviceTestsConfigurations type: object -- name: macTestsConfigurations - type: object - - name: stageDisplayNamePrefix type: string default: '' @@ -265,22 +254,6 @@ stages: commit: ${{ parameters.commit }} postPipeline: true -- ${{ if eq(parameters.runOldMacOSTests, true) }}: - - ${{ each config in parameters.macTestsConfigurations }}: - - template: ./mac/stage.yml - parameters: - isPR: ${{ parameters.isPR }} - repositoryAlias: ${{ parameters.repositoryAlias }} - commit: ${{ parameters.commit }} - stageName: ${{ config.stageName }} - displayName: ' ${{ parameters.stageDisplayNamePrefix }}${{ config.displayName }}' - macPool: ${{ config.macPool }} - useImage: ${{ config.useImage }} - statusContext: ${{ config.statusContext }} - keyringPass: $(pass--lab--mac--builder--keychain) - demands: ${{ config.demands }} - postPipeline: true - - ${{ if eq(parameters.runWindowsIntegration, true) }}: - template: ./windows/stage.yml parameters: @@ -294,20 +267,3 @@ stages: gitHubToken: $(Github.Token) xqaCertPass: $(xqa--certificates--password) postPipeline: true - -- ${{ if eq(parameters.runSamples, true) }}: - # TODO: Not the real step - - stage: sample_testing - displayName: '${{ stageDisplayNamePrefix }}Sample testing' - dependsOn: - - build_packages - condition: and(succeeded(), contains (stageDependencies.build_packages.build.outputs['configuration.RunSampleTests'], 'True')) - jobs: - - job: sample_testing - pool: - vmImage: ubuntu-latest - steps: - # TODO: do parse labels - - bash: | - echo "Samples!" - displayName: 'Sample testing' diff --git a/tools/devops/automation/templates/tests/stage.yml b/tools/devops/automation/templates/tests/stage.yml index 7b5649db6792..89f4d67de919 100644 --- a/tools/devops/automation/templates/tests/stage.yml +++ b/tools/devops/automation/templates/tests/stage.yml @@ -119,8 +119,9 @@ stages: steps: - bash: | - env | sort - env + set +x + env -0 | sort -z | tr '\0' '\n' + ifconfig | grep 'inet ' displayName: 'Dump env' name: DumpEnv - template: build.yml diff --git a/tools/devops/build-samples-report-to-github.sh b/tools/devops/build-samples-report-to-github.sh deleted file mode 100755 index 024c6d9580b5..000000000000 --- a/tools/devops/build-samples-report-to-github.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -ex - -# This script takes -# First argument: the github token to authenticate with -# Subsequent arguments: the names of each test variation in the test matrix. -# There is a corresponding environment variable with the result from each test variation. - - -# Print environment for debugging -env | sort - -TOKEN=$1 -shift 1 -STEPS="$*" - -EMOJII="✅" -GH_STATE=success -FILE=commit-comment.md - -for STEP in $STEPS; do - # The environment variable's name is the variation name in uppercase, and special symbols removed (|-_) - STEPNAME=JOBRESULT$(echo "$STEP" | tr '[:lower:]' '[:upper:]' | sed -e 's/|//g' -e 's/-//g' -e 's/_//g') - STEPSTATUS=${!STEPNAME} - if [[ "$STEPSTATUS" == "Succeeded" ]]; then - STEPEMOJII="✅" - else - STEPEMOJII="❌" - EMOJII="❌" - GH_STATE=failure - fi - echo "* $STEPEMOJII $STEP: $STEPSTATUS" >> "$FILE" -done - -printf "%s\n\n" "$EMOJII Status for '$BUILD_DEFINITIONNAME': [$GH_STATE]($AZURE_BUILD_URL)." | cat - "$FILE" > "$FILE.tmp" -mv "$FILE.tmp" "$FILE" - -./jenkins/add-commit-comment.sh "--token=$TOKEN" "--hash=$BUILD_SOURCEVERSION" "--file=$FILE" -./jenkins/add-commit-status.sh "--token=$TOKEN" "--hash=$BUILD_SOURCEVERSION" "--state=$GH_STATE" --target-url="$AZURE_BUILD_URL" --description="$BUILD_DEFINITIONNAME" --context="$BUILD_DEFINITIONNAME" -rm -f "$FILE" diff --git a/tools/devops/build-samples.csx b/tools/devops/build-samples.csx deleted file mode 100644 index cf183145e875..000000000000 --- a/tools/devops/build-samples.csx +++ /dev/null @@ -1,57 +0,0 @@ -#load "utils.csx" - -using System.Collections.Generic; -using System.IO; -using System.Net; -using System.Linq; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -using Newtonsoft.Json.Linq; - -using Xamarin.Provisioning; -using Xamarin.Provisioning.Model; - -// Provision Mono, Mono, Objective-Sharpie, provisioning profiles. -// -// We get Mono from the current commit's MIN_MONO_URL value in Make.config -// -// Overrides: -// * Each download URL can be overriden by setting an environment variable (MIN_MONO_URL). -// * The current commit can be overridden by setting the PROVISION_FROM_COMMIT variable. This is usually easier than overriding each url. - -var commit = Environment.GetEnvironmentVariable ("BUILD_SOURCEVERSION"); -var provision_from_commit = Environment.GetEnvironmentVariable ("PROVISION_FROM_COMMIT") ?? commit; - -string FindVariable (string variable, bool throwIfNotFound = true) -{ - var value = FindConfigurationVariable (variable, provision_from_commit); - if (!string.IsNullOrEmpty (value)) - return value; - - if (!string.IsNullOrEmpty (value)) - return value; - - if (!throwIfNotFound) - return null; - - throw new Exception ($"Could not find {variable} in environment nor in the commit's ({commit}) manifest."); -} - -if (string.IsNullOrEmpty (provision_from_commit)) { - Console.Error.WriteLine ($"Either BUILD_SOURCEVERSION or PROVISION_FROM_COMMIT must be set."); - Environment.Exit (1); - return 1; -} -Console.WriteLine ($"Provisioning from {provision_from_commit}..."); - -InstallPackage ("Mono", FindVariable ("MIN_MONO_URL")); -InstallPackage ("Objective-Sharpie", FindVariable ("MIN_SHARPIE_URL")); - -// Provisioning profiles -Console.WriteLine ("Provisioning provisioning profiles..."); -Exec ($"../../../maccore/tools/install-qa-provisioning-profiles.sh"); - -// .NET core -// The version number here must match the one in Xamarin.Tests.Configuration:CreateGlobalConfig (tests/sampletester/Configuration.cs). -DotNetCoreSdk ("2.2.204"); diff --git a/tools/devops/build-samples.sh b/tools/devops/build-samples.sh deleted file mode 100755 index 50e3b95b87eb..000000000000 --- a/tools/devops/build-samples.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -eux - -cd "$(dirname "${BASH_SOURCE[0]}")/../.." - -make -C tests test-system.config -make -C tests/sampletester TESTS_USE_SYSTEM=1 \ No newline at end of file diff --git a/tools/devops/build-samples.yml b/tools/devops/build-samples.yml deleted file mode 100644 index dacde1aa5796..000000000000 --- a/tools/devops/build-samples.yml +++ /dev/null @@ -1,231 +0,0 @@ -# Xamarin -# Build samples - -variables: - azure_build_url: '$(System.CollectionUri)/$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)' - azpPoolName: 'Azure Pipelines' - macOSVersion: 'internal-macos-11' - debug_filter: '^.*Debug.*$' - release_filter: '^.*Release.*$' - iphone_filter: '^iPhone$' - iphonesimulator_filter: '^iPhoneSimulator$' - mac_platform_filter: '^$' - name_filter_af: '^[A-Fa-f].*$' - name_filter_gr: '^[G-Rg-r].*$' - name_filter_rest: '^[^A-Ra-r].*$' - -resources: - repositories: - - repository: xamarin-macios-data - type: github - name: xamarin/xamarin-macios-data - ref: refs/heads/main - endpoint: xamarin - - repository: maccore - type: github - name: xamarin/maccore - ref: refs/heads/main - endpoint: xamarin - -### -### Tell GitHub we're starting working on this commit -### - -jobs: -- job: ReportStartToGitHub - displayName: Set pending GitHub status - pool: - name: '$(azpPoolName)' - vmImage: '$(macOSVersion)' - steps: - - bash: ./jenkins/add-commit-status.sh "--token=$(github-pat)" "--hash=$BUILD_SOURCEVERSION" "--state=pending" --target-url="$AZURE_BUILD_URL" --description="$BUILD_DEFINITIONNAME" --context="$BUILD_DEFINITIONNAME" - displayName: Set pending GitHub status - -### -### Run the sample tests. -### -### They're split over multiple bots to make them run faster (and not hit the -### max job time duration for a single job). -### - -- job: macOS - dependsOn: ReportStartToGitHub - displayName: Build samples - timeoutInMinutes: 360 - strategy: - matrix: - # We have rougly 900 tests, which take a while to build for device. - # So in that case, we split them in 3 buckets of roughly 300 tests each, - # based on the first letter of the project's filename. - Debug_iPhone_AF: - TEST_PLATFORM_FILTER_EXPRESSION: $(iphone_filter) - TEST_CONFIG_FILTER_EXPRESSION: $(debug_filter) - TEST_NAME_FILTER_EXPRESSION: $(name_filter_af) - Debug_iPhone_GR: - TEST_PLATFORM_FILTER_EXPRESSION: $(iphone_filter) - TEST_CONFIG_FILTER_EXPRESSION: $(debug_filter) - TEST_NAME_FILTER_EXPRESSION: $(name_filter_gr) - Debug_iPhone_SZ: - TEST_PLATFORM_FILTER_EXPRESSION: $(iphone_filter) - TEST_CONFIG_FILTER_EXPRESSION: $(debug_filter) - TEST_NAME_FILTER_EXPRESSION: $(name_filter_rest) - Debug_iPhoneSimulator: - TEST_PLATFORM_FILTER_EXPRESSION: $(iphonesimulator_filter) - TEST_CONFIG_FILTER_EXPRESSION: $(debug_filter) - Release_iPhone_AF: - TEST_PLATFORM_FILTER_EXPRESSION: $(iphone_filter) - TEST_CONFIG_FILTER_EXPRESSION: $(release_filter) - TEST_NAME_FILTER_EXPRESSION: $(name_filter_af) - Release_iPhone_GR: - TEST_PLATFORM_FILTER_EXPRESSION: $(iphone_filter) - TEST_CONFIG_FILTER_EXPRESSION: $(release_filter) - TEST_NAME_FILTER_EXPRESSION: $(name_filter_gr) - Release_iPhone_SZ: - TEST_PLATFORM_FILTER_EXPRESSION: $(iphone_filter) - TEST_CONFIG_FILTER_EXPRESSION: $(release_filter) - TEST_NAME_FILTER_EXPRESSION: $(name_filter_rest) - Release_iPhoneSimulator: - TEST_PLATFORM_FILTER_EXPRESSION: $(iphonesimulator_filter) - TEST_CONFIG_FILTER_EXPRESSION: $(release_filter) - Debug_Mac: - TEST_PLATFORM_FILTER_EXPRESSION: $(mac_platform_filter) - TEST_CONFIG_FILTER_EXPRESSION: $(debug_filter) - Release_Mac: - TEST_PLATFORM_FILTER_EXPRESSION: $(mac_platform_filter) - TEST_CONFIG_FILTER_EXPRESSION: $(release_filter) - - pool: - name: '$(azpPoolName)' - vmImage: '$(macOSVersion)' - - steps: - - checkout: self - path: s/xamarin-macios - - checkout: xamarin-macios-data - persistCredentials: true - - checkout: maccore - persistCredentials: true - - - bash: ./xamarin-macios/tools/devops/system-info.sh - displayName: System Info - - - bash: ./xamarin-macios/tools/devops/fetch-maccore.sh - displayName: Fetch correct maccore hash - - - bash: | - echo "Requested Xcode $XCODE_URL" - make -C $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/ provision-xcode.csx - displayName: 'Generate Xcode provisioning csx file' - - - task: provisionator@2 - displayName: Xcode - inputs: - provisionator_uri: '$(provisionator-uri)' - github_token: '$(github-pat)' - provisioning_script: $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/provision-xcode.csx - - - task: provisionator@2 - displayName: Provision XI/XM/Mono/Objective-Sharpie - inputs: - provisionator_uri: '$(provisionator-uri)' - github_token: '$(github-pat)' - provisioning_script: $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/build-samples.csx - - - bash: ./xamarin-macios/tools/devops/system-info.sh - displayName: System Info post provisioning - - - bash: ./xamarin-macios/tools/devops/build-samples.sh - displayName: Run tests - - - task: PublishTestResults@2 - displayName: Publish test results - condition: always() - inputs: - testResultsFormat: NUnit - testResultsFiles: '**/TestResult*.xml' - testRunTitle: Sample tests (build) - publishRunAttachments: true - mergeTestResults: true - - - bash: ./xamarin-macios/tools/devops/prepare-performance-data.sh - displayName: Prepare performance data - condition: always() - - - publish: logs - displayName: 'Upload perf data' - condition: always() - artifact: logs-$(System.JobId) - - - bash: echo "##vso[task.setvariable variable=JobStatus;isOutput=true]$AGENT_JOBSTATUS" - name: ExportedVariables - displayName: Export status - condition: always() - -### -### Push performance data to the xamarin-macios-data repository -### - -- job: PublishPerformanceData - displayName: Publish Performance Data - condition: always() - dependsOn: macOS - pool: - name: '$(azpPoolName)' - vmImage: '$(macOSVersion)' - steps: - - checkout: self - path: s/xamarin-macios - - checkout: xamarin-macios-data - persistCredentials: true - - - task: DownloadPipelineArtifact@2 - displayName: Download performance data - inputs: - source: current - path: logs - - - bash: ./xamarin-macios/tools/devops/push-performance-data.sh - displayName: Publish perf data - - - bash: echo "##vso[task.setvariable variable=JobStatus;isOutput=true]$AGENT_JOBSTATUS" - name: ExportedVariables - displayName: Export status - condition: always() - -### -### Report final results to GitHub -### - -- job: ReportResultsToGitHub - displayName: Report status/results to GitHub - dependsOn: - - PublishPerformanceData - - macOS - condition: always() - pool: - name: '$(azpPoolName)' - vmImage: '$(macOSVersion)' - variables: - jobResultDebugiPhoneAF: $[ dependencies.macOS.outputs['Debug_iPhone_AF.ExportedVariables.JobStatus'] ] - jobResultDebugiPhoneGR: $[ dependencies.macOS.outputs['Debug_iPhone_GR.ExportedVariables.JobStatus'] ] - jobResultDebugiPhoneSZ: $[ dependencies.macOS.outputs['Debug_iPhone_SZ.ExportedVariables.JobStatus'] ] - jobResultDebugiPhoneSimulator: $[ dependencies.macOS.outputs['Debug_iPhoneSimulator.ExportedVariables.JobStatus'] ] - jobResultReleaseiPhoneAF: $[ dependencies.macOS.outputs['Release_iPhone_AF.ExportedVariables.JobStatus'] ] - jobResultReleaseiPhoneGR: $[ dependencies.macOS.outputs['Release_iPhone_GR.ExportedVariables.JobStatus'] ] - jobResultReleaseiPhoneSZ: $[ dependencies.macOS.outputs['Release_iPhone_SZ.ExportedVariables.JobStatus'] ] - jobResultReleaseiPhoneSimulator: $[ dependencies.macOS.outputs['Release_iPhoneSimulator.ExportedVariables.JobStatus'] ] - jobResultDebugMac: $[ dependencies.macOS.outputs['Debug_Mac.ExportedVariables.JobStatus'] ] - jobResultReleaseMac: $[ dependencies.macOS.outputs['Release_Mac.ExportedVariables.JobStatus'] ] - jobResultPublishPerformanceData: $[ dependencies.PublishPerformanceData.outputs['ExportedVariables.JobStatus'] ] - steps: - - bash: | - ./tools/devops/build-samples-report-to-github.sh "$(github-pat)" \ - "Debug_iPhone_AF" "Debug_iPhone_GR" "Debug_iPhone_SZ" \ - "Debug_iPhoneSimulator" \ - "Release_iPhone_AF" "Release_iPhone_GR" "Release_iPhone_SZ" \ - "Release_iPhoneSimulator" \ - "Debug_Mac" \ - "Release_Mac" \ - "PublishPerformanceData" - displayName: Report results to GitHub as comment / status - condition: always() diff --git a/tools/devops/fetch-maccore.sh b/tools/devops/fetch-maccore.sh deleted file mode 100755 index cecdb7c19eec..000000000000 --- a/tools/devops/fetch-maccore.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -eux - -# maccore is already checked out, but our script does a different remote -# ('xamarin' vs 'origin'), so add the different remote, and at the same time -# use https for the repository (instead of git@), since GitHub auth on Azure -# Devops only works with https. - -cd "$(dirname "${BASH_SOURCE[0]}")" -cd "$(git rev-parse --show-toplevel)/../maccore" -git remote add -f xamarin https://github.com/xamarin/maccore -cd ../xamarin-macios - -# Make sure we've enabled our xamarin bits -./configure --enable-xamarin - -# fetch the hash we want -make reset-maccore V=1 diff --git a/tools/devops/prepare-performance-data.sh b/tools/devops/prepare-performance-data.sh deleted file mode 100755 index 7d3764d38140..000000000000 --- a/tools/devops/prepare-performance-data.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -ex - -DIR=perf-data/samples/$BUILD_SOURCEBRANCHNAME/$BUILD_SOURCEVERSION/$SYSTEM_JOBID -mkdir -p "$DIR" - -XMLS=(xamarin-macios/tests/sampletester/bin/Debug/tmp-test-dir/execution-logs/*.xml) -if ! test -f "${XMLS[0]}"; then - echo "##vso[task.logissue type=warning]Could not find any performance data to publish" - exit 0 -fi -cp -c xamarin-macios/tests/sampletester/bin/Debug/tmp-test-dir/execution-logs/*.xml "$DIR/" - -mkdir -p logs -zip -9r "logs/execution-logs-$SYSTEM_JOBID.zip" perf-data diff --git a/tools/devops/push-performance-data.sh b/tools/devops/push-performance-data.sh deleted file mode 100755 index 1144154d10ab..000000000000 --- a/tools/devops/push-performance-data.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -ex - -cd xamarin-macios-data -git checkout main -cp -cr ../logs/ ./ - -mv ./*/*.zip . -for zip in ./*.zip; do - unzip "$zip" -done - -# Merge each individual xml file into one big xml file -DIR=perf-data/samples/$BUILD_SOURCEBRANCHNAME/$BUILD_SOURCEVERSION -cd "$DIR" -# Merge the xml files from each bot into a big per-bot xml file. Don't merge -# the xml from all the bots together into a single enormous xml file, because -# it'll be close to GitHub's size limit per file (limit is 100mb, the enormous -# xml file would be ~80mb now), and might very well pass that one day. -for job in ????????-????-????-????-????????????; do -{ - echo '' - echo '' - find "$job" -name '*perfdata*.xml' -print0 | xargs -0 -n 1 tail -n +2 | grep -F -v -e '' -e '' - echo '' -} > "data-$job.xml" -done - -# Add the big xml files to git -git add data-*.xml -git commit -m "Add performance data for $BUILD_SOURCEBRANCHNAME/$BUILD_SOURCEVERSION." - -# Push! -# Try to push 5 times, just in case someone else pushed first. -COUNTER=5 -while [[ $COUNTER -gt 0 ]]; do - if git push; then break; fi - git pull - (( COUNTER-- )) -done diff --git a/tools/devops/system-info.sh b/tools/devops/system-info.sh deleted file mode 100755 index 455544f3f0dd..000000000000 --- a/tools/devops/system-info.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -x - -# we do not want errors to fail the script, we want to print as much info as possible, so we don't pass -e to bash - -uname -a -ls -la /Library/Frameworks/Xamarin.iOS.framework/Versions -ls -la /Library/Frameworks/Xamarin.Mac.framework/Versions -ls -la /Library/Frameworks/ObjectiveSharpie.framework/Versions/ -ls -lad /Applications/Xcode* -xcode-select -p -mono --version -env | sort -uptime -ps aux - -exit 0 diff --git a/tools/devops/utils.csx b/tools/devops/utils.csx deleted file mode 100644 index 6589f76ca9e9..000000000000 --- a/tools/devops/utils.csx +++ /dev/null @@ -1,90 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Net; -using System.Linq; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -using Newtonsoft.Json.Linq; - -string DownloadWithGithubAuth (string uri) -{ - var downloader = new Downloader (); - var path = Path.GetTempFileName (); - var headers = new List<(string, string)> (); - var authToken = AuthToken ("github.com"); - if (!string.IsNullOrEmpty (authToken)) - headers.Add (("Authorization", $"token {authToken}")); - path = downloader - .DownloadItemAsync ( - uri, - headers.ToArray (), - Path.GetDirectoryName (path), - Path.GetFileName (path), - options: Downloader.Options.Default.WithUseCache (false)) - .GetAwaiter () - .GetResult (); - try { - return File.ReadAllText (path); - } finally { - File.Delete (path); - } -} - -string manifest_url = null; -string GetManifestUrl (string hash) -{ - var page = 1; - var hasContent = true; - while (manifest_url == null && hasContent) { - var url = $"https://api.github.com/repos/xamarin/xamarin-macios/statuses/{hash}?page={page}"; - var json = (JArray) JToken.Parse (DownloadWithGithubAuth (url)); - hasContent &= json.HasValues; - if (hasContent) { - manifest_url = (string) ((JValue) json.Where ((v) => v ["context"].ToString () == "vsts-devdiv artifacts").Select ((v) => v ["target_url"]).FirstOrDefault ())?.Value; - } - page++; - } - - if (manifest_url == null) - throw new Exception ($"Could not find the manifest for {hash}. Is the commit already built by CI?"); - return manifest_url; -} - -string[] manifest = null; -string[] GetManifest (string hash) -{ - // The manifest is gone but we can fake it until we make it using the "vsts-devdiv artifacts" - if (manifest == null) { - var artifactsUrl = GetManifestUrl (hash); - var artifactsjson = (JArray) JToken.Parse (DownloadWithGithubAuth (artifactsUrl)); - manifest = artifactsjson.Select ((v) => (string) v ["url"])?.ToArray (); - } - return manifest; -} - -// Looks for a variable either in the environment, or in current repo's Make.config. -// Returns null if the variable couldn't be found. -IEnumerable make_config = null; -string FindConfigurationVariable (string variable, string hash = "HEAD") -{ - var value = Environment.GetEnvironmentVariable (variable); - if (!string.IsNullOrEmpty (value)) - return value; - - if (make_config == null) - make_config = Exec ("git", "show", $"{hash}:Make.config"); - foreach (var line in make_config) { - if (line.StartsWith (variable + "=", StringComparison.Ordinal)) - return line.Substring (variable.Length + 1); - } - - return null; -} - -void InstallPackage (string name, string url) -{ - Console.WriteLine ($"Installing {name} from {url}"); - var version = Regex.Match (url, "[0-9]+[.][0-9]+[.][0-9]+([.][0-9]+)?").Value; - Item (name, version).Source (url); -}