-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
67 lines (54 loc) · 1.64 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
import java.net.URI
plugins {
java
kotlin("jvm") version "1.3.72"
}
group = "xyz.acrylicstyle"
version = "1.0"
repositories {
mavenCentral()
maven { url = URI("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
maven { url = URI("https://repo.acrylicstyle.xyz/") }
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
compileOnly("xyz.acrylicstyle.grid:grid-api:1.16.1-R0.1-SNAPSHOT")
compileOnly("xyz.acrylicstyle:api:0.5.14a")
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}
tasks {
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> {
from(configurations.getByName("implementation").apply{ isCanBeResolved = true }.map { if (it.isDirectory) it else zipTree(it) })
}
}