-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
122 lines (100 loc) · 3.4 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import java.io.BufferedWriter
import java.io.FileInputStream
import java.io.FileWriter
import java.util.Properties
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.jetbrains.kotlin.jvm") version "1.7.20"
id("org.jetbrains.compose") version "1.4.0"
jacoco
}
val appVersion = "1.1.0"
group = "com.github.ai.autokpass"
version = appVersion
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
tasks.test {
useJUnitPlatform()
finalizedBy("jacocoTestReport")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
tasks.jacocoTestReport {
reports {
val coverageDir = File("$buildDir/reports/coverage")
csv.required.set(true)
csv.outputLocation.set(File(coverageDir, "coverage.csv"))
html.required.set(true)
html.outputLocation.set(coverageDir)
}
classDirectories.setFrom(
classDirectories.files.map {
fileTree(it).matching {
exclude("com/github/ai/autokpass/di/**")
}
}
)
dependsOn(allprojects.map { it.tasks.named<Test>("test") })
}
tasks.classes {
dependsOn("createPropertyFileWithVersion")
}
tasks.register("createPropertyFileWithVersion") {
doLast {
val propertyName = "version"
val propsFile = File("$projectDir/src/main/resources/version.properties")
val props = Properties()
if (propsFile.exists()) {
props.load(FileInputStream(propsFile))
}
if (props[propertyName] != appVersion) {
project.logger.lifecycle("Updating file: version.properties")
props[propertyName] = appVersion
props.store(BufferedWriter(FileWriter(propsFile)), "File is generated by Gradle")
}
}
}
compose.desktop {
application {
mainClass = "com.github.ai.autokpass.MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
modules("java.instrument", "jdk.unsupported", "java.naming")
packageName = "autokpass"
packageVersion = appVersion
}
}
}
dependencies {
// Test
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.5.2")
testImplementation("io.kotest:kotest-assertions-core-jvm:5.5.3")
testImplementation("io.mockk:mockk:1.12.3")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
// Kotlin
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.7.3")
// Compose
implementation(compose.desktop.currentOs)
implementation(compose.materialIconsExtended)
// Navigation
implementation("com.arkivanov.decompose:decompose:1.0.0")
implementation("com.arkivanov.decompose:extensions-compose-jetbrains:1.0.0")
// DI
implementation("io.insert-koin:koin-core:3.1.5")
// Logging
implementation("ch.qos.logback:logback-core:1.3.5")
implementation("ch.qos.logback:logback-classic:1.3.5")
// Keepass
implementation("com.github.anvell:kotpass:0.4.9")
// Other
implementation("org.buildobjects:jproc:2.8.0")
implementation("org.jetbrains.kotlinx:kotlinx-cli:0.3.4")
implementation("com.github.aivanovski:fzf4j:0.2.1")
}