Skip to content

Commit

Permalink
[FIX/#1] lint formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonsuKang committed Dec 24, 2024
1 parent de5216c commit 068ae8a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions build-logic/src/main/java/com/yapp/convention/Extension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ internal val ExtensionContainer.libs: VersionCatalog
get() = getByType<VersionCatalogsExtension>().named("libs")

internal fun CommonExtension<*, *, *, *, *, *>.addBuildConfigFields(project: Project) {
val baseUrl = project.getLocalProperty("baseUrl", "https://default.example.com").takeIf { it.isNotBlank() }
?: throw IllegalArgumentException("baseUrl is missing or empty. Check your local.properties or environment configuration.")
val baseUrl = project.getLocalProperty("baseUrl", "https://default.example.com")
val isDebug = project.providers.gradleProperty("isDebug").orNull?.toBoolean() ?: false

buildTypes {
Expand All @@ -49,7 +48,7 @@ internal fun Project.getLocalProperty(key: String, defaultValue: String? = null)
load(propertiesFile.inputStream())
}
return properties.getProperty(key)?.takeIf { it.isNotBlank() }
?: defaultValue ?: throw IllegalArgumentException("Property $key is missing or empty in local.properties and no default value provided.")
?: defaultValue ?: "https://default.example.com"
}
return defaultValue ?: throw IllegalArgumentException("Property $key not found in local.properties and no default value provided.")
return defaultValue ?: "https://default.example.com"
}

0 comments on commit 068ae8a

Please sign in to comment.