Skip to content

Commit

Permalink
Migrate to cthing-projectversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
baron1405 committed May 26, 2024
1 parent 97fa368 commit bf25fa7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
19 changes: 13 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import com.github.spotbugs.snom.Confidence
import com.github.spotbugs.snom.Effort
import org.cthing.projectversion.BuildType
import org.cthing.projectversion.ProjectVersion
import java.text.SimpleDateFormat
import java.util.*

Expand All @@ -18,12 +20,16 @@ plugins {
alias(libs.plugins.versions)
}

val baseVersion = "0.1.0"
val isSnapshot = true
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath(libs.cthingProjectVersion)
}
}

val isCIServer = System.getenv("CTHING_CI") != null
val buildNumber = if (isCIServer) System.currentTimeMillis().toString() else "0"
version = if (isSnapshot) "$baseVersion-$buildNumber" else baseVersion
version = ProjectVersion("0.1.0", BuildType.snapshot)
group = "org.cthing"
description = "A port of the Molinillo generic dependency resolution algorithm to Java."

Expand Down Expand Up @@ -213,7 +219,8 @@ publishing {
}
}

val repoUrl = if (isSnapshot) findProperty("cthing.nexus.snapshotsUrl") else findProperty("cthing.nexus.candidatesUrl")
val repoUrl = if ((version as ProjectVersion).isSnapshotBuild)
findProperty("cthing.nexus.snapshotsUrl") else findProperty("cthing.nexus.candidatesUrl")
if (repoUrl != null) {
repositories {
maven {
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ versions = { id = "com.github.ben-manes.versions", version = "0.51.0" }
[libraries]
assertJ = "org.assertj:assertj-core:3.25.3"
cthingAnnots = "org.cthing:cthing-annotations:1.0.0"
cthingProjectVersion = "org.cthing:cthing-projectversion:1.0.0"
equalsVerifier = "nl.jqno.equalsverifier:equalsverifier:3.15.6"
jacksonAnnots = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" }
jacksonCore = { module = "com.fasterxml.jackson.core:jackson-core", version.ref = "jackson" }
Expand Down

0 comments on commit bf25fa7

Please sign in to comment.