mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-29 17:38:12 -07:00
Refactor PomGenerator.
This commit is contained in:
parent
095a3918f1
commit
5df0d01a21
8 changed files with 29 additions and 20 deletions
|
@ -154,7 +154,7 @@ class Variant(val initialProductFlavor: ProductFlavorConfig? = null,
|
|||
|
||||
/**
|
||||
* Generate BuildConfig.java if requested. Also look up if any BuildConfig is defined on the current build type,
|
||||
* product flavor or main project, and use them to generate any additional field (in that order to
|
||||
* product flavor or main project, and use them to generateAndSave any additional field (in that order to
|
||||
* respect the priorities). Return the generated file if it was generated, null otherwise.
|
||||
*/
|
||||
fun maybeGenerateBuildConfig(project: Project, context: KobaltContext) : File? {
|
||||
|
@ -163,7 +163,7 @@ class Variant(val initialProductFlavor: ProductFlavorConfig? = null,
|
|||
if (buildConfigs.size > 0) {
|
||||
val pkg = project.packageName ?: project.group
|
||||
?: throw KobaltException(
|
||||
"packageName needs to be defined on the project in order to generate BuildConfig")
|
||||
"packageName needs to be defined on the project in order to generateAndSave BuildConfig")
|
||||
|
||||
val contributor = ActorUtils.selectAffinityActor(context.pluginInfo.buildConfigContributors, project)
|
||||
if (contributor != null) {
|
||||
|
@ -178,7 +178,7 @@ class Variant(val initialProductFlavor: ProductFlavorConfig? = null,
|
|||
log(2, "Generated ${outputDir.path}")
|
||||
return result
|
||||
} else {
|
||||
throw KobaltException("Couldn't find a contributor to generate BuildConfig")
|
||||
throw KobaltException("Couldn't find a contributor to generateAndSave BuildConfig")
|
||||
}
|
||||
} else {
|
||||
return null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue