Skip to content

Commit 149936e

Browse files
committed
Merge branch 'master' of github.com:NativeScript/nativescript-cli
2 parents 272aff9 + 7574be2 commit 149936e

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

lib/services/android-plugin-build-service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
374374
);
375375
const allGradleTemplateFiles = path.join(gradleTemplatePath, "*");
376376
const buildGradlePath = path.join(pluginTempDir, "build.gradle");
377-
377+
const settingsGradlePath = path.join(pluginTempDir, "settings.gradle");
378+
378379
this.$fs.copyFile(allGradleTemplateFiles, pluginTempDir);
379380
const runtimeGradleVersions = await this.getRuntimeGradleVersions(
380381
projectDir
@@ -384,6 +385,7 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
384385
runtimeGradleVersions.gradleVersion
385386
);
386387
this.replaceFileContent(buildGradlePath, "{{pluginName}}", pluginName);
388+
this.replaceFileContent(settingsGradlePath, "{{pluginName}}", pluginName);
387389
}
388390

389391
private async getRuntimeGradleVersions(

lib/services/platform-environment-requirements.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,11 @@ export class PlatformEnvironmentRequirements
152152
darwin: "macos",
153153
} as any)[process.platform];
154154

155+
const anchor = platform ? `#${os}-${platform.toLowerCase()}` : ''
156+
155157
return (
156158
`Verify that your environment is configured according to the system requirements described at\n` +
157-
`https://docs.nativescript.org/environment-setup.html#${os}-${platform.toLowerCase()}.`
159+
`https://docs.nativescript.org/environment-setup.html${anchor}.`
158160
);
159161
}
160162

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
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()

0 commit comments

Comments
 (0)