-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Using kts files instead of .gradle #807
base: main
Are you sure you want to change the base?
Conversation
would you mind re-basing when you get the chance, please |
This commit also correct double quotes handling for properties.
This is required having disabled compile avoidance for kapt in master: kapt.include.compile.classpath=false
Rebase on master plus, a commit to add the main Glide artifact to kapt classpath. This is required having disabled compile avoidance for kapt in master:
|
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.
Overall, for someone with no experience with kts, this looks good.
Maybe someone else, could take a look as well.
gradle.properties
Outdated
|
||
# Use kapt in parallel | ||
kapt.use.worker.api=true | ||
## Use kapt incremental |
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.
is this not needed anymore?
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.
Incremental annotation processing is enabled by default starting from version 1.3.50.
- Split the config object into three separate files based on content - Cleanup main build.gradle.kts
- Incremental annotation processing is now enabled by default - Too many kts in "build.gradle.kts.kts.kts".
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.
AFAICT depconstraints
only hosts a build file. Does it need to be its own project for that?
id("maven-publish") | ||
} | ||
|
||
val appcompat = "1.1.0" |
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.
Why arent' these constant?
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 would prefer to not put them in an object: "const val are only allowed on top level or in objects
buildSrc/src/main/java/Libs.kt
Outdated
@Suppress("MayBeConstant") // Improve perf when changing values | ||
|
||
object Libs { | ||
val AX_ANNOTATION = "androidx.annotation:annotation:" |
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.
Either const & SCREAMING_SNAKE_CASE or non const & pascalCase
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.
const & screaming
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.
This is a special components that needs to be consumed by the other modules:
https://docs.gradle.org/current/userguide/java_platform_plugin.html#sec:java_platform_consumption
e.g. it needs to be a project that can be imported:
dependencies {
// get recommended versions from the platform project
api(platform(project(":platform")))
// no version required
api("commons-httpclient:commons-httpclient")
}
📢 Type of change
📜 Description
Moving to Kotlin DSL for the gradle build scripts.
💡 Motivation and Context
Having a single language both for the app and for its build script.
💚 How did you test it?
./gradlew check
📝 Checklist
./gradlew spotlessApply
before submitting the PR🔮 Next steps
Improve KTS design and build speed.
📸 Screenshots / GIFs