mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Merge pull request #58 from fboldog/make-java-buildconfig-final
generate final class and fields
This commit is contained in:
commit
f6d5c8a1f1
1 changed files with 2 additions and 2 deletions
|
@ -12,14 +12,14 @@ class JavaProjectInfo : IProjectInfo {
|
|||
override val defaultTestDirectories = hashSetOf("src/test/java", "src/test/resources", "src/test/res")
|
||||
|
||||
private fun generate(type: String, name: String, value: Any) =
|
||||
" public static $type $name = $value;"
|
||||
" public static final $type $name = $value;"
|
||||
|
||||
override fun generateBuildConfig(packageName: String, variant: Variant, buildConfigs: List<BuildConfig>) : String {
|
||||
val lines = arrayListOf<String>()
|
||||
with(lines) {
|
||||
add("package $packageName;")
|
||||
add("")
|
||||
add("public class BuildConfig {")
|
||||
add("public final class BuildConfig {")
|
||||
add(generate("String", "PRODUCT_FLAVOR", "\"" + variant.productFlavor.name + "\""))
|
||||
add(generate("String", "BUILD_TYPE", "\"" + variant.buildType.name + "\""))
|
||||
buildConfigs.forEach {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue