Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] Adds gradle-dependency-graph-generator-plugin to Android pr…
Browse files Browse the repository at this point in the history
…oject (#11603)

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

* keep script in sync with mapbox/mapbox-android-demo#671

* adds a makefile rule for dependency generation
  • Loading branch information
zugaldia authored Apr 10, 2018
1 parent 05d2444 commit 61bb9be
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions platform/android/MapboxGLAndroidSDK/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dependency-graph-mapbox-libraries.png
1 change: 1 addition & 0 deletions platform/android/MapboxGLAndroidSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
29 changes: 29 additions & 0 deletions platform/android/gradle/gradle-dependencies-graph.gradle
Original file line number Diff line number Diff line change
@@ -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]
}

0 comments on commit 61bb9be

Please sign in to comment.