-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
64 lines (52 loc) · 1.55 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
plugins {
kotlin("jvm") version "1.5.31"
}
group = "xyz.acrylicstyle"
version = "1.0.11"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib"))
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}
tasks {
test {
useJUnitPlatform()
}
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs = listOf(
"-Xjsr305=strict"
)
}
withType<JavaCompile>().configureEach {
options.encoding = "utf-8"
}
withType<ProcessResources> {
filteringCharset = "UTF-8"
from(sourceSets.main.get().resources.srcDirs) {
include("**")
val tokenReplacementMap = mapOf(
"version" to project.version,
"name" to project.rootProject.name
)
filter<org.apache.tools.ant.filters.ReplaceTokens>("tokens" to tokenReplacementMap)
}
from(projectDir) {
include("LICENSE")
}
}
withType<Jar> {
doFirst {
manifest {
manifest.attributes["Main-Class"] = "xyz.acrylicstyle.unusedCommentRemover.Main"
}
}
from(configurations.getByName("implementation").apply { isCanBeResolved = true }.map { if (it.isDirectory) it else zipTree(it) })
}
}