Skip to content

Commit

Permalink
Enable minification for debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tmo1 committed Oct 11, 2023
1 parent 068ab68 commit 685ab26
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ The above applies only to SMS and MMS messages; the format for call logs and con

SMS Import / Export is available from [Github](https://github.com/tmo1/sms-ie). The repository can be cloned and built locally, from the command line (e.g., by issuing `gradlew assembleDebug` in the root directory of the project) or within Android Studio. Releases, which include pre-built APK packages, can be downloaded from the [Releases page](https://github.com/tmo1/sms-ie/releases), and are also available at [F-Droid](https://f-droid.org/packages/com.github.tmo1.sms_ie/). Automatically built (debug) packages of the latest code pushed to the repository are generally available [here](https://github.com/tmo1/sms-ie/actions/workflows/build.yml) (click on the latest workflow run, then click on `com.github.tmo1.sms_ie` in the `Artifacts` section).

### Building

**Note:** When using Android Studio to build debug builds and deploy them to systems with API level >= 21, it may be desirable to turn off minification; see the comments in `[build.gradle](https://github.com/tmo1/sms-ie/app/build.gradle)` for details.

## Compatibility

Current versions of SMS Import / Export should run on any Android (phone-like) device running KitKat / 4.4 (API level 19) or later, although message import and scheduled message export are only possible on devices running Marshmallow / 6.0 (API level 23) or later.
Expand Down
18 changes: 18 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,24 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
/* The following 'debug {}' stanza is necessary to avoid hitting the 64K reference limit:
https://developer.android.com/build/multidex
Minification can, however, slow down build times, and Android Studio warns about this.
This stanza is only necessary for building debug builds from the command line, or when
deploying to systems with API level < 21; when deploying from Android Studio to systems
with API level >= 21, multidex is enabled by default and the stanza can be deleted for
faster build times:
https://developer.android.com/build/multidex#mdex-on-l */
debug {
// https://stackoverflow.com/a/55785351
postprocessing {
removeUnusedCode true
obfuscate false
optimizeCode true
}
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down

0 comments on commit 685ab26

Please sign in to comment.