2017-10-24 05:55:28 +00:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
apply plugin: 'com.github.ben-manes.versions'
|
|
|
|
apply plugin: 'com.github.triplet.play'
|
|
|
|
|
|
|
|
dependencies {
|
2019-06-17 04:32:19 +00:00
|
|
|
implementation 'eu.chainfire:libsuperuser:1.1.0.201903290044'
|
2018-10-07 13:32:55 +00:00
|
|
|
implementation 'com.android.support:design:28.0.0'
|
2018-10-21 18:50:52 +00:00
|
|
|
implementation 'com.android.support:recyclerview-v7:28.0.0'
|
2017-12-05 11:53:33 +00:00
|
|
|
implementation 'com.google.zxing:android-integration:3.3.0'
|
2019-03-23 10:59:41 +00:00
|
|
|
implementation 'com.google.code.gson:gson:2.8.5'
|
2017-12-05 11:53:33 +00:00
|
|
|
implementation 'org.mindrot:jbcrypt:0.4'
|
2018-10-27 14:34:08 +00:00
|
|
|
// com.google.guava:guava:24.1-jre will crash on Android 5.x
|
2019-06-17 04:32:19 +00:00
|
|
|
implementation 'com.google.guava:guava:27.1-android'
|
2019-03-23 10:59:41 +00:00
|
|
|
implementation 'com.annimon:stream:1.2.1'
|
|
|
|
implementation 'com.android.volley:volley:1.1.1'
|
2018-09-22 17:19:18 +00:00
|
|
|
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
2019-06-17 04:32:19 +00:00
|
|
|
implementation 'com.google.dagger:dagger:2.23.1'
|
|
|
|
annotationProcessor "com.google.dagger:dagger-compiler:2.23.1"
|
2018-08-19 22:26:26 +00:00
|
|
|
androidTestImplementation 'com.android.support.test:rules:1.0.2'
|
2018-10-07 13:32:55 +00:00
|
|
|
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
|
2017-10-24 05:55:28 +00:00
|
|
|
}
|
|
|
|
|
2019-06-17 04:18:11 +00:00
|
|
|
apply from: 'versions.gradle'
|
|
|
|
def ourVersionCode = versionMajor * 1000000 + versionMinor * 10000 + versionPatch * 100 + versionWrapper
|
|
|
|
def ourVersionName = "${versionMajor}.${versionMinor}.${versionPatch}.${versionWrapper}"
|
|
|
|
|
2017-10-24 05:55:28 +00:00
|
|
|
android {
|
2017-12-26 18:47:23 +00:00
|
|
|
// Changes to these values need to be reflected in `.travis.yml`
|
2018-10-07 13:32:55 +00:00
|
|
|
compileSdkVersion 28
|
2019-03-30 07:43:53 +00:00
|
|
|
buildToolsVersion '28.0.3'
|
2017-12-26 18:47:23 +00:00
|
|
|
|
2018-08-19 22:00:37 +00:00
|
|
|
buildTypes.debug.applicationIdSuffix ".debug"
|
2017-10-24 05:55:28 +00:00
|
|
|
dataBinding.enabled = true
|
|
|
|
|
2019-06-17 04:32:19 +00:00
|
|
|
playConfigs {
|
2017-10-24 05:55:28 +00:00
|
|
|
defaultAccountConfig {
|
2019-06-17 04:32:19 +00:00
|
|
|
serviceAccountCredentials = file(System.getenv("SYNCTHING_RELEASE_PLAY_ACCOUNT_CONFIG_FILE") ?: 'keys.json')
|
2017-10-24 05:55:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
defaultConfig {
|
2018-08-19 22:02:15 +00:00
|
|
|
applicationId "com.github.catfriend1.syncthingandroid"
|
2018-04-27 22:29:25 +00:00
|
|
|
minSdkVersion 16
|
2019-03-23 10:59:41 +00:00
|
|
|
targetSdkVersion 28
|
2019-06-17 04:18:11 +00:00
|
|
|
versionCode ourVersionCode
|
|
|
|
versionName ourVersionName
|
2018-08-19 22:02:15 +00:00
|
|
|
testApplicationId 'com.github.catfriend1.syncthingandroid.test'
|
2017-10-24 05:55:28 +00:00
|
|
|
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
|
|
|
|
}
|
|
|
|
|
|
|
|
signingConfigs {
|
|
|
|
release {
|
2017-11-13 02:09:26 +00:00
|
|
|
storeFile = {
|
|
|
|
def path = System.getenv("SYNCTHING_RELEASE_STORE_FILE")
|
|
|
|
return (path) ? file(path) : null
|
|
|
|
}()
|
2017-10-24 05:55:28 +00:00
|
|
|
storePassword System.getenv("SIGNING_PASSWORD") ?: ""
|
2017-11-13 02:09:26 +00:00
|
|
|
keyAlias System.getenv("SYNCTHING_RELEASE_KEY_ALIAS") ?: ""
|
2017-10-24 05:55:28 +00:00
|
|
|
keyPassword System.getenv("SIGNING_PASSWORD") ?: ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
2018-04-09 20:13:25 +00:00
|
|
|
signingConfig = signingConfigs.release.storeFile ? signingConfigs.release : null
|
|
|
|
}
|
|
|
|
debug {
|
2018-10-08 03:00:59 +00:00
|
|
|
gradle.buildFinished {
|
2019-06-15 09:40:02 +00:00
|
|
|
buildResult -> if (buildResult.failure) {
|
|
|
|
logger.lifecycle("BUILD FAILED")
|
2018-10-08 03:00:59 +00:00
|
|
|
}
|
|
|
|
}
|
2017-10-24 05:55:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
2018-11-29 21:16:51 +00:00
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
abortOnError true
|
|
|
|
}
|
2017-10-24 05:55:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
play {
|
2019-06-17 04:32:19 +00:00
|
|
|
serviceAccountCredentials = file(System.getenv("SYNCTHING_RELEASE_PLAY_ACCOUNT_CONFIG_FILE") ?: 'keys.json')
|
2018-04-18 22:46:20 +00:00
|
|
|
track = 'beta'
|
2019-06-19 00:57:46 +00:00
|
|
|
resolutionStrategy = 'ignore'
|
2017-10-24 05:55:28 +00:00
|
|
|
}
|
|
|
|
|
2018-11-29 21:16:51 +00:00
|
|
|
tasks.whenTaskAdded { task ->
|
|
|
|
if (task.name == 'compileDebugSources') {
|
2019-06-15 09:40:02 +00:00
|
|
|
// task.dependsOn lint
|
|
|
|
// task.mustRunAfter lint
|
2018-11-29 21:16:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-24 05:55:28 +00:00
|
|
|
/**
|
|
|
|
* Some languages are not supported by Google Play, so we ignore them.
|
|
|
|
*/
|
|
|
|
task deleteUnsupportedPlayTranslations(type: Delete) {
|
2019-06-17 04:32:19 +00:00
|
|
|
delete 'src/main/play/listings/el-EL/'
|
|
|
|
delete 'src/main/play/listings/en/'
|
|
|
|
delete 'src/main/play/listings/eu/'
|
|
|
|
delete 'src/main/play/listings/nb/'
|
|
|
|
delete 'src/main/play/listings/nl_BE/'
|
|
|
|
delete 'src/main/play/listings/nl-BE/'
|
|
|
|
delete 'src/main/play/listings/nn/'
|
|
|
|
delete 'src/main/play/listings/ta/'
|
2017-10-24 05:55:28 +00:00
|
|
|
}
|
2018-10-08 03:00:59 +00:00
|
|
|
|
2019-01-06 17:02:59 +00:00
|
|
|
task postBuildScript(type: Exec) {
|
2018-10-08 03:00:59 +00:00
|
|
|
executable = 'python'
|
2019-01-06 17:02:59 +00:00
|
|
|
args = ['-u', './postbuild.py']
|
2018-10-08 03:00:59 +00:00
|
|
|
}
|