Skip to content

Commit 8d04785

Browse files
committed
Use snapshot repo for snapshot versions
1 parent 4fc10b7 commit 8d04785

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

buildSrc/src/main/kotlin/bluemap.base.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ publishing {
7373
repositories {
7474
maven {
7575
name = "bluecolored"
76-
url = uri( "https://repo.bluecolored.de/releases" )
76+
url = uri("https://repo.bluecolored.de/releases")
77+
78+
if (!gitIsRelease())
79+
url = uri("https://repo.bluecolored.de/snapshots")
7780

7881
credentials {
7982
username = project.findProperty("bluecoloredUsername") as String? ?: System.getenv("BLUECOLORED_USERNAME")

buildSrc/src/main/kotlin/versioning.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ fun Project.gitVersion(): String {
2424
return gitVersion
2525
}
2626

27+
fun Project.gitIsRelease(): Boolean {
28+
val lastTag = if (runCommand("git tag", "").isEmpty()) "" else runCommand("git describe --tags --abbrev=0", "")
29+
val commits = runCommand("git rev-list --count $lastTag..HEAD", "0")
30+
return commits == "0" && gitClean()
31+
}
32+
2733
fun Project.releaseNotes(): String {
2834
val file = rootProject.projectDir.resolve("release.md")
2935
if (!file.exists()) return ""

0 commit comments

Comments
 (0)