@@ -76,6 +76,27 @@ def renameResultApks = { variant ->
76
76
// /////////////////////////// CONFIGURATIONS ///////////////////////////////////////
77
77
// //////////////////////////////////////////////////////////////////////////////////
78
78
79
+ def getAppResourcesDirectory = { ->
80
+ def USER_PROJECT_ROOT = " $rootDir /../.."
81
+ def defaultPathToAppResources = " $USER_PROJECT_ROOT /app/App_Resources"
82
+ def pathToAppResources
83
+ def nsConfigFile = file(" $USER_PROJECT_ROOT /nsconfig.json" )
84
+
85
+ if (nsConfigFile. exists()) {
86
+ def nsConfigJsonContent = new JsonSlurper (). parseText(nsConfigFile. getText(" UTF-8" ))
87
+
88
+ if (nsConfigJsonContent. app_resources != null ) {
89
+ pathToAppResources = java.nio.file.Paths . get(USER_PROJECT_ROOT ). resolve(nsConfigJsonContent. app_resources). toAbsolutePath()
90
+ } else if (nsConfigJsonContent. app_folder != null ) {
91
+ def pathToApp = java.nio.file.Paths . get(USER_PROJECT_ROOT ). resolve(nsConfigJsonContent. app_folder). toAbsolutePath();
92
+ pathToAppResources = " $pathToApp /App_Resources"
93
+ }
94
+ }
95
+
96
+ return pathToAppResources != null ? pathToAppResources : defaultPathToAppResources
97
+ }
98
+
99
+
79
100
def applyPluginsIncludeGradleConfigurations = { ->
80
101
def taskNames = project. getGradle(). startParameter. taskNames
81
102
@@ -139,7 +160,8 @@ def applyPluginsIncludeGradleConfigurations = { ->
139
160
}
140
161
141
162
def applyAppGradleConfiguration = { ->
142
- def pathToAppGradle = " $rootDir /../../app/App_Resources/Android/app.gradle"
163
+ def appResourcesDir = getAppResourcesDirectory()
164
+ def pathToAppGradle = " $appResourcesDir /Android/app.gradle"
143
165
def appGradle = file(pathToAppGradle)
144
166
if (appGradle. exists()) {
145
167
println " \t + applying user-defined configuration from ${ appGradle} "
0 commit comments