OsmAnd/OsmAnd/build.gradle
Vitaliy 8db153db32 Remove unnecessary changes
(cherry picked from commit 67039222c5)
2021-03-18 19:06:04 +02:00

195 lines
5.7 KiB
Groovy

apply plugin: 'com.android.application'
apply from: 'build-common.gradle'
// Global Parameters accepted
// TARGET_APP_NAME - app name
// APK_NUMBER_VERSION - version number of apk
// APK_VERSION_SUFFIX - build number like #99999Z, appended (for dev builds) to Manifest's versionName as X.X.X#99999Z
// Z means flavor: M=-master, D=-main-default, Des=-design, MQA=-main-qt-arm, MQDA=-main-qt-default-arm, S=-sherpafy
// APP_EDITION - date stamp of builds
// 1. To be done Filter fonts
// <unzip src="OsmAndCore_android.aar" dest=".">
// <patternset>
// <include name="assets/**/map/fonts/OpenSans/*"/>
// <include name="assets/**/map/fonts/NotoSans/*"/>
// </patternset>
// </unzip>
// Less important
android {
signingConfigs {
development {
storeFile file("../keystores/debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
publishing {
storeFile file("/var/lib/jenkins/osmand_key")
storePassword System.getenv("OSMAND_APK_PASSWORD")
keyAlias "osmand"
keyPassword System.getenv("OSMAND_APK_PASSWORD")
}
}
defaultConfig {
minSdkVersion System.getenv("MIN_SDK_VERSION") ? System.getenv("MIN_SDK_VERSION").toInteger() : 15
versionCode 400
versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode
versionName "4.0.0"
versionName System.getenv("APK_VERSION")? System.getenv("APK_VERSION").toString(): versionName
versionName System.getenv("APK_VERSION_SUFFIX")? versionName + System.getenv("APK_VERSION_SUFFIX").toString(): versionName
}
lintOptions {
lintConfig file("lint.xml")
warningsAsErrors false
}
bundle {
language {
// Specifies that the app bundle should not support
// configuration APKs for language resources. These
// resources are instead packaged with each base and
// dynamic feature APK.
enableSplit = false
}
}
// related to kuromoji
//packagingOptions {
// exclude '/META-INF/CONTRIBUTORS.md'
// exclude '/META-INF/LICENSE.md'
// exclude '/META-INF/NOTICE.md'
//}
sourceSets {
debug {
manifest.srcFile "AndroidManifest-debug.xml"
}
androidFull {
java.srcDirs = ["src-nogms", "src-google"]
}
gplayFull {
java.srcDirs = ["src-gms", "src-google"]
}
gplayFree {
java.srcDirs = ["src-gms", "src-google"]
manifest.srcFile "AndroidManifest-gplayFree.xml"
}
nightlyFree {
java.srcDirs = ["src-nogms", "src-google"]
manifest.srcFile "AndroidManifest-nightlyFree.xml"
}
amazonFree {
java.srcDirs = ["src-nogms", "src-amazon"]
manifest.srcFile "AndroidManifest-gplayFree.xml"
}
amazonFull {
java.srcDirs = ["src-nogms", "src-amazon"]
}
huawei {
java.srcDirs = ["src-nogms", "src-huawei"]
manifest.srcFile "AndroidManifest-huawei.xml"
}
legacy {
jniLibs.srcDirs = ["libc++"]
}
}
flavorDimensions "version", "coreversion", "abi"
productFlavors {
// Version
nightlyFree {
dimension "version"
applicationId "net.osmand.dev"
resValue "string", "app_name", "OsmAnd Nightly"
resValue "string", "app_edition", System.getenv("APP_EDITION") ? System.getenv("APP_EDITION") : ""
// resConfig "en"
}
androidFull {
dimension "version"
applicationId "net.osmand.plus"
resValue "string", "app_name", "OsmAnd~"
resValue "string", "app_edition", System.getenv("APP_EDITION") ? System.getenv("APP_EDITION") : ""
}
gplayFree {
dimension "version"
applicationId "net.osmand"
resValue "string", "app_name", "OsmAnd"
resValue "string", "app_edition", System.getenv("APP_EDITION") ? System.getenv("APP_EDITION") : ""
}
gplayFull {
dimension "version"
applicationId "net.osmand.plus"
resValue "string", "app_name", "OsmAnd+"
resValue "string", "app_edition", System.getenv("APP_EDITION") ? System.getenv("APP_EDITION") : ""
}
amazonFree {
dimension "version"
applicationId "net.osmand"
resValue "string", "app_name", "OsmAnd"
resValue "string", "app_edition", ""
}
amazonFull {
dimension "version"
applicationId "net.osmand.plus"
resValue "string", "app_name", "OsmAnd+"
resValue "string", "app_edition", ""
}
huawei {
dimension "version"
applicationId "net.osmand.huawei"
resValue "string", "app_name", "OsmAnd"
resValue "string", "app_edition", ""
}
// Build that includes 3D OpenGL release
opengl {
dimension "coreversion"
}
// Build that includes 3D OpenGL debug
opengldebug {
dimension "coreversion"
}
}
buildTypes {
debug {
signingConfig signingConfigs.development
}
release {
signingConfig signingConfigs.publishing
}
}
}
afterEvaluate {
android.applicationVariants.all { variant ->
variant.javaCompiler.dependsOn(collectExternalResources, buildOsmAndCore, cleanupDuplicatesInCore)
}
Gradle gradle = getGradle()
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString().toLowerCase()
if (tskReqStr.contains("huawei")) {
apply plugin: 'com.huawei.agconnect'
}
}
dependencies {
openglImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
opengldebugImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
opengldebugImplementation "net.osmand:OsmAndCore_androidNativeDebug:0.1-SNAPSHOT@aar"
opengldebugImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
openglImplementation "net.osmand:OsmAndCore_androidNativeRelease:0.1-SNAPSHOT@aar"
openglImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
huaweiImplementation 'com.huawei.hms:iap:5.0.2.300'
gplayFreeImplementation 'com.google.android.gms:play-services-location:18.0.0'
gplayFullImplementation 'com.google.android.gms:play-services-location:18.0.0'
}