Skip to content

Commit f1b1269

Browse files
committed
fix: gradle methods order fix
1 parent e39c3d3 commit f1b1269

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

vendor/gradle-plugin/build.gradle

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,27 @@ buildscript {
7272
logger.warn "\t + failed to load gradle properties from \"$path\". Error is: ${ex.getMessage()}"
7373
}
7474
}
75+
def getAppPath = { ->
76+
def relativePathToApp = "app"
77+
def nsConfigFile = file("$USER_PROJECT_ROOT/nsconfig.json")
78+
def nsConfig
79+
80+
if (nsConfigFile.exists()) {
81+
nsConfig = new JsonSlurper().parseText(nsConfigFile.getText("UTF-8"))
82+
}
83+
84+
if (project.hasProperty("appPath")) {
85+
// when appPath is passed through -PappPath=/path/to/app
86+
// the path could be relative or absolute - either case will work
87+
relativePathToApp = appPath
88+
} else if (nsConfig != null && nsConfig.appPath != null) {
89+
relativePathToApp = nsConfig.appPath
90+
}
91+
92+
project.ext.appPath = Paths.get(USER_PROJECT_ROOT).resolve(relativePathToApp).toAbsolutePath()
93+
94+
return project.ext.appPath
95+
}
7596
def getAppResourcesPath = { ->
7697
def relativePathToAppResources
7798
def absolutePathToAppResources
@@ -99,28 +120,6 @@ buildscript {
99120
return absolutePathToAppResources
100121
}
101122

102-
103-
def getAppPath = { ->
104-
def relativePathToApp = "app"
105-
def nsConfigFile = file("$USER_PROJECT_ROOT/nsconfig.json")
106-
def nsConfig
107-
108-
if (nsConfigFile.exists()) {
109-
nsConfig = new JsonSlurper().parseText(nsConfigFile.getText("UTF-8"))
110-
}
111-
112-
if (project.hasProperty("appPath")) {
113-
// when appPath is passed through -PappPath=/path/to/app
114-
// the path could be relative or absolute - either case will work
115-
relativePathToApp = appPath
116-
} else if (nsConfig != null && nsConfig.appPath != null) {
117-
relativePathToApp = nsConfig.appPath
118-
}
119-
120-
project.ext.appPath = Paths.get(USER_PROJECT_ROOT).resolve(relativePathToApp).toAbsolutePath()
121-
122-
return project.ext.appPath
123-
}
124123
def initialize = { ->
125124
// set up our logger
126125
project.ext.outLogger = services.get(StyledTextOutputFactory).create("colouredOutputLogger")
@@ -295,6 +294,7 @@ android {
295294
nativescriptDependencies.each { dep ->
296295
def includeGradlePath = "${getDepPlatformDir(dep)}/include.gradle"
297296
if (file(includeGradlePath).exists()) {
297+
outLogger.withStyle(Style.SuccessHeader).println "\t + applying plugin include.gradle from dependency ${includeGradlePath}"
298298
apply from: includeGradlePath
299299
}
300300
}
@@ -315,6 +315,10 @@ android {
315315
versionCode 1
316316
versionName "1.0"
317317
}
318+
lintOptions {
319+
checkReleaseBuilds false
320+
abortOnError false
321+
}
318322
}
319323

320324

0 commit comments

Comments
 (0)