From a3c33ee4a88318943e657d33b41aa409606486e7 Mon Sep 17 00:00:00 2001 From: Siphalor Date: Sat, 2 Nov 2024 23:11:36 +0100 Subject: [PATCH] [gradle] Introduce gradle conventions using buildSrc --- build.gradle.kts | 5 ++--- buildSrc/build.gradle.kts | 7 +++++++ buildSrc/settings.gradle.kts | 1 + .../de.siphalor.tweed5.local-runtime-only.gradle.kts | 6 ++++++ settings.gradle.kts | 1 + 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 buildSrc/build.gradle.kts create mode 100644 buildSrc/settings.gradle.kts create mode 100644 buildSrc/src/main/kotlin/de.siphalor.tweed5.local-runtime-only.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts index f163643..c513d65 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("java") id("maven-publish") + id("de.siphalor.tweed5.local-runtime-only") } group = "de.siphalor.tweed5" @@ -10,6 +11,7 @@ allprojects { apply(plugin = "java") apply(plugin = "java-library") apply(plugin = "maven-publish") + apply(plugin = "de.siphalor.tweed5.local-runtime-only") group = rootProject.group version = properties["version"]!! @@ -23,9 +25,6 @@ allprojects { mavenCentral() } - val localRuntimeOnly = configurations.create("localRuntimeOnly") - sourceSets.main.get().runtimeClasspath += localRuntimeOnly - sourceSets.test.get().runtimeClasspath += sourceSets.main.get().runtimeClasspath dependencies { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 0000000..8156a89 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + `kotlin-dsl` +} + +repositories { + gradlePluginPortal() +} \ No newline at end of file diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts new file mode 100644 index 0000000..74a5b09 --- /dev/null +++ b/buildSrc/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "tweed5-conventions" \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/de.siphalor.tweed5.local-runtime-only.gradle.kts b/buildSrc/src/main/kotlin/de.siphalor.tweed5.local-runtime-only.gradle.kts new file mode 100644 index 0000000..df312a7 --- /dev/null +++ b/buildSrc/src/main/kotlin/de.siphalor.tweed5.local-runtime-only.gradle.kts @@ -0,0 +1,6 @@ +plugins { + id("java") +} + +val localRuntimeOnly = configurations.create("localRuntimeOnly") +sourceSets.main.get().runtimeClasspath += localRuntimeOnly diff --git a/settings.gradle.kts b/settings.gradle.kts index d89b388..24cc10d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -8,3 +8,4 @@ include("tweed5-serde-api") include("tweed5-serde-extension") include("tweed5-serde-hjson") include("tweed5-weaver-pojo") +include("tweed5-weaver-pojo-serde-extension")