Skip to content

Commit

Permalink
Don't specify catalog version if undetermined
Browse files Browse the repository at this point in the history
  • Loading branch information
Virtlink committed Jul 14, 2024
1 parent 3ec2bf7 commit 0f3dddd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ object BuildInfo {
}

/** The current version. */
val version: String get() = checkNotNull(properties.getProperty("version"))
val version: String? get() = properties.getProperty("version")
/** The most recent release version. */
val releaseVersion: String get() = checkNotNull(properties.getProperty("release-version"))
val releaseVersion: String? get() = properties.getProperty("release-version")
/** The commit ID. */
val commit: String get() = checkNotNull(properties.getProperty("short-revision"))
val commit: String? get() = properties.getProperty("short-revision")

/** The application build time, as an [Instant]; or `null` when it could not be parsed. */
val buildTime: Instant? get() = tryParseOffsetDateTime(buildTimeString)
val buildTime: Instant? get() = buildTimeString?.let { tryParseOffsetDateTime(it) }
/** The application build time, as a string. */
val buildTimeString: String get() = checkNotNull(properties.getProperty("build-time"))
val buildTimeString: String? get() = properties.getProperty("build-time")


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import org.gradle.kotlin.dsl.maven
class SettingsConventionPlugin: Plugin<Settings> {

// Version of org.metaborg.spoofax3:catalog to be used for Metaborg projects
private val catalogVersion = BuildInfo.releaseVersion
private val catalogVersion: String? = BuildInfo.releaseVersion

@Suppress("UnstableApiUsage")
override fun apply(settings: Settings): Unit = with(settings) {
Expand All @@ -39,7 +39,7 @@ class SettingsConventionPlugin: Plugin<Settings> {
}
versionCatalogs {
create("libs") {
from("org.metaborg:catalog:$catalogVersion")
from("org.metaborg:catalog" + (catalogVersion?.let { ":$it" } ?: ""))
}
}
}
Expand Down

0 comments on commit 0f3dddd

Please sign in to comment.