-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Refactor some build logic to the buildSrc & gradle kotlin-dsl #218
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
Files buildSrc/src/main/java/{Versions.kt,Libs.kt} are generated with the task $ ./gradlew syncLibs Signed-off-by: Jean-Michel Fayard <jmfayard@gmail.com>
CLAs look good, thanks! |
Mmh, test |
That test is a bit flaky, and #212 should fix it. I manually kicked off a CI re-run. |
Wow, pretty same what I want to introduce, thx @jmfayard, however, it is real kotlin special, I like it. |
@tiembo anyway I have a good grasp now on Gradle's Kotlin DSL. If not, that's also fine. I used a few projects like yours to make sure that my plugin https://github.com/jmfayard/gradle-kotlin-dsl-libs works correctly, which seems to be the case :) |
@jmfayard could you please resolve conflicts, I am personally as one of fans of dsl. |
…lin-dsl Signed-off-by: Jean-Michel Fayard <jmfayard@gmail.com> # Conflicts: # build.gradle
Got feedback from the gradle team that it's better to sue buildSrc/src/main/kotlin Signed-off-by: Jean-Michel Fayard <jmfayard@gmail.com>
@XinyueZ done |
Signed-off-by: Jean-Michel Fayard <jmfayard@gmail.com>
@jmfayard I think you need format code 🌦 |
@XinyueZ done. |
Hi @jmfayard , apologies for the delay in replying. I like the Kotlin DSL but feel that it's beyond the scope of this Jetpack-focused sample. Happy to note this PR in the README or Wiki as an sample of implementing gradle-kotlin-dsl-libs. Would that work? |
@tiembo no big problem for me, I needed repositories to test my plugin with anyway, so that part is mission accomplished. Just for completion, I realize that putting I think that writing Gradle builds in Kotlin instead of Groovy is the future, but writing them in Groovy is the present, and I wouldn't actually recommend rewriting any existing build just for the sake of the rewrite. In the end, it's just the same Gradle build. What I'm instead doing for my own projects (and it's a Gradle best practice by the way)
|
Referenced this PR in the wiki. |
Refactor some build logic to the buildSrc & gradle kotlin-dsl
Files buildSrc/src/main/java/{Versions.kt,Libs.kt} generated by kotlinpoet and the task
$
./gradlew syncLibs
See https://blog.kotlin-academy.com/gradle-kotlin-the-missing-piece-of-the-puzzle-7528a85f0d2c