forked from ripmeapp2/ripme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
155 lines (133 loc) · 4.1 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// permits to start the build setting the javac release parameter, no parameter means build for java8:
// gradle clean build -PjavacRelease=8
// gradle clean build -PjavacRelease=17
val javacRelease = (project.findProperty("javacRelease") ?: "11") as String
plugins {
id("fr.brouillard.oss.gradle.jgitver") version "0.9.1"
id("jacoco")
id("java")
id("maven-publish")
kotlin("jvm") version "1.6.10"
id("org.jetbrains.compose") version "1.1.1"
}
repositories {
mavenLocal()
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
implementation("com.lmax:disruptor:3.4.4")
implementation("org.java-websocket:Java-WebSocket:1.5.2")
implementation("org.jsoup:jsoup:1.14.3")
implementation("org.json:json:20211205")
implementation("com.j2html:j2html:1.5.0")
implementation("commons-configuration:commons-configuration:1.10")
implementation("commons-cli:commons-cli:1.5.0")
implementation("commons-io:commons-io:2.11.0")
implementation("org.apache.httpcomponents:httpclient:4.5.13")
implementation("org.apache.httpcomponents:httpmime:4.5.13")
implementation("org.apache.logging.log4j:log4j-api:2.17.1")
implementation("org.apache.logging.log4j:log4j-core:2.17.1")
implementation("org.graalvm.js:js:22.0.0.2")
testImplementation(enforcedPlatform("org.junit:junit-bom:5.8.2"))
testImplementation("org.junit.jupiter:junit-jupiter")
implementation(compose.desktop.currentOs)
implementation(compose.materialIconsExtended)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.6.0")
}
compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
// targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "Ripme_Compose"
packageVersion = "1.0.0"
windows {
menu = true
// see https://wixtoolset.org/documentation/manual/v3/howtos/general/generate_guids.html
upgradeUuid = "61DAB35E-17CB-43B0-81D5-B30E1C0830FA"
}
}
}
}
group = "com.rarchives.ripme"
version = "1.7.94"
description = "ripme"
jgitver {
gitCommitIDLength = 8
nonQualifierBranches = "main,master"
useGitCommitID = true
}
tasks.compileJava {
options.release.set(Integer.parseInt(javacRelease))
}
tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest {
attributes["Main-Class"] = "com.rarchives.ripme.App"
attributes["Implementation-Version"] = archiveVersion
attributes["Multi-Release"] = "true"
}
// To add all of the dependencies otherwise a "NoClassDefFoundError" error
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.test {
testLogging {
showStackTraces = true
}
useJUnitPlatform {
// gradle-6.5.1 not yet allows passing this as parameter, so exclude it
excludeTags("flaky","slow")
includeEngines("junit-jupiter")
includeEngines("junit-vintage")
}
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}
tasks.register<Test>("testAll") {
useJUnitPlatform {
includeTags("any()", "none()")
}
}
tasks.register<Test>("testFlaky") {
useJUnitPlatform {
includeTags("flaky")
}
}
tasks.register<Test>("testSlow") {
useJUnitPlatform {
includeTags("slow")
}
}
tasks.register<Test>("testTagged") {
useJUnitPlatform {
includeTags("any()")
}
}
// make all archive tasks in the build reproducible
tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
tasks.jacocoTestReport {
dependsOn(tasks.test) // tests are required to run before generating the report
reports {
xml.required.set(false)
csv.required.set(false)
html.outputLocation.set(file("${buildDir}/jacocoHtml"))
}
}