ReadYou/app/build.gradle
Moderpach 1199c6850b
feat(ui): switch to androidx edge to edge implementation (#690)
* switch to androidx edge to edge implementation

* switch to androidx edge to edge implementation for CrashReportActivity

* Remove systemuicontroller
enableEdgeToEdge() has replaced systemuicontroller

* Remove systemuicontroller dependency

* clean code
2024-04-28 00:21:04 +08:00

224 lines
8.2 KiB
Groovy

plugins {
id "com.android.application"
id "org.jetbrains.kotlin.android"
id "kotlin-kapt"
id "dagger.hilt.android.plugin"
id "com.google.dagger.hilt.android"
id 'com.mikepenz.aboutlibraries.plugin'
}
def gitCommitHash = "git rev-parse --verify --short HEAD".execute().text.trim()
def keyProps = new Properties()
def keyPropsFile = rootProject.file("signature/keystore.properties")
if (keyPropsFile.exists()) {
println("Loading keystore properties from ${keyPropsFile.absolutePath}")
keyProps.load(new FileInputStream(keyPropsFile))
}
android {
compileSdk 34
defaultConfig {
applicationId "me.ash.reader"
minSdk 26
targetSdk 33
versionCode 23
versionName "0.9.12"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
javaCompileOptions {
annotationProcessorOptions {
arguments += [
"room.schemaLocation": "$projectDir/schemas".toString(),
"room.incremental" : "true"
]
}
}
}
flavorDimensions "channel"
productFlavors {
fdroid {
dimension "channel"
}
googlePlay {
dimension "channel"
applicationIdSuffix ".google.play"
}
github {
dimension "channel"
}
}
signingConfigs {
release {
keyAlias keyProps["keyAlias"]
keyPassword keyProps["keyPassword"]
storeFile keyProps["storeFile"] ? file(keyProps["storeFile"]) : null
storePassword keyProps["storePassword"]
}
}
lint {
disable.addAll("MissingTranslation", "ExtraTranslation")
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFileName = "ReadYou-${defaultConfig.versionName}-${gitCommitHash}.apk"
}
}
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.5.8'
}
packagingOptions {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
// https://developer.android.com/guide/topics/resources/app-languages#auto-localeconfig
androidResources {
generateLocaleConfig true
}
namespace 'me.ash.reader'
}
dependencies {
// https://github.com/mikepenz/AboutLibraries/releases
implementation "com.mikepenz:aboutlibraries-core:${aboutLibsRelease}"
implementation "com.mikepenz:aboutlibraries-compose-m3:${aboutLibsRelease}"
// https://github.com/ireward/compose-html/tags
implementation "com.github.ireward:compose-html:1.0.2"
// http://bigbadaboom.github.io/androidsvg/release_notes.html
implementation "com.caverock:androidsvg-aar:$androidSVG"
// https://github.com/mdewilde/opml-parser
implementation "be.ceau:opml-parser:$opmlParser"
// https://github.com/dankito/Readability4J
implementation "net.dankito.readability4j:readability4j:$readability4j"
// https://mvnrepository.com/artifact/com.rometools/rome
implementation "com.rometools:rome:$rome"
// https://coil-kt.github.io/coil/changelog/
implementation("io.coil-kt:coil-base:$coil")
implementation("io.coil-kt:coil-compose:$coil")
implementation("io.coil-kt:coil-svg:$coil")
implementation("io.coil-kt:coil-gif:$coil")
// https://saket.github.io/telephoto/zoomableimage/
implementation("me.saket.telephoto:zoomable:0.7.1")
// Cancel TLSv1.3 support pre Android10
// implementation 'org.conscrypt:conscrypt-android:2.5.2'
// https://square.github.io/okhttp/changelogs/changelog/
implementation "com.squareup.okhttp3:okhttp:$okhttp"
implementation "com.squareup.okhttp3:okhttp-coroutines-jvm:$okhttp"
implementation "com.squareup.retrofit2:retrofit:$retrofit2"
implementation "com.squareup.retrofit2:converter-gson:$retrofit2"
// https://developer.android.com/jetpack/androidx/releases/profileinstaller
implementation "androidx.profileinstaller:profileinstaller:$profileinstaller"
// https://developer.android.com/jetpack/androidx/releases/work
implementation "androidx.work:work-runtime-ktx:$work"
// https://developer.android.com/jetpack/androidx/releases/datastore
implementation "androidx.datastore:datastore-preferences:$datastore"
// https://developer.android.com/jetpack/androidx/releases/room
implementation "androidx.room:room-paging:$room"
implementation "androidx.room:room-common:$room"
implementation "androidx.room:room-ktx:$room"
kapt "androidx.room:room-compiler:$room"
// https://developer.android.com/jetpack/androidx/releases/paging
implementation "androidx.paging:paging-common-ktx:$paging"
implementation "androidx.paging:paging-runtime-ktx:$paging"
implementation "androidx.paging:paging-compose:$paging"
// https://developer.android.com/jetpack/androidx/releases/paging
implementation "androidx.browser:browser:1.5.0"
// https://developer.android.com/jetpack/androidx/releases/navigation
implementation "androidx.navigation:navigation-compose:$navigation"
// https://developer.android.com/jetpack/androidx/releases/lifecycle
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycle"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle"
// https://developer.android.com/jetpack/androidx/releases/compose-material3
implementation "androidx.compose.material3:material3:$material3"
// https://github.com/google/accompanist/releases
implementation "com.google.accompanist:accompanist-pager:$accompanist"
implementation "com.google.accompanist:accompanist-flowlayout:$accompanist"
implementation "com.google.accompanist:accompanist-navigation-animation:$accompanist"
implementation "com.google.accompanist:accompanist-swiperefresh:$accompanist"
implementation platform("androidx.compose:compose-bom:$composeBom")
androidTestImplementation(platform("androidx.compose:compose-bom:$composeBom"))
// https://developer.android.com/jetpack/androidx/releases/compose-animation
implementation "androidx.compose.animation:animation-graphics"
// https://developer.android.com/jetpack/androidx/releases/compose-ui
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.ui:ui-util"
// https://developer.android.com/jetpack/androidx/releases/compose-material
implementation "androidx.compose.material:material"
implementation "androidx.compose.material:material-icons-extended"
implementation "androidx.compose.ui:ui-tooling"
implementation "androidx.compose.ui:ui-tooling-preview"
androidTestImplementation "androidx.compose.ui:ui-test-junit4"
// hilt
implementation "androidx.hilt:hilt-work:1.1.0"
implementation "com.google.dagger:hilt-android:2.50"
kapt "com.google.dagger:hilt-android-compiler:2.50"
// implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
kapt "androidx.hilt:hilt-compiler:1.1.0"
implementation "androidx.hilt:hilt-navigation-compose:1.1.0"
// android
implementation "androidx.core:core-ktx:1.12.0"
implementation "androidx.activity:activity-compose:1.8.2"
implementation 'androidx.appcompat:appcompat:1.7.0-alpha03'
testImplementation "junit:junit:4.13.2"
androidTestImplementation "androidx.test.ext:junit:1.1.5"
androidTestImplementation "androidx.test.espresso:espresso-core:3.5.1"
// mockito
testImplementation "org.mockito:mockito-core:5.11.0"
testImplementation 'org.mockito:mockito-junit-jupiter:5.11.0'
testImplementation "org.mockito.kotlin:mockito-kotlin:5.2.1"
}