square / anvil

A Kotlin compiler plugin to make dependency injection with Dagger 2 easier.
Apache License 2.0
1.31k stars 82 forks source link

build logic + better publishing #760

Closed RBusarow closed 1 year ago

RBusarow commented 1 year ago

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.