0

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?

Igor Strekha
  • 176
  • 3
  • 17
  • `cat $APPCENTER_SOURCE_DIRECTORY/UserApp/UserApp.Android/Properties/Conf1AndroidManifest.xml > $APPCENTER_SOURCE_DIRECTORY/UserApp/UserApp.Android/Properties/AndroidManifest.xml` and `cat $APPCENTER_SOURCE_DIRECTORY/UserApp/UserApp.Android/Properties/Conf2AndroidManifest.xml > $APPCENTER_SOURCE_DIRECTORY/UserApp/UserApp.Android/Properties/AndroidManifest.xml` or this is more complex problem ? What do you want to achieve ? – 3sky Jul 10 '18 at 12:35
  • Which is the question? Which is the problem? Which is the code failing? – Poshi Jul 10 '18 at 12:41
  • Yes. If I use appcenter-post-clone.sh Conf1AndroidManifest.xml does not rewrite AndroidManifest.xml . – Igor Strekha Jul 10 '18 at 13:06
  • are you sure the script is getting executed? – Jeremy Jul 16 '18 at 18:27

0 Answers0