Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Apr 9, 2024
1 parent 16a5914 commit 7ef50da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 81 deletions.
86 changes: 12 additions & 74 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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<Checkstyle> {
Expand All @@ -24,72 +23,11 @@ allprojects {
}
}

tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
metaInf {
from("${rootProject.projectDir.path}/NOTICE.md")
from("${rootProject.projectDir.path}/LICENSE")
configure<org.eclipse.edc.plugins.edcbuild.extensions.BuildExtension> {
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)
}
}
}
9 changes: 2 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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:[email protected]:eclipse-edc/Runtime-Metamodel.git
# used for publishing artifacts and plugins
developerId=mspiekermann
developerName=Markus Spiekermann
developerEmail=[email protected]
scmConnection=scm:git:[email protected]:eclipse-dataspaceconnector/GradlePlugins.git
websiteUrl=https://github.com/eclipse-dataspaceconnector/GradlePlugins.git
scmUrl=https://github.com/eclipse-dataspaceconnector/GradlePlugins.git

0 comments on commit 7ef50da

Please sign in to comment.