* Different level of APK compression - can reduce from 200mb to 50mb with level 5 of compression. Supports Intellij IDEA and command line gradle invocation - by default, this feature is disabled. To enable create a file local.properties in `apps/android` and paste this line: `compression_level=5` - level can be from 0 (no compression) to 9 (slowest and the must effective) - automatically enables `extractNativeLibs` AndroidManifest's flag since it's required in this case. Feel free to find an alternative that works with compression of .so libs and without enabling this flag - Windows is not suppored, of course. Only Unix-like OSes * script corrections * Missing JAVA_HOME in some environments * Rename release apk made by IDEA to simplex.apk * Enhancements Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
49 lines
2.3 KiB
Groovy
49 lines
2.3 KiB
Groovy
buildscript {
|
|
Properties localProperties = new Properties()
|
|
if (rootProject.file('local.properties').canRead()) {
|
|
localProperties.load(rootProject.file("local.properties").newDataInputStream())
|
|
}
|
|
|
|
ext {
|
|
compose_version = localProperties['compose_version'] ?: '1.2.0-beta02'
|
|
kotlin_version = localProperties['kotlin_version'] ?: '1.6.21'
|
|
gradle_plugin_version = localProperties['gradle_plugin_version'] ?: '7.2.0'
|
|
|
|
// Name that will be shown for debug build. By default it is from strings
|
|
app_name = localProperties['app_name'] ?: "@string/app_name"
|
|
// Whether the app is debuggable or not. Specify `false` if you want good performance in debug builds
|
|
enable_debuggable = localProperties['debuggable'] ?: true
|
|
// Ending part of package name.
|
|
// Provide, for example, `application_id_suffix=.debug` in local.properties
|
|
// to allow debug & release versions to coexist
|
|
application_id_suffix = localProperties['application_id_suffix'] ?: ''
|
|
|
|
// Compression level for debug AND release apk. 0 = disable compression. Max is 9
|
|
compression_level = localProperties['compression_level'] ?: '0'
|
|
|
|
// NOTE: If you need a different version of something, provide it in `local.properties`
|
|
// like so: compose_version=123, or gradle_plugin_version=1.2.3, etc
|
|
}
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
dependencies {
|
|
classpath "com.android.tools.build:gradle:$gradle_plugin_version"
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
classpath "org.jetbrains.kotlin:kotlin-serialization:1.3.2"
|
|
|
|
// NOTE: Do not place your application dependencies here; they belong
|
|
// in the individual module build.gradle files
|
|
}
|
|
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
plugins {
|
|
id 'com.android.application' version "$gradle_plugin_version" apply false
|
|
id 'com.android.library' version "$gradle_plugin_version" apply false
|
|
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
|
|
id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlin_version"
|
|
}
|
|
|
|
task clean(type: Delete) {
|
|
delete rootProject.buildDir
|
|
} |