Reputation: 53
I am working on a javafx 11 mobile project. Gluon client plugin is being used to build APK.
From this single project we need to build multiple apps (APKs) for different customers each with different 'app icon' and 'app name'.
Using maven 'build profiles' I am able to dynamically use text, images based on selected build profile (using resource filtering). Now I have to change 'app name', 'app icon' and 'application id' based on selected build profile.
As stated in official documentation of gluon client plugin, we can change 'app name' in appLabel tag under release configuration. But there was no option to set 'application id' or 'app icon'.
In gradle, we can load properties from '.properties' file and change 'app name' and 'application id'. But, it's not possible with maven (tried with properties-maven-plugin).
How can it be achieved?
Upvotes: 0
Views: 167
Reputation: 1153
Look for the section that describe how to override default Android settings.
If you need to set specific Android settings in
AndroidManifest.xml
, copy the file fromtarget/client/aarch64-android/gensrc/android/AndroidManifest.xml
tosrc/android/AndroidManifest.xml
The next sub section is "Override the default icon". There seems to be a typo, but I guess what you need is a folder like src/android/res
which follows the regular Android rules for naming resource sub-folder and files (like ic_launcher[_round].[xml|png]
).
#edit: I obviously forgot to add the profile related part...
Basically what you need to to, after understanding how to change icon, ist to set up a profile based task that copies the correct resource to the correct folder prior to the client-maven-plugin
begin it's action.
This could be done via Ant tasks or a simple script execution, that does what you need.
At least that would my approach be.
For the app package / ID you'd need to update the AndroidManifest.xml
- because the plugin uses your artifact (I guess) by default for the package ID. Gluon could clarify on that.
Upvotes: 1