Prepare Android release workflow for Vulkan release (#3081)
This commit is contained in:
@@ -223,6 +223,8 @@ run-android-unit-test:
|
||||
run-android-unit-test-%:
|
||||
$(MLN_ANDROID_GRADLE) -Pmaplibre.abis=none :MapLibreAndroid:testLegacyDebugUnitTest --info --tests "$*"
|
||||
|
||||
DEBUG_TAR_FILE_NAME := $(if $(findstring drawable,$(RENDERER)),debug-symbols-opengl.tar.gz,debug-symbols-$(RENDERER).tar.gz)
|
||||
|
||||
# Builds a release package and .tar.gz with debug symbols of the Android SDK
|
||||
.PHONY: apackage
|
||||
apackage:
|
||||
@@ -230,7 +232,7 @@ apackage:
|
||||
make android-lib-arm-v7 && make android-lib-arm-v8 && make android-lib-x86 && make android-lib-x86-64
|
||||
$(MLN_ANDROID_GRADLE) -Pmaplibre.abis=all assemble$(RENDERER)$(BUILDTYPE)
|
||||
mkdir -p build
|
||||
tar -czvf build/debug-symbols.tar.gz -C MapLibreAndroid/build/intermediates/library_jni/*/*JniLibsProjectOnly/jni .
|
||||
tar -czvf build/$(DEBUG_TAR_FILE_NAME) -C MapLibreAndroid/build/intermediates/library_jni/$(RENDERER)Release/*JniLibsProjectOnly/jni .
|
||||
|
||||
# Build test app instrumentation tests apk and test app apk for all abi's
|
||||
.PHONY: android-ui-test
|
||||
@@ -245,7 +247,7 @@ run-android-test-app-center:
|
||||
# Uploads the compiled Android SDK to Maven Central Staging
|
||||
.PHONY: run-android-publish
|
||||
run-android-publish:
|
||||
$(MLN_ANDROID_GRADLE_SINGLE_JOB)-Pmaplibre.abis=all :MapLibreAndroid:publishReleasePublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository
|
||||
$(MLN_ANDROID_GRADLE_SINGLE_JOB)-Pmaplibre.abis=all :MapLibreAndroid:publishAllPublicationsToSonatypeRepository closeAndReleaseSonatypeStagingRepository
|
||||
|
||||
# Dump system graphics information for the test app
|
||||
.PHONY: android-gfxinfo
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
extra["mapLibreArtifactGroupId"] = "org.maplibre.gl"
|
||||
extra["mapLibreArtifactId"] = "android-sdk"
|
||||
extra["mapLibreArtifactTitle"] = "MapLibre Maps SDK for Android"
|
||||
extra["mapLibreArtifactDescription"] = "MapLibre Maps SDK for Android"
|
||||
extra["mapLibreArtifactTitle"] = "MapLibre Android"
|
||||
extra["mapLibreArtifactDescription"] = "MapLibre Android"
|
||||
extra["mapLibreDeveloperName"] = "MapLibre"
|
||||
extra["mapLibreDeveloperId"] = "maplibre"
|
||||
extra["mapLibreArtifactUrl"] = "https://github.com/maplibre/maplibre-native"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import org.gradle.kotlin.dsl.get
|
||||
import java.util.Locale
|
||||
|
||||
plugins {
|
||||
`maven-publish`
|
||||
@@ -43,20 +44,24 @@ project.logger.lifecycle(project.extra["versionName"].toString())
|
||||
version = project.extra["versionName"] as String
|
||||
group = project.extra["mapLibreArtifactGroupId"] as String
|
||||
|
||||
afterEvaluate {
|
||||
fun configureMavenPublication(
|
||||
renderer: String,
|
||||
publicationName: String,
|
||||
artifactIdPostfix: String,
|
||||
descriptionPostfix: String,
|
||||
) {
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("release") {
|
||||
groupId = this@afterEvaluate.group.toString()
|
||||
artifactId = project.extra["mapLibreArtifactId"].toString()
|
||||
version = this@afterEvaluate.version.toString()
|
||||
create<MavenPublication>(publicationName) {
|
||||
groupId = project.group.toString()
|
||||
artifactId = "${project.extra["mapLibreArtifactId"]}$artifactIdPostfix"
|
||||
version = project.version.toString()
|
||||
|
||||
// Conditional component selection based on environment variable
|
||||
from(components[if (System.getenv("RENDERER")?.lowercase() == "vulkan") "vulkanRelease" else "drawableRelease"])
|
||||
from(components["${renderer}Release"])
|
||||
|
||||
pom {
|
||||
name.set(project.extra["mapLibreArtifactTitle"].toString())
|
||||
description.set(project.extra["mapLibreArtifactTitle"].toString())
|
||||
name.set("${project.extra["mapLibreArtifactTitle"]}$descriptionPostfix")
|
||||
description.set("${project.extra["mapLibreArtifactTitle"]}$descriptionPostfix")
|
||||
url.set(project.extra["mapLibreArtifactUrl"].toString())
|
||||
licenses {
|
||||
license {
|
||||
@@ -68,7 +73,7 @@ afterEvaluate {
|
||||
developer {
|
||||
id.set(project.extra["mapLibreDeveloperId"].toString())
|
||||
name.set(project.extra["mapLibreDeveloperName"].toString())
|
||||
email.set("maplibre@maplibre.org")
|
||||
email.set("team@maplibre.org")
|
||||
}
|
||||
}
|
||||
scm {
|
||||
@@ -80,7 +85,24 @@ afterEvaluate {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// workaround for https://github.com/gradle/gradle/issues/26091#issuecomment-1836156762
|
||||
// https://github.com/gradle-nexus/publish-plugin/issues/208
|
||||
tasks {
|
||||
withType<PublishToMavenRepository> {
|
||||
dependsOn(withType<Sign>())
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
configureMavenPublication("drawable", "opengl", "", "")
|
||||
configureMavenPublication("vulkan", "vulkan", "-vulkan", "(Vulkan)")
|
||||
// Right now this is the same as the first, but in the future we might release a major version
|
||||
// which defaults to Vulkan (or has support for multiple backends). We will keep using only
|
||||
// OpenGL ES with this artifact ID if that happens.
|
||||
configureMavenPublication("drawable", "opengl2", "-opengl", " (OpenGL ES)")
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user