diff --git a/build.gradle.kts b/build.gradle.kts index 5d40466..af110d1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,20 +1,19 @@ plugins { - // Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins - checkstyle `java-library` - `version-catalog` - `maven-publish` - signing - id("io.github.gradle-nexus.publish-plugin") version "2.0.0" } -val group: String by project val edcScmUrl: String by project val edcScmConnection: String by project +buildscript { + dependencies { + val edcGradlePluginsVersion: String by project + classpath("org.eclipse.edc.edc-build:org.eclipse.edc.edc-build.gradle.plugin:${edcGradlePluginsVersion}") + } +} + allprojects { - apply(plugin = "checkstyle") - apply(plugin = "maven-publish") + apply(plugin = "${group}.edc-build") // let's not generate any reports because that is done from within the GitHub Actions workflow tasks.withType { @@ -24,72 +23,11 @@ allprojects { } } - tasks.withType { - duplicatesStrategy = DuplicatesStrategy.INCLUDE - metaInf { - from("${rootProject.projectDir.path}/NOTICE.md") - from("${rootProject.projectDir.path}/LICENSE") + configure { + pom { + scmUrl.set(edcScmUrl) + scmConnection.set(edcScmConnection) } } - 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) - } - } - } - } - if (!project.hasProperty("skip.signing")) { - signing { - useGpgCmd() - sign(publishing.publications) - } - } - } - } - -} -// configure checkstyle version -checkstyle { - toolVersion = "10.0" - maxErrors = 0 // does not tolerate errors } - -nexusPublishing { - repositories { - sonatype { - nexusUrl.set(uri("https://oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/")) - username.set(System.getenv("OSSRH_USER") ?: return@sonatype) - password.set(System.getenv("OSSRH_PASSWORD") ?: return@sonatype) - } - } -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 9f8dd1a..bb90a44 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,7 @@ group=org.eclipse.edc version=0.6.1-SNAPSHOT +edcGradlePluginsVersion=0.6.1-SNAPSHOT + edcScmUrl=https://github.com/eclipse-edc/Runtime-Metamodel edcScmConnection=scm:git:git@github.com:eclipse-edc/Runtime-Metamodel.git -# used for publishing artifacts and plugins -developerId=mspiekermann -developerName=Markus Spiekermann -developerEmail=markus.spiekermann@isst.fraunhofer.de -scmConnection=scm:git:git@github.com:eclipse-dataspaceconnector/GradlePlugins.git -websiteUrl=https://github.com/eclipse-dataspaceconnector/GradlePlugins.git -scmUrl=https://github.com/eclipse-dataspaceconnector/GradlePlugins.git