-
-
Notifications
You must be signed in to change notification settings - Fork 421
Android: Variant and Release Submodules #6126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Android: Variant and Release Submodules #6126
Conversation
# Conflicts: # libs/androidlib/src/mill/androidlib/AndroidR8AppModule.scala
| * Never use these defaults in a production environment as they are not secure. | ||
| * This is just for testing purposes. | ||
| */ | ||
| def androidReleaseKeyName: Option[String] = Some("releaseKey.jks") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think with this change, we should remove the defaults and avoid the comment above
|
Hi! I'm I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:
|
|
@lefou what do you think about this approach? Looking at the build variants in general, I think the cross module might be a better fit and perhaps we give a trait to easily achieve the release targets. Just thinking out loud: For the variants in general the users are free to create a cross module themselves, but we should have something for release imo, but in this form a lot of the weight falls on us maintaining it while perhaps a different cross module approach than our first attempt would be better, for example having a |
This implements #6047 (comment).
Changes
androidIsDebugtofalse.Having a dedicated Variant for each module type (Android, AndroidKotlin, AndroidR8, AndroidNative) seems necessary to avoid missing configurations.
Users now need to create a
releaseobject that extends the correspondingReleasetrait, and then run:./mill app.release.compile, etcWhat's Next
Remove the
androidIsDebugflag and instead let theReleasetraits override the relevant tasks directly.Release configurations (keystore details) should be in the release variant too
Concerns
This approach utilizes shared resources and may provide a better user experience with the APIs. However in my opinion, manually overriding tasks to reference outer implementations may be error-prone, both in terms of development and potential unexpected behavior if users override unshared tasks.
Maybe the shared base trait approach is something safer and more scalable, but with the cost of not sharing resources. Perhaps we could use the
outerapproach —just as an exception— to share some resource-heavy tasks.