@@ -89,10 +89,8 @@ version of the {N} CLI install a previous version of the runtime package - 'tns
89
89
project. ext. PLATFORMS_ANDROID = " platforms/android"
90
90
project. ext. USER_PROJECT_ROOT = " $rootDir /../.."
91
91
92
- project. ext. getAppResourcesPath = { ->
92
+ project. ext. getAppPath = { ->
93
93
def relativePathToApp = " app"
94
- def relativePathToAppResources
95
- def absolutePathToAppResources
96
94
def nsConfigFile = file(" $USER_PROJECT_ROOT /nsconfig.json" )
97
95
def nsConfig
98
96
@@ -104,14 +102,28 @@ version of the {N} CLI install a previous version of the runtime package - 'tns
104
102
relativePathToApp = nsConfig. appPath
105
103
}
106
104
105
+ project. ext. appPath = java.nio.file.Paths . get(USER_PROJECT_ROOT ). resolve(relativePathToApp). toAbsolutePath()
106
+
107
+ return project. ext. appPath
108
+ }
109
+
110
+ project. ext. getAppResourcesPath = { ->
111
+ def relativePathToAppResources
112
+ def absolutePathToAppResources
113
+ def nsConfigFile = file(" $USER_PROJECT_ROOT /nsconfig.json" )
114
+ def nsConfig
115
+
116
+ if (nsConfigFile. exists()) {
117
+ nsConfig = new JsonSlurper (). parseText(nsConfigFile. getText(" UTF-8" ))
118
+ }
119
+
107
120
if (nsConfig != null && nsConfig. appResourcesPath != null ) {
108
121
relativePathToAppResources = nsConfig. appResourcesPath
122
+ absolutePathToAppResources = java.nio.file.Paths . get(USER_PROJECT_ROOT ). resolve(relativePathToAppResources). toAbsolutePath()
109
123
} else {
110
- relativePathToAppResources = " $r elativePathToApp /App_Resources"
124
+ absolutePathToAppResources = " ${ getAppPath() } /App_Resources"
111
125
}
112
126
113
- absolutePathToAppResources = java.nio.file.Paths . get(USER_PROJECT_ROOT ). resolve(relativePathToAppResources). toAbsolutePath()
114
-
115
127
project. ext. appResourcesPath = absolutePathToAppResources
116
128
117
129
return absolutePathToAppResources
@@ -188,7 +200,7 @@ def getAppIdentifier = { packageJsonMap ->
188
200
189
201
def setAppIdentifier = { ->
190
202
println " \t + setting applicationId"
191
- File packageJsonFile = new File (" $r ootDir /../../package.json " )
203
+ File packageJsonFile = new File (" $U SER_PROJECT_ROOT / $P ACKAGE_JSON " )
192
204
193
205
if (packageJsonFile. exists()) {
194
206
def content = packageJsonFile. getText(" UTF-8" )
@@ -326,11 +338,24 @@ dependencies {
326
338
implementation " com.android.support:appcompat-v7:$supportVer "
327
339
implementation " com.android.support:design:$supportVer "
328
340
}
329
- def useV8Symbols = nativescriptDependencies. any {
330
- def packageJsonPath = file(" $rootDir /${ it.directory} /$PACKAGE_JSON " )
331
- def packageJson = new JsonSlurper (). parseText(packageJsonPath. text)
332
- return packageJson. nativescript. useV8Symbols
341
+
342
+ def useV8Symbols = false
343
+
344
+ def appPackageJsonFile = file(" ${ getAppPath()} /$PACKAGE_JSON " )
345
+ if (appPackageJsonFile. exists()) {
346
+ def appPackageJson = new JsonSlurper (). parseText(appPackageJsonFile. text)
347
+ useV8Symbols = appPackageJson. android && appPackageJson. android. useV8Symbols
333
348
}
349
+
350
+ if (! useV8Symbols) {
351
+ // check whether any of the dependencies require v8 symbols
352
+ useV8Symbols = nativescriptDependencies. any {
353
+ def packageJsonFile = file(" $rootDir /${ it.directory} /$PACKAGE_JSON " )
354
+ def packageJson = new JsonSlurper (). parseText(packageJsonFile. text)
355
+ return packageJson. nativescript && packageJson. nativescript. useV8Symbols
356
+ }
357
+ }
358
+
334
359
if (! externalRuntimeExists) {
335
360
def runtime = " nativescript-optimized-with-inspector"
336
361
@@ -539,7 +564,7 @@ afterEvaluate { project ->
539
564
// It mattered only when we were extracting JARs from AARs.
540
565
// To try it simply remove the following comments.
541
566
// workerExecutor.submit(EmptyRunnable.class) {
542
- explodeAar(jar, outputDir)
567
+ explodeAar(jar, outputDir)
543
568
// }
544
569
}
545
570
}
0 commit comments