diff --git a/build.gradle.kts.release b/build.gradle.kts.release new file mode 100644 index 0000000..aa1963c --- /dev/null +++ b/build.gradle.kts.release @@ -0,0 +1,76 @@ +plugins { + // Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins + checkstyle + `java-library` + `version-catalog` + `maven-publish` +} + +val group: String by project +val edcScmUrl: String by project +val edcScmConnection: String by project + +allprojects { + apply(plugin = "checkstyle") + apply(plugin = "maven-publish") + + // let's not generate any reports because that is done from within the GitHub Actions workflow + tasks.withType { + reports { + html.required.set(false) + xml.required.set(true) + } + } + + tasks.withType { + duplicatesStrategy = DuplicatesStrategy.INCLUDE + metaInf { + from("${rootProject.projectDir.path}/NOTICE.md") + from("${rootProject.projectDir.path}/LICENSE") + } + } + + afterEvaluate { + // values needed for publishing + val websiteUrl: String by project + val developerId: String by project + val developerName: String by project + val developerEmail: String by project + val scmConnection: String by project + val scmUrl: String by project + publishing { + publications.forEach { i -> + val mp = (i as MavenPublication) + mp.pom { + name.set(project.name) + description.set("Runtime metamodel for annotations of the Eclipse Dataspace Components") + url.set(websiteUrl) + + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + } + developers { + developer { + id.set(developerId) + name.set(developerName) + email.set(developerEmail) + } + } + scm { + connection.set(scmConnection) + url.set(scmUrl) + } + } + } + } + } + } + +} +// configure checkstyle version +checkstyle { + toolVersion = "10.0" + maxErrors = 0 // does not tolerate errors +} \ No newline at end of file