Skip to content

Commit

Permalink
Add a convention plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
durimkryeziu committed Oct 2, 2024
1 parent 44f8aab commit 8c6c67d
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 31 deletions.
7 changes: 7 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
id 'groovy-gradle-plugin'
}

repositories {
gradlePluginPortal()
}
1 change: 1 addition & 0 deletions buildSrc/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'common-conventions'
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins {
id 'java'
}

repositories {
mavenCentral()
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

testing {
suites {
test {
useJUnitJupiter()
}
}
}
12 changes: 2 additions & 10 deletions characters-count/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.1.0'
}

repositories {
mavenCentral()
alias(libs.plugins.javafxplugin)
id 'com.craftsmanshipinsoftware.common-conventions'
}

javafx {
Expand All @@ -19,9 +16,4 @@ application {
dependencies {
testImplementation(libs.assertj.core)
testImplementation(libs.junit.jupiter)
testRuntimeOnly(libs.junit.platform.launcher)
}

tasks.named('test') {
useJUnitPlatform()
}
6 changes: 4 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
[versions]
assertj-core = "3.26.3"
junit-jupiter = "5.11.0"
junit-platform-launcher = "1.11.0"
javafxplugin = "0.1.0"

[libraries]
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj-core" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit-platform-launcher" }

[plugins]
javafxplugin = { id = "org.openjfx.javafxplugin", version.ref = "javafxplugin" }
10 changes: 1 addition & 9 deletions printing-quotes/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
plugins {
id 'java'
}

repositories {
mavenCentral()
id 'com.craftsmanshipinsoftware.common-conventions'
}

dependencies {
testImplementation(libs.assertj.core)
testImplementation(libs.junit.jupiter)
}

tasks.named('test') {
useJUnitPlatform()
}
11 changes: 1 addition & 10 deletions saying-hello/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
plugins {
id 'java'
}

repositories {
mavenCentral()
id 'com.craftsmanshipinsoftware.common-conventions'
}

dependencies {
testImplementation(libs.assertj.core)
testImplementation(libs.junit.jupiter)
testRuntimeOnly(libs.junit.platform.launcher)
}

tasks.named('test') {
useJUnitPlatform()
}

0 comments on commit 8c6c67d

Please sign in to comment.