File tree 2 files changed +27
-1
lines changed
2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -408,7 +408,8 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
408
408
) ;
409
409
const allGradleTemplateFiles = path . join ( gradleTemplatePath , "*" ) ;
410
410
const buildGradlePath = path . join ( pluginTempDir , "build.gradle" ) ;
411
-
411
+ const settingsGradlePath = path . join ( pluginTempDir , "settings.gradle" ) ;
412
+
412
413
this . $fs . copyFile ( allGradleTemplateFiles , pluginTempDir ) ;
413
414
this . addCompileDependencies ( platformsAndroidDirPath , buildGradlePath ) ;
414
415
const runtimeGradleVersions = await this . getRuntimeGradleVersions (
@@ -423,6 +424,7 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
423
424
runtimeGradleVersions . gradleAndroidPluginVersion
424
425
) ;
425
426
this . replaceFileContent ( buildGradlePath , "{{pluginName}}" , pluginName ) ;
427
+ this . replaceFileContent ( settingsGradlePath , "{{pluginName}}" , pluginName ) ;
426
428
}
427
429
428
430
private async getRuntimeGradleVersions (
Original file line number Diff line number Diff line change
1
+ import groovy.json.JsonSlurper
1
2
3
+ def USER_PROJECT_ROOT = " $rootDir /../../../"
4
+ def PLATFORMS_ANDROID = " platforms/android"
5
+ def PLUGIN_NAME = " {{pluginName}}"
6
+
7
+ def dependenciesJson = file(" ${ USER_PROJECT_ROOT} /${ PLATFORMS_ANDROID} /dependencies.json" )
8
+ def appDependencies = new JsonSlurper (). parseText(dependenciesJson. text)
9
+ def pluginData = appDependencies. find { it. name == PLUGIN_NAME }
10
+ def nativescriptDependencies = appDependencies. findAll{pluginData. name == it. name}
11
+
12
+ def getDepPlatformDir = { dep ->
13
+ file(" $USER_PROJECT_ROOT /$PLATFORMS_ANDROID /${ dep.directory} /$PLATFORMS_ANDROID " )
14
+ }
15
+
16
+ def applyIncludeSettingsGradlePlugin = {
17
+ nativescriptDependencies. each { dep ->
18
+ def includeSettingsGradlePath = " ${ getDepPlatformDir(dep)} /include-settings.gradle"
19
+ if (file(includeSettingsGradlePath). exists()) {
20
+ apply from : includeSettingsGradlePath
21
+ }
22
+ }
23
+ }
24
+
25
+ applyIncludeSettingsGradlePlugin()
You can’t perform that action at this time.
0 commit comments