This repository has been archived by the owner on Mar 15, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
115 lines (93 loc) · 2.78 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
buildscript {
repositories {
jcenter()
mavenCentral()
}
}
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'kr.entree.spigradle' version '2.2.3'
id 'io.freefair.lombok' version '5.3.0'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext {
mcVersion = project.property("minecraft.version")
}
group project.property("plugin.group")
archivesBaseName = project.property("plugin.name")
spigot {
name = project.property("plugin.name")
authors = [project.property("plugin.author")]
apiVersion = project.property("api.version")
version = project.property("plugin.version")
load = STARTUP
// depends = ['']
debug {
buildVersion = project.property("minecraft.version")
}
}
repositories {
mavenCentral()
jcenter()
papermc()
spigot()
jitpack()
maven { url "https://libraries.minecraft.net" }
maven { url = "https://repo.aikar.co/content/groups/aikar/" }
maven { url = "https://hub.spigotmc.org/nexus/content/groups/public/" }
}
def urlFile = { url, name ->
File file = new File("$buildDir/download/${name}.jar")
file.parentFile.mkdirs()
if (!file.exists()) {
new URL(url).withInputStream { downloadStream ->
file.withOutputStream { fileOut ->
fileOut << downloadStream
}
}
}
files(file.absolutePath)
}
dependencies {
// Game core
compileOnly spigot(project.property("minecraft.version"))
// Tests
testImplementation 'org.junit.jupiter:junit-jupiter:5.+'
testImplementation "org.mockito:mockito-core:3.+"
testImplementation mockBukkit()
testImplementation 'org.assertj:assertj-core:3.+'
// Command parsing
compile 'com.mojang:brigadier:1.0.17'
compile "co.aikar:acf-paper:0.5.0-SNAPSHOT"
// https://mvnrepository.com/artifact/commons-io/commons-io
compile group: 'commons-io', name: 'commons-io', version: '2.8.0'
// JSON handler
implementation 'com.google.code.gson:gson:2.8.6'
}
shadowJar {
classifier = ''
version = project.property("plugin.version")
relocate 'co.aikar.commands', "${project.property('plugin.group')}.${project.property('plugin.name')}.acf"
relocate 'co.aikar.locales', "${project.property('plugin.group')}.${project.property('plugin.name')}.locales"
}
tasks.build.dependsOn(shadowJar)
tasks.prepareSpigotPlugins.dependsOn(shadowJar)
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
ignoreFailures = false
}
processResources {
project.properties.put("version", this.version)
expand project.properties
}
compileJava {
options.compilerArgs += ["-parameters"]
options.fork = true
options.forkOptions.executable = 'javac'
}
defaultTasks 'build'