|
1 | 1 | import org.gradle.jvm.tasks.Jar |
| 2 | +import org.jetbrains.compose.ExperimentalComposeLibrary |
2 | 3 | import org.jetbrains.compose.compose |
| 4 | +import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag |
3 | 5 | import java.io.FileOutputStream |
4 | 6 | 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 | +} |
5 | 17 |
|
6 | 18 | val javaLanguageVersion = JavaLanguageVersion.of(17) |
7 | 19 | val linuxArmTarget = "aarch64-unknown-linux-gnu" |
8 | 20 | val linuxX64Target = "x86_64-unknown-linux-gnu" |
9 | 21 |
|
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 | | - |
19 | 22 | // Remember to update Constants.APP_VERSION when changing this version |
20 | 23 | val projectVersion = "1.5.0-rc01" |
21 | 24 |
|
@@ -47,42 +50,42 @@ repositories { |
47 | 50 | } |
48 | 51 |
|
49 | 52 | dependencies { |
50 | | - val jgit = "7.2.0.202503040940-r" |
51 | | - val ktorVersion = "3.0.3" |
52 | 53 |
|
53 | 54 | when { |
54 | 55 | currentOs() == OS.LINUX && isLinuxAarch64 -> implementation(compose.desktop.linux_arm64) |
55 | 56 | currentOs() == OS.MAC -> implementation(compose.desktop.macos_x64) |
56 | 57 | else -> implementation(compose.desktop.currentOs) |
57 | 58 | } |
58 | 59 |
|
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) |
86 | 89 | } |
87 | 90 |
|
88 | 91 | fun currentOs(): OS { |
@@ -127,6 +130,13 @@ tasks.withType<JavaExec> { |
127 | 130 | }) |
128 | 131 | } |
129 | 132 |
|
| 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 | +} |
130 | 140 |
|
131 | 141 | compose.desktop { |
132 | 142 | application { |
@@ -203,7 +213,6 @@ tasks.getByName("compileTestKotlin").doLast { |
203 | 213 | generateKotlinFromRs() |
204 | 214 | } |
205 | 215 |
|
206 | | - |
207 | 216 | task("tasksList") { |
208 | 217 | println("Tasks") |
209 | 218 | tasks.forEach { |
|
0 commit comments