Skip to content

Commit d926dd4

Browse files
farfromrefugrigor789
authored andcommitted
fix: load before-plugins.gradle in build.gradle to allow to override androidBuildToolsVersion and other vars
1 parent 77585ad commit d926dd4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test-app/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@ version of the {N} CLI install a previous version of the runtime package - 'tns
122122

123123
}
124124

125+
def applyBeforePluginGradleConfiguration = { ->
126+
def appResourcesPath = getAppResourcesPath()
127+
def pathToBeforePluginGradle = "$appResourcesPath/Android/before-plugins.gradle"
128+
def beforePluginGradle = file(pathToBeforePluginGradle)
129+
if (beforePluginGradle.exists()) {
130+
outLogger.withStyle(Style.SuccessHeader).println "\t + applying user-defined configuration from ${beforePluginGradle}"
131+
apply from: pathToBeforePluginGradle
132+
}
133+
}
125134
def applyBuildScriptConfigurations = { ->
126135
def absolutePathToAppResources = getAppResourcesPath()
127136
def pathToBuildScriptGradle = "$absolutePathToAppResources/Android/rootbuildscript.gradle"
@@ -143,6 +152,7 @@ version of the {N} CLI install a previous version of the runtime package - 'tns
143152

144153
initialize()
145154
applyBuildScriptConfigurations()
155+
applyBeforePluginGradleConfiguration()
146156

147157
def computeKotlinVersion = { -> project.hasProperty("kotlinVersion") ? kotlinVersion : "${kotlin_version}"
148158
}

0 commit comments

Comments
 (0)