Skip to content

Commit

Permalink
build: migrate build to version catalogs
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Dec 23, 2023
1 parent 8ad1248 commit 38b5da1
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 63 deletions.
68 changes: 34 additions & 34 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import org.gradle.configurationcache.extensions.capitalized

plugins {
id("com.osfans.trime.data-checksums")
id("com.android.application")
kotlin("android")
kotlin("plugin.serialization") version Versions.kotlin
id("com.google.devtools.ksp") version Versions.ksp
id("com.mikepenz.aboutlibraries.plugin")
alias(libs.plugins.android.application)
alias(libs.plugins.aboutlibraries)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.ksp)
}

android {
Expand Down Expand Up @@ -153,35 +153,35 @@ tasks.register<Delete>("cleanCxxIntermediates") {

dependencies {
ksp(project(":codegen"))
implementation("com.blankj:utilcodex:1.31.1")
implementation("com.jakewharton.timber:timber:5.0.1")
implementation("com.github.getActivity:XXPermissions:18.5")
implementation("com.charleskorn.kaml:kaml:0.56.0")
implementation("com.mikepenz:aboutlibraries-core:${Versions.aboutlibraries}")
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.preference:preference-ktx:1.2.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.viewpager2:viewpager2:1.0.0")
implementation("androidx.fragment:fragment-ktx:1.5.4")
implementation("androidx.navigation:navigation-fragment-ktx:${Versions.navigation}")
implementation("androidx.navigation:navigation-ui-ktx:${Versions.navigation}")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlin}")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.kotlinCoroutines}")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.kotlinCoroutines}")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.1")
implementation("com.google.android.flexbox:flexbox:3.0.0")
implementation("com.louiscad.splitties:splitties-bitflags:${Versions.splitties}")
implementation("com.louiscad.splitties:splitties-systemservices:${Versions.splitties}")
implementation("com.louiscad.splitties:splitties-views-dsl:${Versions.splitties}")
implementation("com.louiscad.splitties:splitties-views-dsl-constraintlayout:${Versions.splitties}")
implementation("com.louiscad.splitties:splitties-views-dsl-recyclerview:${Versions.splitties}")
implementation("com.louiscad.splitties:splitties-views-recyclerview:${Versions.splitties}")
implementation("androidx.room:room-runtime:${Versions.room}")
ksp("androidx.room:room-compiler:${Versions.room}")
implementation("androidx.room:room-ktx:${Versions.room}")
implementation(libs.kotlinx.coroutines)
implementation(libs.kotlinx.serialization.json)
implementation(libs.androidx.activity)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.navigation.fragment)
implementation(libs.androidx.navigation.ui)
implementation(libs.androidx.preference)
implementation(libs.androidx.recyclerview)
ksp(libs.androidx.room.compiler)
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
implementation(libs.androidx.viewpager2)
implementation(libs.flexbox)
implementation(libs.kaml)
implementation(libs.timber)
implementation(libs.utilcode)
implementation(libs.xxpermissions)
implementation(libs.splitties.bitflags)
implementation(libs.splitties.systemservices)
implementation(libs.splitties.views.dsl)
implementation(libs.splitties.views.dsl.constraintlayout)
implementation(libs.splitties.views.dsl.coordinatorlayout)
implementation(libs.splitties.views.dsl.recyclerview)
implementation(libs.splitties.views.recyclerview)
implementation(libs.aboutlibraries.core)

// Testing
testImplementation("junit:junit:4.13.2")
androidTestImplementation("junit:junit:4.13.2")
testImplementation(libs.junit)
androidTestImplementation(libs.junit)
}
13 changes: 8 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
*/

plugins {
id("com.android.application") version Versions.androidGradlePlugin apply false
id("com.android.library") version Versions.androidGradlePlugin apply false
kotlin("android") version Versions.kotlin apply false
id("com.diffplug.spotless") version "6.23.3"
id("com.mikepenz.aboutlibraries.plugin") version Versions.aboutlibraries apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.aboutlibraries) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.spotless)
}

spotless {
Expand Down
14 changes: 4 additions & 10 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@ plugins {
kotlin("plugin.serialization") version embeddedKotlinVersion
}

repositories {
google()
mavenCentral()
gradlePluginPortal()
}

dependencies {
compileOnly("com.android.tools.build:gradle:8.2.0")
compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
implementation("com.google.guava:guava:33.0.0-jre")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.1")
compileOnly(libs.android.gradlePlugin)
compileOnly(libs.kotlin.gradlePlugin)
implementation(libs.guava)
implementation(libs.kotlinx.serialization.json)
}

gradlePlugin {
Expand Down
12 changes: 12 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
10 changes: 0 additions & 10 deletions buildSrc/src/main/kotlin/Versions.kt

This file was deleted.

7 changes: 3 additions & 4 deletions codegen/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id("java-library")
kotlin("jvm")
alias(libs.plugins.kotlin.jvm)
}

java {
Expand All @@ -13,6 +12,6 @@ kotlin {
}

dependencies {
implementation("com.squareup:kotlinpoet-ksp:1.12.0")
implementation("com.google.devtools.ksp:symbol-processing-api:1.8.0-1.0.8")
implementation(libs.kotlinpoet.ksp)
implementation(libs.ksp)
}
55 changes: 55 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[versions]
androidGradlePlugin = "8.2.0"
kotlin = "1.9.20"
ksp = "1.9.20-1.0.14"
lifecycle = "2.6.2"
navigation = "2.7.5"
room = "2.6.1"
splitties = "3.0.0"
aboutlibraries = "10.9.2"

[libraries]
android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" }
kotlin-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version = "1.7.3" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.6.1" }
androidx-activity = { module = "androidx.activity:activity-ktx", version = "1.8.1" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.6.1" }
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version = "2.1.4" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version = "1.12.0" }
androidx-navigation-fragment = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navigation" }
androidx-navigation-ui = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigation" }
androidx-preference = { module = "androidx.preference:preference-ktx", version = "1.2.1" }
androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version = "1.3.2" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
androidx-viewpager2 = { module = "androidx.viewpager2:viewpager2", version = "1.1.0-beta02" }
flexbox = { module = "com.google.android.flexbox:flexbox", version = "3.0.0" }
guava = { module = "com.google.guava:guava", version = "33.0.0-jre"}
kaml = { module = "com.charleskorn.kaml:kaml", version = "0.56.0" }
timber = { module = "com.jakewharton.timber:timber", version = "5.0.1" }
utilcode = { module = "com.blankj:utilcodex", version = "1.31.1" }
xxpermissions = { module = "com.github.getActivity:XXPermissions", version = "18.5" }
splitties-bitflags = { module = "com.louiscad.splitties:splitties-bitflags", version.ref = "splitties" }
splitties-systemservices = { module = "com.louiscad.splitties:splitties-systemservices", version.ref = "splitties" }
splitties-views-dsl = { module = "com.louiscad.splitties:splitties-views-dsl", version.ref = "splitties" }
splitties-views-dsl-constraintlayout = { module = "com.louiscad.splitties:splitties-views-dsl-constraintlayout", version.ref = "splitties" }
splitties-views-dsl-coordinatorlayout = { module = "com.louiscad.splitties:splitties-views-dsl-coordinatorlayout", version.ref = "splitties" }
splitties-views-dsl-recyclerview = { module = "com.louiscad.splitties:splitties-views-dsl-recyclerview", version.ref = "splitties" }
splitties-views-recyclerview = { module = "com.louiscad.splitties:splitties-views-recyclerview", version.ref = "splitties" }
aboutlibraries-core = { module = "com.mikepenz:aboutlibraries-core", version.ref = "aboutlibraries" }
aboutlibraries-plugin = { module = "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin", version.ref = "aboutlibraries" }
junit = { module = "junit:junit", version = "4.13.2" }
kotlinpoet-ksp = { module = "com.squareup:kotlinpoet-ksp", version = "1.14.2" }
ksp = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
aboutlibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "aboutlibraries" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
spotless = { id = "com.diffplug.spotless", version = "6.23.3" }

0 comments on commit 38b5da1

Please sign in to comment.