Skip to content
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

Merged
merged 3 commits into from
Oct 30, 2023
Merged

build logic + better publishing #760

merged 3 commits into from
Oct 30, 2023

Conversation

RBusarow
Copy link
Collaborator

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 from gradle.properties. The important difference is that each module now sets its artifact ID, pom name, and pom description from inside the DSL, such as:

publish {
  configurePom(
      artifactId: 'annotations-optional',
      pomName: 'Anvil Optional Annotations',
      pomDescription: 'Optional annotations that we\'ve found to be helpful with managing larger dependency graphs'
  )
}

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.

@RBusarow RBusarow marked this pull request as ready for review October 27, 2023 01:55
gradlePlugin {
plugins {
module {
id = "library"
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Copy link
Collaborator Author

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" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sneaky

Copy link
Collaborator Author

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.

@RBusarow RBusarow merged commit b6e0b3a into main Oct 30, 2023
19 checks passed
@RBusarow RBusarow deleted the rick/build-logic branch October 30, 2023 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants