Skip to content

Commit 8c6c67d

Browse files
committed
Add a convention plugin
1 parent 44f8aab commit 8c6c67d

File tree

7 files changed

+37
-31
lines changed

7 files changed

+37
-31
lines changed

buildSrc/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
plugins {
2+
id 'groovy-gradle-plugin'
3+
}
4+
5+
repositories {
6+
gradlePluginPortal()
7+
}

buildSrc/settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'common-conventions'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins {
2+
id 'java'
3+
}
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
java {
10+
toolchain {
11+
languageVersion = JavaLanguageVersion.of(21)
12+
}
13+
}
14+
15+
testing {
16+
suites {
17+
test {
18+
useJUnitJupiter()
19+
}
20+
}
21+
}

characters-count/build.gradle

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
plugins {
22
id 'application'
3-
id 'org.openjfx.javafxplugin' version '0.1.0'
4-
}
5-
6-
repositories {
7-
mavenCentral()
3+
alias(libs.plugins.javafxplugin)
4+
id 'com.craftsmanshipinsoftware.common-conventions'
85
}
96

107
javafx {
@@ -19,9 +16,4 @@ application {
1916
dependencies {
2017
testImplementation(libs.assertj.core)
2118
testImplementation(libs.junit.jupiter)
22-
testRuntimeOnly(libs.junit.platform.launcher)
23-
}
24-
25-
tasks.named('test') {
26-
useJUnitPlatform()
2719
}

gradle/libs.versions.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
[versions]
33
assertj-core = "3.26.3"
44
junit-jupiter = "5.11.0"
5-
junit-platform-launcher = "1.11.0"
5+
javafxplugin = "0.1.0"
66

77
[libraries]
88
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj-core" }
99
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
10-
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit-platform-launcher" }
10+
11+
[plugins]
12+
javafxplugin = { id = "org.openjfx.javafxplugin", version.ref = "javafxplugin" }

printing-quotes/build.gradle

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
plugins {
2-
id 'java'
3-
}
4-
5-
repositories {
6-
mavenCentral()
2+
id 'com.craftsmanshipinsoftware.common-conventions'
73
}
84

95
dependencies {
106
testImplementation(libs.assertj.core)
117
testImplementation(libs.junit.jupiter)
128
}
13-
14-
tasks.named('test') {
15-
useJUnitPlatform()
16-
}

saying-hello/build.gradle

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
plugins {
2-
id 'java'
3-
}
4-
5-
repositories {
6-
mavenCentral()
2+
id 'com.craftsmanshipinsoftware.common-conventions'
73
}
84

95
dependencies {
106
testImplementation(libs.assertj.core)
117
testImplementation(libs.junit.jupiter)
12-
testRuntimeOnly(libs.junit.platform.launcher)
13-
}
14-
15-
tasks.named('test') {
16-
useJUnitPlatform()
178
}

0 commit comments

Comments
 (0)