Suggested build files changes #177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello, I have recently looked a bit on Phocid build files and I think there are a few improvements that can be done.
gradle.properties changes
jvmargs
This defines the parameters given to the Java process that runs Gradle.
I personally have standardized my projects to something like this (I have 32 GB of RAM, so I gave it quite a bit of RAM):
The relevant part is the 4GB for both Java a and the Kotlin daemon.
gradle speedup
To speed up the gradle build I also use these:
Those can generally be applied to any Gradle project without any drawbacks and they are well documented on the Gradle website:
There's a third option however it causes a few issues with you project:
Apparently this one is not a fan of some of your custom tasks
others
This one can be removed:
Since AGP 8.0 it's set to true by default.
result
If you apply those changes you should get a file similar to this:
Module-level buiild.gradle
Update Java
These are set to Java 8:
AFAIK
sourceCompatibilitydetermines the features that can be used in Java code based on which release the feature was introduced,targetCompatibilityandkotlinOptions.jvmTargetaffect the Java and Kotlin bytecode generation (whcih later goes through a process to become dalvik bytecode).Ideally this should be updated to a newer Java LTS, such as 11, 17, 21 or 25. According to the Android developer docs
, Android uses Java 11 since Android 12 and Java 17 since Android 14 (but since ART is a Mainline module since Android 12, this means Java 17 support was backported)
Compose compiler
This line is uneeded:
According to the docs you are already using its replacement: