From df9d2cfabed791fa95dd7d03e8c22352ed2438be Mon Sep 17 00:00:00 2001 From: Rhys <98863820+rhysdh540@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:24:51 +0800 Subject: [PATCH] consistent error on no property --- build.gradle.kts | 2 +- buildSrc/build.gradle.kts | 2 +- fabric/build.gradle.kts | 2 +- forge/build.gradle.kts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a4e1c98..b00d0e4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -395,4 +395,4 @@ tasks.register("nukeGradleCaches") { } } -operator fun String.invoke(): String = rootProject.ext[this] as String \ No newline at end of file +operator fun String.invoke(): String = rootProject.ext[this] as? String ?: error("No property \"$this\"") \ No newline at end of file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index f422c79..f87ec34 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -44,7 +44,7 @@ dependencies { plugin(id = "xyz.wagyourtail.unimined.expect-platform", version = "expectplatform_version"()) } -operator fun String.invoke(): String = gradleProperties.getProperty(this) ?: error("Property $this is not defined") +operator fun String.invoke(): String = gradleProperties.getProperty(this) ?: error("No property \"$this\"") fun DependencyHandler.plugin(id: String, version: String) = implementation(group = id, name = "$id.gradle.plugin", version = version) diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts index 15207c0..963154d 100644 --- a/fabric/build.gradle.kts +++ b/fabric/build.gradle.kts @@ -49,4 +49,4 @@ dependencies { } } -operator fun String.invoke(): String = rootProject.ext[this] as? String ?: error("Property $this is not defined") \ No newline at end of file +operator fun String.invoke(): String = rootProject.ext[this] as? String ?: error("No property \"$this\"") \ No newline at end of file diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts index ca90076..d4e8778 100644 --- a/forge/build.gradle.kts +++ b/forge/build.gradle.kts @@ -41,4 +41,4 @@ dependencies { modImplementation("com.jozufozu.flywheel:flywheel-forge-${"flywheel_mc_version"()}:${"flywheel_version"()}") } -operator fun String.invoke(): String = rootProject.ext[this] as? String ?: error("Property $this is not defined") \ No newline at end of file +operator fun String.invoke(): String = rootProject.ext[this] as? String ?: error("No property \"$this\"") \ No newline at end of file