-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: include-settings.gradle plugin (#5693)
- Loading branch information
1 parent
aa3de73
commit 6155ff7
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
import groovy.json.JsonSlurper | ||
|
||
def USER_PROJECT_ROOT = "$rootDir/../../../" | ||
def PLATFORMS_ANDROID = "platforms/android" | ||
def PLUGIN_NAME = "{{pluginName}}" | ||
|
||
def dependenciesJson = file("${USER_PROJECT_ROOT}/${PLATFORMS_ANDROID}/dependencies.json") | ||
def appDependencies = new JsonSlurper().parseText(dependenciesJson.text) | ||
def pluginData = appDependencies.find { it.name == PLUGIN_NAME } | ||
def nativescriptDependencies = appDependencies.findAll{pluginData.name == it.name} | ||
|
||
def getDepPlatformDir = { dep -> | ||
file("$USER_PROJECT_ROOT/$PLATFORMS_ANDROID/${dep.directory}/$PLATFORMS_ANDROID") | ||
} | ||
|
||
def applyIncludeSettingsGradlePlugin = { | ||
nativescriptDependencies.each { dep -> | ||
def includeSettingsGradlePath = "${getDepPlatformDir(dep)}/include-settings.gradle" | ||
if (file(includeSettingsGradlePath).exists()) { | ||
apply from: includeSettingsGradlePath | ||
} | ||
} | ||
} | ||
|
||
applyIncludeSettingsGradlePlugin() |