Skip to content

Commit

Permalink
Merge branch 'main' into corevideo-xcode13-beta3
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque committed Sep 9, 2021
2 parents ac7a987 + 897170f commit d44a025
Show file tree
Hide file tree
Showing 262 changed files with 1,972 additions and 10,166 deletions.
19 changes: 13 additions & 6 deletions dotnet/SingleProject.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,24 @@ For our Apple platforms this means we're mapping the following MSBuild
properties to Info.plist keys (this mapping will only take place if the
Info.plist in the project doesn't already contain entries for these keys):

| MSBuild Property | Info.plist key | Notes |
| --------------------|----------------------------|-------------------------------------------|
| ApplicationId | CFBundleIdentifier | |
| ApplicationTitle | CFBundleDisplayName | |
| ApplicationVersion | CFBundleVersion | |
| AppleShortVersion | CFBundleShortVersionString | Defaults to ApplicationVersion when blank |
| MSBuild Property | Info.plist key | Notes |
| --------------------------|----------------------------|-------------------------------------------|
| ApplicationId | CFBundleIdentifier | |
| ApplicationTitle | CFBundleDisplayName | |
| ApplicationVersion | CFBundleVersion | |
| ApplicationDisplayVersion | CFBundleShortVersionString | Defaults to ApplicationVersion when blank |

This is only enabled if the `GenerateApplicationManifest` is set to `true`
(which is the default for `.NET 6`, and not for "legacy"
Xamarin.iOS/Xamarin.Mac)

Additionally, `$(ApplicationDisplayVersion)` will overwrite the value for `$(Version)`,
so the following properties will be set with the same value:

* `$(AssemblyVersion)`
* `$(FileVersion)`
* `$(InformationalVersion)`

Ref: [Issue #10473][2]

[1]: https://github.com/xamarin/xamarin-android/blob/40cedfa89c2660479fcb5e2482d2463fbcad1d04/Documentation/guides/OneDotNetSingleProject.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
},
"minOSVersion": {
"type": "parameter",
"description": "Overrides LSMinimumSystemVersion in the Info.plist",
"description": "Overrides SupportedOSPlatformVersion in the project file",
"replaces": "minOSVersion",
"datatype": "string",
"defaultValue": "10.15.1"
"defaultValue": "14.2"
}
},
"defaultName": "MacCatalystApp1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSMinimumSystemVersion</key>
<string>minOSVersion</string>
<key>UIDeviceFamily</key>
<array>
<integer>2</integer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<SupportedOSPlatformVersion>minOSVersion</SupportedOSPlatformVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"minOSVersion": {
"type": "parameter",
"description": "Overrides MinimumOSVersion in the Info.plist",
"description": "Overrides SupportedOSPlatformVersion in the project file",
"replaces": "minOSVersion",
"datatype": "string",
"defaultValue": "11.2"
Expand Down
2 changes: 0 additions & 2 deletions dotnet/Templates/Microsoft.iOS.Templates/ios/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>minOSVersion</string>
<key>UIDeviceFamily</key>
<array>
<!--#if((deviceFamily == "iphone") || (deviceFamily == "universal"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<SupportedOSPlatformVersion>minOSVersion</SupportedOSPlatformVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"minOSVersion": {
"type": "parameter",
"description": "Overrides LSMinimumSystemVersion in the Info.plist",
"description": "Overrides SupportedOSPlatformVersion in the project file",
"replaces": "minOSVersion",
"datatype": "string",
"defaultValue": "10.14"
Expand Down
2 changes: 0 additions & 2 deletions dotnet/Templates/Microsoft.macOS.Templates/macos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>minOSVersion</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<SupportedOSPlatformVersion>minOSVersion</SupportedOSPlatformVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"minOSVersion": {
"type": "parameter",
"description": "Overrides MinimumOSVersion in the Info.plist",
"description": "Overrides SupportedOSPlatformVersion in the project file",
"replaces": "minOSVersion",
"datatype": "string",
"defaultValue": "11.2"
Expand Down
2 changes: 0 additions & 2 deletions dotnet/Templates/Microsoft.tvOS.Templates/tvos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>minOSVersion</string>
<key>UIDeviceFamily</key>
<array>
<integer>3</integer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<SupportedOSPlatformVersion>minOSVersion</SupportedOSPlatformVersion>
</PropertyGroup>
</Project>
11 changes: 11 additions & 0 deletions dotnet/targets/Xamarin.Shared.Sdk.props
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,15 @@
<_RuntimeIdentifierUsesAppHost>false</_RuntimeIdentifierUsesAppHost>
<UseAppHost>false</UseAppHost>
</PropertyGroup>

<!--
Enable LLVM by default for mobile release builds.
At this point we don't necessarily know yet whether we're building for device or simulator,
but the MtouchUseLlvm value is ignored when using the simulator, so it doesn't matter
if we set it in all cases.
-->
<PropertyGroup Condition="'$(MtouchUseLlvm)' == '' And '$(Configuration)' == 'Release' And ('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS')">
<MtouchUseLlvm>true</MtouchUseLlvm>
</PropertyGroup>
</Project>
58 changes: 35 additions & 23 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<PropertyGroup>
<!-- Use single-project MSBuild properties to generate the application manifest by default -->
<GenerateApplicationManifest Condition="'$(GenerateApplicationManifest)' == ''">true</GenerateApplicationManifest>
<Version Condition="'$(GenerateApplicationManifest)' == 'true' and '$(ApplicationDisplayVersion)' != ''">$(ApplicationDisplayVersion)</Version>
</PropertyGroup>

<UsingTask TaskName="Xamarin.MacDev.Tasks.CompileNativeCode" AssemblyFile="$(_XamarinTaskAssembly)" />
Expand Down Expand Up @@ -215,7 +216,6 @@
_CompileCoreMLModels;
_CreatePkgInfo;
_SmeltMetal;
_ForgeMetal;
_TemperMetal;
_CompileEntitlements;
_DetectAppManifest;
Expand All @@ -232,6 +232,7 @@
_LinkNativeExecutable;
_ComputePublishLocation;
CopyFilesToPublishDirectory;
_CopyFrameworksToBundle;
_CopyAppExtensionsToBundle;
</CreateAppBundleDependsOn>

Expand Down Expand Up @@ -560,30 +561,39 @@
<WriteLinesToFile SessionId="$(BuildSessionId)" File="$(_CustomLinkerOptionsFile)" Lines="$(_CustomLinkerOptions)" Overwrite="true" />
</Target>

<!-- Look in the NativeReference items for frameworks that need to be added to the app bundle, and add all those frameworks to ResolvedFileToPublish (as separate files) -->
<!-- Look in the _FrameworkNativeReference items for frameworks that need to be added to the app bundle, and add all those frameworks to _FrameworkToPublish -->
<Target Name="_ComputeFrameworkFilesToPublish" DependsOnTargets="_ExpandNativeReferences;_ComputeVariables;_LoadLinkerOutput">
<ItemGroup>
<!-- Expand each framework (which are directories) into all the files in the framework -->
<!-- Support a 'CopyToAppBundle' metadata that can be set to 'false' to avoid copying a framework to the app bundle -->
<_FrameworkFilesToPublish Include="%(_FrameworkNativeReference.RootDir)%(_FrameworkNativeReference.Directory)/**/*" Condition="'%(_FrameworkNativeReference.Kind)' == 'Framework' And '%(_FrameworkNativeReference.CopyToAppBundle)' != 'false'">
<_FrameworkIdentity>%(RootDir)%(Directory)</_FrameworkIdentity>
<_FrameworkPath>$(_AppBundleFrameworksDir)\%(Filename).framework</_FrameworkPath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</_FrameworkFilesToPublish>

<!-- Compute the relative path of each file in the framework relative to the framework directory -->
<_FrameworkFilesToPublish Update="@(_FrameworkFilesToPublish)">
<_FrameworkRelativePath>$([System.String]::Copy('%(Identity)').Substring($([System.String]::Copy('%(_FrameworkIdentity)').Length)))</_FrameworkRelativePath>
</_FrameworkFilesToPublish>

<!-- Add all the framework files to ResolvedFileToPublish -->
<ResolvedFileToPublish Include="@(_FrameworkFilesToPublish)">
<RelativePath>%(_FrameworkFilesToPublish._FrameworkPath)\%(_FrameworkFilesToPublish._FrameworkRelativePath)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
<!-- Collect the list of frameworks to publish from _FrameworkNativeReference. The ExtractBindingLibrariesStep in the linker might also add frameworks to _FrameworkToPublish -->
<_FrameworkToPublish Include="@(_FrameworkNativeReference)" Condition="'%(_FrameworkNativeReference.Kind)' == 'Framework' And '%(_FrameworkNativeReference.CopyToAppBundle)' != 'false'" />

<!-- Set TargetDirectory and SourceDirectory for all frameworks we have to publish -->
<_FrameworkToPublish Update="@(_FrameworkToPublish)">
<TargetDirectory>$(_RelativePublishDir)$(_AppBundleFrameworksDir)\%(Filename).framework</TargetDirectory>
<SourceDirectory>%(RootDir)%(Directory)</SourceDirectory>
</_FrameworkToPublish>
</ItemGroup>
</Target>

<Target Name="_CopyFrameworksToBundle"
DependsOnTargets="_ComputeFrameworkFilesToPublish"
Inputs="@(_FrameworkToPublish)"
Outputs="@(_FrameworkToPublish -> '%(TargetDirectory)%(Filename)')"
>
<!-- We specifically do *not* use the publishing logic in .NET to (ResolvedFileToPublish) copy frameworks to the app bundle, because symlinks aren't handled correctly.
In particular, MSBuild can't handle symlinks to directories: https://github.com/dotnet/msbuild/issues/6821.
So we have a custom item group (_FrameworkToPublish), which we copy ourselves.
-->
<Ditto
SessionId="$(BuildSessionId)"
Condition="'$(IsMacEnabled)' == 'true'"
ToolExe="$(DittoExe)"
ToolPath="$(DittoPath)"
Source="%(_FrameworkToPublish.SourceDirectory)"
Destination="%(_FrameworkToPublish.TargetDirectory)"
/>
</Target>

<!-- Look in the NativeReference items for dylibs that need to be added to the app bundle, and add all those frameworks to ResolvedFileToPublish (as separate files) -->
<Target Name="_ComputeDynamicLibrariesToPublish" DependsOnTargets="_ExpandNativeReferences;_ComputeVariables;_LoadLinkerOutput">
<ItemGroup>
Expand Down Expand Up @@ -641,9 +651,9 @@
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_AssembliesToAOT.items" Condition="Exists('$(_LinkerItemsDirectory)/_AssembliesToAOT.items')">
<Output TaskParameter="Items" ItemName="_AssembliesToAOT" />
</ReadItemsFromFile>
<!-- Load _FrameworkFilesToPublish -->
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_FrameworkFilesToPublish.items" Condition="Exists('$(_LinkerItemsDirectory)/_FrameworkFilesToPublish.items')">
<Output TaskParameter="Items" ItemName="_FrameworkFilesToPublish" />
<!-- Load _FrameworkToPublish -->
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_FrameworkToPublish.items" Condition="Exists('$(_LinkerItemsDirectory)/_FrameworkToPublish.items')">
<Output TaskParameter="Items" ItemName="_FrameworkToPublish" />
</ReadItemsFromFile>
<!-- Load _DynamicLibraryToPublish -->
<ReadItemsFromFile SessionId="$(BuildSessionId)" File="$(_LinkerItemsDirectory)/_DynamicLibraryToPublish.items" Condition="Exists('$(_LinkerItemsDirectory)/_DynamicLibraryToPublish.items')">
Expand Down Expand Up @@ -722,6 +732,8 @@
<!-- Take into account that 'PublishDir' may or may not be an absolute path to begin with -->
<_AbsolutePublishDir>$(PublishDir)</_AbsolutePublishDir>
<_AbsolutePublishDir Condition="!$([System.IO.Path]::IsPathRooted ('$(_AbsolutePublishDir)'))">$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\$(PublishDir)'))</_AbsolutePublishDir>
<!-- Compute the relative path to the publish directory ('PublishDir' is by default a relative path, but the developer might use an absolute path) -->
<_RelativePublishDir>$([MSBuild]::MakeRelative($(MSBuildProjectDirectory),$(_AbsolutePublishDir)))</_RelativePublishDir>
<!-- Compute the relative path of the app bundle relative to the publish directory. The _AppBundlePath is relative to the project directory, so to compute this we need to have both app bundle path and the publish directory as absolute paths first. -->
<_RelativeAppBundlePath>$([MSBuild]::MakeRelative($(_AbsolutePublishDir),$(MSBuildProjectDirectory)/$(_AppBundlePath)))</_RelativeAppBundlePath>

Expand Down
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.100-rc.2.21425.12">
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.100-rc.2.21456.8">
<Uri>https://github.com/dotnet/installer</Uri>
<Sha>49485bd6125f6cd23c75e0af463c44c3ea0d6278</Sha>
<Sha>b238cfad7138873efd5a8b731a6b523a141d4ac5</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="6.0.100-preview.6.21419.1" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="6.0.100-preview.6.21452.4" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
<Uri>https://github.com/mono/linker</Uri>
<Sha>5851f6d62fedd9eb2edea9712c9764ca2ad6ab60</Sha>
<Sha>8a5c446a84922bddccfcfc6d3cb5c117dc3babd4</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<!--Package versions-->
<PropertyGroup>
<MicrosoftDotnetSdkInternalPackageVersion>6.0.100-rc.2.21425.12</MicrosoftDotnetSdkInternalPackageVersion>
<MicrosoftNETILLinkTasksPackageVersion>6.0.100-preview.6.21419.1</MicrosoftNETILLinkTasksPackageVersion>
<MicrosoftDotnetSdkInternalPackageVersion>6.0.100-rc.2.21456.8</MicrosoftDotnetSdkInternalPackageVersion>
<MicrosoftNETILLinkTasksPackageVersion>6.0.100-preview.6.21452.4</MicrosoftNETILLinkTasksPackageVersion>
<MicrosoftDotNetBuildTasksFeedPackageVersion>6.0.0-beta.21212.6</MicrosoftDotNetBuildTasksFeedPackageVersion>
</PropertyGroup>
</Project>
2 changes: 2 additions & 0 deletions msbuild/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,9 @@ MSBUILD_PRODUCTS += $(DOTNET_TARGETS)
DOTNET_IOS_WINDOWS_OUTPUT_FILES = \
$(foreach dll,$(IOS_WINDOWS_TASK_ASSEMBLIES),$(dll).*) \
$(foreach dll,$(IOS_WINDOWS_DEPENDENCIES),$(dll).*) \
iSign.Core.pdb \
System.Diagnostics.Tracer.pdb \
Xamarin.iOS.Windows.Client.pdb \
Broker.zip \
Build.zip \
Xamarin.PreBuilt.iOS.app.zip
Expand Down
9 changes: 9 additions & 0 deletions msbuild/Xamarin.Localization.MSBuild/MSBStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1308,4 +1308,13 @@
{0}: the path to the compiler
</comment>
</data>

<data name="E7082" xml:space="preserve">
<value>The {0} value in the Info.plist ({1}) does not match the SupportedOSPlatformVersion value in the project file ({2}).</value>
<comment>
{0}: the name of a value from the Info.plist file the message talks about (either 'MinimumOSVersion' or 'LSMinimumSystemVersion').
{1}: the value from the Info.plist.
{2}: the value from the project file.
</comment>
</data>
</root>
1 change: 0 additions & 1 deletion msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ Copyright (C) 2014 Xamarin. All rights reserved.
_DetectSigningIdentity;
_CopyResourcesToBundle;
_SmeltMetal;
_ForgeMetal;
_TemperMetal;
_CompileEntitlements;
_WriteAppManifest;
Expand Down
4 changes: 3 additions & 1 deletion msbuild/Xamarin.MacDev.Tasks.Core/Tasks/CodesignTaskBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,14 @@ IList<string> GenerateCommandLineArguments (ITaskItem item)
// signing a framework and a file inside a framework is not *always* identical
// on macOS apps {item.ItemSpec} can be a symlink to `Versions/Current/{item.ItemSpec}`
// and `Current` also a symlink to `A`... and `_CodeSignature` will be found there
var path = PathUtils.ResolveSymbolicLinks (item.ItemSpec);
var path = item.ItemSpec;
var parent = Path.GetDirectoryName (path);

// so do not don't sign `A.framework/A`, sign `A.framework` which will always sign the *bundle*
if ((Path.GetExtension (parent) == ".framework") && (Path.GetFileName (path) == Path.GetFileNameWithoutExtension (parent)))
path = parent;

path = PathUtils.ResolveSymbolicLinks (path);
args.Add (Path.GetFullPath (path));

return args;
Expand Down
Loading

0 comments on commit d44a025

Please sign in to comment.