Skip to content

Commit

Permalink
Merge pull request #30 from sdeparte/sylvain-fix-issue-5
Browse files Browse the repository at this point in the history
Throw GradleException when tmdb.api.key isn't defined in local.properties
  • Loading branch information
Ribesg authored May 24, 2024
2 parents 0508b40 + 7fc4e33 commit efb0c1e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
import org.jetbrains.kotlin.konan.properties.hasProperty

val artifactId = "cinematic.journey"
val groupId = "com.wizbii"
Expand Down Expand Up @@ -106,6 +107,10 @@ buildConfig {

packageName = packageId

if (!localProperties.hasProperty("tmdb.api.key")) {
throw GradleException("TMDB API key not defined. Set the tmdb.api.key in your project's local properties file at '${rootDir}/local.properties'.")
}

buildConfigField(
name = "TMDB_API_KEY",
value = localProperties.getProperty("tmdb.api.key"),
Expand Down

0 comments on commit efb0c1e

Please sign in to comment.