Skip to content

Commit

Permalink
add buildfile specifically for release
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Jun 26, 2023
1 parent 9c15af4 commit 3568253
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions build.gradle.kts.release
Original file line number Diff line number Diff line change
@@ -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<Checkstyle> {
reports {
html.required.set(false)
xml.required.set(true)
}
}

tasks.withType<Jar> {
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
}

0 comments on commit 3568253

Please sign in to comment.