I create builds using AppCenter.ms. But My project has many CustomAndroidManifest.xml files. It places on UserApp/UserApp.Android/Properties/
AppCenter automatically increments version code. But AppCenter changes it in AndroidManifest.xml.
Task: I need to rewrite CustomAndroidManifest.xml to AndroidManifest.xml before AppCenter will change build number.
Why I have many CustomAndroidManifests... because My App has many Configurations.
I've created appcenter-post-clone.sh file and put it in Droid folder. Please look at the my script:
#!/usr/bin/env bash
if [ "$APPCENTER_XAMARIN_CONFIGURATION" == "Conf1" ];
then
cp -R $APPCENTER_SOURCE_DIRECTORY/UserApp/UserApp.Android/Properties/Conf1AndroidManifest.xml/. $APPCENTER_SOURCE_DIRECTORY/UserApp/UserApp.Android/Properties/AndroidManifest.xml/
if [ "$APPCENTER_XAMARIN_CONFIGURATION" == "Conf2" ];
then
cp -R $APPCENTER_SOURCE_DIRECTORY/UserApp/UserApp.Android/Properties/Conf2AndroidManifest.xml/. $APPCENTER_SOURCE_DIRECTORY/UserApp/UserApp.Android/Properties/AndroidManifest.xml/
fi
Main Idea is change first file to second. Thank you.
EDIT! Problem is that CustomAndroidManifest.xml dos not rewrite to AndroidManifest.xml.
Question: How can I rewrite one file to second using bash?