Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-mullvad committed Aug 12, 2024
1 parent 158bdff commit b5d767e
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 92 deletions.
8 changes: 4 additions & 4 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
alias(libs.plugins.play.publisher)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.ksp)
alias(libs.plugins.kotlin.ksp)
alias(libs.plugins.compose)

id(Dependencies.junit5AndroidPluginId) version Versions.junit5Plugin
Expand Down Expand Up @@ -336,9 +336,9 @@ dependencies {
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.ktx)
implementation(libs.androidx.coresplashscreen)
implementation(libs.androidx.lifecycleRuntimeKtx)
implementation(libs.androidx.lifecycleViewmodelKtx)
implementation(libs.androidx.lifecycleRuntimeCompose)
implementation(libs.androidx.lifecycle.runtime)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.arrow)
implementation(libs.arrow.resilience)
implementation(libs.compose.constrainlayout)
Expand Down
10 changes: 5 additions & 5 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ plugins {
alias(libs.plugins.dependency.versions) apply false
alias(libs.plugins.ktfmt) apply false
alias(libs.plugins.compose) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.play.publisher) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.ksp) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.protobuf) apply false
alias(libs.plugins.protobuf.core) apply false

alias(libs.plugins.detekt) apply true
}
Expand All @@ -31,14 +31,14 @@ buildscript {
// https://github.com/gradle/gradle/issues/19228s
//noinspection UseTomlInstead
val aapt = libs.aapt.get().toString()
val aaptVersion = libs.versions.aapt.get()
val aaptVersion = libs.versions.android.gradle.aapt.get()
val agpVersion = libs.versions.android.gradle.plugin.get()
classpath("$aapt:$agpVersion-$aaptVersion:linux")
classpath("$aapt:$agpVersion-$aaptVersion:osx")
classpath("$aapt:$agpVersion-$aaptVersion:windows")

// Protoc plugin
val protoc = libs.plugins.protoc.core.get().toString()
val protoc = libs.plugins.protobuf.protoc.get().toString()
classpath("$protoc:linux-aarch_64@exe")
classpath("$protoc:linux-ppcle_64@exe")
classpath("$protoc:linux-s390_64@exe")
Expand All @@ -50,7 +50,7 @@ buildscript {
classpath("$protoc:windows-x86_64@exe")

// ProtoC gen grpc java plugin
val protocJava = libs.plugins.protoc.gen.grpc.java.get().toString()
val protocJava = libs.plugins.grpc.protoc.gen.grpc.java.get().toString()
classpath("$protocJava:linux-aarch_64@exe")
classpath("$protocJava:linux-ppcle_64@exe")
classpath("$protocJava:linux-s390_64@exe")
Expand Down
132 changes: 75 additions & 57 deletions android/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
[versions]
commonsvalidator = "1.9.0"
jodatime = "2.12.7"
kermit = "2.0.4"
konsist = "0.15.1"
kotlin = "2.0.0"
kotlinx = "1.8.1"
leakcanary = "2.13"
mockk = "1.13.12"
mockwebserver = "4.12.0"
turbine = "1.1.0"

# Android
# The androidAapt plugin version must be in sync with the android plugin version.
# Required for Gradle metadata verification to work properly, see:
# https://github.com/gradle/gradle/issues/19228
android-gradle-plugin = "8.3.0"
android-gradle-aapt = "10880808"
android-billingclient = "6.2.0"
android-volley = "1.2.1"

# AndroidX
androidx-activitycompose = "1.9.1"
androidx-appcompat = "1.7.0"
androidx-ktx = "1.13.1"
Expand All @@ -25,8 +21,10 @@ androidx-testorchestrator = "1.5.0"
androidx-testrunner = "1.6.1"
androidx-uiautomator = "2.4.0-alpha01"

# Arrow
arrow = "1.2.4"

# Compose
compose = "1.7.0-beta06"
compose-destinations = "2.1.0-beta10"
compose-constraintlayout = "1.0.1"
Expand All @@ -36,53 +34,57 @@ grpc = "1.65.1"
grpc-kotlin = "1.4.1"
grpc-protobuf = "4.27.2"

# Plugins
# The androidAapt plugin version must be in sync with the android plugin version.
# Required for Gradle metadata verification to work properly, see:
# https://github.com/gradle/gradle/issues/19228
android-gradle-plugin = "8.3.0"
aapt = "10880808"
play-publisher = "3.9.0"
# Koin
koin = "3.5.6"
koin-compose = "3.5.6"

# Kotlin
# Bump kotlin and kotlin-ksp together, find matching release here:
# https://github.com/google/ksp/releases
kotlin = "2.0.0"
kotlin-ksp = "2.0.0-1.0.22"
kotlinx = "1.8.1"

# Protobuf
protobuf = "0.9.4"

# Misc
commonsvalidator = "1.9.0"
dependency-check = "10.0.3"
detekt = "1.23.6"
dependency-versions = "0.51.0"
detekt = "1.23.6"
jodatime = "2.12.7"
kermit = "2.0.4"
konsist = "0.15.1"
ktfmt = "0.17.0"
# Ksp version is linked with kotlin version, find matching release here:
# https://github.com/google/ksp/releases
ksp = "%kotlin-1.0.22"

koin = "3.5.6"
koin-compose = "3.5.6"
leakcanary = "2.13"
mockk = "1.13.12"
mockwebserver = "4.12.0"
play-publisher = "3.9.0"
turbine = "1.1.0"

[libraries]
android-volley = { module = "com.android.volley:volley", version.ref = "android-volley" }
commons-validator = { module = "commons-validator:commons-validator", version.ref = "commonsvalidator" }
jodatime = { module = "joda-time:joda-time", version.ref = "jodatime" }
kermit = { module = "co.touchlab:kermit", version.ref = "kermit" }
konsist = { module = "com.lemonappdev:konsist", version.ref = "konsist" }
leakCanary = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanary" }
mockkWebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "mockwebserver" }
turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" }

# Android
android-billingclient = { module = "com.android.billingclient:billing-ktx", version.ref = "android-billingclient" }
android-volley = { module = "com.android.volley:volley", version.ref = "android-volley" }
aapt = { module = "com.android.tools.build:aapt2" }

# AndroidX
androidx-activity-Compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activitycompose" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-coresplashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidx-coresplashscreen" }
androidx-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-espresso" }
androidx-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-ktx" }
androidx-lifecycleRuntimeKtx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" }
androidx-lifecycleViewmodelKtx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
androidx-lifecycleRuntimeCompose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
androidx-lifecycleService = { module = "androidx.lifecycle:lifecycle-service", version.ref = "androidx-lifecycle" }
androidx-testCore = { module = "androidx.test:core", version.ref = "androidx-test" }
androidx-testMonitor = { module = "androidx.test:monitor", version.ref = "androidx-testmonitor" }
androidx-testRunner = { module = "androidx.test:runner", version.ref = "androidx-testrunner" }
androidx-testRules = { module = "androidx.test:rules", version.ref = "androidx-test" }
androidx-testUiAutomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "androidx-uiautomator" }
androidx-testOrchestrator = { module = "androidx.test:orchestrator", version.ref = "androidx-testorchestrator" }
androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" }
androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
androidx-lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
androidx-lifecycle-service = { module = "androidx.lifecycle:lifecycle-service", version.ref = "androidx-lifecycle" }
androidx-test-core = { module = "androidx.test:core", version.ref = "androidx-test" }
androidx-test-monitor = { module = "androidx.test:monitor", version.ref = "androidx-testmonitor" }
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-testrunner" }
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test" }
androidx-test-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "androidx-uiautomator" }
androidx-test-orchestrator = { module = "androidx.test:orchestrator", version.ref = "androidx-testorchestrator" }

# Arrow
arrow = { module = "io.arrow-kt:arrow-core", version.ref = "arrow" }
Expand Down Expand Up @@ -122,34 +124,50 @@ kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-native-prebuilt = { module = "org.jetbrains.kotlin:kotlin-native-prebuilt", version.ref = "kotlin" }

# KotlinX
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx" }

# MockK
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockk" }

aapt = { module = "com.android.tools.build:aapt2" }
# Misc
commons-validator = { module = "commons-validator:commons-validator", version.ref = "commonsvalidator" }
jodatime = { module = "joda-time:joda-time", version.ref = "jodatime" }
kermit = { module = "co.touchlab:kermit", version.ref = "kermit" }
konsist = { module = "com.lemonappdev:konsist", version.ref = "konsist" }
leakCanary = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanary" }
mockkWebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "mockwebserver" }
turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" }

[plugins]
# Android
android-gradle-plugin = { id = "com.android.tools.build:gradle", version.ref = "android-gradle-plugin" }
android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" }
android-test = { id = "com.android.test", version.ref = "android-gradle-plugin" }

# Compose
compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
dependency-check = { id = "org.owasp.dependencycheck", version.ref = "dependency-check" }
dependency-versions = { id = "com.github.ben-manes.versions", version.ref = "dependency-versions" }

# Kotlin
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
# TODO: Fix version!
ksp = { id = "com.google.devtools.ksp", version = "2.0.0-1.0.22"}
kotlin-ksp = { id = "com.google.devtools.ksp", version.ref = "kotlin-ksp"}

# Protobuf
protobuf-core = { id = "com.google.protobuf", version.ref = "protobuf" }
protobuf-protoc = { id = "com.google.protobuf:protoc", version.ref = "grpc-protobuf" }

# gRPC
grpc-protoc-gen-grpc-java = { id = "io.grpc:protoc-gen-grpc-java", version.ref = "grpc" }
grpc-protoc-gen-grpc-kotlin = { id = "io.grpc:protoc-gen-grpc-kotlin" }

# Misc
dependency-check = { id = "org.owasp.dependencycheck", version.ref = "dependency-check" }
dependency-versions = { id = "com.github.ben-manes.versions", version.ref = "dependency-versions" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
ktfmt = { id = "com.ncorti.ktfmt.gradle", version.ref = "ktfmt" }
play-publisher = { id = "com.github.triplet.play", version.ref = "play-publisher" }
protobuf = { id = "com.google.protobuf", version.ref = "protobuf" }

# TODO: Should the below be plugins?
protoc-core = { id = "com.google.protobuf:protoc", version.ref = "grpc-protobuf" }
protoc-gen-grpc-java = { id = "io.grpc:protoc-gen-grpc-java", version.ref = "grpc" }
# TODO: Fix version!
protoc-gen-grpc-kotlin = { id = "io.grpc:protoc-gen-grpc-kotlin", version = "1.4.1:jdk8@jar" }
10 changes: 5 additions & 5 deletions android/lib/daemon-grpc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.protobuf)
alias(libs.plugins.protobuf.core)

id(Dependencies.junit5AndroidPluginId) version Versions.junit5Plugin
}
Expand Down Expand Up @@ -36,11 +36,11 @@ android {
}

protobuf {
protoc { artifact = libs.plugins.protoc.core.get().toString() }
protoc { artifact = libs.plugins.protobuf.protoc.get().toString() }
plugins {
create("java") { artifact = libs.plugins.protoc.gen.grpc.java.get().toString() }
create("grpc") { artifact = libs.plugins.protoc.gen.grpc.java.get().toString() }
create("grpckt") { artifact = libs.plugins.protoc.gen.grpc.kotlin.get().toString() }
create("java") { artifact = libs.plugins.grpc.protoc.gen.grpc.java.get().toString() }
create("grpc") { artifact = libs.plugins.grpc.protoc.gen.grpc.java.get().toString() }
create("grpckt") { artifact = libs.plugins.grpc.protoc.gen.grpc.kotlin.get().toString() }
}
generateProtoTasks {
all().forEach {
Expand Down
2 changes: 1 addition & 1 deletion android/lib/map/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ android {
dependencies {
implementation(projects.lib.model)

implementation(libs.androidx.lifecycleRuntimeKtx)
implementation(libs.androidx.lifecycle.runtime)
implementation(libs.compose.ui)
implementation(libs.compose.foundation)
implementation(libs.kermit)
Expand Down
2 changes: 1 addition & 1 deletion android/lib/model/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.ksp)
alias(libs.plugins.kotlin.ksp)

id(Dependencies.junit5AndroidPluginId) version Versions.junit5Plugin
}
Expand Down
2 changes: 1 addition & 1 deletion android/lib/talpid/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ android {
dependencies {
implementation(projects.lib.model)

implementation(libs.androidx.lifecycleService)
implementation(libs.androidx.lifecycle.service)
implementation(libs.kermit)
implementation(libs.kotlin.stdlib)
implementation(libs.kotlinx.coroutines.android)
Expand Down
2 changes: 1 addition & 1 deletion android/service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dependencies {
implementation(projects.lib.talpid)

implementation(libs.androidx.ktx)
implementation(libs.androidx.lifecycleService)
implementation(libs.androidx.lifecycle.service)
implementation(libs.arrow)
implementation(libs.kermit)
implementation(libs.koin)
Expand Down
10 changes: 5 additions & 5 deletions android/test/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ androidComponents {
dependencies {
implementation(projects.lib.endpoint)

implementation(libs.androidx.testCore)
implementation(libs.androidx.testRunner)
implementation(libs.androidx.testRules)
implementation(libs.androidx.testUiAutomator)
implementation(libs.androidx.test.core)
implementation(libs.androidx.test.runner)
implementation(libs.androidx.test.rules)
implementation(libs.androidx.test.uiautomator)
implementation(Dependencies.junitJupiterEngine)
implementation(libs.kermit)
implementation(libs.kotlin.stdlib)

androidTestUtil(libs.androidx.testOrchestrator)
androidTestUtil(libs.androidx.test.orchestrator)
}
12 changes: 6 additions & 6 deletions android/test/e2e/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,18 @@ configure<org.owasp.dependencycheck.gradle.extension.DependencyCheckExtension> {
dependencies {
implementation(projects.test.common)
implementation(projects.lib.endpoint)
implementation(libs.androidx.testCore)
implementation(libs.androidx.test.core)
// Fixes: https://github.com/android/android-test/issues/1589
implementation(libs.androidx.testMonitor)
implementation(libs.androidx.testRunner)
implementation(libs.androidx.testRules)
implementation(libs.androidx.testUiAutomator)
implementation(libs.androidx.test.monitor)
implementation(libs.androidx.test.runner)
implementation(libs.androidx.test.rules)
implementation(libs.androidx.test.uiautomator)
implementation(libs.android.volley)
implementation(libs.kermit)
implementation(Dependencies.junitJupiterApi)
implementation(Dependencies.junit5AndroidTestExtensions)
implementation(Dependencies.junit5AndroidTestRunner)
implementation(libs.kotlin.stdlib)

androidTestUtil(libs.androidx.testOrchestrator)
androidTestUtil(libs.androidx.test.orchestrator)
}
12 changes: 6 additions & 6 deletions android/test/mockapi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ dependencies {
implementation(projects.lib.endpoint)
implementation(projects.test.common)

implementation(libs.androidx.testCore)
implementation(libs.androidx.test.core)
// Fixes: https://github.com/android/android-test/issues/1589
implementation(libs.androidx.testMonitor)
implementation(libs.androidx.testRunner)
implementation(libs.androidx.testRules)
implementation(libs.androidx.testUiAutomator)
implementation(libs.androidx.test.monitor)
implementation(libs.androidx.test.runner)
implementation(libs.androidx.test.rules)
implementation(libs.androidx.test.uiautomator)
implementation(libs.kermit)
implementation(libs.jodatime)
implementation(Dependencies.junitJupiterApi)
Expand All @@ -87,5 +87,5 @@ dependencies {
implementation(libs.kotlin.stdlib)
implementation(libs.mockkWebserver)

androidTestUtil(libs.androidx.testOrchestrator)
androidTestUtil(libs.androidx.test.orchestrator)
}

0 comments on commit b5d767e

Please sign in to comment.