libreoffice-online/android/app/build.gradle
mert 30a01c0b21 tdf#131567 android: added version number in about dialog
also included git-hashes

Change-Id: Ia1d7f7f14b4c560ad7e47fd7a2f459e0da60e3d1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91951
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-05-03 08:49:33 +02:00

98 lines
3.7 KiB
Groovy

apply plugin: 'com.android.application'
// buildhost settings - paths and the like
apply from: 'appSettings.gradle'
android {
compileSdkVersion 28
buildDir = "${rootProject.getBuildDir()}/app"
defaultConfig {
// applicationId, versionCode and versionName are defined in appSettings.gradle
minSdkVersion 21
targetSdkVersion 28
}
lintOptions {
disable 'MissingTranslation', 'ExtraTranslation'
}
buildTypes {
debug {
resValue "string", "app_name", "${liboAppName} Debug"
resValue "string", "vendor", "${liboVendor}"
resValue "string", "info_url", "${liboInfoURL}"
resValue "string", "online_version_hash", "${liboOVersionHash}"
resValue "string", "core_version_hash", "${liboCoreVersionHash}"
resValue "string", "image_draw_header", "@drawable/drawer_header"
manifestPlaceholders = [ appIcon: "${liboLauncherIcon}" ]
buildConfigField "boolean", "APP_HAS_BRANDING", "${liboHasBranding}"
ndk {
abiFilters = []
abiFilters.addAll("${liboAndroidAbi}".split(' ').collect{it as String})
}
applicationIdSuffix '.debug'
versionNameSuffix '-debug'
debuggable true
}
release {
resValue "string", "app_name", "${liboAppName}"
resValue "string", "vendor", "${liboVendor}"
resValue "string", "info_url", "${liboInfoURL}"
resValue "string", "online_version_hash", "${liboOVersionHash}"
resValue "string", "core_version_hash", "${liboCoreVersionHash}"
if (file("src/main/res/drawable/drawer_header_brand.png").exists()) {
resValue "string", "image_draw_header", "@drawable/drawer_header_brand"
} else {
resValue "string", "image_draw_header", "@drawable/drawer_header"
}
manifestPlaceholders = [ appIcon: "${liboLauncherIcon}" ]
buildConfigField "boolean", "APP_HAS_BRANDING", "${liboHasBranding}"
ndk {
abiFilters = []
abiFilters.addAll("${liboAndroidAbi}".split(' ').collect{it as String})
}
minifyEnabled false // FIXME disabled before we get a good proguardRules for callFakeWebsocketOnMessage calling from C++
shrinkResources false // FIXME cannot be enabled when minifyEnabled is turned off
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha04'
//before changing the version please see https://issuetracker.google.com/issues/111662669
implementation 'androidx.preference:preference:1.1.0-alpha01'
implementation project(path: ':lib')
}
task copyBrandFiles(type: Copy) {
from "${liboBrandingDir}/android"
into "src/main/res"
}
task generateLoleafletAssets(type: Exec) {
commandLine 'make', '-C', '../../'
}
afterEvaluate {
if (!project.ext.liboHasBranding.equals("true") || !file("${liboBrandingDir}").exists()) {
copyBrandFiles.enabled = false
}
preBuild.dependsOn copyBrandFiles
generateDebugAssets.dependsOn generateLoleafletAssets
generateReleaseAssets.dependsOn generateLoleafletAssets
}