Skip to content

Commit e4c221b

Browse files
committed
Migrated to gradle catalogs and removed unused dependencies
Removed: - Retrofit - JNA - net.i2p.crypto.eddsa
1 parent 9ebc253 commit e4c221b

File tree

5 files changed

+108
-62
lines changed

5 files changed

+108
-62
lines changed

build.gradle.kts

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
import org.gradle.jvm.tasks.Jar
2+
import org.jetbrains.compose.ExperimentalComposeLibrary
23
import org.jetbrains.compose.compose
4+
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag
35
import java.io.FileOutputStream
46
import java.nio.file.Files
7+
import org.jetbrains.compose.reload.ComposeHotRun
8+
9+
plugins {
10+
alias(libs.plugins.kotlin.jvm)
11+
alias(libs.plugins.compose.compiler)
12+
alias(libs.plugins.compose)
13+
alias(libs.plugins.hotReload)
14+
alias(libs.plugins.ksp)
15+
alias(libs.plugins.kotlinx.serialization)
16+
}
517

618
val javaLanguageVersion = JavaLanguageVersion.of(17)
719
val linuxArmTarget = "aarch64-unknown-linux-gnu"
820
val linuxX64Target = "x86_64-unknown-linux-gnu"
921

10-
plugins {
11-
// Kotlin version must match compose version
12-
kotlin("jvm") version "2.1.10"
13-
kotlin("plugin.serialization") version "2.1.10"
14-
id("com.google.devtools.ksp") version "2.1.10-1.0.29"
15-
id("org.jetbrains.compose") version "1.7.3"
16-
id("org.jetbrains.kotlin.plugin.compose") version "2.0.20"
17-
}
18-
1922
// Remember to update Constants.APP_VERSION when changing this version
2023
val projectVersion = "1.5.0-rc01"
2124

@@ -47,42 +50,42 @@ repositories {
4750
}
4851

4952
dependencies {
50-
val jgit = "7.2.0.202503040940-r"
51-
val ktorVersion = "3.0.3"
5253

5354
when {
5455
currentOs() == OS.LINUX && isLinuxAarch64 -> implementation(compose.desktop.linux_arm64)
5556
currentOs() == OS.MAC -> implementation(compose.desktop.macos_x64)
5657
else -> implementation(compose.desktop.currentOs)
5758
}
5859

59-
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
60-
implementation(compose("org.jetbrains.compose.ui:ui-util"))
61-
implementation(compose("org.jetbrains.compose.components:components-animatedimage"))
62-
implementation(compose("org.jetbrains.compose.components:components-resources"))
63-
implementation("org.eclipse.jgit:org.eclipse.jgit:$jgit")
64-
implementation("org.eclipse.jgit:org.eclipse.jgit.gpg.bc:$jgit")
65-
implementation("org.eclipse.jgit:org.eclipse.jgit.lfs:$jgit")
66-
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
67-
implementation("com.google.dagger:dagger:2.48.1")
68-
ksp("com.google.dagger:dagger-compiler:2.48.1")
69-
testImplementation(platform("org.junit:junit-bom:5.9.0"))
70-
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
71-
testImplementation("io.mockk:mockk:1.13.4")
72-
implementation("com.squareup.retrofit2:retrofit:2.11.0")
73-
implementation("com.squareup.retrofit2:converter-scalars:2.9.0")
74-
implementation("net.i2p.crypto:eddsa:0.3.0")
75-
implementation("net.java.dev.jna:jna:5.14.0")
76-
implementation("io.github.oshai:kotlin-logging-jvm:5.0.1")
77-
implementation("org.slf4j:slf4j-api:2.0.7")
78-
implementation("org.slf4j:slf4j-reload4j:2.0.7")
79-
implementation("androidx.datastore:datastore-preferences-core:1.0.0")
80-
implementation("org.bouncycastle:bcpg-jdk18on:1.78.1")
81-
implementation("io.ktor:ktor-client:$ktorVersion")
82-
implementation("io.ktor:ktor-client-cio:$ktorVersion")
83-
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
84-
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
85-
implementation("io.ktor:ktor-client-logging:$ktorVersion")
60+
implementation(compose.uiUtil)
61+
@OptIn(ExperimentalComposeLibrary::class)
62+
implementation(compose.desktop.components.animatedImage)
63+
implementation(compose.components.resources)
64+
implementation(compose.materialIconsExtended)
65+
implementation(libs.jgit.core)
66+
implementation(libs.jgit.gpg)
67+
implementation(libs.jgit.lfs)
68+
69+
implementation(libs.kotlinx.serialization.json)
70+
implementation(libs.dagger)
71+
ksp(libs.dagger.compiler)
72+
73+
testImplementation(platform(libs.junit.bom))
74+
testImplementation(libs.junit.jupiter)
75+
testImplementation(libs.mockk)
76+
77+
implementation(libs.kotlin.logging)
78+
implementation(libs.slf4j.api)
79+
implementation(libs.slf4j.reload4j)
80+
81+
implementation(libs.datastore.core)
82+
implementation(libs.bouncycastle)
83+
84+
implementation(libs.ktor.client)
85+
implementation(libs.ktor.client.cio)
86+
implementation(libs.ktor.client.content.negotiation)
87+
implementation(libs.ktor.serialization.kotlinx.json)
88+
implementation(libs.ktor.client.logging)
8689
}
8790

8891
fun currentOs(): OS {
@@ -127,6 +130,13 @@ tasks.withType<JavaExec> {
127130
})
128131
}
129132

133+
//https://github.com/JetBrains/compose-hot-reload
134+
composeCompiler {
135+
featureFlags.add(ComposeFeatureFlag.OptimizeNonSkippingGroups)
136+
}
137+
tasks.withType<ComposeHotRun>().configureEach {
138+
mainClass.set("com.jetpackduba.gitnuro.MainKt")
139+
}
130140

131141
compose.desktop {
132142
application {
@@ -203,7 +213,6 @@ tasks.getByName("compileTestKotlin").doLast {
203213
generateKotlinFromRs()
204214
}
205215

206-
207216
task("tasksList") {
208217
println("Tasks")
209218
tasks.forEach {

gradle/libs.versions.toml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[versions]
2+
3+
kotlin = "2.1.21"
4+
compose = "1.8.1"
5+
hotReload = "1.0.0-alpha09"
6+
ksp = "2.1.21-2.0.1"
7+
jgit = "7.2.0.202503040940-r"
8+
dagger = "2.56.2"
9+
kotlinx-serialization = "1.5.0"
10+
junit-bom = "5.9.0"
11+
junit-jupiter = "5.9.2"
12+
mockk = "1.13.4"
13+
kotlin-logging = "5.0.1"
14+
slf4j = "2.0.7"
15+
datastore = "1.1.7"
16+
bouncycastle = "1.78.1"
17+
ktor = "3.0.3"
18+
19+
20+
[libraries]
21+
22+
jgit-core = { group = "org.eclipse.jgit", name = "org.eclipse.jgit", version.ref = "jgit" }
23+
jgit-gpg = { group = "org.eclipse.jgit", name = "org.eclipse.jgit.gpg.bc", version.ref = "jgit" }
24+
jgit-lfs = { group = "org.eclipse.jgit", name = "org.eclipse.jgit.lfs", version.ref = "jgit" }
25+
26+
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
27+
28+
dagger = { group = "com.google.dagger", name = "dagger", version.ref = "dagger" }
29+
dagger-compiler = { group = "com.google.dagger", name = "dagger-compiler", version.ref = "dagger" }
30+
31+
junit-bom = { group = "org.junit", name = "junit-bom", version.ref = "junit-bom" }
32+
junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit-jupiter" }
33+
34+
mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" }
35+
36+
kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging-jvm", version.ref = "kotlin-logging" }
37+
38+
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
39+
slf4j-reload4j = { group = "org.slf4j", name = "slf4j-reload4j", version.ref = "slf4j" }
40+
41+
datastore-core = { group = "androidx.datastore", name = "datastore-preferences-core", version.ref = "datastore" }
42+
43+
bouncycastle = { group = "org.bouncycastle", name = "bcpg-jdk18on", version.ref = "bouncycastle" }
44+
45+
ktor-client = { group = "io.ktor", name = "ktor-client", version.ref = "ktor" }
46+
ktor-client-cio = { group = "io.ktor", name = "ktor-client-cio", version.ref = "ktor" }
47+
ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
48+
ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
49+
ktor-client-logging = { group = "io.ktor", name = "ktor-client-logging", version.ref = "ktor" }
50+
51+
52+
[plugins]
53+
54+
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
55+
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
56+
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
57+
compose = { id = "org.jetbrains.compose", version.ref = "compose" }
58+
hotReload = { id = "org.jetbrains.compose.hot-reload", version.ref = "hotReload" }
59+
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }

src/main/kotlin/com/jetpackduba/gitnuro/AppConstants.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ object AppConstants {
1616
apache__2_0
1717
),
1818
Project("Mockk", "https://mockk.io/", apache__2_0),
19-
Project("Retrofit2", "https://square.github.io/retrofit/", apache__2_0),
2019
Project("LibSSH", "libssh.org/", lgpl__2_1),
2120
)
2221

src/main/kotlin/com/jetpackduba/gitnuro/di/modules/NetworkModule.kt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,20 @@
11
package com.jetpackduba.gitnuro.di.modules
22

3-
import com.jetpackduba.gitnuro.updates.UpdatesService
43
import dagger.Provides
54
import io.ktor.client.*
65
import io.ktor.client.engine.cio.*
76
import io.ktor.client.plugins.logging.*
8-
import retrofit2.Retrofit
9-
import retrofit2.converter.scalars.ScalarsConverterFactory
107
import java.security.cert.X509Certificate
118
import javax.net.ssl.X509TrustManager
129

1310
@dagger.Module
1411
class NetworkModule {
15-
@Provides
16-
fun provideWebService(): UpdatesService {
17-
return Retrofit.Builder()
18-
.baseUrl("https://github.com")
19-
.addConverterFactory(ScalarsConverterFactory.create())
20-
.build()
21-
.create(UpdatesService::class.java)
22-
}
23-
2412
@Provides
2513
fun provideKtorHttpClient(): HttpClient {
2614
val httpClient = HttpClient(CIO) {
2715
install(Logging) {
2816
logger = Logger.DEFAULT
29-
level = LogLevel.ALL
17+
level = LogLevel.NONE
3018
}
3119
engine {
3220
https {

src/main/kotlin/com/jetpackduba/gitnuro/updates/UpdatesWebService.kt

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)