[msbuild] Unify the _CodesignAppBundle targets between iOS and Mac. (#13870)

The targets were somewhat different, where the Mac version seemed much less
evolved than the iOS version, so this meant mostly update the iOS version to
be Mac-compatible as well (and use it for macOS).
This commit is contained in:
Rolf Bjarne Kvinge 2022-01-28 09:20:58 +01:00 коммит произвёл GitHub
Родитель 5cf3e0ab18
Коммит 0d27c71a48
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 52 добавлений и 56 удалений

Просмотреть файл

@ -65,25 +65,6 @@ Copyright (C) 2014 Xamarin. All rights reserved.
</CreateAppBundleDependsOn>
</PropertyGroup>
<Target Name="_CodesignAppBundle" Condition="'$(_RequireCodeSigning)'" DependsOnTargets="$(_CodesignAppBundleDependsOn)">
<Codesign
Condition="'$(IsMacEnabled)' == 'true'"
SessionId="$(BuildSessionId)"
ToolExe="$(CodesignExe)"
ToolPath="$(CodesignPath)"
CodesignAllocate="$(_CodesignAllocate)"
Keychain="$(CodesignKeychain)"
Entitlements="$(IntermediateOutputPath)Entitlements.xcent"
Resources="$(AppBundleDir)"
SigningKey="$(_CodeSigningKey)"
ExtraArgs="$(CodesignExtraArgs)"
IsAppExtension="$(IsAppExtension)"
UseHardenedRuntime="$(UseHardenedRuntime)"
UseSecureTimestamp="$(UseHardenedRuntime)"
>
</Codesign>
</Target>
<PropertyGroup>
<CompileToNativeDependsOn>
_ComputeLinkMode;

Просмотреть файл

@ -2024,10 +2024,61 @@ Copyright (C) 2018 Microsoft. All rights reserved.
/>
</Target>
<Target Name="_CalculateCodesignAppBundleInputs" Condition="('$(_CanOutputAppBundle)' == 'true' And '$(_CodeSigningKey)' != '') And ('$(IsAppExtension)' == 'false' Or '@(_ResolvedAppExtensionReferences)' != '')">
<Target Name="_CalculateCodesignAppBundleInputs">
<ItemGroup>
<_CodesignAppBundleInputs Include="$(_AppBundlePath)**\*.*" Exclude="$(_AppCodeSignaturePath)_CodeSignature\CodeResources" />
</ItemGroup>
<PropertyGroup>
<_CodesignAppBundleCondition Condition="'$(_PlatformName)' == 'macOS' And '$(_RequireCodeSigning)'">true</_CodesignAppBundleCondition>
<_CodesignAppBundleCondition Condition="'$(_PlatformName)' != 'macOS' And ('$(_CanOutputAppBundle)' == 'true' And '$(_CodeSigningKey)' != '') And ('$(IsAppExtension)' == 'false' Or '@(_ResolvedAppExtensionReferences)' != '')">true</_CodesignAppBundleCondition>
</PropertyGroup>
</Target>
<Target Name="_CodesignAppBundle"
Condition="'$(_CodesignAppBundleCondition)' == 'true'"
DependsOnTargets="$(_CodesignAppBundleDependsOn)"
Inputs="@(_CodesignAppBundleInputs)"
Outputs="$(_AppCodeSignaturePath)_CodeSignature\CodeResources"
>
<PropertyGroup>
<_CodesignDisableTimestamp>False</_CodesignDisableTimestamp>
<_CodesignDisableTimestamp Condition="'$(_SdkIsSimulator)' == 'true' Or '$(_BundlerDebug)' == 'true'">True</_CodesignDisableTimestamp>
<_AppBundleCodesignEntitlements Condition="'$(_PlatformName)' == 'macOS'">$(IntermediateOutputPath)Entitlements.xcent</_AppBundleCodesignEntitlements>
<_AppBundleCodesignEntitlements Condition="'$(_PlatformName)' != 'macOS'">$(_CompiledCodesignEntitlements)</_AppBundleCodesignEntitlements>
</PropertyGroup>
<Codesign
SessionId="$(BuildSessionId)"
Condition="'$(IsMacEnabled)' == 'true'"
CodesignAllocate="$(_CodesignAllocate)"
DisableTimestamp="$(_CodesignDisableTimestamp)"
Entitlements="$(_AppBundleCodesignEntitlements)"
ExtraArgs="$(CodesignExtraArgs)"
IsAppExtension="$(IsAppExtension)"
Keychain="$(CodesignKeychain)"
ResourceRules="$(_PreparedResourceRules)"
Resources="$(AppBundleDir)"
SigningKey="$(_CodeSigningKey)"
ToolExe="$(CodesignExe)"
ToolPath="$(CodesignPath)"
UseHardenedRuntime="$(UseHardenedRuntime)"
UseSecureTimestamp="$(UseHardenedRuntime)"
>
</Codesign>
<Touch
SessionId="$(BuildSessionId)"
Condition="'$(IsMacEnabled)' == 'true' And Exists ('$(AppBundleDir).dSYM\Contents\Info.plist')"
Files="$(AppBundleDir).dSYM\Contents\Info.plist"
/>
<Touch
SessionId="$(BuildSessionId)"
Condition="'$(IsMacEnabled)' == 'true' And Exists ('$(_AppBundlePath)_CodeSignature\CodeResources')"
Files="$(_AppBundlePath)_CodeSignature\CodeResources"
/>
</Target>
<!-- LinkMode -->

Просмотреть файл

@ -434,42 +434,6 @@ Copyright (C) 2013-2016 Xamarin. All rights reserved.
/>
</Target>
<Target Name="_CodesignAppBundle" Condition="('$(_CanOutputAppBundle)' == 'true' And '$(_CodeSigningKey)' != '') And ('$(IsAppExtension)' == 'false' Or '@(_ResolvedAppExtensionReferences)' != '')" DependsOnTargets="$(_CodesignAppBundleDependsOn)"
Inputs="@(_CodesignAppBundleInputs)" Outputs="$(_AppBundlePath)_CodeSignature\CodeResources">
<PropertyGroup>
<_CodesignDisableTimestamp>False</_CodesignDisableTimestamp>
<_CodesignDisableTimestamp Condition="'$(_SdkIsSimulator)' == 'true' Or '$(_BundlerDebug)' == 'true'">True</_CodesignDisableTimestamp>
</PropertyGroup>
<Codesign
SessionId="$(BuildSessionId)"
Condition="'$(IsMacEnabled)' == 'true'"
ToolExe="$(CodesignExe)"
ToolPath="$(CodesignPath)"
CodesignAllocate="$(_CodesignAllocate)"
DisableTimestamp="$(_CodesignDisableTimestamp)"
Keychain="$(CodesignKeychain)"
Entitlements="$(_CompiledCodesignEntitlements)"
ResourceRules="$(_PreparedResourceRules)"
Resources="$(AppBundleDir)"
SigningKey="$(_CodeSigningKey)"
ExtraArgs="$(CodesignExtraArgs)"
>
</Codesign>
<Touch
SessionId="$(BuildSessionId)"
Condition="'$(IsMacEnabled)' == 'true' And Exists ('$(AppBundleDir).dSYM\Contents\Info.plist')"
Files="$(AppBundleDir).dSYM\Contents\Info.plist"
/>
<Touch
SessionId="$(BuildSessionId)"
Condition="'$(IsMacEnabled)' == 'true' And Exists ('$(_AppBundlePath)_CodeSignature\CodeResources')"
Files="$(_AppBundlePath)_CodeSignature\CodeResources"
/>
</Target>
<Target Name="_CoreCreateIpa" Condition="'$(BuildIpa)' == 'true'" DependsOnTargets="Codesign">
<RemoveDir SessionId="$(BuildSessionId)" Condition="'$(IsMacEnabled)' == 'true'" Directories="$(DeviceSpecificIntermediateOutputPath)ipa" />