Skip to content

Commit 9419a55

Browse files
committed
Build: Add personal nexus repository for publishing
1 parent d9fbb1b commit 9419a55

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

plugin/build.gradle.kts

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,37 @@ plugins {
33
id("com.gradle.plugin-publish") version "2.0.0"
44
}
55

6-
val releaseVersion = releaseVersion()
7-
val releaseNotes = releaseNotes()
8-
version = releaseVersion.get()
6+
val releaseVersion = releaseVersion().get()
7+
val releaseNotes = releaseNotes().get()
8+
version = releaseVersion
99

1010
gradlePlugin {
1111
website = "https://infolektuell.github.io/gradle-jextract/"
1212
vcsUrl = "https://github.com/infolektuell/gradle-jextract.git"
1313
plugins.create("jextractPlugin") {
1414
id = "de.infolektuell.jextract"
1515
displayName = "jextract gradle plugin"
16-
description = releaseNotes.get()
16+
description = releaseNotes
1717
tags = listOf("native", "FFM", "panama", "jextract")
1818
implementationClass = "de.infolektuell.gradle.jextract.GradleJextractPlugin"
1919
}
2020
}
2121

22+
publishing {
23+
repositories {
24+
maven {
25+
name = "release"
26+
url = uri("https://nexus.infolektuell.de/repository/maven-releases/")
27+
credentials(PasswordCredentials::class)
28+
}
29+
maven {
30+
name = "snapshot"
31+
url = uri("https://nexus.infolektuell.de/repository/maven-snapshots/")
32+
credentials(PasswordCredentials::class)
33+
}
34+
}
35+
}
36+
2237
signing {
2338
// Get credentials from env variables for better CI compatibility
2439
val signingKeyId: String? by project
@@ -27,9 +42,12 @@ signing {
2742
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
2843
}
2944

45+
tasks.withType<Sign>().configureEach {
46+
val isReleaseVersion = !releaseVersion.endsWith("-SNAPSHOT")
47+
onlyIf { isReleaseVersion }
48+
}
49+
3050
java {
31-
withSourcesJar()
32-
withJavadocJar()
3351
toolchain {
3452
languageVersion = JavaLanguageVersion.of(21)
3553
}

0 commit comments

Comments
 (0)