forked from plasmoapp/plasmo-voice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
119 lines (98 loc) · 2.95 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
import java.io.ByteArrayOutputStream
// Version
val targetJavaVersion: String by rootProject
val mavenGroup: String by rootProject
val buildVersion: String by rootProject
plugins {
java
idea
alias(libs.plugins.shadow)
alias(libs.plugins.idea.ext)
kotlin("jvm") version "1.6.10"
id("gg.essential.multi-version.root") apply false
}
subprojects {
if (project.buildFile.name.equals("root.gradle.kts")) return@subprojects
apply(plugin = "java")
apply(plugin = "idea")
apply(plugin = "maven-publish")
apply(plugin = "com.github.johnrengelman.shadow")
group = mavenGroup
if (buildVersion.contains("+") && !project.parent?.name.equals("api")) {
val gitCommitHash: String = ByteArrayOutputStream().use { outputStream ->
rootProject.exec {
commandLine("git")
.args("rev-parse", "--verify", "--short", "HEAD")
standardOutput = outputStream
}
outputStream.toString().trim()
}
version = "$buildVersion+$gitCommitHash"
} else {
version = buildVersion
}
dependencies {
compileOnly(rootProject.libs.annotations)
compileOnly(rootProject.libs.guava)
compileOnly(rootProject.libs.gson)
compileOnly(rootProject.libs.log4j)
compileOnly(rootProject.libs.lombok)
annotationProcessor(rootProject.libs.lombok)
testCompileOnly(rootProject.libs.junit.api)
testAnnotationProcessor(rootProject.libs.junit.api)
testRuntimeOnly(rootProject.libs.junit.engine)
testImplementation(rootProject.libs.guava)
testImplementation(rootProject.libs.gson)
testImplementation(rootProject.libs.log4j)
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
tasks {
java {
withJavadocJar()
withSourcesJar()
toolchain.languageVersion.set(JavaLanguageVersion.of(targetJavaVersion))
}
compileJava {
options.encoding = Charsets.UTF_8.name()
}
javadoc {
options.encoding = Charsets.UTF_8.name()
}
processResources {
filteringCharset = Charsets.UTF_8.name()
}
// jar {
// archiveClassifier.set("dev")
// }
//
// shadowJar {
// configurations = listOf(project.configurations.shadow.get())
// archiveClassifier.set("dev-shadow")
// }
//
// build {
// dependsOn.add(shadowJar)
// }
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.plo.su")
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
}
}
tasks {
build {
doLast {
jar.get().archiveFile.get().asFile.delete()
}
}
}