Skip to content

Commit

Permalink
Use snapshot repo for snapshot versions
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Nov 2, 2024
1 parent 4fc10b7 commit 8d04785
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion buildSrc/src/main/kotlin/bluemap.base.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ publishing {
repositories {
maven {
name = "bluecolored"
url = uri( "https://repo.bluecolored.de/releases" )
url = uri("https://repo.bluecolored.de/releases")

if (!gitIsRelease())
url = uri("https://repo.bluecolored.de/snapshots")

credentials {
username = project.findProperty("bluecoloredUsername") as String? ?: System.getenv("BLUECOLORED_USERNAME")
Expand Down
6 changes: 6 additions & 0 deletions buildSrc/src/main/kotlin/versioning.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ fun Project.gitVersion(): String {
return gitVersion
}

fun Project.gitIsRelease(): Boolean {
val lastTag = if (runCommand("git tag", "").isEmpty()) "" else runCommand("git describe --tags --abbrev=0", "")
val commits = runCommand("git rev-list --count $lastTag..HEAD", "0")
return commits == "0" && gitClean()
}

fun Project.releaseNotes(): String {
val file = rootProject.projectDir.resolve("release.md")
if (!file.exists()) return ""
Expand Down

0 comments on commit 8d04785

Please sign in to comment.