Files
MapLibreParticleLab/platform/android/MapboxGLAndroidSDK/build.gradle
mwilsnd 1963697687 Selectable renderer implementation (#1247)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-31 15:36:19 +02:00

167 lines
5.3 KiB
Groovy

import org.jetbrains.dokka.gradle.DokkaTask
plugins {
id 'org.jmailen.kotlinter'
id 'org.jetbrains.dokka' version '1.7.20'
}
apply plugin: 'com.android.library'
apply plugin: "com.jaredsburrows.license"
apply plugin: 'kotlin-android'
apply from: "${rootDir}/gradle/native-build.gradle"
dependencies {
lintChecks project(":MapboxGLAndroidSDKLint")
api dependenciesList.mapboxJavaGeoJSON
api dependenciesList.mapboxAndroidGestures
implementation dependenciesList.mapboxJavaTurf
implementation dependenciesList.supportAnnotations
implementation dependenciesList.supportFragmentV4
implementation dependenciesList.okhttp3
implementation dependenciesList.timber
implementation dependenciesList.interpolator
testImplementation dependenciesList.junit
testImplementation dependenciesList.mockito
testImplementation dependenciesList.mockk
testImplementation dependenciesList.robolectric
testImplementation dependenciesList.kotlinLib
testImplementation dependenciesList.commonsIO
testImplementation dependenciesList.assertjcore
androidTestImplementation dependenciesList.testRunner
androidTestImplementation dependenciesList.testRules
}
tasks.withType(DokkaTask.class) {
moduleName.set("MapLibre Native for Android")
dokkaSourceSets {
configureEach {
includes.from("README.md")
}
}
}
android {
compileSdkVersion androidVersions.compileSdkVersion
buildToolsVersion androidSdkVersions.buildToolsVersion
defaultConfig {
minSdkVersion androidVersions.minSdkVersion
targetSdkVersion androidVersions.targetSdkVersion
buildConfigField "String", "GIT_REVISION_SHORT", String.format("\"%s\"", getGitRevision())
buildConfigField "String", "MAPBOX_SDK_IDENTIFIER", String.format("\"%s\"", "mapbox-maps-android")
buildConfigField "String", "MAPBOX_SDK_VERSION", String.format("\"%s\"", project.VERSION_NAME)
buildConfigField "String", "MAPBOX_VERSION_STRING", String.format("\"Mapbox/%s\"", project.VERSION_NAME)
buildConfigField "String", "MAPBOX_EVENTS_USER_AGENT", String.format("\"mapbox-maps-android/%s\"", project.VERSION_NAME)
consumerProguardFiles 'proguard-rules.pro'
externalNativeBuild {
cmake {
arguments "-DMLN_LEGACY_RENDERER=ON", "-DMLN_DRAWABLE_RENDERER=OFF", "-DMLN_RENDERER_SPLIT_VIEW=OFF"
}
}
}
flavorDimensions += "renderer"
productFlavors {
create("legacy") {
dimension = "renderer"
externalNativeBuild {
cmake {
arguments "-DMLN_LEGACY_RENDERER=ON", "-DMLN_DRAWABLE_RENDERER=OFF", "-DMLN_RENDERER_SPLIT_VIEW=OFF"
}
}
}
create("drawable") {
dimension = "renderer"
externalNativeBuild {
cmake {
arguments "-DMLN_LEGACY_RENDERER=OFF", "-DMLN_DRAWABLE_RENDERER=ON", "-DMLN_RENDERER_SPLIT_VIEW=OFF"
}
}
}
create("split") {
dimension = "renderer"
externalNativeBuild {
cmake {
arguments "-DMLN_LEGACY_RENDERER=ON", "-DMLN_DRAWABLE_RENDERER=ON", "-DMLN_RENDERER_SPLIT_VIEW=ON"
}
}
}
}
// build native libraries
List nativeTargets = ["mapbox-gl"]
if (project.hasProperty("mapbox.with_test")) {
nativeTargets.add("mbgl-test")
}
if (project.hasProperty("mapbox.with_benchmark")) {
nativeTargets.add("mbgl-benchmark")
}
nativeBuild(nativeTargets)
// avoid naming conflicts, force usage of prefix
resourcePrefix 'maplibre_'
sourceSets {
// limit amount of exposed library resources
main.res.srcDirs += 'src/main/res-public'
}
testOptions {
unitTests {
returnDefaultValues true
// Roboelectric 4.0 required config
// http://robolectric.org/migrating/#migrating-to-40
includeAndroidResources = true
}
}
buildTypes {
debug {
testCoverageEnabled false
jniDebuggable true
debuggable true
}
}
namespace 'org.maplibre.android'
lint {
checkAllWarnings true
disable 'MissingTranslation', 'TypographyQuotes', 'ObsoleteLintCustomCheck', 'MissingPermission', 'WrongThreadInterprocedural'
warningsAsErrors false
}
}
licenseReport {
generateHtmlReport = false
generateJsonReport = true
copyHtmlReportToAssets = false
copyJsonReportToAssets = false
}
def static getGitRevision() {
def cmd = "git rev-parse --short HEAD"
def proc = cmd.execute()
def ref = proc.text.trim()
return ref
}
configurations {
all*.exclude group: 'commons-logging', module: 'commons-logging'
all*.exclude group: 'commons-collections', module: 'commons-collections'
}
apply from: "${rootDir}/gradle/gradle-javadoc.gradle"
apply from: "${rootDir}/gradle/gradle-checkstyle.gradle"
apply from: "${rootDir}/gradle/gradle-dependencies-graph.gradle"
apply from: "${rootDir}/gradle/gradle-update-vendor-modules.gradle"
apply from: "${rootDir}/gradle/android-nitpick.gradle"
apply from: "${rootDir}/gradle/gradle-publish.gradle"
// intentionally disabled
// apply from: "${rootDir}/gradle/jacoco-report.gradle"