Skip to content

Commit 4f08591

Browse files
authored
Merge pull request #1185 from NativeScript/trifonov/before-plugins
added support for before-plugins.gradle file applied before plugin
2 parents afc5aea + 94d42ac commit 4f08591

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test-app/app/build.gradle

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,17 @@ def getAppResourcesPath = { ->
111111
project.ext.appResourcesPath = absolutePathToAppResources
112112

113113
return absolutePathToAppResources
114-
};
114+
}
115+
116+
def applyBeforePluginGradleConfiguration = { ->
117+
def appResourcesPath = getAppResourcesPath()
118+
def pathToBeforePluginGradle = "$appResourcesPath/Android/before-plugins.gradle"
119+
def beforePluginGradle = file(pathToBeforePluginGradle)
120+
if (beforePluginGradle.exists()) {
121+
println "\t + applying user-defined configuration from ${beforePluginGradle}"
122+
apply from: pathToBeforePluginGradle
123+
}
124+
}
115125

116126
def applyAppGradleConfiguration = { ->
117127
def appResourcesPath = getAppResourcesPath()
@@ -212,6 +222,7 @@ android {
212222
}
213223

214224
setAppIdentifier()
225+
applyBeforePluginGradleConfiguration()
215226
applyPluginGradleConfigurations()
216227
applyAppGradleConfiguration()
217228
}
@@ -251,7 +262,7 @@ dependencies {
251262
supportVer = supportVersion
252263
}
253264

254-
println "Using support version $supportVer"
265+
println "Using support library version $supportVer"
255266

256267
implementation "com.android.support:multidex:1.0.2"
257268
implementation "com.android.support:support-v4:$supportVer"

0 commit comments

Comments
 (0)