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

Commit

Permalink
[android] revert modules vendorization and keep submodules only
Browse files Browse the repository at this point in the history
(cherry picked from commit ca8625f)
  • Loading branch information
LukasPaczos committed Jan 29, 2019
1 parent 13faad9 commit 8a1cf7f
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 89 deletions.
12 changes: 1 addition & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -517,13 +517,8 @@ android-style-code:
node platform/android/scripts/generate-style-code.js
style-code: android-style-code

# Vendor submodules configuration for Android.
.PHONY: platform/android/vendor
platform/android/vendor:
git submodule update --init --recursive platform/android/vendor

# Configuration file for running CMake from Gradle within Android Studio.
platform/android/gradle/configuration.gradle: platform/android/vendor
platform/android/gradle/configuration.gradle:
@printf "ext {\n node = '`command -v node || command -v nodejs`'\n npm = '`command -v npm`'\n ccache = '`command -v ccache`'\n}" > $@

define ANDROID_RULES
Expand Down Expand Up @@ -763,11 +758,6 @@ endif
android-configuration: platform/android/gradle/configuration.gradle
cat platform/android/gradle/configuration.gradle

# Updates Android's vendor submodules
.PHONY: android-update-vendor
android-update-vendor: platform/android/gradle/configuration.gradle
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none updateVendorSubmodules

# Creates a dependency graph using Graphviz
.PHONY: android-graph
android-graph: platform/android/gradle/configuration.gradle
Expand Down
48 changes: 48 additions & 0 deletions platform/android/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens

===========================================================================

Mapbox GL uses portions of the Android Lifecycle Extensions.
URL: [https://developer.android.com/topic/libraries/architecture/index.html](https://developer.android.com/topic/libraries/architecture/index.html)
License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)

===========================================================================

Mapbox GL uses portions of the Android Lifecycle LiveData.
URL: [https://developer.android.com/topic/libraries/architecture/index.html](https://developer.android.com/topic/libraries/architecture/index.html)
License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)

===========================================================================

Mapbox GL uses portions of the Android Lifecycle LiveData Core.
URL: [https://developer.android.com/topic/libraries/architecture/index.html](https://developer.android.com/topic/libraries/architecture/index.html)
License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)
Expand Down Expand Up @@ -94,6 +106,42 @@ License: [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)

===========================================================================

Mapbox GL uses portions of the Mapbox Android Core Library.
URL: [https://github.com/mapbox/mapbox-events-android](https://github.com/mapbox/mapbox-events-android)
License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)

===========================================================================

Mapbox GL uses portions of the Mapbox Android Gestures Library.
URL: [https://github.com/mapbox/mapbox-gestures-android](https://github.com/mapbox/mapbox-gestures-android)
License: [BSD 2-Clause "Simplified" License](https://raw.githubusercontent.com/mapbox/mapbox-gestures-android/master/LICENSE.md)

===========================================================================

Mapbox GL uses portions of the Mapbox Android Telemetry Library.
URL: [https://github.com/mapbox/mapbox-events-android](https://github.com/mapbox/mapbox-events-android)
License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)

===========================================================================

Mapbox GL uses portions of the Mapbox Services SDK.
URL: [https://github.com/mapbox/mapbox-java](https://github.com/mapbox/mapbox-java)
License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)

===========================================================================

Mapbox GL uses portions of the Mapbox Services SDK.
URL: [https://github.com/mapbox/mapbox-java](https://github.com/mapbox/mapbox-java)
License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)

===========================================================================

Mapbox GL uses portions of the Mapbox Services SDK.
URL: [https://github.com/mapbox/mapbox-java](https://github.com/mapbox/mapbox-java)
License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)

===========================================================================

Mapbox GL uses portions of the OkHttp.
License: [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)

Expand Down
12 changes: 7 additions & 5 deletions platform/android/MapboxGLAndroidSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ apply plugin: 'kotlin-android'

dependencies {
lintChecks project(":MapboxGLAndroidSDKLint")
api project(":libcore")
api project(":libtelemetry")
api project(":MapboxAndroidGestures")
api project(":services-geojson")
implementation project(":services-turf")
api dependenciesList.mapboxAndroidTelemetry
api dependenciesList.mapboxJavaGeoJSON
api (dependenciesList.mapboxAndroidGestures) {
// workaround until https://github.com/mapbox/mapbox-gestures-android/issues/50 is released
exclude group: 'com.jakewharton.timber', module: 'timber'
}
implementation dependenciesList.mapboxJavaTurf
implementation dependenciesList.supportAppcompatV7
implementation dependenciesList.supportAnnotations
implementation dependenciesList.supportFragmentV4
Expand Down
2 changes: 1 addition & 1 deletion platform/android/MapboxGLAndroidSDKTestApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dependencies {
implementation dependenciesList.kotlinLib

implementation project(':MapboxGLAndroidSDK')
implementation project(":services-turf")
implementation dependenciesList.mapboxJavaTurf

implementation dependenciesList.supportAppcompatV7
implementation dependenciesList.supportRecyclerView
Expand Down
1 change: 0 additions & 1 deletion platform/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
buildscript {
apply from: "${rootDir}/gradle/gradle-update-vendor-modules.gradle"
apply from: "${rootDir}/gradle/dependencies.gradle"

repositories {
Expand Down
25 changes: 10 additions & 15 deletions platform/android/gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ ext {
]

versions = [
mapboxServices : '4.3.0',
mapboxTelemetry : '4.2.0',
mapboxGestures : '0.3.0',
supportLib : '27.1.1',
constraintLayout: '1.1.2',
espresso : '3.0.2',
Expand All @@ -25,23 +28,15 @@ ext {
reLinker : '1.3.1'
]

vendorArtifacts = [
mapboxGestures : 'mapbox-android-gestures',
mapboxJavaCore : 'mapbox-sdk-core',
mapboxJavaTurf : 'mapbox-sdk-turf',
mapboxJavaGeojson: 'mapbox-sdk-geojson',
mapboxTelemetry : 'mapbox-android-telemetry',
mapboxAndroidCore: 'mapbox-android-core'
]
dependenciesList = [
mapboxJavaServices : "com.mapbox.mapboxsdk:mapbox-sdk-services:${versions.mapboxServices}",
mapboxJavaGeoJSON : "com.mapbox.mapboxsdk:mapbox-sdk-geojson:${versions.mapboxServices}",
mapboxAndroidTelemetry : "com.mapbox.mapboxsdk:mapbox-android-telemetry:${versions.mapboxTelemetry}",
mapboxAndroidGestures : "com.mapbox.mapboxsdk:mapbox-android-gestures:${versions.mapboxGestures}",

vendorVersions = [
mapboxGestures : '0.3.0',
mapboxJava : '4.3.0',
mapboxTelemetry : '4.2.0',
mapboxAndroidCore: '1.1.0'
]
// for testApp
mapboxJavaTurf : "com.mapbox.mapboxsdk:mapbox-sdk-turf:${versions.mapboxServices}",

dependenciesList = [
junit : "junit:junit:${versions.junit}",
mockito : "org.mockito:mockito-core:${versions.mockito}",
mockk : "io.mockk:mockk:${versions.mockk}",
Expand Down
46 changes: 0 additions & 46 deletions platform/android/gradle/gradle-publish.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apply plugin: 'maven'
apply plugin: 'signing'
apply from: "${rootDir}/gradle/dependencies.gradle"

allprojects {
group project.GROUP
Expand Down Expand Up @@ -98,21 +97,6 @@ afterEvaluate { project ->
}
}
}

def vendorMap = getVendorMap()
pom.whenConfigured { pom ->
println("Current dependencies ${pom.dependencies}")
pom.dependencies.each { dep ->
println("Processing vendor ${dep}")
if (dep.getGroupId() == rootProject.name) {
Vendor vendor = vendorMap.get(dep.getArtifactId())
dep.setGroupId(project.GROUP)
dep.setArtifactId(vendor.artifactName)
dep.setVersion(vendor.artifactVersion)
println("Updated vendor ${dep}")
}
}
}
}
}
}
Expand Down Expand Up @@ -157,33 +141,3 @@ afterEvaluate { project ->
}
}
}

// this class holds values that will be included in the resulting pom file for vendorized libraries
class Vendor {
private final artifactName
private final artifactVersion

Vendor(artifactName, artifactVersion) {
this.artifactName = artifactName
this.artifactVersion = artifactVersion
}

def getArtifactName() {
return artifactName
}

def getArtifactVersion() {
return artifactVersion
}
}

HashMap<String, Vendor> getVendorMap() {
def map = new HashMap<String, Vendor>()
map.put("mapbox-android-gestures", new Vendor(vendorArtifacts.mapboxGestures, vendorVersions.mapboxGestures))
map.put("services-core", new Vendor(vendorArtifacts.mapboxJavaCore, vendorVersions.mapboxJava))
map.put("services-turf", new Vendor(vendorArtifacts.mapboxJavaTurf, vendorVersions.mapboxJava))
map.put("services-geojson", new Vendor(vendorArtifacts.mapboxJavaGeojson, vendorVersions.mapboxJava))
map.put("libcore", new Vendor(vendorArtifacts.mapboxAndroidCore, vendorVersions.mapboxAndroidCore))
map.put("libtelemetry", new Vendor(vendorArtifacts.mapboxTelemetry, vendorVersions.mapboxTelemetry))
return map
}
3 changes: 0 additions & 3 deletions platform/android/gradle/gradle-update-vendor-modules.gradle

This file was deleted.

8 changes: 1 addition & 7 deletions platform/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
include ':MapboxGLAndroidSDK', ':MapboxGLAndroidSDKTestApp', ':MapboxGLAndroidSDKLint', ':MapboxAndroidGestures', ':services-core', ':services-geojson', ':services-turf', ':libtelemetry', ':libcore'
project(':MapboxAndroidGestures').projectDir = new File('vendor/mapbox-gestures-android/library')
project(':services-core').projectDir = new File('vendor/mapbox-java/services-core')
project(':services-geojson').projectDir = new File('vendor/mapbox-java/services-geojson')
project(':services-turf').projectDir = new File('vendor/mapbox-java/services-turf')
project(':libtelemetry').projectDir = new File('vendor/mapbox-events-android/libtelemetry')
project(':libcore').projectDir = new File('vendor/mapbox-events-android/libcore')
include ':MapboxGLAndroidSDK', ':MapboxGLAndroidSDKTestApp', ':MapboxGLAndroidSDKLint'

0 comments on commit 8a1cf7f

Please sign in to comment.