Skip to content

Commit b0b4fcc

Browse files
committed
Migrate build to shared convention plugins setup
1 parent 902f13c commit b0b4fcc

File tree

6 files changed

+18
-98
lines changed

6 files changed

+18
-98
lines changed

.gitattributes

Lines changed: 0 additions & 9 deletions
This file was deleted.

build.gradle.kts

Lines changed: 16 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
1-
plugins {
2-
id("groovy")
3-
id("org.gradlex.internal.plugin-publish-conventions") version "0.6"
4-
}
5-
6-
group = "org.gradlex"
71
version = "1.13.1"
82

9-
java {
10-
toolchain.languageVersion = JavaLanguageVersion.of(17)
11-
sourceCompatibility = JavaVersion.VERSION_1_8
12-
targetCompatibility = JavaVersion.VERSION_1_8
13-
}
14-
15-
dependencies {
16-
implementation("org.ow2.asm:asm:9.9")
3+
dependencies { implementation("org.ow2.asm:asm:9.9") }
174

18-
testImplementation("org.spockframework:spock-core:2.3-groovy-4.0")
19-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
20-
}
21-
22-
pluginPublishConventions {
23-
id("${project.group}.${project.name}")
24-
implementationClass("org.gradlex.javamodule.moduleinfo.ExtraJavaModuleInfoPlugin")
25-
displayName("Extra Java Module Info Gradle Plugin")
26-
description("Add module information to legacy Java libraries.")
27-
tags("gradlex", "java", "modularity", "jigsaw", "jpms")
5+
publishingConventions {
6+
pluginPortal("${project.group}.${project.name}") {
7+
implementationClass("org.gradlex.javamodule.moduleinfo.ExtraJavaModuleInfoPlugin")
8+
displayName("Extra Java Module Info Gradle Plugin")
9+
description("Add module information to legacy Java libraries.")
10+
tags("gradlex", "java", "modularity", "jigsaw", "jpms")
11+
}
2812
gitHub("https://github.com/gradlex-org/extra-java-module-info")
2913
developer {
3014
id.set("jjohannes")
@@ -33,27 +17,12 @@ pluginPublishConventions {
3317
}
3418
}
3519

36-
tasks.test {
37-
description = "Runs tests against the Gradle version the plugin is built with"
38-
classpath = sourceSets.test.get().runtimeClasspath
39-
useJUnitPlatform()
40-
maxParallelForks = 4
41-
}
20+
testingConventions { testGradleVersions("6.8.3", "6.9.4", "7.6.5", "8.14.2") }
4221

43-
listOf("6.8.3", "6.9.4", "7.6.5", "8.14.2").forEach { gradleVersionUnderTest ->
44-
val testGradle = tasks.register<Test>("testGradle$gradleVersionUnderTest") {
45-
group = "verification"
46-
description = "Runs tests against Gradle $gradleVersionUnderTest"
47-
testClassesDirs = sourceSets.test.get().output.classesDirs
48-
classpath = sourceSets.test.get().runtimeClasspath
49-
useJUnitPlatform()
50-
maxParallelForks = 4
51-
systemProperty("gradleVersionUnderTest", gradleVersionUnderTest)
52-
if (gradleVersionUnderTest.startsWith("6")) {
53-
javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(11) }
54-
}
55-
}
56-
tasks.check {
57-
dependsOn(testGradle)
58-
}
59-
}
22+
// === the following custom configuration should be removed once tests are migrated to Java
23+
apply(plugin = "groovy")
24+
25+
tasks.named<GroovyCompile>("compileTestGroovy") { targetCompatibility = "11" } // allow tests to run against 6.x
26+
27+
dependencies { testImplementation("org.spockframework:spock-core:2.3-groovy-4.0") } //
28+
// ====================================================================================

gradle/checkstyle/checkstyle.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

gradle/checkstyle/header.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
toolchainVersion=17

settings.gradle.kts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
plugins {
2-
id("com.gradle.develocity") version "4.2.2"
3-
}
1+
plugins { id("org.gradlex.internal-build-conventions") version "0.8" }
42

53
rootProject.name = "extra-java-module-info"
6-
7-
dependencyResolutionManagement {
8-
repositories.mavenCentral()
9-
}
10-
11-
develocity {
12-
buildScan {
13-
val isCi = providers.environmentVariable("CI").getOrElse("false").toBoolean()
14-
if (isCi) {
15-
termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use"
16-
termsOfUseAgree = "yes"
17-
} else {
18-
publishing.onlyIf { false }
19-
}
20-
}
21-
}

0 commit comments

Comments
 (0)