Skip to content

Commit 028ef86

Browse files
Extract publishable-library convention plugin, reorganize build-logic structure
1 parent 8bcebf0 commit 028ef86

25 files changed

Lines changed: 133 additions & 66 deletions

File tree

allwrite-recipes/build.gradle.kts

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
plugins {
2-
`java-library`
3-
`maven-publish`
42
`java-test-fixtures`
5-
signing
63
alias(libs.plugins.openrewrite.recipe.library.base)
74
id("conventions.kotlin")
85
id("conventions.koin")
6+
id("conventions.publishable-library")
7+
}
8+
9+
publishableLibrary {
10+
name = "allwrite-recipes"
11+
description = "A collection of recipes, filling the gaps in vanilla OpenRewrite"
912
}
1013

1114
recipeDependencies {
@@ -51,47 +54,8 @@ dependencies {
5154
testImplementation(libs.rewrite.test)
5255
}
5356

54-
publishing {
55-
publications {
56-
create<MavenPublication>("library") {
57-
from(components["java"])
58-
pom {
59-
name = "allwrite-recipes"
60-
description = "A collection of recipes, filling the gaps in vanilla OpenRewrite"
61-
url = "https://github.com/allegro/allwrite"
62-
licenses {
63-
license {
64-
name = "Apache License, Version 2.0"
65-
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
66-
}
67-
}
68-
scm {
69-
url = "https://github.com/allegro/allwrite"
70-
connection = "scm:git@github.com:allegro/allwrite.git"
71-
developerConnection = "scm:git@github.com:allegro/allwrite.git"
72-
}
73-
developers {
74-
developer {
75-
id = "radoslaw-panuszewski"
76-
name = "Radosław Panuszewski"
77-
}
78-
developer {
79-
id = "aleksandrserbin"
80-
name = "Aleksandr Serbin"
81-
}
82-
}
83-
}
84-
}
85-
}
86-
}
87-
88-
signing {
89-
val gpgKeyId = System.getenv("GPG_KEY_ID")
90-
val gpgPrivateKey = System.getenv("GPG_PRIVATE_KEY")
91-
val gpgPrivateKeyPassword = System.getenv("GPG_PRIVATE_KEY_PASSWORD")
92-
93-
if (gpgKeyId != null && gpgPrivateKey != null && gpgPrivateKeyPassword != null) {
94-
useInMemoryPgpKeys(gpgKeyId, gpgPrivateKey, gpgPrivateKeyPassword)
95-
sign(publishing.publications["library"])
57+
tasks {
58+
test {
59+
jvmArgs("-Xmx4g")
9660
}
9761
}

allwrite-spi/build.gradle.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
plugins {
2-
`java-library`
32
id("conventions.kotlin")
43
id("conventions.koin")
4+
id("conventions.publishable-library")
5+
}
6+
7+
publishableLibrary {
8+
name = "allwrite-spi"
9+
description = "A service provider interface for implementing recipes aware of allwrite features (e.g. declaring friendly names)"
510
}
611

712
dependencies {

build-logic/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# build-logic
2+
3+
This included build is split into several subprojects.
4+
5+
The purpose of every subproject is to hold a subset of convention plugins that are mostly applied together.
6+
7+
Ideally, modifying a convention plugin should only change classpath of the projects that apply it. Having all convention plugins in a single project would always change classpath of every project buildscript.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# cli-app-conventions
2+
3+
Contains convention plugins only applied CLI app projects.
4+
5+
Currently, there is only one such project: `allwrite-cli`.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
dependencies {
6+
implementation(projects.rootProjectConventions)
7+
}

build-logic/cli-distribution/src/main/kotlin/conventions/cli-distribution.gradle.kts renamed to build-logic/cli-app-conventions/src/main/kotlin/conventions/cli-distribution.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
package conventions
44

5-
import pl.allegro.tech.allwrite.buildlogic.jdk.ExtractJdkTask
5+
import pl.allegro.tech.allwrite.buildlogic.ExtractJdkTask
66
import libs
77
import org.gradle.internal.jvm.Jvm
88
import org.jreleaser.gradle.plugin.tasks.AbstractJReleaserTask

build-logic/cli-distribution/build.gradle.kts

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# kotlin-conventions
2+
3+
Contains convention plugins to be applied in any project using Kotlin.
File renamed without changes.

build-logic/kotlin-compilation/src/main/kotlin/conventions/koin.gradle.kts renamed to build-logic/kotlin-conventions/src/main/kotlin/conventions/koin.gradle.kts

File renamed without changes.

0 commit comments

Comments
 (0)