2014-12-16 12:23:45 +01:00
|
|
|
apply plugin: 'com.android.application'
|
2021-01-19 13:26:27 +01:00
|
|
|
apply from: 'build-common.gradle'
|
2018-03-28 23:03:17 +02:00
|
|
|
|
2015-04-23 17:26:29 +02:00
|
|
|
// Global Parameters accepted
|
2017-06-03 12:06:51 +02:00
|
|
|
// TARGET_APP_NAME - app name
|
2015-01-21 23:32:16 +01:00
|
|
|
// APK_NUMBER_VERSION - version number of apk
|
2017-06-03 13:40:07 +02:00
|
|
|
// APK_VERSION_SUFFIX - build number like #99999Z, appended (for dev builds) to Manifest's versionName as X.X.X#99999Z
|
2021-01-19 13:26:27 +01:00
|
|
|
// Z means flavor: M=-master, D=-main-default, Des=-design, MQA=-main-qt-arm, MQDA=-main-qt-default-arm, S=-sherpafy
|
2017-06-03 12:06:51 +02:00
|
|
|
// APP_EDITION - date stamp of builds
|
2015-01-21 23:32:16 +01:00
|
|
|
|
2015-04-24 23:20:54 +02:00
|
|
|
// 1. To be done Filter fonts
|
2015-01-21 00:51:32 +01:00
|
|
|
// <unzip src="OsmAndCore_android.aar" dest=".">
|
|
|
|
// <patternset>
|
|
|
|
// <include name="assets/**/map/fonts/OpenSans/*"/>
|
|
|
|
// <include name="assets/**/map/fonts/NotoSans/*"/>
|
|
|
|
// </patternset>
|
|
|
|
// </unzip>
|
2015-01-23 13:32:07 +01:00
|
|
|
// Less important
|
2015-01-21 00:51:32 +01:00
|
|
|
|
2014-12-16 12:23:45 +01:00
|
|
|
android {
|
2015-01-28 10:58:19 +01:00
|
|
|
signingConfigs {
|
|
|
|
development {
|
|
|
|
storeFile file("../keystores/debug.keystore")
|
|
|
|
storePassword "android"
|
|
|
|
keyAlias "androiddebugkey"
|
|
|
|
keyPassword "android"
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
2015-04-23 17:39:46 +02:00
|
|
|
storeFile file("/var/lib/jenkins/osmand_key")
|
2015-02-01 11:56:19 +01:00
|
|
|
storePassword System.getenv("OSMAND_APK_PASSWORD")
|
2015-04-23 17:26:29 +02:00
|
|
|
keyAlias "osmand"
|
2015-02-01 11:56:19 +01:00
|
|
|
keyPassword System.getenv("OSMAND_APK_PASSWORD")
|
2015-01-28 10:58:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultConfig {
|
2019-11-04 12:21:23 +01:00
|
|
|
minSdkVersion System.getenv("MIN_SDK_VERSION") ? System.getenv("MIN_SDK_VERSION").toInteger() : 15
|
2021-02-20 00:42:59 +01:00
|
|
|
versionCode 400
|
2015-01-28 10:58:19 +01:00
|
|
|
versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode
|
2021-02-20 00:42:59 +01:00
|
|
|
versionName "4.0.0"
|
2016-02-19 12:23:26 +01:00
|
|
|
versionName System.getenv("APK_VERSION")? System.getenv("APK_VERSION").toString(): versionName
|
2017-06-03 18:40:15 +02:00
|
|
|
versionName System.getenv("APK_VERSION_SUFFIX")? versionName + System.getenv("APK_VERSION_SUFFIX").toString(): versionName
|
2015-01-28 10:58:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
lintConfig file("lint.xml")
|
|
|
|
warningsAsErrors false
|
|
|
|
}
|
|
|
|
|
2019-03-15 13:57:09 +01:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-21 12:16:25 +01:00
|
|
|
// related to kuromoji
|
|
|
|
//packagingOptions {
|
|
|
|
// exclude '/META-INF/CONTRIBUTORS.md'
|
|
|
|
// exclude '/META-INF/LICENSE.md'
|
|
|
|
// exclude '/META-INF/NOTICE.md'
|
|
|
|
//}
|
2019-02-20 16:17:32 +01:00
|
|
|
|
2015-01-28 10:58:19 +01:00
|
|
|
sourceSets {
|
2018-05-02 22:06:06 +02:00
|
|
|
debug {
|
|
|
|
manifest.srcFile "AndroidManifest-debug.xml"
|
|
|
|
}
|
2021-01-19 13:26:27 +01:00
|
|
|
androidFull {
|
2021-01-17 20:11:57 +01:00
|
|
|
java.srcDirs = ["src-nogms", "src-google"]
|
|
|
|
}
|
2021-01-19 13:26:27 +01:00
|
|
|
gplayFull {
|
|
|
|
java.srcDirs = ["src-gms", "src-google"]
|
|
|
|
}
|
|
|
|
gplayFree {
|
2021-01-17 20:11:57 +01:00
|
|
|
java.srcDirs = ["src-gms", "src-google"]
|
2021-01-19 13:26:27 +01:00
|
|
|
manifest.srcFile "AndroidManifest-gplayFree.xml"
|
2020-09-28 13:15:29 +02:00
|
|
|
}
|
2021-01-19 13:26:27 +01:00
|
|
|
nightlyFree {
|
2021-01-17 20:11:57 +01:00
|
|
|
java.srcDirs = ["src-nogms", "src-google"]
|
2021-01-19 13:26:27 +01:00
|
|
|
manifest.srcFile "AndroidManifest-nightlyFree.xml"
|
2021-01-17 20:11:57 +01:00
|
|
|
}
|
2021-01-19 13:26:27 +01:00
|
|
|
amazonFree {
|
2021-03-18 09:43:56 +01:00
|
|
|
java.srcDirs = ["src-nogms", "src-amazon"]
|
2021-03-18 10:14:57 +01:00
|
|
|
manifest.srcFile "AndroidManifest-gplayFree.xml"
|
2015-01-28 10:58:19 +01:00
|
|
|
}
|
2021-01-19 13:26:27 +01:00
|
|
|
amazonFull {
|
2021-03-18 09:43:56 +01:00
|
|
|
java.srcDirs = ["src-nogms", "src-amazon"]
|
2020-11-04 15:50:24 +01:00
|
|
|
}
|
2021-01-19 13:26:27 +01:00
|
|
|
huawei {
|
2021-03-17 16:45:18 +01:00
|
|
|
java.srcDirs = ["src-nogms", "src-huawei"]
|
2021-01-19 13:26:27 +01:00
|
|
|
manifest.srcFile "AndroidManifest-huawei.xml"
|
2019-12-17 13:59:47 +01:00
|
|
|
}
|
2020-11-04 15:50:24 +01:00
|
|
|
|
2015-01-28 10:58:19 +01:00
|
|
|
legacy {
|
2018-08-07 20:24:35 +02:00
|
|
|
jniLibs.srcDirs = ["libc++"]
|
2015-01-28 10:58:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
flavorDimensions "version", "coreversion", "abi"
|
|
|
|
productFlavors {
|
|
|
|
// Version
|
2021-01-19 13:26:27 +01:00
|
|
|
nightlyFree {
|
2016-04-11 11:51:44 +02:00
|
|
|
dimension "version"
|
2016-01-27 22:46:25 +01:00
|
|
|
applicationId "net.osmand.dev"
|
2021-02-09 18:01:39 +01:00
|
|
|
resValue "string", "app_name", "OsmAnd Nightly"
|
2021-02-09 18:07:43 +01:00
|
|
|
resValue "string", "app_edition", System.getenv("APP_EDITION") ? System.getenv("APP_EDITION") : ""
|
2017-03-25 12:36:51 +01:00
|
|
|
// resConfig "en"
|
2016-01-27 22:46:25 +01:00
|
|
|
}
|
2021-01-19 13:26:27 +01:00
|
|
|
androidFull {
|
2016-04-11 11:51:44 +02:00
|
|
|
dimension "version"
|
2021-01-19 13:26:27 +01:00
|
|
|
applicationId "net.osmand.plus"
|
2021-02-09 18:01:39 +01:00
|
|
|
resValue "string", "app_name", "OsmAnd~"
|
2021-02-09 18:07:43 +01:00
|
|
|
resValue "string", "app_edition", System.getenv("APP_EDITION") ? System.getenv("APP_EDITION") : ""
|
2015-01-28 10:58:19 +01:00
|
|
|
}
|
2021-01-19 13:26:27 +01:00
|
|
|
gplayFree {
|
2021-01-17 20:11:57 +01:00
|
|
|
dimension "version"
|
|
|
|
applicationId "net.osmand"
|
2021-02-09 18:01:39 +01:00
|
|
|
resValue "string", "app_name", "OsmAnd"
|
2021-02-09 18:07:43 +01:00
|
|
|
resValue "string", "app_edition", System.getenv("APP_EDITION") ? System.getenv("APP_EDITION") : ""
|
2021-01-17 20:11:57 +01:00
|
|
|
}
|
2021-01-19 13:26:27 +01:00
|
|
|
gplayFull {
|
2016-04-11 11:51:44 +02:00
|
|
|
dimension "version"
|
2015-01-28 10:58:19 +01:00
|
|
|
applicationId "net.osmand.plus"
|
2021-02-09 18:01:39 +01:00
|
|
|
resValue "string", "app_name", "OsmAnd+"
|
2021-02-09 18:07:43 +01:00
|
|
|
resValue "string", "app_edition", System.getenv("APP_EDITION") ? System.getenv("APP_EDITION") : ""
|
2015-01-28 10:58:19 +01:00
|
|
|
}
|
2021-01-19 13:26:27 +01:00
|
|
|
amazonFree {
|
|
|
|
dimension "version"
|
|
|
|
applicationId "net.osmand"
|
2021-02-09 18:01:39 +01:00
|
|
|
resValue "string", "app_name", "OsmAnd"
|
2021-02-09 18:10:21 +01:00
|
|
|
resValue "string", "app_edition", ""
|
2021-01-19 13:26:27 +01:00
|
|
|
}
|
|
|
|
amazonFull {
|
2021-01-17 20:11:57 +01:00
|
|
|
dimension "version"
|
|
|
|
applicationId "net.osmand.plus"
|
2021-02-09 18:01:39 +01:00
|
|
|
resValue "string", "app_name", "OsmAnd+"
|
2021-02-09 18:10:21 +01:00
|
|
|
resValue "string", "app_edition", ""
|
2021-01-17 20:11:57 +01:00
|
|
|
}
|
2021-01-19 13:26:27 +01:00
|
|
|
huawei {
|
2019-12-12 15:42:18 +01:00
|
|
|
dimension "version"
|
|
|
|
applicationId "net.osmand.huawei"
|
2021-02-09 18:01:39 +01:00
|
|
|
resValue "string", "app_name", "OsmAnd"
|
2021-02-09 18:10:21 +01:00
|
|
|
resValue "string", "app_edition", ""
|
2019-12-12 15:42:18 +01:00
|
|
|
}
|
2021-01-19 13:26:27 +01:00
|
|
|
|
2020-11-04 15:36:44 +01:00
|
|
|
// Build that includes 3D OpenGL release
|
2021-01-19 13:26:27 +01:00
|
|
|
opengl {
|
2016-04-11 11:51:44 +02:00
|
|
|
dimension "coreversion"
|
2015-01-28 10:58:19 +01:00
|
|
|
}
|
2020-11-04 15:36:44 +01:00
|
|
|
// Build that includes 3D OpenGL debug
|
2021-01-19 13:26:27 +01:00
|
|
|
opengldebug {
|
2016-04-11 11:51:44 +02:00
|
|
|
dimension "coreversion"
|
2015-01-28 10:58:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
debug {
|
|
|
|
signingConfig signingConfigs.development
|
|
|
|
}
|
|
|
|
release {
|
2020-11-18 12:30:57 +01:00
|
|
|
signingConfig signingConfigs.publishing
|
2015-01-28 10:58:19 +01:00
|
|
|
}
|
2015-01-26 12:30:23 +01:00
|
|
|
}
|
2018-03-31 01:22:10 +02:00
|
|
|
|
2015-01-21 23:32:16 +01:00
|
|
|
}
|
2015-01-21 02:58:28 +01:00
|
|
|
|
2018-03-30 20:44:00 +02:00
|
|
|
afterEvaluate {
|
2019-09-11 18:04:12 +02:00
|
|
|
android.applicationVariants.all { variant ->
|
2019-09-11 20:20:38 +02:00
|
|
|
variant.javaCompiler.dependsOn(collectExternalResources, buildOsmAndCore, cleanupDuplicatesInCore)
|
2019-09-11 18:04:12 +02:00
|
|
|
}
|
2020-09-28 13:15:29 +02:00
|
|
|
Gradle gradle = getGradle()
|
|
|
|
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString().toLowerCase()
|
|
|
|
if (tskReqStr.contains("huawei")) {
|
|
|
|
apply plugin: 'com.huawei.agconnect'
|
|
|
|
}
|
2015-01-23 13:32:07 +01:00
|
|
|
}
|
|
|
|
|
2014-12-16 12:23:45 +01:00
|
|
|
dependencies {
|
2021-01-19 13:26:27 +01:00
|
|
|
openglImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
|
|
|
|
opengldebugImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
|
2019-02-20 09:25:50 +01:00
|
|
|
|
2021-01-19 13:26:27 +01:00
|
|
|
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"
|
2019-09-10 16:16:11 +02:00
|
|
|
|
2021-01-19 13:26:27 +01:00
|
|
|
huaweiImplementation 'com.huawei.hms:iap:5.0.2.300'
|
2020-11-16 18:16:06 +01:00
|
|
|
|
2021-02-27 09:54:15 +01:00
|
|
|
gplayFreeImplementation 'com.google.android.gms:play-services-location:18.0.0'
|
|
|
|
gplayFullImplementation 'com.google.android.gms:play-services-location:18.0.0'
|
2014-12-16 12:23:45 +01:00
|
|
|
}
|