diff options
author | Łukasz Paczos <lukas.paczos@gmail.com> | 2019-01-18 18:47:48 +0100 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2019-01-21 13:41:11 +0100 |
commit | 531b41ada73f21fb9851d6f214bc927d92b6d3b2 (patch) | |
tree | b3fdd10db640b228001916fb4a22291eaed8f333 | |
parent | c3566753498198eb05269e9bfa3c47bb67ccd685 (diff) | |
download | qtlocation-mapboxgl-531b41ada73f21fb9851d6f214bc927d92b6d3b2.tar.gz |
[android] adjust maven pom file with vendorized libraries versions
-rw-r--r-- | platform/android/gradle/dependencies.gradle | 16 | ||||
-rw-r--r-- | platform/android/gradle/gradle-publish.gradle | 46 |
2 files changed, 62 insertions, 0 deletions
diff --git a/platform/android/gradle/dependencies.gradle b/platform/android/gradle/dependencies.gradle index 5c0442c3a9..ae63b46a2a 100644 --- a/platform/android/gradle/dependencies.gradle +++ b/platform/android/gradle/dependencies.gradle @@ -25,6 +25,22 @@ ext { gms : '16.0.0' ] + 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' + ] + + vendorVersions = [ + mapboxGestures : '0.3.0', + mapboxJava : '4.3.0', + mapboxTelemetry : '4.2.0', + mapboxAndroidCore: '1.1.0' + ] + dependenciesList = [ junit : "junit:junit:${versions.junit}", mockito : "org.mockito:mockito-core:${versions.mockito}", diff --git a/platform/android/gradle/gradle-publish.gradle b/platform/android/gradle/gradle-publish.gradle index a3bf83348f..3f4686444c 100644 --- a/platform/android/gradle/gradle-publish.gradle +++ b/platform/android/gradle/gradle-publish.gradle @@ -1,5 +1,6 @@ apply plugin: 'maven' apply plugin: 'signing' +apply from: "${rootDir}/gradle/dependencies.gradle" allprojects { group project.GROUP @@ -97,6 +98,21 @@ 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}") + } + } + } } } } @@ -141,3 +157,33 @@ 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 +}
\ No newline at end of file |