Skip to content

Commit

Permalink
Merge branch 'main' into xcode13.0-quicklookui-b1
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelkang committed Aug 13, 2021
2 parents ebec4f3 + bd7e5c2 commit d8a9f40
Show file tree
Hide file tree
Showing 175 changed files with 1,711 additions and 866 deletions.
8 changes: 4 additions & 4 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ MACCATALYST_NUGET_VERSION_FULL=$(MACCATALYST_NUGET_VERSION_NO_METADATA)+$(NUGET_

# Xcode version should have both a major and a minor version (even if the minor version is 0)
XCODE_VERSION=13.0
XCODE_URL=https://dl.internalx.com/internal-files/xcodes/Xcode_13_beta_4.xip
XCODE_DEVELOPER_ROOT=/Applications/Xcode_13.0.0-beta4.app/Contents/Developer
XCODE_URL=https://dl.internalx.com/internal-files/xcodes/Xcode_13_beta_5.xip
XCODE_DEVELOPER_ROOT=/Applications/Xcode_13.0.0-beta5.app/Contents/Developer
XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist)

# Mono version embedded in XI/XM (NEEDED_MONO_VERSION/BRANCH) are specified in mk/mono.mk
Expand All @@ -167,9 +167,9 @@ MIN_CMAKE_URL=https://cmake.org/files/v3.6/cmake-3.6.2-Darwin-x86_64.dmg
MIN_CMAKE_VERSION=2.8.8

# ObjectiveSharpie min/max versions
MIN_SHARPIE_VERSION=3.5.45
MIN_SHARPIE_VERSION=3.5.46
MAX_SHARPIE_VERSION=3.5.99
MIN_SHARPIE_URL=https://download.visualstudio.microsoft.com/download/pr/77766fbc-995f-410b-9546-4a1731051956/d3f34a07d9c3a2fcdda16bb3fe5b41e8/objectivesharpie-3.5.45.pkg
MIN_SHARPIE_URL=https://download.visualstudio.microsoft.com/download/pr/0e9ecce4-10b6-46a4-ae06-ad031b25eafc/761cd868c5c27f5b68765e1fa53fd873/objectivesharpie-3.5.46.pkg

# Minimum OSX versions for building XI/XM
MIN_OSX_BUILD_VERSION=11.0
Expand Down
5 changes: 4 additions & 1 deletion dotnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ $(DOTNET_NUPKG_DIR)/vs-workload.props: Workloads/vs-workload.template.props
$(DOTNET_NUPKG_DIR)/SignList.xml: Workloads/SignList.xml
$(Q) $(CP) $< $@

$(DOTNET_NUPKG_DIR)/SignList.targets: Workloads/SignList.targets
$(Q) $(CP) $< $@

TEMPLATED_FILES = \
$(foreach platform,$(DOTNET_PLATFORMS),Microsoft.$(platform).Sdk/targets/Microsoft.$(platform).Sdk.Versions.props) \
$(foreach platform,$(DOTNET_PLATFORMS),Microsoft.$(platform).Sdk/targets/Microsoft.$(platform).Sdk.SupportedTargetPlatforms.props) \
Expand Down Expand Up @@ -213,7 +216,7 @@ pack-$(shell echo $(1) | tr A-Z a-z): $$(RUNTIME_PACKS_$(1)) $$(REF_PACKS_$(1))
endef
$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(eval $(call PacksDefinitions,$(platform))))

TARGETS += $(RUNTIME_PACKS) $(REF_PACKS) $(SDK_PACKS) $(TEMPLATE_PACKS) $(WORKLOAD_PACKS) $(DOTNET_NUPKG_DIR)/vs-workload.props $(DOTNET_NUPKG_DIR)/SignList.xml
TARGETS += $(RUNTIME_PACKS) $(REF_PACKS) $(SDK_PACKS) $(TEMPLATE_PACKS) $(WORKLOAD_PACKS) $(DOTNET_NUPKG_DIR)/vs-workload.props $(DOTNET_NUPKG_DIR)/SignList.xml $(DOTNET_NUPKG_DIR)/SignList.targets

define InstallWorkload
# .NET comes with a workload for us, but we don't want that, we want our own. So delete the workload that comes with .NET.
Expand Down
53 changes: 53 additions & 0 deletions dotnet/Workloads/SignList.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<Project>
<!-- Extensions for signing nested .zip files for https://github.com/xamarin/yaml-templates/blob/e0f3cdce6210e05495188def8c695372b64ada1d/sign-artifacts/steps/v2-SignFiles.proj -->
<Target Name="_UnzipNestedZips"
BeforeTargets="_CalculateItemsToSign">
<PropertyGroup>
<_NestedZipExtractionDir>$(_WorkingDir)nested\</_NestedZipExtractionDir>
</PropertyGroup>

<ItemGroup>
<_NestedBrokerZip Include="$(_WorkingDir)**\Broker.zip" />
<_NestedBuildZip Include="$(_WorkingDir)**\Build.zip" />
<_NestediOSAppZip Include="$(_WorkingDir)**\Xamarin.PreBuilt.iOS.app.zip" />
</ItemGroup>

<RemoveDir Directories="$(_NestedZipExtractionDir)" />
<Unzip
SourceFiles="@(_NestedBrokerZip)"
DestinationFolder="@(_NestedBrokerZip -> '$(_NestedZipExtractionDir)%(Filename)')"
/>
<Delete Files="@(_NestedBrokerZip)" />

<Unzip
SourceFiles="@(_NestedBuildZip)"
DestinationFolder="@(_NestedBuildZip -> '$(_NestedZipExtractionDir)%(Filename)')"
/>
<Delete Files="@(_NestedBuildZip)" />

<Unzip
SourceFiles="@(_NestediOSAppZip)"
DestinationFolder="@(_NestediOSAppZip -> '$(_NestedZipExtractionDir)%(Filename)')"
/>
<Delete Files="@(_NestediOSAppZip)" />
</Target>

<Target Name="_ZipNestedZips"
DependsOnTargets="_UnzipNestedZips"
AfterTargets="SignFiles" >
<ZipDirectory
SourceDirectory="@(_NestedBrokerZip -> '$(_NestedZipExtractionDir)%(Filename)')"
DestinationFile="@(_NestedBrokerZip)"
/>
<ZipDirectory
SourceDirectory="@(_NestedBuildZip -> '$(_NestedZipExtractionDir)%(Filename)')"
DestinationFile="@(_NestedBuildZip)"
/>
<ZipDirectory
SourceDirectory="@(_NestediOSAppZip -> '$(_NestedZipExtractionDir)%(Filename)')"
DestinationFile="@(_NestediOSAppZip)"
/>
<RemoveDir Directories="$(_NestedZipExtractionDir)" />
</Target>

</Project>
59 changes: 56 additions & 3 deletions dotnet/Workloads/SignList.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,48 @@
<ItemGroup>
<Skip Include="Mono.Options.dll" />
<Skip Include="System.Reflection.MetadataLoadContext.dll" />
<!-- Microsoft.iOS.Windows.Sdk content -->
<Skip Include="tools\msbuild\iOS\Microsoft.Win32.Registry.dll" />
<Skip Include="tools\msbuild\iOS\System.Buffers.dll" />
<Skip Include="tools\msbuild\iOS\System.Memory.dll" />
<Skip Include="tools\msbuild\iOS\System.Numerics.Vectors.dll" />
<Skip Include="tools\msbuild\iOS\System.Runtime.CompilerServices.Unsafe.dll" />
<Skip Include="tools\msbuild\iOS\System.Security.AccessControl.dll" />
<Skip Include="tools\msbuild\iOS\System.Security.Cryptography.Pkcs.dll" />
<Skip Include="tools\msbuild\iOS\System.Security.Cryptography.ProtectedData.dll" />
<Skip Include="tools\msbuild\iOS\System.Security.Principal.Windows.dll" />
<Skip Include="tools\msbuild\iOS\ws2_32.dll" />
<!-- Broker.zip -->
<Skip Include="Broker\Newtonsoft.Json.dll" />
<Skip Include="Broker\System.Net.Mqtt.dll" />
<Skip Include="Broker\System.Net.Mqtt.Server.dll" />
<Skip Include="Broker\System.Reactive.dll" />
<Skip Include="Broker\System.Runtime.CompilerServices.Unsafe.dll" />
<Skip Include="Broker\System.Security.Cryptography.ProtectedData.dll" />
<Skip Include="Broker\System.Threading.Tasks.Extensions.dll" />
<Skip Include="Broker\System.ValueTuple.dll" />
<!-- Build.zip -->
<Skip Include="Build\Microsoft.Bcl.AsyncInterfaces.dll" />
<Skip Include="Build\System.Buffers.dll" />
<Skip Include="Build\System.Collections.Immutable.dll" />
<Skip Include="Build\System.Memory.dll" />
<Skip Include="Build\System.Numerics.Vectors.dll" />
<Skip Include="Build\System.Reflection.Metadata.dll" />
<Skip Include="Build\System.Resources.Extensions.dll" />
<Skip Include="Build\System.Runtime.CompilerServices.Unsafe.dll" />
<Skip Include="Build\System.Text.Encodings.Web.dll" />
<Skip Include="Build\System.Text.Json.dll" />
<Skip Include="Build\System.Threading.Tasks.Dataflow.dll" />
<Skip Include="Build\System.Threading.Tasks.Extensions.dll" />
</ItemGroup>

<!--ItemGroup>
<ThirdParty Include="" />
</ItemGroup-->
<ItemGroup>
<ThirdParty Include="BouncyCastle.Crypto.dll" />
<ThirdParty Include="imobiledevice-*\*.dll" />
<ThirdParty Include="imobiledevice-*\*.exe" />
<!-- Build.zip -->
<ThirdParty Include="Mono.Cecil*.dll" />
</ItemGroup>

<ItemGroup>
<FirstParty Include="bgen.dll" />
Expand All @@ -21,5 +58,21 @@
<FirstParty Include="System.dll" />
<FirstParty Include="System.Numerics.dll" />
<FirstParty Include="System.Xml.dll" />
<!-- Microsoft.iOS.Windows.Sdk content -->
<FirstParty Include="iSign.Core.dll" />
<FirstParty Include="System.Diagnostics.Tracer.dll" />
<!-- Broker.zip -->
<FirstParty Include="Broker.exe" />
<FirstParty Include="Merq.dll" />
<!-- Build.zip -->
<FirstParty Include="Build.exe" />
<FirstParty Include="Microsoft.Build*.dll" />
<FirstParty Include="Microsoft.NET.StringTools.dll" />
<FirstParty Include="System.IO.Abstractions.dll" />
<!-- Xamarin.PreBuilt.iOS.app.zip -->
<FirstParty Include="Xamarin.PreBuilt.iOS.app\*.dll" />
</ItemGroup>

<Import Project="$(MSBuildThisFileDirectory)SignList.targets" />

</Project>
4 changes: 2 additions & 2 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,10 @@
<!-- We only include any mono components when linking with mono statically. The components are already included in the dynamic versions of Mono (both the dylib and the framework) -->
<ItemGroup Condition="'$(_LibMonoLinkMode)' == 'static'">
<!-- Remove files mono told us not to link with -->
<_MonoLibrary Remove="@(_MonoRuntimeComponentDontLink -> '$(_MonoRuntimePackPath)/native/%(Identity)')" />
<_MonoLibrary Remove="@(_MonoRuntimeComponentDontLink -> '$(_MonoRuntimePackPath)native/%(Identity)')" />

<!-- Add files mono told us to link with -->
<_MonoLibrary Include="@(_MonoRuntimeComponentLink -> '$(_MonoRuntimePackPath)/native/%(Identity)')" />
<_MonoLibrary Include="@(_MonoRuntimeComponentLink -> '$(_MonoRuntimePackPath)native/%(Identity)')" />
</ItemGroup>
</Target>

Expand Down
2 changes: 1 addition & 1 deletion mk/mono.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NEEDED_MONO_VERSION := c633fe923832f0c3db3c4e6aa98e5592bf5a06e7
NEEDED_MONO_VERSION := 8b6809243db21a9ab3e2c21570958ab9c537ce29
NEEDED_MONO_BRANCH := 2020-02

MONO_DIRECTORY := mono
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public override bool Execute ()
if (!Compile (plist))
return false;

// Merge with any partial plists generated by the Asset Catalog compiler...
// Merge with any partial plists...
MergePartialPlistTemplates (plist);

CompiledAppManifest = new TaskItem (Path.Combine (AppManifestBundleDirectory, "Info.plist"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ public override bool Execute ()
}

BundleResources = bundleResources.ToArray ();

if (PartialAppManifests != null)
partialPlists.AddRange (PartialAppManifests);
PartialAppManifests = partialPlists.ToArray ();

return !Log.HasLoggedErrors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public override bool Execute ()
xml.Add (value);
break;
default:
Log.LogMessage (MessageImportance.Low, "Skipping unknown argument '{0}' with value '{1}'", name, value);
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,16 @@ public override bool Execute ()
{
var document = XDocument.Load (this.File.ItemSpec);

this.Items = document.Root
var items = document.Root
.Elements (ItemGroupElementName)
.SelectMany (element => element.Elements ())
.Select (element => this.CreateItemFromElement (element))
.ToArray ();
.ToList ();

if (Items != null)
items.AddRange (Items);

Items = items.ToArray ();

return true;
}
Expand Down
16 changes: 8 additions & 8 deletions msbuild/Xamarin.Shared/Xamarin.Shared.targets
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ Copyright (C) 2018 Microsoft. All rights reserved.

<Target Name="_CompileAppManifest"
DependsOnTargets="$(_CompileAppManifestDependsOn)"
Inputs="$(_AppManifest);@(_PartialAppManifest)"
Inputs="$(_AppManifest);@(PartialAppManifest)"
Outputs="$(_AppBundlePath)$(_AppBundleManifestRelativePath)Info.plist" >
<CompileAppManifest
SessionId="$(BuildSessionId)"
Expand All @@ -307,7 +307,7 @@ Copyright (C) 2018 Microsoft. All rights reserved.
IsWatchExtension="$(IsWatchExtension)"
IsXPCService="$(IsXPCService)"
MinimumOSVersion="$(_MinimumOSVersion)"
PartialAppManifests="@(_PartialAppManifest)"
PartialAppManifests="@(PartialAppManifest)"
ResourceRules="$(_PreparedResourceRules)"
TargetArchitectures="$(TargetArchitectures)"
TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)"
Expand Down Expand Up @@ -439,7 +439,7 @@ Copyright (C) 2018 Microsoft. All rights reserved.
<!-- If _BeforeCoreCompileImageAssets did not delete the generated items lists from _CoreCompileImageAsset, then we read them
since that target won't run and we need the output items that are cached in those files, which includes full metadata -->
<ReadItemsFromFile File="$(_ACTool_PartialAppManifestCache)" Condition="Exists('$(_ACTool_PartialAppManifestCache)')">
<Output TaskParameter="Items" ItemName="_PartialAppManifest" />
<Output TaskParameter="Items" ItemName="PartialAppManifest" />
</ReadItemsFromFile>
<ReadItemsFromFile File="$(_ACTool_BundleResourceCache)" Condition="Exists('$(_ACTool_BundleResourceCache)')">
<Output TaskParameter="Items" ItemName="_BundleResourceWithLogicalName" />
Expand Down Expand Up @@ -476,7 +476,7 @@ Copyright (C) 2018 Microsoft. All rights reserved.
SdkVersion="$(_SdkVersion)"
TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)"
>
<Output TaskParameter="PartialAppManifest" ItemName="_PartialAppManifest" />
<Output TaskParameter="PartialAppManifest" ItemName="PartialAppManifest" />
<Output TaskParameter="BundleResources" ItemName="_BundleResourceWithLogicalName" />

<!-- Local items to be persisted to items files -->
Expand All @@ -485,7 +485,7 @@ Copyright (C) 2018 Microsoft. All rights reserved.
</ACTool>

<!-- Cache the generated outputs items for incremental build support -->
<WriteItemsToFile Items="@(_ACTool_PartialAppManifest)" ItemName="_PartialAppManifest" File="$(_ACTool_PartialAppManifestCache)" Overwrite="true" IncludeMetadata="true" />
<WriteItemsToFile Items="@(_ACTool_PartialAppManifest)" ItemName="PartialAppManifest" File="$(_ACTool_PartialAppManifestCache)" Overwrite="true" IncludeMetadata="true" />
<WriteItemsToFile Items="@(_ACTool_BundleResources)" ItemName="_BundleResourceWithLogicalName" File="$(_ACTool_BundleResourceCache)" Overwrite="true" IncludeMetadata="true" />
<ItemGroup>
<FileWrites Include="$(_ACTool_PartialAppManifestCache);$(_ACTool_BundleResourceCache)" />
Expand Down Expand Up @@ -703,7 +703,7 @@ Copyright (C) 2018 Microsoft. All rights reserved.
<!-- If _BeforeCompileCoreMLModels did not delete the generated items lists from _CoreCompileCoreMLModels, then we read them
since that target won't run and we need the output items that are cached in those files, which includes full metadata -->
<ReadItemsFromFile File="$(_CoreMLModel_PartialAppManifestCache)" Condition="Exists('$(_CoreMLModel_PartialAppManifestCache)')">
<Output TaskParameter="Items" ItemName="_PartialAppManifest" />
<Output TaskParameter="Items" ItemName="PartialAppManifest" />
</ReadItemsFromFile>
<ReadItemsFromFile File="$(_CoreMLModel_BundleResourceCache)" Condition="Exists('$(_CoreMLModel_BundleResourceCache)')">
<Output TaskParameter="Items" ItemName="_BundleResourceWithLogicalName" />
Expand All @@ -727,15 +727,15 @@ Copyright (C) 2018 Microsoft. All rights reserved.
ResourcePrefix="$(_ResourcePrefix)"
SdkDevPath="$(_SdkDevPath)">
<Output TaskParameter="BundleResources" ItemName="_BundleResourceWithLogicalName" />
<Output TaskParameter="PartialAppManifests" ItemName="_PartialAppManifest" />
<Output TaskParameter="PartialAppManifests" ItemName="PartialAppManifest" />

<!-- Local items to be persisted to items files -->
<Output TaskParameter="PartialAppManifests" ItemName="_CoreMLModel_PartialAppManifest" />
<Output TaskParameter="BundleResources" ItemName="_CoreMLModel_BundleResources" />
</CoreMLCompiler>

<!-- Cache the generated outputs items for incremental build support -->
<WriteItemsToFile Items="@(_CoreMLModel_PartialAppManifest)" ItemName="_PartialAppManifest" File="$(_CoreMLModel_PartialAppManifestCache)" Overwrite="true" IncludeMetadata="true" />
<WriteItemsToFile Items="@(_CoreMLModel_PartialAppManifest)" ItemName="PartialAppManifest" File="$(_CoreMLModel_PartialAppManifestCache)" Overwrite="true" IncludeMetadata="true" />
<WriteItemsToFile Items="@(_CoreMLModel_BundleResources)" ItemName="_BundleResourceWithLogicalName" File="$(_CoreMLModel_BundleResourceCache)" Overwrite="true" IncludeMetadata="true" />
<ItemGroup>
<FileWrites Include="$(_CoreMLModel_PartialAppManifestCache);$(_CoreMLModel_BundleResourceCache)" />
Expand Down
8 changes: 8 additions & 0 deletions src/AppKit/NSApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#if !__MACCATALYST__

using System;
using System.ComponentModel;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
Expand All @@ -36,7 +37,14 @@ namespace AppKit {
public partial class NSApplication : NSResponder {
public static bool CheckForIllegalCrossThreadCalls = true;
public static bool CheckForEventAndDelegateMismatches = true;

#if !(XAMCORE_4_0 && NET)
#if NET
[EditorBrowsable (EditorBrowsableState.Never)]
[Obsolete ("This field is ignored (treated as if always true).")]
#endif
public static bool IgnoreMissingAssembliesDuringRegistration = false;
#endif

private static Thread mainThread;

Expand Down
1 change: 0 additions & 1 deletion src/AudioUnit/AudioComponentDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public enum AudioTypeEffect { // OSType in AudioComponentDescription
#endif
[Mac (10,15)]
[Unavailable (PlatformName.MacCatalyst)]
[Advice ("This API is not available when using UIKit on macOS.")]
Reverb2=0x72766232, // 'rvb2'
NBandEq=0x6e626571, // 'nbeq'
}
Expand Down
26 changes: 26 additions & 0 deletions src/CoreFoundation/CFArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,31 @@ internal static nint GetCount (IntPtr array)
ret [i] = CFString.FromHandle (CFArrayGetValueAtIndex (handle, i));
return ret;
}

static T? UnsafeGetItem<T> (IntPtr handle, nint index) where T : class, INativeObject
{
var val = CFArrayGetValueAtIndex (handle, index);
// Native code could return a CFArray with kCFNull inside its elements
// and they should be valid for things like T : NSDate so we handle
// them as just null values inside the array
if (val == CFNullHandle)
return null;

return Runtime.GetINativeObject<T> (val, false);
}

// identical signature to NSArray API
static public T?[]? ArrayFromHandle<T> (IntPtr handle) where T : class, INativeObject
{
if (handle == IntPtr.Zero)
return null;

var c = CFArrayGetCount (handle);
T?[] ret = new T [c];

for (nint i = 0; i < c; i++)
ret [i] = UnsafeGetItem<T> (handle, i);
return ret;
}
}
}
2 changes: 1 addition & 1 deletion src/ObjCRuntime/Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ static void CollectReferencedAssemblies (List<Assembly> assemblies, Assembly ass
// that's more important for XI because device builds don't go thru this step
// and we can end up with simulator-only failures - bug #29211
NSLog ("Could not find `{0}` referenced by assembly `{1}`.", fefe.FileName, assembly.FullName);
#if MONOMAC
#if MONOMAC && !NET
if (!NSApplication.IgnoreMissingAssembliesDuringRegistration)
throw;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/SceneKit/Defs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public enum SCNRenderingApi : ulong
{
Metal,
#if !MONOMAC
[Unavailable (PlatformName.MacCatalyst)][Advice ("This API is not available when using UIKit on macOS.")]
[Unavailable (PlatformName.MacCatalyst)]
OpenGLES2,
#else
OpenGLLegacy,
Expand Down
Loading

0 comments on commit d8a9f40

Please sign in to comment.