File tree Expand file tree Collapse file tree 3 files changed +6
-12
lines changed
Expand file tree Collapse file tree 3 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -465,10 +465,11 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
465465 this . getPlatformData ( projectData ) . projectRoot ,
466466 "settings.gradle"
467467 ) ;
468+ const relativePath = path . relative ( this . getPlatformData ( projectData ) . projectRoot , projectData . projectDir )
468469 shell . sed (
469470 "-i" ,
470471 / d e f U S E R _ P R O J E C T _ R O O T = \" \$ r o o t D i r \/ ..\/ ..\/ \" / ,
471- ' def USER_PROJECT_ROOT = System.getProperties().projectRoot != null ? System.getProperties().projectRoot : "$rootDir/../../"' ,
472+ ` def USER_PROJECT_ROOT = "$rootDir/${ relativePath } "` ,
472473 gradleSettingsFilePath
473474 ) ;
474475
@@ -527,7 +528,6 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
527528 ) ;
528529 const buildGradlePath = path . join (
529530 this . getPlatformData ( projectData ) . projectRoot ,
530- "app" ,
531531 "build.gradle"
532532 ) ;
533533 shell . sed (
@@ -536,10 +536,11 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
536536 projectData . projectIdentifiers . android ,
537537 buildGradlePath
538538 ) ;
539+ const relativePath = path . relative ( this . getPlatformData ( projectData ) . projectRoot , projectData . projectDir )
539540 shell . sed (
540541 "-i" ,
541542 / p r o j e c t .e x t .U S E R _ P R O J E C T _ R O O T = \" \$ r o o t D i r \/ ..\/ ..\" / ,
542- ' project.ext.USER_PROJECT_ROOT = System.getProperties().projectRoot != null ? System.getProperties().projectRoot : "$rootDir/../../"' ,
543+ ` project.ext.USER_PROJECT_ROOT = "$rootDir/${ relativePath } "` ,
543544 buildGradlePath
544545 ) ;
545546 }
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ version of the {N} CLI install a previous version of the runtime package - 'tns
4545
4646 project. ext. nativescriptDependencies = new JsonSlurper (). parseText(dependenciesJson. text)
4747 project. ext. PLATFORMS_ANDROID = " platforms/android"
48- project. ext. USER_PROJECT_ROOT = System . getProperties() . projectRoot != null ? System . getProperties() . projectRoot : " $rootDir /../../ "
48+ project. ext. USER_PROJECT_ROOT = " $rootDir /../.."
4949
5050 project. ext. getAppPath = { ->
5151 def relativePathToApp = " app"
Original file line number Diff line number Diff line change @@ -14,14 +14,7 @@ import org.gradle.internal.logging.text.StyledTextOutputFactory
1414import groovy.json.JsonSlurper
1515import static org.gradle.internal.logging.text.StyledTextOutput.Style
1616
17- def getProjectRoot = { ->
18- def projectRoot = " $rootDir /../../"
19- if (System . getProperties(). projectRoot != null ) {
20- projectRoot = System . getProperties(). projectRoot
21- }
22- return projectRoot
23- }
24- def USER_PROJECT_ROOT = getProjectRoot()
17+ def USER_PROJECT_ROOT = " $rootDir /../../"
2518def outLogger = services. get(StyledTextOutputFactory ). create(" colouredOutputLogger" )
2619def ext = {
2720 appResourcesPath = getProperty(" appResourcesPath" )
You can’t perform that action at this time.
0 commit comments