ed85b0a9d9
Currently a single huge APK is produced. For GooglePlay that doesn't matter since since they require a complete bundle, while creating stripped and optimised APKs per device. For alternative downloads - be that directly or via fdroid-like repo currently we download/store about four times more information than needed. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Change-Id: Ic43ef6a3f3e072323ecd57448552379113123e9c
87 lines
2.9 KiB
Groovy
87 lines
2.9 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
// buildhost settings - paths and the like
|
|
apply from: 'appSettings.gradle'
|
|
|
|
android {
|
|
compileSdkVersion 29
|
|
buildDir = "${rootProject.getBuildDir()}/app"
|
|
|
|
defaultConfig {
|
|
// applicationId, versionCode and versionName are defined in appSettings.gradle
|
|
minSdkVersion 21
|
|
targetSdkVersion 29
|
|
|
|
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}"
|
|
resValue "string", "image_draw_header", "@drawable/drawer_header"
|
|
manifestPlaceholders = [ appIcon: "${liboLauncherIcon}" ]
|
|
buildConfigField "boolean", "APP_HAS_BRANDING", "${liboHasBranding}"
|
|
}
|
|
splits {
|
|
abi {
|
|
enable true
|
|
|
|
reset ()
|
|
include @ANDROID_ABI_SPLIT@
|
|
}
|
|
}
|
|
|
|
lintOptions {
|
|
disable 'MissingTranslation', 'ExtraTranslation'
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
resValue "string", "app_name", "${liboAppName} Debug"
|
|
applicationIdSuffix '.debug'
|
|
versionNameSuffix '-debug'
|
|
debuggable true
|
|
}
|
|
release {
|
|
if (file("src/main/res/drawable/drawer_header_brand.png").exists()) {
|
|
resValue "string", "image_draw_header", "@drawable/drawer_header_brand"
|
|
}
|
|
|
|
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.1.0'
|
|
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'
|
|
implementation 'com.google.android.play:core:1.8.0'
|
|
|
|
//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"
|
|
}
|
|
|
|
afterEvaluate {
|
|
if (!project.ext.liboHasBranding.equals("true") || !file("${liboBrandingDir}").exists()) {
|
|
copyBrandFiles.enabled = false
|
|
}
|
|
|
|
preBuild.dependsOn copyBrandFiles
|
|
}
|