diff --git a/convention-plugin/src/main/kotlin/org/metaborg/convention/BuildInfo.kt b/convention-plugin/src/main/kotlin/org/metaborg/convention/BuildInfo.kt index 2b1b537..7bf09d6 100644 --- a/convention-plugin/src/main/kotlin/org/metaborg/convention/BuildInfo.kt +++ b/convention-plugin/src/main/kotlin/org/metaborg/convention/BuildInfo.kt @@ -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") /** diff --git a/convention-plugin/src/main/kotlin/org/metaborg/convention/SettingsConventionPlugin.kt b/convention-plugin/src/main/kotlin/org/metaborg/convention/SettingsConventionPlugin.kt index 97a7fda..b66d50a 100644 --- a/convention-plugin/src/main/kotlin/org/metaborg/convention/SettingsConventionPlugin.kt +++ b/convention-plugin/src/main/kotlin/org/metaborg/convention/SettingsConventionPlugin.kt @@ -17,7 +17,7 @@ import org.gradle.kotlin.dsl.maven class SettingsConventionPlugin: Plugin { // 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) { @@ -39,7 +39,7 @@ class SettingsConventionPlugin: Plugin { } versionCatalogs { create("libs") { - from("org.metaborg:catalog:$catalogVersion") + from("org.metaborg:catalog" + (catalogVersion?.let { ":$it" } ?: "")) } } }