syncstuff/app/build.gradle
2024-07-27 14:11:16 +02:00

153 lines
5.0 KiB
Groovy

plugins {
id 'com.android.application'
id 'com.github.ben-manes.versions'
id 'com.github.triplet.play' version '3.6.0'
}
dependencies {
androidTestImplementation 'androidx.annotation:annotation:1.2.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
annotationProcessor "com.google.dagger:dagger-compiler:2.38.1"
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.core:core:1.3.0'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'androidx.fragment:fragment:1.2.5'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.annimon:stream:1.2.2'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.code.gson:gson:2.8.8'
implementation 'com.google.dagger:dagger:2.38.1'
implementation 'com.google.guava:guava:30.1.1-android'
// Do not upgrade zxing:core beyond 3.3.0 to ensure Android 6.0 compatibility, see issue #761.
implementation 'com.google.zxing:core:3.3.0'
implementation ('com.journeyapps:zxing-android-embedded:4.2.0') { transitive = false }
implementation 'eu.chainfire:libsuperuser:1.1.0.202004101746'
implementation 'org.mindrot:jbcrypt:0.4'
constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
}
apply from: 'versions.gradle'
def ourVersionCode = versionMajor * 1000000 + versionMinor * 10000 + versionPatch * 100 + versionWrapper
def ourVersionName = "${versionMajor}.${versionMinor}.${versionPatch}.${versionWrapper}"
android {
compileSdkVersion 35
buildToolsVersion '35.0.0'
ndkVersion = "${ndkVersionShared}"
namespace = 'com.nutomic.syncthingandroid'
buildFeatures.dataBinding = true
defaultConfig {
applicationId "com.github.catfriend1.syncthingandroid"
minSdkVersion 21
targetSdkVersion 35
versionCode ourVersionCode
versionName ourVersionName
testApplicationId 'com.github.catfriend1.syncthingandroid.test'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
signingConfigs {
release {
storeFile = {
def path = System.getenv("SYNCTHING_RELEASE_STORE_FILE")
return (path) ? file(path) : null
}()
storePassword System.getenv("SIGNING_PASSWORD") ?: ""
keyAlias System.getenv("SYNCTHING_RELEASE_KEY_ALIAS") ?: ""
keyPassword System.getenv("SIGNING_PASSWORD") ?: ""
}
}
buildTypes {
release {
signingConfig = signingConfigs.release.storeFile ? signingConfigs.release : null
}
debug {
applicationIdSuffix ".debug"
gradle.buildFinished {
buildResult -> if (buildResult.failure) {
logger.lifecycle("BUILD FAILED")
}
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
bundle {
language {
enableSplit = false
}
density {
enableSplit = true
}
abi {
enableSplit = true
}
}
packagingOptions {
jniLibs {
useLegacyPackaging = true
}
}
lint {
abortOnError true
disable 'UnsafeExperimentalUsageError', 'UnsafeExperimentalUsageWarning', 'ExpiringTargetSdkVersion', 'ExpiredTargetSdkVersion'
}
}
play {
// Use ANDROID_PUBLISHER_CREDENTIALS environment variable to specify serviceAccountCredentials.
track = 'beta'
resolutionStrategy = com.github.triplet.gradle.androidpublisher.ResolutionStrategy.IGNORE
defaultToAppBundles = true
}
tasks.whenTaskAdded { task ->
if (task.name == 'compileDebugSources') {
// task.dependsOn lint
// task.mustRunAfter lint
}
}
/**
* Some languages are not supported by Google Play, so we ignore them.
*/
task deleteUnsupportedPlayTranslations(type: Delete) {
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/'
}
task postBuildScript(type: Exec) {
executable = 'python'
args = ['-u', './postbuild.py']
}
project.afterEvaluate {
project.getTasks().getByName("mergeDebugJniLibFolders").dependsOn(":syncthing:buildNative")
}