Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ To begin using this plugin, you'll need to add the plugin to your `settings.grad
under the hood. If you attempt to place the plugin in your typical `build.gradle` or `build.gradle.kts` files, it will not work.

### Kotlin
<!-- x-release-please-start-version -->
```kotlin
// settings.gradle.kts
plugins {
Expand All @@ -62,6 +63,7 @@ plugins {
id 'xyz.atrius.compositor' version '0.0.1'
}
```
<!-- x-release-please-end -->

#### Additional Note

Expand Down
44 changes: 40 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.vanniktech.maven.publish.GradlePlugin
import com.vanniktech.maven.publish.JavadocJar

plugins {
`java-gradle-plugin`
Expand Down Expand Up @@ -30,7 +32,19 @@ kotlin {
jvmToolchain(17)
}

val projectWebsite: String by project
val license: String by project
val licenseLink: String by project

mavenPublishing {

configure(
GradlePlugin(
javadocJar = JavadocJar.Javadoc(),
sourcesJar = true,
)
)

publishToMavenCentral(automaticRelease = true)
signAllPublications()

Expand All @@ -41,10 +55,6 @@ mavenPublishing {
)

pom {
val projectWebsite: String by project
val license: String by project
val licenseLink: String by project

name = rootProject.name
url = projectWebsite

Expand All @@ -57,6 +67,32 @@ mavenPublishing {
}
}

publishing {
// Both plugins should be deployed as a single artifact to ensure they can be setup automatically
publications {

create<MavenPublication>("Compositor") {
from(components["java"])

groupId = group.toString()
artifactId = rootProject.name
version = property("version") as String

pom {
name = rootProject.name
url = projectWebsite

licenses {
license {
name = license
url = licenseLink
}
}
}
}
}
}

gradlePlugin {
// Since we provide two plugins together that we want deployed as a single plugin, we should disable this to avoid
// publishing either of them separately when running through deployment pipelines.
Expand Down