-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
126 lines (107 loc) · 2.77 KB
/
build.gradle
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
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.7.20'
id 'application'
id("com.github.johnrengelman.shadow") version "7.1.2"
id 'idea'
id("io.github.patrick.remapper") version "1.3.0"
}
group = 'sk.ignissak'
def currentVersion = '1.0.0'
def target = 17
java {
def javaVersion = JavaVersion.toVersion(target)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(target)
}
}
tasks.withType(JavaCompile).configureEach {
if (target >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = target
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
project.setProperty('mainClassName', 'sk.ignissak.mobsurvival.Main')
shadowJar {
archiveBaseName.set('mobsurvival')
archiveClassifier.set('')
archiveVersion.set(currentVersion)
dependencies {
exclude(dependency("org.jetbrains.kotlin:kotlin-stdlib"))
exclude("kotlin")
}
}
clean { delete "./build" }
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
task generateJavadocs(type: Javadoc) {
source = sourceSets.main.allJava
classpath = sourceSets.main.compileClasspath
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
tasks {
remap {
version.set("1.19.2")
}
}
repositories {
mavenCentral()
mavenLocal()
maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
// As of Gradle 5.1, you can limit this to only those
// dependencies you expect from it
content {
includeGroup 'org.bukkit'
includeGroup 'org.spigotmc'
}
}
maven {
url "https://gitlab.com/api/v4/groups/craftmania/-/packages/maven"
name "GitLab"
credentials(HttpHeaderCredentials) {
name = 'Private-Token'
value = GITLAB_TOKEN
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
dependencies {
compileOnly ('org.spigotmc:spigot-api:1.19.2-R0.1-SNAPSHOT')
compileOnly ('org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT:remapped-mojang')
compileOnly 'cz.craftmania.craftcore:craftcore:2.9'
}
compileKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
build.dependsOn shadowJar
task compileAndRemap {
dependsOn 'clean'
dependsOn 'shadowJar'
dependsOn 'remap'
tasks.findByName('remap').mustRunAfter 'shadowJar'
}