Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale
During some testing on the related project, I had to add key android:resizeableActivity to the application to prevent split screen mode causing a crash on Android. As I went to make the changes to flagship to allow adding during init process, I checked the repositories of our existing flagship applications and found all places where we are modifying the AndroidManifest.xml and app/build.gradle files in scripts after the init step. I took these scripts as keys are where we could add some template type injection into the Android init process.
I also added config settings to handle version name and codes. These version config settings should allow us to cleanup the manual step for store builds to fix the version numbers that currently exists in many of our projects.
New Config Values for env configuration
list of strings to add to the dependencies block
string or function that will set version name in gradle.properties. The function will be passed in the current version from package.json
string or function that will set version short code in gradle.properties. The function will be passed in the current version from package.json
string or function that will set android.defaultConfig.versionCode in app/build.gradle. The function will be passed in the current version from package.json
dictionary of attribute values that will added to the activity element of the AndroidManifest for the MainActivity
additional xml elements that get added inside the main application element of the AndroidManifest. Useful for adding additional activity elements or services of dependencies
add additional use:permissions elements to the AndroidManifest
dictionary of attribute values that will added to the application element of the AndroidManifest for the MainApplication
modify deep link host path, some of our apps did not expect url-scheme:/app/* path and just used url-scheme:/* since it works that way on iOS. By allowing this to change we can remove these patch scripts
Test
Note: these changes should be backwards compatible so they should work on any flagship project