If I'm in an android project which has one android...
# random
c
If I'm in an android project which has one android app module + android library module in it (that app depends on) If I run ./gradlew app:assembleRelease, will that give me a release build of the library too?
👌 2
j
Yes. You can verify this by running the command with
--dry-run
, it will show that it calls release tasks on the library (like
compileReleaseKotlinAndroid
and others).
today i learned 1
c
thanks! lemme give that a shot. i know technically in AS in the build variant panel you can technically have an app in release and lib in debug, and so i wasn't sure if that also somehow affected things.
yep. that did the trick. awesome. thank you! TIL
t
another cool fairly recent thing is you can also publish multiple variants so even when pulling from maven you can get the same treatment.
Copy code
publishing {
    multipleVariants {
        allVariants()
        withSourcesJar()
    }
}
Personally I prefer that since it makes consuming from maven basically 1:1 behavior with depending on a project in the same build. For quite a while the IDE wouldn't handle source loading correctly when consuming multiple variants but its fine now.
🎉 1