-
Notifications
You must be signed in to change notification settings - Fork 84
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
build logic + better publishing #760
Conversation
db45ecc
to
bf082cb
Compare
bf082cb
to
68c66a0
Compare
build-logic/build.gradle
Outdated
gradlePlugin { | ||
plugins { | ||
module { | ||
id = "library" |
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.
"library" is so generic, why not com.squareup.anvil.library
?
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.
In my head, I consider local convention plugins to be closely related to precompiled script plugins or built-in plugins. Since the precompiled plugins often have short names and the built-in ones all have short names, I'm mostly convinced that this type of plugin should also have a short name.
It's not something I feel strongly about, though. If you're unconvinced, I can change it.
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 don't feel strongly either. But my first impression was "what's that and where is it coming from". Searching only for "library" also takes longer.
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 will continue to slightly lean in the other direction, but the IDs have now been lengthened.
@@ -87,6 +90,8 @@ kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = | |||
kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinpoet" } | |||
kotlinpoet-ksp = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlinpoet" } | |||
|
|||
kgx = { module = "com.rickbusarow.kgx:kotlin-gradle-extensions", version.ref = "kgx" } |
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.
Sneaky
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.
Hiding in plain sight!
Actually, I forgot about this or I would have called it out. It has lots of excellent build-logic yak-shaving applications.
This introduces a convention plugin to handle publishing for the main build and the
gradle-plugin
build. It mostly just uses the newer base plugin, and most of the configuration still just comes fromgradle.properties
. The important difference is that each module now sets its artifact ID, pom name, and pom description from inside the DSL, such as:This allows us to just symlink the
gradle-plugin/gradle.properties
without worrying about breaking publishing.I tried to avoid yak-shaving. There's lots more than can be moved to conventions, but this is enough to unblock local publishing for integration tests.