Skip to content

Commit

Permalink
added toml file
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudoankit committed Jan 27, 2024
1 parent d8d560b commit b03c7e5
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 13 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ android {
namespace = "pseudoankit.droid.tasky"

defaultConfig {
applicationId = BuildConfig.App.ApplicationId
applicationId = "pseudoankit.droid.tasky"
versionCode = BuildConfig.App.VersionCode
versionName = BuildConfig.App.VersionName
testInstrumentationRunner = BuildConfig.App.TestInstrumentationRunner
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

vectorDrawables {
useSupportLibrary = true
Expand All @@ -23,8 +23,8 @@ android {
getByName("release") {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile(BuildConfig.App.DefaultProguardOptimizeFile),
BuildConfig.App.ProGuardRules
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
create("benchmark") {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
namespace = "com.pseudoankit.tasky.benchmark"

defaultConfig {
testInstrumentationRunner = BuildConfig.App.TestInstrumentationRunner
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand Down
4 changes: 4 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ repositories {
dependencies {
implementation("com.android.tools.build:gradle:7.4.0")
implementation(kotlin("gradle-plugin", "1.8.10"))

// Make version catalog available in precompiled scripts
// https://github.com/gradle/gradle/issues/15383#issuecomment-1567461389
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
}

gradlePlugin {
Expand Down
19 changes: 19 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pluginManagement {
repositories {
google()
gradlePluginPortal()
}
}

dependencyResolutionManagement {
repositories {
google()
gradlePluginPortal()
}

versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
6 changes: 0 additions & 6 deletions buildSrc/src/main/java/BuildConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@ object BuildConfig {
const val JvmTarget = "11"
const val MinSdkVersion = 23
const val TargetSdkVersion = CompileSdkVersion
val JavaVersion = org.gradle.api.JavaVersion.VERSION_11

object App {
const val ApplicationId = "pseudoankit.droid.tasky"
const val VersionCode = 1
const val VersionName = "1.0"
const val ProGuardRules = "proguard-rules.pro"
const val DefaultProguardOptimizeFile = "proguard-android-optimize.txt"
const val DefaultConsumerProguardFiles = "consumer-rules.pro"
const val TestInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
}
5 changes: 3 additions & 2 deletions buildSrc/src/main/java/plugin/base/CorePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Dependencies
import Plugins
import Versions
import com.android.build.gradle.BaseExtension
import org.gradle.api.JavaVersion
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies
Expand Down Expand Up @@ -38,8 +39,8 @@ open class CorePlugin : Plugin<Project> {
}

compileOptions {
sourceCompatibility = BuildConfig.JavaVersion
targetCompatibility = BuildConfig.JavaVersion
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
isCoreLibraryDesugaringEnabled = true
}

Expand Down
138 changes: 138 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
[versions]
kotlin = "1.9.10"
kotlin-coroutines = "1.7.3"
ktor = "2.3.5"
kotest = "5.7.2"
compose = "1.5.3"
# https://developer.android.com/jetpack/androidx/releases/compose-kotlin
compose-compiler = "1.5.3" # It's used! Use compatible with Kotlin one
glance = "1.0.0"
room = "2.6.1"
kotlinx-collections = "0.3.6"

# Android
minSdk = "23"
compileSdk = "34"
targetSdk = "34"
version-code = "1"
version-name = "1.0.0"
jvmTarget = "11"

# Linters
detekt = "1.23.1" # https://detekt.dev/docs/gettingstarted/gradle/

[libraries]
android-gradle-plugin = { module = "com.android.tools.build:gradle", version = "8.1.2" }

# Kotlin
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutines" }
kotlin-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlin-coroutines" }
kotlin-coroutines-googleplay-temp = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services", version.ref = "kotlin-coroutines" }
kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "kotlinx-collections" }

# KotlinX Serialization
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.6.0" }
kotlinx-serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }

# Ktor
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
ktor-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" }
ktor-serialization = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-serialization = { module = "io.ktor:ktor-client-serialization", version.ref = "ktor" }
ktor-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" }

# Testing
mockk = { module = "io.mockk:mockk", version = "1.13.8" }
kotest-junit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" }
kotest-assertions = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
kotest-property = { module = "io.kotest:kotest-property", version.ref = "kotest" }
kotest-datatest = { module = "io.kotest:kotest-framework-datatest", version.ref = "kotest" }
kotlin-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlin-coroutines" }
cashapp-molecule-plugin = { module = "app.cash.molecule:molecule-gradle-plugin", version = "1.2.1" }
cashapp-turbine = { module = "app.cash.turbine:turbine", version = "1.0.0" }

# Compose
compose-bom = { module = "androidx.compose:compose-bom", version = "2023.01.00" }
compose-animation = { module = "androidx.compose.animation:animation" }
compose-foundation = { module = "androidx.compose.foundation:foundation" }
compose-material3 = { module = "androidx.compose.material3:material3" }
compose-material3-windowsize = { module = "androidx.compose.material3:material3-window-size-class" }
compose-runtime = { module = "androidx.compose.runtime:runtime" }
compose-ui = { module = "androidx.compose.ui:ui" }
compose-activity = { module = "androidx.activity:activity-compose" }
compose-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
glance = { module = "androidx.glance:glance", version.ref = "glance" }
glance-appwidget = { module = "androidx.glance:glance-appwidget", version.ref = "glance" }
glance-material3 = { module = "androidx.glance:glance-material3", version.ref = "glance" }
compose-coil = { module = "io.coil-kt:coil-compose", version = "2.5.0" }

# Local persistence
datastore = { module = "androidx.datastore:datastore-preferences", version = "1.0.0" }
room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }

# Linters
detekt-gradle-plugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" }
detekt-ruleset-compiler = { module = "com.braisgabin.detekt:kotlin-compiler-wrapper", version = "0.0.4" }
detekt-ruleset-ktlint = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
detekt-ruleset-compose = { module = "io.nlopez.compose.rules:detekt", version = "0.3.0" }
slack-lint-compose = { module = "com.slack.lint.compose:compose-lint-checks", version = "1.2.0" }

# KSP
ksp-plugin = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin", version = "1.9.10-1.0.13" }

[bundles]
kotlin = [
"kotlin-stdlib",
"kotlin-coroutines-core",
"kotlinx-collections-immutable"
]
kotlin-android = [
"kotlin-coroutines-android",
"kotlin-coroutines-googleplay-temp",
]
ktor = [
"kotlinx-serialization-json",
"ktor-client-okhttp",
"ktor-content-negotiation",
"ktor-serialization",
"ktor-client-core",
"ktor-client-serialization",
"ktor-logging"
]
testing = [
"kotest-junit5",
"kotest-assertions",
"kotest-property",
"kotest-datatest",
"kotlin-coroutines-test",
"mockk",
"cashapp-turbine"
]
compose = [
"compose-animation",
"compose-foundation",
"compose-material3",
"compose-material3-windowsize",
"compose-runtime",
"compose-ui",
"compose-activity",
"compose-tooling",
"compose-coil",
]
glance = [
"glance",
"glance-appwidget",
"glance-material3"
]
room = [
"room-runtime",
"room-ktx"
]

[plugins]
gradleWrapperUpgrade = { id = "org.gradle.wrapper-upgrade", version = "0.11.4" }

0 comments on commit b03c7e5

Please sign in to comment.