File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
Expand file tree Collapse file tree 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 {
408408 ) ;
409409 const allGradleTemplateFiles = path . join ( gradleTemplatePath , "*" ) ;
410410 const buildGradlePath = path . join ( pluginTempDir , "build.gradle" ) ;
411-
411+ const settingsGradlePath = path . join ( pluginTempDir , "settings.gradle" ) ;
412+
412413 this . $fs . copyFile ( allGradleTemplateFiles , pluginTempDir ) ;
413414 this . addCompileDependencies ( platformsAndroidDirPath , buildGradlePath ) ;
414415 const runtimeGradleVersions = await this . getRuntimeGradleVersions (
@@ -423,6 +424,7 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
423424 runtimeGradleVersions . gradleAndroidPluginVersion
424425 ) ;
425426 this . replaceFileContent ( buildGradlePath , "{{pluginName}}" , pluginName ) ;
427+ this . replaceFileContent ( settingsGradlePath , "{{pluginName}}" , pluginName ) ;
426428 }
427429
428430 private async getRuntimeGradleVersions (
Original file line number Diff line number Diff line change 1+ import groovy.json.JsonSlurper
12
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