[msbuild] Only sign the app bundle if codesigning is enabled. Fixes #16197. (#16266)

Only sign the app bundle if codesigning is enabled.

This fixes a bug where we'd still try to sign an app bundle, even if the user
disabled code signing by setting EnableCodeSigning=false, if the default logic
was to sign the app bundle.

Fixes https://github.com/xamarin/xamarin-macios/issues/16197.
This commit is contained in:
Rolf Bjarne Kvinge 2022-10-10 15:33:20 +02:00 коммит произвёл GitHub
Родитель acf4edbfed
Коммит 7336100b9a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 1 удалений

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

@ -2049,8 +2049,9 @@ Copyright (C) 2018 Microsoft. All rights reserved.
We only run the CodesignAppBundle target on the outer-most executable project
* Not on app extensions
* Not on watch apps
* Not if explicitly disabled by setting EnableCodeSigning=false
-->
<_CodesignAppBundleCondition Condition="'$(_CodesignAppBundleCondition)' == '' And '$(IsAppExtension)' != 'true' And '$(IsWatchApp)' != 'true' And '$(_CanOutputAppBundle)' == 'true'">true</_CodesignAppBundleCondition>
<_CodesignAppBundleCondition Condition="'$(_CodesignAppBundleCondition)' == '' And '$(IsAppExtension)' != 'true' And '$(IsWatchApp)' != 'true' And '$(_CanOutputAppBundle)' == 'true' And '$(EnableCodeSigning)' != 'false'">true</_CodesignAppBundleCondition>
<_CodesignAppBundleCondition Condition="'$(_CodesignAppBundleCondition)' == ''">false</_CodesignAppBundleCondition>
</PropertyGroup>
</Target>