Skip to content

Commit 1d1cd5d

Browse files
author
plamen5kov
committed
added special logic for android resources manifest (should be merged first)
1 parent 139902e commit 1d1cd5d

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

build/project-template-gradle/build.gradle

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def configStage = "\n:config phase: "
3939
def nodeModulesDir = "../../node_modules/"
4040
def pluginNames = new ArrayList<String>()
4141
def configDir = file(configurationsDir)
42+
def appResExists = false
43+
def appResourcesName = "NativescriptAppResources"
4244

4345
def compiteCompileSdkVersion () {
4446
if(project.hasProperty("compileSdk")) {
@@ -216,6 +218,10 @@ task createDefaultIncludeFiles {
216218
createPluginConfigFile = true
217219
def foundIncludeFile = false
218220

221+
if(fileName == appResourcesName) {
222+
appResExists = true
223+
}
224+
219225
println "\t+found plugins: " + fileName
220226
fl.listFiles().each { subFile ->
221227

@@ -225,7 +231,9 @@ task createDefaultIncludeFiles {
225231
}
226232
}
227233

228-
pluginNames.add('"' + dimensionName + '"')
234+
if(!appResExists) {
235+
pluginNames.add('"' + dimensionName + '"')
236+
}
229237

230238
if(!foundIncludeFile) {
231239
createIncludeFile(fl.getAbsolutePath() ,fileName, dimensionName)
@@ -246,6 +254,9 @@ task createPluginsConfigFile {
246254
if(createPluginConfigFile) {
247255
println "\t+creating product flavors include.gradle file in $configurationsDir folder..."
248256
def flavors = pluginNames.join(",")
257+
if(appResExists) {
258+
flavors = '"' + appResourcesName + '", ' + flavors
259+
}
249260
flavorsFile << "android { \n"
250261
flavorsFile << "\tflavorDimensions " + flavors + "\n"
251262
flavorsFile << "}\n"

0 commit comments

Comments
 (0)