Skip to content

Commit c290946

Browse files
committed
add flavorDimensions to build in place, instead of writing to a file
1 parent 2db2fdf commit c290946

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

build-artifacts/project-template-gradle/build.gradle

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ task addDependenciesFromNativeScriptPlugins {
246246
}
247247

248248
task applyPluginsIncludeGradleConfigurations {
249+
configurationsDir.deleteDir()
250+
249251
def dimensions = []
250252
def includes = new ArrayList<String>()
251253
def flavorNumber = 0
@@ -283,27 +285,22 @@ task applyPluginsIncludeGradleConfigurations {
283285
copyAndRenamePluginDirToFlavorName(androidDir, flavor);
284286
}
285287

288+
flavorDimensions(*dimensions)
289+
286290
includes.each {
287291
println "\t + applying plugin configuration from ${it}"
288292
apply from: it
289293
}
290-
291-
def concatenatedDimensions = dimensions.collect { "\"${it}\"" }.join(", ");
292-
def includeFile = file("${configurationsDir}/include.gradle")
293-
294-
includeFile.text = "android { flavorDimensions ${concatenatedDimensions} }"
295-
296-
apply from: includeFile
297-
298-
configurationsDir.deleteDir()
299294
}
300295

296+
applyPluginsIncludeGradleConfigurations.finalizedBy(applyAppGradleConfiguration)
297+
301298
task applyAppGradleConfiguration {
302299
description "applies user-defined gradle configuration"
303300

304301
def pathToAppGradle = "$projectDir/../../app/App_Resources/Android/app.gradle"
305302
def appGradle = file(pathToAppGradle)
306-
if(appGradle.exists()) {
303+
if (appGradle.exists()) {
307304
println "\t + applying user-defined configuration from ${appGradle}"
308305
apply from: pathToAppGradle
309306
}

0 commit comments

Comments
 (0)