Skip to content

Commit 277d41b

Browse files
committed
chore(project-build-script): externalize app and appResources paths for other gradle scripts to use
1 parent f88bfe0 commit 277d41b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test-app/app/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def computeBuildToolsVersion = { ->
6767
}
6868

6969
project.ext.selectedBuildType = project.hasProperty("release") ? "release" : "debug"
70+
project.ext.appPath = ""
71+
project.ext.appResourcesPath = ""
7072

7173
////////////////////////////////////////////////////////////////////////////////////
7274
///////////////////////////// CONFIGURATIONS ///////////////////////////////////////
@@ -83,11 +85,14 @@ def getAppResourcesDirectory = { ->
8385
if (nsConfigJsonContent.appResourcesPath != null) {
8486
pathToAppResources = java.nio.file.Paths.get(USER_PROJECT_ROOT).resolve(nsConfigJsonContent.appResourcesPath).toAbsolutePath()
8587
} else if (nsConfigJsonContent.appPath != null) {
88+
project.ext.appPath = nsConfigJsonContent.appPath
8689
pathToAppResources = java.nio.file.Paths.get(USER_PROJECT_ROOT).resolve(nsConfigJsonContent.appPath).toAbsolutePath()
8790
}
8891
}
8992

90-
return pathToAppResources != null ? pathToAppResources : defaultPathToAppResources
93+
def result = pathToAppResources != null ? pathToAppResources : defaultPathToAppResources
94+
project.ext.appResourcesPath = result
95+
return result
9196
}
9297

9398
def applyAppGradleConfiguration = { ->

0 commit comments

Comments
 (0)