Skip to content

Commit

Permalink
consistent error on no property
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysdh540 committed Oct 7, 2024
1 parent 98b7165 commit df9d2cf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -395,4 +395,4 @@ tasks.register("nukeGradleCaches") {
}
}

operator fun String.invoke(): String = rootProject.ext[this] as String
operator fun String.invoke(): String = rootProject.ext[this] as? String ?: error("No property \"$this\"")
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ dependencies {
}
}

operator fun String.invoke(): String = rootProject.ext[this] as? String ?: error("Property $this is not defined")
operator fun String.invoke(): String = rootProject.ext[this] as? String ?: error("No property \"$this\"")
2 changes: 1 addition & 1 deletion forge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
operator fun String.invoke(): String = rootProject.ext[this] as? String ?: error("No property \"$this\"")

0 comments on commit df9d2cf

Please sign in to comment.