diff --git a/build.gradle.kts b/build.gradle.kts index d9cea1b..53c6965 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ repositories { } group = "com.github.minecraftschurlimods" -version = "1.0" +version = "1.1" base.archivesName = "HelperPlugin" dependencies { diff --git a/src/main/kotlin/com/github/minecraftschurlimods/helperplugin/Util.kt b/src/main/kotlin/com/github/minecraftschurlimods/helperplugin/Util.kt index 9b91633..1b93f64 100644 --- a/src/main/kotlin/com/github/minecraftschurlimods/helperplugin/Util.kt +++ b/src/main/kotlin/com/github/minecraftschurlimods/helperplugin/Util.kt @@ -1,17 +1,15 @@ package com.github.minecraftschurlimods.helperplugin +import net.neoforged.gradle.util.TransformerUtils import org.gradle.api.Project import org.gradle.api.artifacts.dsl.DependencyHandler import org.gradle.api.provider.Provider import org.gradle.kotlin.dsl.the // TODO: remove this once https://github.com/gradle/gradle/issues/23572 is fixed -fun Project.localGradleProperty(name: Provider): Provider = name.map { - if (hasProperty(it)) - property(it)?.toString()!! - else - null!! -} +fun Project.localGradleProperty(name: Provider): Provider = name.map(TransformerUtils.guard { + return@guard if (hasProperty(it)) property(it)?.toString() else null +}) fun Project.localGradleProperty(name: String): Provider = localGradleProperty(provider { name })