From f8baa77fe42935041dab19859fa9259e3236f954 Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Fri, 27 Oct 2023 17:07:46 +0200 Subject: [PATCH 01/13] Removed `snapshot` postfix temporally & added publishing config for `bee.persistent` Publishing was tested successfully locally. --- bee.persistent/build.gradle.kts | 80 ++++++++++++++++++++++++++++++--- gradle/libs.versions.toml | 2 +- 2 files changed, 75 insertions(+), 7 deletions(-) diff --git a/bee.persistent/build.gradle.kts b/bee.persistent/build.gradle.kts index 8129184..fc55eb1 100644 --- a/bee.persistent/build.gradle.kts +++ b/bee.persistent/build.gradle.kts @@ -1,10 +1,14 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jreleaser.model.Active plugins { alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.jpa) alias(libs.plugins.kotlin.spring) java + id("maven-publish") + id("org.jreleaser").version("1.8.0") + id("signing") // id("org.hibernate.orm") version "6.1.7.Final" } @@ -44,11 +48,17 @@ sourceSets { } java { + withSourcesJar() + withJavadocJar() registerFeature("dgs") { usingSourceSet(sourceSets["dgs"]) + withSourcesJar() + withJavadocJar() } registerFeature("jpa") { usingSourceSet(sourceSets["jpa"]) + withSourcesJar() + withJavadocJar() } } @@ -113,9 +123,67 @@ allOpen { annotation("javax.persistence.Entity") } -// hibernate { -// enhancement { -// enableLazyInitialization(true) -// enableExtendedEnhancement(true) -// } -// } +// Based on https://www.tschuehly.de/posts/guide-kotlin-gradle-publish-to-maven-central/#51-generate-javadocs-and-sources-jars +publishing { + publications { + create("Maven") { + from(components["java"]) + description = "A collection of modular libraries tailor-made for Kotlin enthusiasts." + } + withType { + pom { + packaging = "jar" + name.set(project.name) + description.set("A collection of modular libraries tailor-made for Kotlin enthusiasts.") + url.set("https://github.com/bee-produced/bee-built") + licenses { + license { + name.set("MIT license") + url.set("https://opensource.org/licenses/MIT") + } + } + developers { + developer { + id.set("kurbaniec") + name.set("Kacper Urbaniec") + email.set("kacper.urbaniec@beeproduced.com") + } + } + scm { + connection.set("scm:git:git@github.com:bee-produced/bee-built.git") + developerConnection.set("scm:git:ssh:git@github.com:bee-produced/bee-built.git") + url.set("https://github.com/bee-produced/bee-built") + } + } + } + } + repositories { + maven { + url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI() + } + } +} + +jreleaser { + project { + copyright.set("bee produced") + } + gitRootSearch.set(true) + signing { + active.set(Active.ALWAYS) + armored.set(true) + } + deploy { + maven { + nexus2 { + create("maven-central") { + active.set(Active.ALWAYS) + url.set("https://s01.oss.sonatype.org/service/local") + closeRepository.set(false) + releaseRepository.set(false) + stagingRepositories.add("build/staging-deploy") + } + } + } + } +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cf9493d..e6886e9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -bee-built = "0.3.0-SNAPSHOT" +bee-built = "0.3.0" springboot-base = "3.1.4" springboot-dependencymanagement = "1.1.3" kotlin-base = "1.9.10" From a07803f67beed86d2c5ecb5d8ca8daa376ec9fb0 Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Fri, 27 Oct 2023 18:36:15 +0200 Subject: [PATCH 02/13] Added publishing config for `bee.functional` Publishing was tested successfully locally. --- README.md | 2 +- bee.functional/build.gradle.kts | 95 ++++++++++++++++++++++++++++++++- bee.persistent/build.gradle.kts | 12 ++--- gradle/libs.versions.toml | 3 +- 4 files changed, 103 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5fc223d..0b8679a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Extend DGS: Some changes are currently being made: * `bee.persistent` - Easier data handling for GraphQL + JPA, [documentation](./lib.data/README.md) + Easier data handling for GraphQL + JPA, [documentation](./bee.persistent/README.md) * `bee.functional` Functional kotlin bindings, integration with DGS, `bee.persistent` & more * `bee.buzz` diff --git a/bee.functional/build.gradle.kts b/bee.functional/build.gradle.kts index 6956d6b..68f092b 100644 --- a/bee.functional/build.gradle.kts +++ b/bee.functional/build.gradle.kts @@ -1,14 +1,19 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jreleaser.model.Active plugins { alias(libs.plugins.kotlin.jvm) - java alias(libs.plugins.spring.boot).apply(false) alias(libs.plugins.spring.dependencymanagement) + alias(libs.plugins.jreleaser) + `maven-publish` + signing + java } group = "com.beeproduced" version = libs.versions.bee.built.get() +description = "Functional kotlin bindings, integration with DGS, `bee.persistent` & more" java.sourceCompatibility = JavaVersion.VERSION_17 java.targetCompatibility = JavaVersion.VERSION_17 tasks.withType().configureEach { @@ -61,11 +66,17 @@ sourceSets { } java { + withSourcesJar() + withJavadocJar() registerFeature("dgs") { usingSourceSet(sourceSets["dgs"]) + withSourcesJar() + withJavadocJar() } registerFeature("persistent") { usingSourceSet(sourceSets["persistent"]) + withSourcesJar() + withJavadocJar() } } @@ -100,3 +111,85 @@ tasks.withType { // } // // tasks.check { dependsOn(dgsTestTask) } + +// Based on https://www.tschuehly.de/posts/guide-kotlin-gradle-publish-to-maven-central/#51-generate-javadocs-and-sources-jars +publishing { + publications { + create("Maven") { + from(components["java"]) + description = project.description + } + withType { + pom { + packaging = "jar" + name.set(project.name) + description.set(project.description) + url.set("https://github.com/bee-produced/bee-built") + licenses { + license { + name.set("MIT license") + url.set("https://opensource.org/licenses/MIT") + } + } + developers { + developer { + id.set("kurbaniec") + name.set("Kacper Urbaniec") + email.set("kacper.urbaniec@beeproduced.com") + } + } + scm { + connection.set("scm:git:git@github.com:bee-produced/bee-built.git") + developerConnection.set("scm:git:ssh:git@github.com:bee-produced/bee-built.git") + url.set("https://github.com/bee-produced/bee-built") + } + } + } + } + repositories { + maven { + url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI() + } + } +} + +jreleaser { + project { + copyright.set("bee produced") + } + gitRootSearch.set(true) + signing { + active.set(Active.ALWAYS) + armored.set(true) + } + deploy { + maven { + nexus2 { + create("maven-central") { + active.set(Active.ALWAYS) + url.set("https://s01.oss.sonatype.org/service/local") + closeRepository.set(false) + releaseRepository.set(false) + stagingRepositories.add("build/staging-deploy") + } + } + } + } +} + +// Invalid pom is produced when using both the dependency management plugin and Gradle's bom support +// See: https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/257#issuecomment-895790557 +tasks.withType().all { + doLast { + val file = File("$buildDir/publications/maven/pom-default.xml") + var text = file.readText() + val regex = "(?s)(.+?)(.+?)(.+?)".toRegex() + val matcher = regex.find(text) + if (matcher != null) { + text = regex.replaceFirst(text, "") + val firstDeps = matcher.groups[2]!!.value + text = regex.replaceFirst(text, "$1$2$firstDeps$3") + } + file.writeText(text) + } +} \ No newline at end of file diff --git a/bee.persistent/build.gradle.kts b/bee.persistent/build.gradle.kts index fc55eb1..e9c1b72 100644 --- a/bee.persistent/build.gradle.kts +++ b/bee.persistent/build.gradle.kts @@ -5,15 +5,15 @@ plugins { alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.jpa) alias(libs.plugins.kotlin.spring) + alias(libs.plugins.jreleaser) + `maven-publish` + signing java - id("maven-publish") - id("org.jreleaser").version("1.8.0") - id("signing") - // id("org.hibernate.orm") version "6.1.7.Final" } group = "com.beeproduced" version = libs.versions.bee.built.get() +description = "Easier data handling for GraphQL + JPA" java.sourceCompatibility = JavaVersion.VERSION_17 java.targetCompatibility = JavaVersion.VERSION_17 tasks.withType().configureEach { @@ -128,13 +128,13 @@ publishing { publications { create("Maven") { from(components["java"]) - description = "A collection of modular libraries tailor-made for Kotlin enthusiasts." + description = project.description } withType { pom { packaging = "jar" name.set(project.name) - description.set("A collection of modular libraries tailor-made for Kotlin enthusiasts.") + description.set(project.description) url.set("https://github.com/bee-produced/bee-built") licenses { license { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e6886e9..bbd4d62 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -85,4 +85,5 @@ spring-boot = { id = "org.springframework.boot", version.ref = "springboot-base" spring-dependencymanagement = { id = "io.spring.dependency-management", version.ref = "springboot-dependencymanagement" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin-base" } dgs-codegen = { id = "com.netflix.dgs.codegen", version.ref = "dgs-codegen" } -ksp = { id = "com.google.devtools.ksp", version.ref = "ksp-base"} \ No newline at end of file +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp-base"} +jreleaser = { id = "org.jreleaser", version = "1.8.0" } \ No newline at end of file From d6b3c472839cf7a5c3a55123481537fe271ed301 Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Fri, 27 Oct 2023 19:01:11 +0200 Subject: [PATCH 03/13] Added publishing config for `bee.buzz` Publishing was tested successfully locally. --- bee.buzz/build.gradle.kts | 93 ++++++++++++++++++++++++++++++++- bee.functional/build.gradle.kts | 2 +- 2 files changed, 93 insertions(+), 2 deletions(-) diff --git a/bee.buzz/build.gradle.kts b/bee.buzz/build.gradle.kts index cc5cb0f..2ddf42a 100644 --- a/bee.buzz/build.gradle.kts +++ b/bee.buzz/build.gradle.kts @@ -1,14 +1,19 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jreleaser.model.Active plugins { alias(libs.plugins.kotlin.jvm) alias(libs.plugins.spring.boot).apply(false) alias(libs.plugins.spring.dependencymanagement) + alias(libs.plugins.jreleaser) + `maven-publish` + signing java } group = "com.beeproduced" version = libs.versions.bee.built.get() +description = "Simple event manager based on the mediator pattern." java.sourceCompatibility = JavaVersion.VERSION_17 java.targetCompatibility = JavaVersion.VERSION_17 tasks.withType().configureEach { @@ -41,13 +46,17 @@ sourceSets { } java { + withSourcesJar() + withJavadocJar() registerFeature("simple") { usingSourceSet(sourceSets["simple"]) + withSourcesJar() + withJavadocJar() } } dependencies { - implementation("com.beeproduced:bee.functional") + implementation("com.beeproduced:bee.functional:$version") implementation(libs.kotlin.stdlib) implementation(libs.spring.boot.starter.web) testImplementation(libs.junit.api) @@ -57,3 +66,85 @@ dependencies { tasks.withType { useJUnitPlatform() } + +// Based on https://www.tschuehly.de/posts/guide-kotlin-gradle-publish-to-maven-central/#51-generate-javadocs-and-sources-jars +publishing { + publications { + create("Maven") { + from(components["java"]) + description = project.description + } + withType { + pom { + packaging = "jar" + name.set(project.name) + description.set(project.description) + url.set("https://github.com/bee-produced/bee-built") + licenses { + license { + name.set("MIT license") + url.set("https://opensource.org/licenses/MIT") + } + } + developers { + developer { + id.set("kurbaniec") + name.set("Kacper Urbaniec") + email.set("kacper.urbaniec@beeproduced.com") + } + } + scm { + connection.set("scm:git:git@github.com:bee-produced/bee-built.git") + developerConnection.set("scm:git:ssh:git@github.com:bee-produced/bee-built.git") + url.set("https://github.com/bee-produced/bee-built") + } + } + } + } + repositories { + maven { + url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI() + } + } +} + +jreleaser { + project { + copyright.set("bee produced") + } + gitRootSearch.set(true) + signing { + active.set(Active.ALWAYS) + armored.set(true) + } + deploy { + maven { + nexus2 { + create("maven-central") { + active.set(Active.ALWAYS) + url.set("https://s01.oss.sonatype.org/service/local") + closeRepository.set(false) + releaseRepository.set(false) + stagingRepositories.add("build/staging-deploy") + } + } + } + } +} + +// Invalid pom is produced when using both the dependency management plugin and Gradle's bom support +// See: https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/257#issuecomment-895790557 +tasks.withType().all { + doLast { + val file = File("$buildDir/publications/maven/pom-default.xml") + var text = file.readText() + val regex = "(?s)(.+?)(.+?)(.+?)".toRegex() + val matcher = regex.find(text) + if (matcher != null) { + text = regex.replaceFirst(text, "") + val firstDeps = matcher.groups[2]!!.value + text = regex.replaceFirst(text, "$1$2$firstDeps$3") + } + file.writeText(text) + } +} \ No newline at end of file diff --git a/bee.functional/build.gradle.kts b/bee.functional/build.gradle.kts index 68f092b..4eb4716 100644 --- a/bee.functional/build.gradle.kts +++ b/bee.functional/build.gradle.kts @@ -13,7 +13,7 @@ plugins { group = "com.beeproduced" version = libs.versions.bee.built.get() -description = "Functional kotlin bindings, integration with DGS, `bee.persistent` & more" +description = "Functional kotlin bindings, integration with DGS, `bee.persistent` & more." java.sourceCompatibility = JavaVersion.VERSION_17 java.targetCompatibility = JavaVersion.VERSION_17 tasks.withType().configureEach { From ffd0c9cfec54aa8fcbf85643cebd7d0723518468 Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Fri, 27 Oct 2023 21:00:36 +0200 Subject: [PATCH 04/13] Added publishing config for `bee.generative` & `bee.fetched` Publishing was tested successfully locally. --- bee.fetched/build.gradle.kts | 78 ++++++++++++++++++++++++++-- bee.generative/build.gradle.kts | 90 +++++++++++++++++++++++++++++++++ 2 files changed, 165 insertions(+), 3 deletions(-) diff --git a/bee.fetched/build.gradle.kts b/bee.fetched/build.gradle.kts index f02e33c..d34fde4 100644 --- a/bee.fetched/build.gradle.kts +++ b/bee.fetched/build.gradle.kts @@ -1,12 +1,17 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jreleaser.model.Active plugins { alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.jreleaser) + `maven-publish` + signing java } group = "com.beeproduced" version = libs.versions.bee.built.get() +description = "Automatically generate nested data fetchers for usage with data loaders." java.sourceCompatibility = JavaVersion.VERSION_17 java.targetCompatibility = JavaVersion.VERSION_17 tasks.withType().configureEach { @@ -32,8 +37,12 @@ sourceSets { } java { + withSourcesJar() + withJavadocJar() registerFeature("processor") { usingSourceSet(sourceSets["processor"]) + withSourcesJar() + withJavadocJar() } } @@ -42,13 +51,76 @@ dependencies { testImplementation(libs.kotlin.test) testImplementation(libs.junit.api) testRuntimeOnly(libs.junit.engine) - - - "processorImplementation"("com.beeproduced:bee.generative") + "processorImplementation"("com.beeproduced:bee.generative:$version") "processorImplementation"(sourceSets.main.get().output) "processorImplementation"(libs.dgs.spring.starter) } tasks.withType { useJUnitPlatform() +} + +// Based on https://www.tschuehly.de/posts/guide-kotlin-gradle-publish-to-maven-central/#51-generate-javadocs-and-sources-jars +publishing { + publications { + create("Maven") { + from(components["java"]) + description = project.description + } + withType { + pom { + packaging = "jar" + name.set(project.name) + description.set(project.description) + url.set("https://github.com/bee-produced/bee-built") + licenses { + license { + name.set("MIT license") + url.set("https://opensource.org/licenses/MIT") + } + } + developers { + developer { + id.set("kurbaniec") + name.set("Kacper Urbaniec") + email.set("kacper.urbaniec@beeproduced.com") + } + } + scm { + connection.set("scm:git:git@github.com:bee-produced/bee-built.git") + developerConnection.set("scm:git:ssh:git@github.com:bee-produced/bee-built.git") + url.set("https://github.com/bee-produced/bee-built") + } + } + } + } + repositories { + maven { + url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI() + } + } +} + +jreleaser { + project { + copyright.set("bee produced") + } + gitRootSearch.set(true) + signing { + active.set(Active.ALWAYS) + armored.set(true) + } + deploy { + maven { + nexus2 { + create("maven-central") { + active.set(Active.ALWAYS) + url.set("https://s01.oss.sonatype.org/service/local") + closeRepository.set(false) + releaseRepository.set(false) + stagingRepositories.add("build/staging-deploy") + } + } + } + } } \ No newline at end of file diff --git a/bee.generative/build.gradle.kts b/bee.generative/build.gradle.kts index 541db8b..dc7bb53 100644 --- a/bee.generative/build.gradle.kts +++ b/bee.generative/build.gradle.kts @@ -1,7 +1,11 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jreleaser.model.Active plugins { alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.jreleaser) + `maven-publish` + signing java `java-gradle-plugin` `kotlin-dsl` @@ -9,6 +13,7 @@ plugins { group = "com.beeproduced" version = libs.versions.bee.built.get() +description = "Plugin for the `bee-built` platform." java.sourceCompatibility = JavaVersion.VERSION_17 java.targetCompatibility = JavaVersion.VERSION_17 tasks.withType().configureEach { @@ -26,10 +31,17 @@ gradlePlugin { register("bee.generative") { id = "bee.generative" implementationClass = "com.beeproduced.bee.generative.BeeGenerativePlugin" + displayName = project.name + description = project.description } } } +java { + withSourcesJar() + withJavadocJar() +} + dependencies { // implementation(kotlin("gradle-plugin")) api(libs.ksp.api) @@ -43,4 +55,82 @@ dependencies { tasks.withType { useJUnitPlatform() +} + +// Based on https://www.tschuehly.de/posts/guide-kotlin-gradle-publish-to-maven-central/#51-generate-javadocs-and-sources-jars +publishing { + publications { + create("Maven") { + from(components["java"]) + description = project.description + } + withType { + pom { + packaging = "jar" + name.set(project.name) + description.set(project.description) + url.set("https://github.com/bee-produced/bee-built") + licenses { + license { + name.set("MIT license") + url.set("https://opensource.org/licenses/MIT") + } + } + developers { + developer { + id.set("kurbaniec") + name.set("Kacper Urbaniec") + email.set("kacper.urbaniec@beeproduced.com") + } + } + scm { + connection.set("scm:git:git@github.com:bee-produced/bee-built.git") + developerConnection.set("scm:git:ssh:git@github.com:bee-produced/bee-built.git") + url.set("https://github.com/bee-produced/bee-built") + } + } + } + } + repositories { + maven { + url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI() + } + } +} + +jreleaser { + project { + copyright.set("bee produced") + } + gitRootSearch.set(true) + signing { + active.set(Active.ALWAYS) + armored.set(true) + } + deploy { + maven { + nexus2 { + create("maven-central") { + active.set(Active.ALWAYS) + url.set("https://s01.oss.sonatype.org/service/local") + closeRepository.set(false) + releaseRepository.set(false) + stagingRepositories.add("build/staging-deploy") + } + } + } + } +} + +// Required as plugin markers are only relevant for gradle plugin portal +// https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers +tasks.register("removePluginMetadata") { + doLast { + val dirToRemove = file("${buildDir}/staging-deploy/bee") + dirToRemove.deleteRecursively() + } +} + +tasks.named("publish") { + finalizedBy("removePluginMetadata") } \ No newline at end of file From e569ab9ff7a081b479008e3637cd6333c5fc5b9f Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Fri, 27 Oct 2023 21:02:11 +0200 Subject: [PATCH 05/13] Re-added `snapshot` postfix and began work on automatic pipeline --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index bbd4d62..781d686 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -bee-built = "0.3.0" +bee-built = "0.3.0-SNAPSHOT" springboot-base = "3.1.4" springboot-dependencymanagement = "1.1.3" kotlin-base = "1.9.10" From 170731d81030d21f47b351aa63e47e01454251ca Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Sat, 28 Oct 2023 11:45:42 +0200 Subject: [PATCH 06/13] Updated `bee.fetched` documentation regarding usage of `bee.generative` --- bee.fetched/README.md | 36 +++++++++++++------ .../bee/generative/BeeGenerativePlugin.kt | 5 +++ 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/bee.fetched/README.md b/bee.fetched/README.md index 77341cb..a589fde 100644 --- a/bee.fetched/README.md +++ b/bee.fetched/README.md @@ -15,7 +15,7 @@ In addition, these types of data fetchers can be quite easily overlooked during This code generation library attempts to solve this problem by automatically generating such nested data fetches from DGS DTOs and data loader definitions. `bee.fetched` is based on `ksp` for lightweight, idiomatic code generation. -Note that this library builds upon [DGS](https://netflix.github.io/dgs/) and is not intended for use with only `graphql-java`. +Note that this library builds upon [DGS](https://netflix.github.io/dgs/) and is not intended for use with only `graphql-java`. ## 🚀 Quickstart @@ -23,6 +23,22 @@ Note that this library builds upon [DGS](https://netflix.github.io/dgs/) and is The following shows the easiest way to incorporate `bee.fetched` into a project. +`settings.gradle.kts` + +```kotlin +pluginManagement { + resolutionStrategy { + eachPlugin { + when (requested.id.id) { + "bee.generative" -> useModule("com.beeproduced:bee.generative:") + } + } + } +} +``` + +> ⚠️ As `bee.generative` is currently not published to the gradle plugin portal, the publication on maven central has no [plugin marker](https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers) and thus requires this [workaround](https://github.com/GoogleCloudPlatform/app-gradle-plugin/issues/397#issuecomment-1484070866). + `build.gradle.kts`: ```kotlin @@ -32,7 +48,7 @@ plugins { } dependencies { - beeGenerative("com.beeproduced:bee.fetched") + beeGenerative("com.beeproduced:bee.fetched:") } // DGS codegen @@ -107,9 +123,9 @@ class WaldoDataLoader : MappedBatchLoaderWithContext { } ``` -> ⚠️ Please do not forget to annotate the data loader with `@BeeFetched` if one wants to utilise code generation. +> ⚠️ Please do not forget to annotate the data loader with `@BeeFetched` if one wants to utilise code generation. -> 🪧 The `@BeeFetched` annotation will be explained in the following step by step. +> 🪧 The `@BeeFetched` annotation will be explained in the following step by step. With the help of `bee.fetched` all of the corresponding nested data fetchers including their data loader invocations can be automatically generated. @@ -119,9 +135,9 @@ In the following schema `waldo` and `waldos` are the fields that should be loade A simple approach is used: -* Entities like `waldo` => Search for `waldoId` +* Entities like `waldo` => Search for `waldoId` * Collections like `waldos` => Search for `waldoIds` or `waldosIds` -* Not modelled but possible: A collection called `waldo` => Search for `waldoIds` or `waldosIds` +* Not modelled but possible: A collection called `waldo` => Search for `waldoIds` or `waldosIds` ```crystal type Foo { @@ -215,7 +231,7 @@ type Corge { } ``` -To do so, one must provide a `FetcherMapping` via `@BeeFetched` that maps `Corge`'s `waldo` field to the id `corgeToWaldoId`. +To do so, one must provide a `FetcherMapping` via `@BeeFetched` that maps `Corge`'s `waldo` field to the id `corgeToWaldoId`. ```kotlin @BeeFetched( @@ -290,7 +306,7 @@ In these cases, one must provide a `FetcherInternalType` via `@BeeFetched` that class WaldoDataLoader : MappedBatchLoaderWithContext ``` -> 🪧 If `Grault` would have another field `waldo2: Waldo` the library would use the `Grault` DTO and not the `TestController.MyGrault` internal type as it is only configured for `DgsConstants.GRAULT.Waldo`. Leaving `DgsConstants.GRAULT.Waldo` empty or adding an additional `FetcherInternalType` for `DgsConstants.GRAULT.Waldo2` would result in usage of the internal type. +> 🪧 If `Grault` would have another field `waldo2: Waldo` the library would use the `Grault` DTO and not the `TestController.MyGrault` internal type as it is only configured for `DgsConstants.GRAULT.Waldo`. Leaving `DgsConstants.GRAULT.Waldo` empty or adding an additional `FetcherInternalType` for `DgsConstants.GRAULT.Waldo2` would result in usage of the internal type. This results in following generated code. @@ -377,7 +393,7 @@ class WaldoDataLoader : MappedBatchLoaderWithContext #### Safety first - Do not load what is already present -By default, `bee.fetched` generates nested data fetcher with an early return when data is already present for the requested field. This feature is called `safeMode` and can be illustrated as follows. +By default, `bee.fetched` generates nested data fetcher with an early return when data is already present for the requested field. This feature is called `safeMode` and can be illustrated as follows. ```kotlin @DgsData( @@ -438,4 +454,4 @@ class WaldoDataLoader : MappedBatchLoaderWithContext ## 🧪 Example & Tests -An example on which this documentation is based on can be found under `bee.fetched.test` in the root project. The tests for this library reside also in this example project. \ No newline at end of file +An example on which this documentation is based on can be found under `bee.fetched.test` in the root project. The tests for this library reside also in this example project. \ No newline at end of file diff --git a/bee.generative/src/main/kotlin/com/beeproduced/bee/generative/BeeGenerativePlugin.kt b/bee.generative/src/main/kotlin/com/beeproduced/bee/generative/BeeGenerativePlugin.kt index 70fa6f8..fb1d3fa 100644 --- a/bee.generative/src/main/kotlin/com/beeproduced/bee/generative/BeeGenerativePlugin.kt +++ b/bee.generative/src/main/kotlin/com/beeproduced/bee/generative/BeeGenerativePlugin.kt @@ -29,6 +29,7 @@ open class BeeGenerativePluginExtension { open class BeeDependencies(private val dependencies: DependencyHandler) { operator fun invoke(dependencyNotation: String): Pair { val main = dependencies.add("implementation", dependencyNotation) + // TODO: add main also to ksp? val processor = dependencies.add("ksp", dependencyNotation, closureOf { val capabilityNotation = if (version != null) { "$group:$name-processor:$version" @@ -43,6 +44,10 @@ open class BeeDependencies(private val dependencies: DependencyHandler) { class BeeGenerativePlugin : Plugin{ override fun apply(project: Project) { + // TODO: This is bad + // Makes projects also require this type of gradle file! + // Hardcode and sed in pipeline... + // Get version https://discuss.gradle.org/t/version-catalog-access-from-plugin/43629/4 val version = project.rootProject .extensions From 6f0b0d24108f488cfa2ffd8bc3cc82ea60cf02f6 Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Sat, 28 Oct 2023 12:21:24 +0200 Subject: [PATCH 07/13] Version is now persisted as resource for `bee.generative` Allows to query the `version` info via resource stream. Fixes old wrongful implementation that required external version catalog to be used in project that uses `bee.generative`. Would fail if no `bee-built` version was found. --- bee.generative/build.gradle.kts | 15 +++++++++- .../bee/generative/BeeGenerativePlugin.kt | 29 +++++++------------ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/bee.generative/build.gradle.kts b/bee.generative/build.gradle.kts index dc7bb53..75bf566 100644 --- a/bee.generative/build.gradle.kts +++ b/bee.generative/build.gradle.kts @@ -57,6 +57,19 @@ tasks.withType { useJUnitPlatform() } +val generateResources by tasks.registering { + val propFile = file("${layout.buildDirectory.get().asFile.toURI()}/generated/bee.generative.properties") + outputs.file(propFile) + doLast { + propFile.parentFile.mkdirs() + propFile.writeText("version=${project.version}") + } +} + +tasks.named("processResources") { + from(generateResources) +} + // Based on https://www.tschuehly.de/posts/guide-kotlin-gradle-publish-to-maven-central/#51-generate-javadocs-and-sources-jars publishing { publications { @@ -126,7 +139,7 @@ jreleaser { // https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers tasks.register("removePluginMetadata") { doLast { - val dirToRemove = file("${buildDir}/staging-deploy/bee") + val dirToRemove = file("${layout.buildDirectory.get().asFile.toURI()}/staging-deploy/bee") dirToRemove.deleteRecursively() } } diff --git a/bee.generative/src/main/kotlin/com/beeproduced/bee/generative/BeeGenerativePlugin.kt b/bee.generative/src/main/kotlin/com/beeproduced/bee/generative/BeeGenerativePlugin.kt index fb1d3fa..03b150f 100644 --- a/bee.generative/src/main/kotlin/com/beeproduced/bee/generative/BeeGenerativePlugin.kt +++ b/bee.generative/src/main/kotlin/com/beeproduced/bee/generative/BeeGenerativePlugin.kt @@ -5,11 +5,10 @@ import org.gradle.api.Action import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.artifacts.Dependency -import org.gradle.api.artifacts.VersionCatalogsExtension import org.gradle.api.artifacts.dsl.DependencyHandler import org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency import org.gradle.kotlin.dsl.closureOf -import org.gradle.kotlin.dsl.getByType +import java.util.Properties /** * @@ -27,10 +26,10 @@ open class BeeGenerativePluginExtension { } open class BeeDependencies(private val dependencies: DependencyHandler) { - operator fun invoke(dependencyNotation: String): Pair { + operator fun invoke(dependencyNotation: String): Triple { val main = dependencies.add("implementation", dependencyNotation) - // TODO: add main also to ksp? - val processor = dependencies.add("ksp", dependencyNotation, closureOf { + val processorMain = dependencies.add("ksp", dependencyNotation) + val processorCapability = dependencies.add("ksp", dependencyNotation, closureOf { val capabilityNotation = if (version != null) { "$group:$name-processor:$version" } else "$group:$name-processor" @@ -38,27 +37,21 @@ open class BeeDependencies(private val dependencies: DependencyHandler) { requireCapability(capabilityNotation) } }) - return Pair(main, processor) + return Triple(main, processorMain, processorCapability) } } class BeeGenerativePlugin : Plugin{ override fun apply(project: Project) { - // TODO: This is bad - // Makes projects also require this type of gradle file! - // Hardcode and sed in pipeline... + // Get version https://discuss.gradle.org/t/how-can-a-custom-gradle-plugin-determine-its-own-version/36761/3 + val props = Properties() + val propStream = javaClass.classLoader.getResourceAsStream("bee.generative.properties") + propStream?.use { props.load(it) } + val version = props.getProperty("version") - // Get version https://discuss.gradle.org/t/version-catalog-access-from-plugin/43629/4 - val version = project.rootProject - .extensions - .getByType() - .named("libs") - .findVersion("bee-built") - .get() - .displayName // Adds bee generative to ksp context project.dependencies.add("ksp", "com.beeproduced:bee.generative:$version") - // Allows importing bee generative features easily via `bee´ in dependencies block + // Allows importing bee generative features easily via `beeGenerative´ in dependencies block project.dependencies.extensions.add( "beeGenerative", BeeDependencies(project.dependencies) ) From 7f8204b4df272c2c62c8a9c6f79aa9c220a204ae Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Sat, 28 Oct 2023 15:56:37 +0200 Subject: [PATCH 08/13] Added simple pipeline via github action for building & testing --- .github/workflows/github-actions.yaml | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/github-actions.yaml diff --git a/.github/workflows/github-actions.yaml b/.github/workflows/github-actions.yaml new file mode 100644 index 0000000..f8a1e57 --- /dev/null +++ b/.github/workflows/github-actions.yaml @@ -0,0 +1,40 @@ +name: Build, Test & Publish +on: [push] +jobs: + Build-Test-Publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + #- name: Remove -SNAPSHOT suffix from bee-built version + # run: sed -i '/bee-built/ s/-SNAPSHOT//g' ./gradle/libs.versions.toml + - name: Setup Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + - name: Make gradlew executable + run: | + chmod +x ./bee.persistent/.gradlew + chmod +x ./bee.functional/.gradlew + chmod +x ./bee.buzz/.gradlew + chmod +x ./bee.generative/.gradlew + chmod +x ./bee.fetched/.gradlew + chmod +x ./bee.fetched.test/.gradlew + chmod +x ./example/application/.gradlew + - name: Build & Test bee.persistent + run: ./bee.persistent/.gradlew build + - name: Build & Test bee.functional + run: ./bee.functional/.gradlew build + - name: Build & Test bee.buzz + run: ./bee.buzz/.gradlew build + - name: Build & Test bee.generative + run: ./bee.generative/.gradlew build + - name: Build & Test bee.fetched + run: | + ./bee.fetched/.gradlew build + ./bee.fetched.test/.gradlew build + - name: Build & Test example application + run: ./example/application/.gradlew build + + From 222e89d4b71aa181832ccf3b526d0b7fda82fb11 Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Sat, 28 Oct 2023 16:00:18 +0200 Subject: [PATCH 09/13] Updated pipeline to use right gradle wrapper path --- .github/workflows/github-actions.yaml | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/github-actions.yaml b/.github/workflows/github-actions.yaml index f8a1e57..b22615c 100644 --- a/.github/workflows/github-actions.yaml +++ b/.github/workflows/github-actions.yaml @@ -15,26 +15,26 @@ jobs: distribution: 'adopt' - name: Make gradlew executable run: | - chmod +x ./bee.persistent/.gradlew - chmod +x ./bee.functional/.gradlew - chmod +x ./bee.buzz/.gradlew - chmod +x ./bee.generative/.gradlew - chmod +x ./bee.fetched/.gradlew - chmod +x ./bee.fetched.test/.gradlew - chmod +x ./example/application/.gradlew + chmod +x ./bee.persistent/gradlew + chmod +x ./bee.functional/gradlew + chmod +x ./bee.buzz/gradlew + chmod +x ./bee.generative/gradlew + chmod +x ./bee.fetched/gradlew + chmod +x ./bee.fetched.test/gradlew + chmod +x ./example/application/gradlew - name: Build & Test bee.persistent - run: ./bee.persistent/.gradlew build + run: ./bee.persistent/gradlew build - name: Build & Test bee.functional - run: ./bee.functional/.gradlew build + run: ./bee.functional/gradlew build - name: Build & Test bee.buzz - run: ./bee.buzz/.gradlew build + run: ./bee.buzz/gradlew build - name: Build & Test bee.generative - run: ./bee.generative/.gradlew build + run: ./bee.generative/gradlew build - name: Build & Test bee.fetched run: | - ./bee.fetched/.gradlew build - ./bee.fetched.test/.gradlew build + ./bee.fetched/gradlew build + ./bee.fetched.test/gradlew build - name: Build & Test example application - run: ./example/application/.gradlew build + run: ./example/application/gradlew build From c43033bd810b3cc7eb7e00ef96a9501e3382e921 Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Sat, 28 Oct 2023 16:05:45 +0200 Subject: [PATCH 10/13] Updated pipeline to use right working directories --- .github/workflows/github-actions.yaml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/github-actions.yaml b/.github/workflows/github-actions.yaml index b22615c..75f9ba8 100644 --- a/.github/workflows/github-actions.yaml +++ b/.github/workflows/github-actions.yaml @@ -23,18 +23,25 @@ jobs: chmod +x ./bee.fetched.test/gradlew chmod +x ./example/application/gradlew - name: Build & Test bee.persistent - run: ./bee.persistent/gradlew build + working-directory: ./bee.persistent + run: ./gradlew build - name: Build & Test bee.functional - run: ./bee.functional/gradlew build + working-directory: ./bee.functional + run: ./gradlew build - name: Build & Test bee.buzz - run: ./bee.buzz/gradlew build + working-directory: ./bee.buzz + run: ./gradlew build - name: Build & Test bee.generative - run: ./bee.generative/gradlew build + working-directory: ./bee.generative + run: ./gradlew build - name: Build & Test bee.fetched run: | - ./bee.fetched/gradlew build - ./bee.fetched.test/gradlew build + cd ./bee.fetched/ + ./gradlew build + cd ../bee.fetched.test/ + ./gradlew build - name: Build & Test example application - run: ./example/application/gradlew build + working-directory: ./example/application + run: ./gradlew build From eaac38050e280744517bf00240cf3148a1052240 Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Sat, 28 Oct 2023 16:58:37 +0200 Subject: [PATCH 11/13] Added pipeline job for publishing & bumped version --- .github/workflows/github-actions.yaml | 88 ++++++++++++++++++++++++++- bee.buzz/build.gradle.kts | 4 +- bee.fetched/build.gradle.kts | 4 +- bee.functional/build.gradle.kts | 4 +- bee.generative/build.gradle.kts | 4 +- bee.persistent/build.gradle.kts | 4 +- gradle/libs.versions.toml | 2 +- 7 files changed, 96 insertions(+), 14 deletions(-) diff --git a/.github/workflows/github-actions.yaml b/.github/workflows/github-actions.yaml index 75f9ba8..da084a4 100644 --- a/.github/workflows/github-actions.yaml +++ b/.github/workflows/github-actions.yaml @@ -1,18 +1,75 @@ name: Build, Test & Publish -on: [push] +on: + push: + tags: + - '*' + branches: + - '**' jobs: + Build-Test: + runs-on: ubuntu-latest + if: "!startsWith(github.ref, 'refs/tags/')" + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + cache: 'gradle' + - name: Make gradlew executable + run: | + chmod +x ./bee.persistent/gradlew + chmod +x ./bee.functional/gradlew + chmod +x ./bee.buzz/gradlew + chmod +x ./bee.generative/gradlew + chmod +x ./bee.fetched/gradlew + chmod +x ./bee.fetched.test/gradlew + chmod +x ./example/application/gradlew + - name: Build & Test bee.persistent + working-directory: ./bee.persistent + run: ./gradlew build + - name: Build & Test bee.functional + working-directory: ./bee.functional + run: ./gradlew build + - name: Build & Test bee.buzz + working-directory: ./bee.buzz + run: ./gradlew build + - name: Build & Test bee.generative + working-directory: ./bee.generative + run: ./gradlew build + - name: Build & Test bee.fetched + run: | + cd ./bee.fetched/ + ./gradlew build + cd ../bee.fetched.test/ + ./gradlew build + - name: Build & Test example application + working-directory: ./example/application + run: ./gradlew build + Build-Test-Publish: runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/')" + env: + JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }} + JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }} + JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} + JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} + JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} + JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout uses: actions/checkout@v3 - #- name: Remove -SNAPSHOT suffix from bee-built version - # run: sed -i '/bee-built/ s/-SNAPSHOT//g' ./gradle/libs.versions.toml + - name: Remove -SNAPSHOT suffix from bee-built version + run: sed -i '/bee-built/ s/-SNAPSHOT//g' ./gradle/libs.versions.toml - name: Setup Java uses: actions/setup-java@v3 with: java-version: '17' distribution: 'adopt' + cache: 'gradle' - name: Make gradlew executable run: | chmod +x ./bee.persistent/gradlew @@ -44,4 +101,29 @@ jobs: working-directory: ./example/application run: ./gradlew build + - name: Publish bee.persistent + working-directory: ./bee.persistent + run: | + ./gradlew publish + ./gradlew jreleaserDeploy + - name: Publish bee.functional + working-directory: ./bee.functional + run: | + ./gradlew publish + ./gradlew jreleaserDeploy + - name: Publish bee.buzz + working-directory: ./bee.buzz + run: | + ./gradlew publish + ./gradlew jreleaserDeploy + - name: Publish bee.generative + working-directory: ./bee.generative + run: | + ./gradlew publish + ./gradlew jreleaserDeploy + - name: Publish bee.fetched + working-directory: ./bee.fetched + run: | + ./gradlew publish + ./gradlew jreleaserDeploy diff --git a/bee.buzz/build.gradle.kts b/bee.buzz/build.gradle.kts index 2ddf42a..ea58420 100644 --- a/bee.buzz/build.gradle.kts +++ b/bee.buzz/build.gradle.kts @@ -123,8 +123,8 @@ jreleaser { create("maven-central") { active.set(Active.ALWAYS) url.set("https://s01.oss.sonatype.org/service/local") - closeRepository.set(false) - releaseRepository.set(false) + closeRepository.set(true) + releaseRepository.set(true) stagingRepositories.add("build/staging-deploy") } } diff --git a/bee.fetched/build.gradle.kts b/bee.fetched/build.gradle.kts index d34fde4..9d5dedf 100644 --- a/bee.fetched/build.gradle.kts +++ b/bee.fetched/build.gradle.kts @@ -116,8 +116,8 @@ jreleaser { create("maven-central") { active.set(Active.ALWAYS) url.set("https://s01.oss.sonatype.org/service/local") - closeRepository.set(false) - releaseRepository.set(false) + closeRepository.set(true) + releaseRepository.set(true) stagingRepositories.add("build/staging-deploy") } } diff --git a/bee.functional/build.gradle.kts b/bee.functional/build.gradle.kts index 4eb4716..31a2572 100644 --- a/bee.functional/build.gradle.kts +++ b/bee.functional/build.gradle.kts @@ -168,8 +168,8 @@ jreleaser { create("maven-central") { active.set(Active.ALWAYS) url.set("https://s01.oss.sonatype.org/service/local") - closeRepository.set(false) - releaseRepository.set(false) + closeRepository.set(true) + releaseRepository.set(true) stagingRepositories.add("build/staging-deploy") } } diff --git a/bee.generative/build.gradle.kts b/bee.generative/build.gradle.kts index 75bf566..b076289 100644 --- a/bee.generative/build.gradle.kts +++ b/bee.generative/build.gradle.kts @@ -126,8 +126,8 @@ jreleaser { create("maven-central") { active.set(Active.ALWAYS) url.set("https://s01.oss.sonatype.org/service/local") - closeRepository.set(false) - releaseRepository.set(false) + closeRepository.set(true) + releaseRepository.set(true) stagingRepositories.add("build/staging-deploy") } } diff --git a/bee.persistent/build.gradle.kts b/bee.persistent/build.gradle.kts index e9c1b72..4bf0e4a 100644 --- a/bee.persistent/build.gradle.kts +++ b/bee.persistent/build.gradle.kts @@ -179,8 +179,8 @@ jreleaser { create("maven-central") { active.set(Active.ALWAYS) url.set("https://s01.oss.sonatype.org/service/local") - closeRepository.set(false) - releaseRepository.set(false) + closeRepository.set(true) + releaseRepository.set(true) stagingRepositories.add("build/staging-deploy") } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 781d686..cfe862f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -bee-built = "0.3.0-SNAPSHOT" +bee-built = "0.3.1-SNAPSHOT" springboot-base = "3.1.4" springboot-dependencymanagement = "1.1.3" kotlin-base = "1.9.10" From 2603dfe28b784269fbc3f8e2523382dba5311be5 Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Sat, 28 Oct 2023 17:35:06 +0200 Subject: [PATCH 12/13] Updated workaround for dependency management plugin causing pipeline to fail Also added `continue-on-error` on publishing steps. --- .github/workflows/github-actions.yaml | 5 +++++ bee.buzz/build.gradle.kts | 2 +- bee.functional/build.gradle.kts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yaml b/.github/workflows/github-actions.yaml index da084a4..74a89f5 100644 --- a/.github/workflows/github-actions.yaml +++ b/.github/workflows/github-actions.yaml @@ -102,26 +102,31 @@ jobs: run: ./gradlew build - name: Publish bee.persistent + continue-on-error: true working-directory: ./bee.persistent run: | ./gradlew publish ./gradlew jreleaserDeploy - name: Publish bee.functional + continue-on-error: true working-directory: ./bee.functional run: | ./gradlew publish ./gradlew jreleaserDeploy - name: Publish bee.buzz + continue-on-error: true working-directory: ./bee.buzz run: | ./gradlew publish ./gradlew jreleaserDeploy - name: Publish bee.generative + continue-on-error: true working-directory: ./bee.generative run: | ./gradlew publish ./gradlew jreleaserDeploy - name: Publish bee.fetched + continue-on-error: true working-directory: ./bee.fetched run: | ./gradlew publish diff --git a/bee.buzz/build.gradle.kts b/bee.buzz/build.gradle.kts index ea58420..8a0e76e 100644 --- a/bee.buzz/build.gradle.kts +++ b/bee.buzz/build.gradle.kts @@ -136,7 +136,7 @@ jreleaser { // See: https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/257#issuecomment-895790557 tasks.withType().all { doLast { - val file = File("$buildDir/publications/maven/pom-default.xml") + val file = File("${layout.buildDirectory.get().asFile.toURI()}/publications/Maven/pom-default.xml") var text = file.readText() val regex = "(?s)(.+?)(.+?)(.+?)".toRegex() val matcher = regex.find(text) diff --git a/bee.functional/build.gradle.kts b/bee.functional/build.gradle.kts index 31a2572..6331b54 100644 --- a/bee.functional/build.gradle.kts +++ b/bee.functional/build.gradle.kts @@ -181,7 +181,7 @@ jreleaser { // See: https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/257#issuecomment-895790557 tasks.withType().all { doLast { - val file = File("$buildDir/publications/maven/pom-default.xml") + val file = File("${layout.buildDirectory.get().asFile.toURI()}/publications/Maven/pom-default.xml") var text = file.readText() val regex = "(?s)(.+?)(.+?)(.+?)".toRegex() val matcher = regex.find(text) From df8b90dae57d4bd92b1cf1d233b439c8ea4c3c39 Mon Sep 17 00:00:00 2001 From: Kacper Urbaniec Date: Sat, 28 Oct 2023 17:58:33 +0200 Subject: [PATCH 13/13] Updated workaround for dependency management plugin causing pipeline to fail --- bee.buzz/build.gradle.kts | 2 +- bee.functional/build.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bee.buzz/build.gradle.kts b/bee.buzz/build.gradle.kts index 8a0e76e..5ef28d4 100644 --- a/bee.buzz/build.gradle.kts +++ b/bee.buzz/build.gradle.kts @@ -136,7 +136,7 @@ jreleaser { // See: https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/257#issuecomment-895790557 tasks.withType().all { doLast { - val file = File("${layout.buildDirectory.get().asFile.toURI()}/publications/Maven/pom-default.xml") + val file = file("${layout.buildDirectory.get().asFile.toURI()}/publications/Maven/pom-default.xml") var text = file.readText() val regex = "(?s)(.+?)(.+?)(.+?)".toRegex() val matcher = regex.find(text) diff --git a/bee.functional/build.gradle.kts b/bee.functional/build.gradle.kts index 6331b54..5852f53 100644 --- a/bee.functional/build.gradle.kts +++ b/bee.functional/build.gradle.kts @@ -181,7 +181,7 @@ jreleaser { // See: https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/257#issuecomment-895790557 tasks.withType().all { doLast { - val file = File("${layout.buildDirectory.get().asFile.toURI()}/publications/Maven/pom-default.xml") + val file = file("${layout.buildDirectory.get().asFile.toURI()}/publications/Maven/pom-default.xml") var text = file.readText() val regex = "(?s)(.+?)(.+?)(.+?)".toRegex() val matcher = regex.find(text)