Reputation: 1847
I have a Xamarin Android+iOS application with a .NET standard library, and I want to condition the compiling of some .cs files in my library depending on the package in the AndroidManifest.xml / the bundle identifier in the info.plist. This because I need to customize the app for more customers with different configurations. The condition should also consider if my configuration is Debug or Release (file need to be excluded only in Release configuration).
<Compile Include="ConditionalFile.cs" Condition="'$(Configuration)' == 'Debug'" />
The condition for the debug, I need to add some kind of "or clause" and to fill it, maybe with a bash script launched when it's time to compile the apk/ipa.
Any idea?
Upvotes: 0
Views: 296
Reputation: 1847
One solution I've found is this one:
Custom property with the id of my app: <PackageId>it.mpic.x</PackageId>
bash script which changes the <PackageId>
element with the right app-id before the release
Compile condition in or: Condition="'$(Configuration)' == 'Debug' Or '$(PackageId)' == 'it.mpic.x1'"
Upvotes: 1