Migrate to Gradle Kotlin DSL, version catalog and ksp (#744)

This commit is contained in:
aualbert 2024-06-15 15:12:15 +00:00 committed by GitHub
parent 688eabd8f1
commit 573fead2da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 344 additions and 284 deletions

View File

@ -1,222 +0,0 @@
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 25
versionName "0.10.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
javaCompileOptions {
annotationProcessorOptions {
arguments += [
"room.schemaLocation": "$projectDir/schemas".toString(),
"room.incremental" : "true"
]
}
}
}
flavorDimensions "channel"
productFlavors {
github {
dimension "channel"
}
fdroid {
dimension "channel"
}
googlePlay {
dimension "channel"
applicationIdSuffix ".google.play"
}
}
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.8.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"
// 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-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.13.1"
implementation "androidx.activity:activity-compose:1.9.0"
implementation 'androidx.appcompat:appcompat:1.7.0'
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"
}

185
app/build.gradle.kts Normal file
View File

@ -0,0 +1,185 @@
import java.util.Properties
import java.io.FileInputStream
plugins {
alias(libs.plugins.kotlin.android)
alias(libs.plugins.android.application)
alias(libs.plugins.ksp)
alias(libs.plugins.aboutlibraries)
alias(libs.plugins.room)
alias(libs.plugins.hilt)
}
fun fetchGitCommitHash(): String {
val process = ProcessBuilder("git", "rev-parse", "--verify", "--short", "HEAD")
.redirectErrorStream(true)
.start()
return process.inputStream.bufferedReader().use { it.readText().trim() }
}
val gitCommitHash = fetchGitCommitHash()
val keyProps = Properties()
val keyPropsFile: File = rootProject.file("signature/keystore.properties")
if (keyPropsFile.exists()) {
println("Loading keystore properties from ${keyPropsFile.absolutePath}")
keyProps.load(FileInputStream(keyPropsFile))
}
android {
compileSdk = 34
defaultConfig {
applicationId = "me.ash.reader"
minSdk = 26
targetSdk = 33
versionCode = 25
versionName = "0.10.1"
buildConfigField("String", "USER_AGENT_STRING", "\"ReadYou/${'$'}{versionName}(${versionCode})\"")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
room {
schemaDirectory("$projectDir/schemas")
}
ksp {
arg("room.incremental","true")
}
}
flavorDimensions.add("channel")
productFlavors {
create("github") {
dimension = "channel"
}
create("fdroid") {
dimension = "channel"
}
create("googlePlay") {
dimension = "channel"
applicationIdSuffix = ".google.play"
}
}
signingConfigs {
create("release") {
keyAlias = keyProps["keyAlias"] as String?
keyPassword = keyProps["keyPassword"] as String?
storeFile = keyProps["storeFile"]?.let { file(it as String) }
storePassword = keyProps["storePassword"] as String?
}
}
lint {
disable.addAll(listOf("MissingTranslation", "ExtraTranslation"))
}
buildTypes {
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("release")
}
}
applicationVariants.all {
outputs.all {
(this as com.android.build.gradle.internal.api.BaseVariantOutputImpl).outputFileName = "ReadYou-${defaultConfig.versionName}-${gitCommitHash}.apk"
}
}
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
jvmTarget = JavaVersion.VERSION_11.toString()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
buildFeatures {
compose = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
packaging {
resources.excludes.add("/META-INF/{AL2.0,LGPL2.1}")
}
androidResources {
generateLocaleConfig = true
}
namespace = "me.ash.reader"
}
dependencies {
// AboutLibraries
implementation(libs.aboutlibraries.core)
implementation(libs.aboutlibraries.compose)
// Compose
implementation(libs.compose.html)
implementation(platform(libs.compose.bom))
androidTestImplementation(platform(libs.compose.bom))
implementation(libs.compose.animation.graphics)
implementation(libs.compose.ui)
implementation(libs.compose.ui.util)
implementation(libs.compose.material)
implementation(libs.compose.material.icons.extended)
implementation(libs.compose.ui.tooling)
implementation(libs.compose.ui.tooling.preview)
androidTestImplementation(libs.compose.ui.test.junit4)
implementation(libs.compose.material3)
// Accompanist
implementation(libs.accompanist.pager)
implementation(libs.accompanist.flowlayout)
implementation(libs.accompanist.swiperefresh)
// Coil
implementation(libs.coil.base)
implementation(libs.coil.compose)
implementation(libs.coil.svg)
implementation(libs.coil.gif)
// Hilt
implementation(libs.hilt.work)
implementation(libs.hilt.android)
ksp(libs.hilt.android.compiler)
ksp(libs.hilt.compiler)
implementation(libs.hilt.navigation.compose)
// AndroidX
implementation(libs.android.svg)
implementation(libs.opml.parser)
implementation(libs.readability4j)
implementation(libs.rome)
implementation(libs.telephoto)
implementation(libs.okhttp)
implementation(libs.okhttp.coroutines)
implementation(libs.retrofit)
implementation(libs.retrofit.gson)
implementation(libs.profileinstaller)
implementation(libs.work.runtime.ktx)
implementation(libs.datastore.preferences)
implementation(libs.room.paging)
implementation(libs.room.common)
implementation(libs.room.ktx)
ksp(libs.room.compiler)
implementation(libs.paging.common.ktx)
implementation(libs.paging.runtime.ktx)
implementation(libs.paging.compose)
implementation(libs.browser)
implementation(libs.navigation.compose)
implementation(libs.lifecycle.viewmodel.compose)
implementation(libs.lifecycle.runtime.ktx)
implementation(libs.core.ktx)
implementation(libs.activity.compose)
implementation(libs.appcompat)
// Testing
testImplementation(libs.junit)
androidTestImplementation(libs.junit.ext)
androidTestImplementation(libs.espresso)
testImplementation(libs.mockito.core)
testImplementation(libs.mockito.junit.jupiter)
testImplementation(libs.mockito.kotlin)
}

View File

@ -8,6 +8,7 @@ import androidx.work.ListenableWorker
import androidx.work.WorkManager import androidx.work.WorkManager
import com.rometools.rome.feed.synd.SyndFeed import com.rometools.rome.feed.synd.SyndFeed
import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.async import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
@ -274,6 +275,7 @@ abstract class AbstractRssRepository(
} }
} }
@OptIn(ExperimentalCoroutinesApi::class)
fun pullImportant( fun pullImportant(
isStarred: Boolean, isStarred: Boolean,
isUnread: Boolean, isUnread: Boolean,

View File

@ -122,4 +122,4 @@ object UserAgentInterceptor : Interceptor {
} }
} }
const val USER_AGENT_STRING = "ReadYou/${BuildConfig.VERSION_NAME}(${BuildConfig.VERSION_CODE})" const val USER_AGENT_STRING = BuildConfig.USER_AGENT_STRING

View File

@ -1,56 +0,0 @@
buildscript {
ext {
// https://developer.android.com/jetpack/androidx/releases/compose-ui
// compose = '1.2.0-beta02'
// https://developer.android.com/jetpack/compose/bom
composeBom = '2024.05.00'
// https://github.com/google/accompanist/releases
accompanist = '0.34.0'
// https://developer.android.com/jetpack/androidx/releases/compose-material3
// material3 = '1.2.0-rc01'
// https://developer.android.com/jetpack/androidx/releases/lifecycle
lifecycle = '2.8.1'
// https://developer.android.com/jetpack/androidx/releases/navigation
navigation = '2.7.7'
// https://developer.android.com/jetpack/androidx/releases/paging
paging = '3.3.0'
// https://developer.android.com/jetpack/androidx/releases/room
room = '2.6.1'
// https://developer.android.com/jetpack/androidx/releases/datastore
datastore = '1.1.1'
// https://developer.android.com/jetpack/androidx/releases/work
work = '2.9.0'
// https://developer.android.com/jetpack/androidx/releases/profileinstaller
profileinstaller = '1.3.1'
// https://square.github.io/okhttp/changelogs/changelog/
okhttp = '5.0.0-alpha.12'
retrofit2 = '2.9.0'
// https://coil-kt.github.io/coil/changelog/
coil = '2.5.0'
// https://mvnrepository.com/artifact/com.rometools/rome
rome = '1.18.0'
// https://github.com/dankito/Readability4J
readability4j = '1.0.8'
// https://github.com/mdewilde/opml-parser
opmlParser = '3.1.0'
// http://bigbadaboom.github.io/androidsvg/release_notes.html
androidSVG = '1.4'
// https://github.com/mikepenz/AboutLibraries/releases
aboutLibsRelease = '11.1.1'
}
dependencies {
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.50'
}
}
plugins {
id 'com.android.application' version '8.2.1' apply false
id 'com.android.library' version '8.2.1' apply false
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
id 'com.mikepenz.aboutlibraries.plugin' version "${aboutLibsRelease}" apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}

13
build.gradle.kts Normal file
View File

@ -0,0 +1,13 @@
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.aboutlibraries) apply false
alias(libs.plugins.room) apply false
alias(libs.plugins.hilt) apply false
}
tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}

View File

@ -1,8 +1,8 @@
org.gradle.daemon=true org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -XX:+UseParallelGC org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -XX:+UseParallelGC
org.gradle.parallel=true org.gradle.parallel=true
android.buildConfig = true
android.useAndroidX=true android.useAndroidX=true
android.defaults.buildfeatures.buildconfig=true android.nonTransitiveRClass=true
android.nonTransitiveRClass=false android.nonFinalResIds=true
android.nonFinalResIds=false
android.enableR8.fullMode=false android.enableR8.fullMode=false

136
gradle/libs.versions.toml Normal file
View File

@ -0,0 +1,136 @@
[versions]
# Android Gradle Plugin
androidGradlePlugin = "8.2.1"
# Kotlin
kotlin = "1.9.22"
ksp = "1.9.22-1.0.17"
# AboutLibraries
aboutLibsRelease = "11.1.1"
# Accompanist
accompanist = "0.34.0"
# AndroidX
activityCompose = "1.9.0"
appcompat = "1.7.0"
browser = "1.8.0"
coreKtx = "1.13.1"
datastore = "1.1.1"
espresso = "3.5.1"
lifecycle = "2.8.1"
navigation = "2.7.7"
paging = "3.3.0"
profileinstaller = "1.3.1"
room = "2.6.1"
work = "2.9.0"
# Compose
composeBom = "2024.05.00"
composeCompiler = "1.5.8"
composeHtml = "1.0.2"
# Coil
coil = "2.5.0"
# Hilt
hiltAndroid = "2.50"
hiltCompiler = "1.1.0"
hiltNavigationCompose = "1.1.0"
hiltWork = "1.1.0"
# Miscellaneous Libraries
androidSVG = "1.4"
junit = "4.13.2"
junitExt = "1.1.5"
mockitoCore = "5.11.0"
mockitoJUnitJupiter = "5.11.0"
mockitoKotlin = "5.2.1"
okhttp = "5.0.0-alpha.12"
opmlParser = "3.1.0"
readability4j = "1.0.8"
retrofit2 = "2.9.0"
rome = "1.18.0"
telephoto = "0.7.1"
[libraries]
# AboutLibraries
aboutlibraries-core = { group = "com.mikepenz", name = "aboutlibraries-core", version.ref = "aboutLibsRelease" }
aboutlibraries-compose = { group = "com.mikepenz", name = "aboutlibraries-compose-m3", version.ref = "aboutLibsRelease" }
# Compose
compose-html = { group = "com.github.ireward", name = "compose-html", version.ref = "composeHtml" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
compose-animation-graphics = { group = "androidx.compose.animation", name = "animation-graphics" }
compose-ui = { group = "androidx.compose.ui", name = "ui" }
compose-ui-util = { group = "androidx.compose.ui", name = "ui-util" }
compose-material = { group = "androidx.compose.material", name = "material" }
compose-material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended" }
compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
compose-material3 = { group = "androidx.compose.material3", name = "material3" }
# Accompanist
accompanist-pager = { group = "com.google.accompanist", name = "accompanist-pager", version.ref = "accompanist" }
accompanist-flowlayout = { group = "com.google.accompanist", name = "accompanist-flowlayout", version.ref = "accompanist" }
accompanist-swiperefresh = { group = "com.google.accompanist", name = "accompanist-swiperefresh", version.ref = "accompanist" }
# Coil
coil-base = { group = "io.coil-kt", name = "coil-base", version.ref = "coil" }
coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" }
coil-svg = { group = "io.coil-kt", name = "coil-svg", version.ref = "coil" }
coil-gif = { group = "io.coil-kt", name = "coil-gif", version.ref = "coil" }
# Hilt
hilt-work = { group = "androidx.hilt", name = "hilt-work", version.ref = "hiltWork" }
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hiltAndroid" }
hilt-android-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hiltAndroid" }
hilt-compiler = { group = "androidx.hilt", name = "hilt-compiler", version.ref = "hiltCompiler" }
hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "hiltNavigationCompose" }
# AndroidX
android-svg = { group = "com.caverock", name = "androidsvg-aar", version.ref = "androidSVG" }
opml-parser = { group = "be.ceau", name = "opml-parser", version.ref = "opmlParser" }
readability4j = { group = "net.dankito.readability4j", name = "readability4j", version.ref = "readability4j" }
rome = { group = "com.rometools", name = "rome", version.ref = "rome" }
telephoto = { group = "me.saket.telephoto", name = "zoomable", version.ref = "telephoto" }
okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" }
okhttp-coroutines = { group = "com.squareup.okhttp3", name = "okhttp-coroutines-jvm", version.ref = "okhttp" }
retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit2" }
retrofit-gson = { group = "com.squareup.retrofit2", name = "converter-gson", version.ref = "retrofit2" }
profileinstaller = { group = "androidx.profileinstaller", name = "profileinstaller", version.ref = "profileinstaller" }
work-runtime-ktx = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "work" }
datastore-preferences = { group = "androidx.datastore", name = "datastore-preferences", version.ref = "datastore" }
room-paging = { group = "androidx.room", name = "room-paging", version.ref = "room" }
room-common = { group = "androidx.room", name = "room-common", version.ref = "room" }
room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
paging-common-ktx = { group = "androidx.paging", name = "paging-common-ktx", version.ref = "paging" }
paging-runtime-ktx = { group = "androidx.paging", name = "paging-runtime-ktx", version.ref = "paging" }
paging-compose = { group = "androidx.paging", name = "paging-compose", version.ref = "paging" }
browser = { group = "androidx.browser", name = "browser", version.ref = "browser" }
navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation" }
lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }
lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" }
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
# Testing
junit = { group = "junit", name = "junit", version.ref = "junit" }
junit-ext = { group = "androidx.test.ext", name = "junit", version.ref = "junitExt" }
espresso = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso" }
mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockitoCore" }
mockito-junit-jupiter = { group = "org.mockito", name = "mockito-junit-jupiter", version.ref = "mockitoJUnitJupiter" }
mockito-kotlin = { group = "org.mockito.kotlin", name = "mockito-kotlin", version.ref = "mockitoKotlin" }
[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
aboutlibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "aboutLibsRelease" }
room = { id = "androidx.room", version.ref = "room" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hiltAndroid" }

View File

@ -5,13 +5,15 @@ pluginManagement {
mavenCentral() mavenCentral()
} }
} }
dependencyResolutionManagement { dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven { url 'https://jitpack.io' } maven { url = uri("https://jitpack.io") }
} }
} }
rootProject.name = "Reader" rootProject.name = "Reader"
include ':app' include(":app")