'Shared target values in MS Build
Trying to replace values in the generated AppManifest.Plist (info.plist) in a post-build script (Xamarin iOS).
Minimum example:
#!/usr/bin/env bash PLIST="$buildPath/obj/iPhoneSimulator/Debug/device-builds/iphone14.5-15.4/AppManifest.plist" /usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier com.test.test" "$PLIST"
where buildPath is defined as MSBuildProjectDirectory.
The problem is finding the generic path for "$buildPath/obj/iPhoneSimulator/Debug/device-builds/iphone14.5-15.4/". This path is defined in the source code for Xamarin iOS as _AppBundleManifestPath, which is a result set by the ParseDeviceSpecificBuildInformation class. (https://github.com/xamarin/xamarin-macios/blob/08978fa4b13c540ca2916915985d62345fd80229/msbuild/Xamarin.Shared/Xamarin.Shared.targets#L1061)
How can I, if possible, access this value in my post-build script?
This is how the post-build is run:
<PropertyGroup>
<IntermediateOutputPath>obj$(Platform)$(Configuration)</IntermediateOutputPath><_AppManifest>$(IntermediateOutputPath)AppManifest.plist</_AppManifest>
<PostBuildEvent>export "buildPath=$(MSBuildProjectDirectory)";
chmod 700 $(MSBuildProjectDirectory)\local-post-build-ios.sh;
$(MSBuildProjectDirectory)\local-post-build-ios.sh;
unset buildPath
</PostBuildEvent>
</PropertyGroup>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
