-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: publish version catalog and BOM
- Loading branch information
Showing
13 changed files
with
282 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/> | ||
* SPDX-FileCopyrightText: 2021-2024 The Refinery Authors <https://refinery.tools/> | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
rootProject.name = "buildSrc" | ||
|
||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
|
||
create("pluginLibs") { | ||
from(files("../gradle/pluginLibs.versions.toml")) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
buildSrc/src/main/kotlin/tools/refinery/gradle/maven-bom.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 The Refinery Authors <https://refinery.tools/> | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package tools.refinery.gradle | ||
|
||
plugins { | ||
`java-platform` | ||
id("tools.refinery.gradle.maven-publish") | ||
} | ||
|
||
javaPlatform { | ||
allowDependencies() | ||
} | ||
|
||
publishing.publications.named<MavenPublication>("mavenJava") { | ||
from(components["javaPlatform"]) | ||
} |
80 changes: 80 additions & 0 deletions
80
buildSrc/src/main/kotlin/tools/refinery/gradle/maven-publish.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 The Refinery Authors <https://refinery.tools/> | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package tools.refinery.gradle | ||
|
||
import org.gradle.configurationcache.extensions.capitalized | ||
|
||
plugins { | ||
`maven-publish` | ||
signing | ||
} | ||
|
||
val mavenRepositoryDir = rootProject.layout.buildDirectory.map { it.dir("repo") } | ||
|
||
open class MavenArtifactExtension(project: Project) { | ||
var name: String = project.name.split("-").drop(1).joinToString(" ", transform = String::capitalized) | ||
var description: String? = null | ||
} | ||
|
||
val artifactExtension = project.extensions.create<MavenArtifactExtension>("mavenArtifact", project) | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("mavenJava") { | ||
pom { | ||
name = provider { "Refinery ${artifactExtension.name}" } | ||
description = provider { | ||
val prefix = artifactExtension.description ?: artifactExtension.name.lowercase().capitalized() | ||
"$prefix in Refinery, an efficient graph solver for generating well-formed models" | ||
} | ||
url = "https://refinery.tools/" | ||
licenses { | ||
license { | ||
name = "Eclipse Public License - v 2.0" | ||
url = "https://www.eclipse.org/legal/epl-2.0/" | ||
} | ||
} | ||
developers { | ||
developer { | ||
name = "The Refinery Authors" | ||
url = "https://refinery.tools/" | ||
} | ||
} | ||
scm { | ||
connection = "scm:git:https://github.com/graphs4value/refinery.git" | ||
developerConnection = "scm:git:ssh://github.com:graphs4value/refinery.git" | ||
url = "https://github.com/graphs4value/refinery" | ||
} | ||
issueManagement { | ||
url = "https://github.com/graphs4value/refinery/issues" | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = "file" | ||
setUrl(mavenRepositoryDir.map { uri(it) }) | ||
} | ||
} | ||
} | ||
|
||
tasks.named<PublishToMavenRepository>("publishMavenJavaPublicationToFileRepository") { | ||
mustRunAfter(rootProject.tasks.named("cleanMavenRepository")) | ||
outputs.dir(mavenRepositoryDir) | ||
} | ||
|
||
signing { | ||
// The underlying property cannot be set publicly. | ||
@Suppress("UsePropertyAccessSyntax") | ||
setRequired(project.hasProperty("forceSign")) | ||
val signingKeyId = System.getenv("PGP_KEY_ID") | ||
val signingKey = System.getenv("PGP_KEY") | ||
val signingPassword = System.getenv("PGP_PASSWORD") | ||
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) | ||
sign(publishing.publications["mavenJava"]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.