[android] Adds gradle-dependency-graph-generator-plugin to Android project (#11603)

* adds gradle-dependency-graph-generator-plugin to the project

* keep script in sync with https://github.com/mapbox/mapbox-android-demo/pull/671

* adds a makefile rule for dependency generation
This commit is contained in:
Antonio Zugaldia
2018-04-10 10:58:58 -04:00
committed by GitHub
parent 05d24448bd
commit 61bb9be1e3
4 changed files with 36 additions and 0 deletions

View File

@@ -683,6 +683,11 @@ endif
android-configuration: platform/android/gradle/configuration.gradle
cat platform/android/gradle/configuration.gradle
# Creates a dependency graph using Graphviz
.PHONY: android-graph
android-graph:
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:generateDependencyGraphMapboxLibraries
#### Miscellaneous targets #####################################################
.PHONY: style-code

View File

@@ -0,0 +1 @@
dependency-graph-mapbox-libraries.png

View File

@@ -150,3 +150,4 @@ apply from: "${rootDir}/gradle/gradle-javadoc.gradle"
apply from: "${rootDir}/gradle/gradle-publish.gradle"
apply from: "${rootDir}/gradle/gradle-checkstyle.gradle"
apply from: "${rootDir}/gradle/gradle-tests-staticblockremover.gradle"
apply from: "${rootDir}/gradle/gradle-dependencies-graph.gradle"

View File

@@ -0,0 +1,29 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.vanniktech:gradle-dependency-graph-generator-plugin:0.3.0"
}
}
import com.vanniktech.dependency.graph.generator.DependencyGraphGeneratorPlugin
import com.vanniktech.dependency.graph.generator.DependencyGraphGeneratorExtension.Generator
import com.vanniktech.dependency.graph.generator.dot.GraphFormattingOptions
import com.vanniktech.dependency.graph.generator.dot.Color
import com.vanniktech.dependency.graph.generator.dot.Shape
import com.vanniktech.dependency.graph.generator.dot.Style
plugins.apply(DependencyGraphGeneratorPlugin)
def mapboxGenerator = new Generator(
"mapboxLibraries", // Suffix for our Gradle task.
"", // Root suffix that we don't want in this case.
{ dependency -> dependency.getModuleGroup().startsWith("com.mapbox.mapboxsdk") }, // Only want Mapbox libs.
{ dependency -> true }, // Include transitive dependencies.
)
dependencyGraphGenerator {
generators = [mapboxGenerator]
}