generated from sVoxelDev/spigot-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
130 lines (109 loc) · 3.92 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
127
128
129
130
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.0'
id 'kr.entree.spigradle' version '2.2.4'
id 'io.freefair.lombok' version '6.3.0'
id 'java'
id 'jacoco'
id 'idea'
}
apply from: "$rootDir/gradle/jacoco.gradle"
apply from: "$rootDir/gradle/publish.gradle"
if (project.hasProperty("local_script")) {
apply from: file(project.property("local_script") + "/build.local.gradle")
}
sourceCompatibility = 16
targetCompatibility = 16
ext {
mcVersion = project.property("mcVersion")
}
group project.property("group")
spigot {
name = project.property("pluginName")
authors = [project.property("author")] as List<String>
apiVersion = project.property("apiVersion")
load = STARTUP
depends = ['helper']
softDepends = ['Vault']
}
downloadPaper {
source.set('https://papermc.io/api/v2/projects/paper/versions/1.16.5/builds/794/downloads/paper-1.16.5-794.jar')
}
compileJava {
options.encoding = 'UTF-8'
options.compilerArgs += ["-parameters"]
options.fork = true
options.forkOptions.executable = 'javac'
}
javadoc {
options.encoding = 'UTF-8'
}
archivesBaseName = project.property("pluginName")
repositories {
mavenLocal()
mavenCentral()
maven { url = 'https://jitpack.io' }
maven { url = 'https://repo.aikar.co/content/groups/aikar/' }
maven { url = 'https://repo.dmulloy2.net/repository/public/' }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/public/' }
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url = 'https://papermc.io/repo/repository/maven-public/' }
maven { url = 'https://repo.lucko.me/' }
}
dependencies {
// using spigot-api
// implementation spigot(mcVersion)
// or using paper-api
// implementation "io.papermc.paper:paper-api:${mcVersion}-R0.1-SNAPSHOT"
implementation "com.destroystokyo.paper:paper-api:${mcVersion}-R0.1-SNAPSHOT"
// Add your dependencies here
// Here are some opinionated dependencies that might help you with your plugin development:
implementation "me.lucko:helper:5.6.9"
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
// Annotation Command Framework: https://github.com/aikar/commands
implementation "co.aikar:acf-paper:0.5.1-SNAPSHOT"
// Vault (https://github.com/MilkBowl/VaultAPI) for economy, permissions and chat API
implementation "com.github.MilkBowl:VaultAPI:1.7.1"
// Test dependencies
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
testImplementation 'org.mockito:mockito-core:4.3.1'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.17:1.13.0'
testImplementation 'org.assertj:assertj-core:3.22.0'
}
shadowJar {
archiveClassifier.set('')
minimize()
dependencies {
include(dependency('co.aikar:acf-paper:0.5.1-SNAPSHOT'))
// include(dependency('ccom.squareup.retrofit2:retrofit:2.9.0'))
include(dependency('com.squareup.retrofit2:.*'))
include(dependency('com.squareup.okhttp3:.*'))
include(dependency('com.squareup.okio:.*'))
// exclude(dependency('me.lucko:helper:5.6.9'))
// exclude(dependency('com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT'))
// exclude(dependency('com.github.MilkBowl:VaultAPI:1.7.1'))
}
relocate 'co.aikar.commands', "${packageName}.acf"
relocate 'co.aikar.locales', "${packageName}.locales"
}
tasks.build.dependsOn(shadowJar)
tasks.publish.dependsOn(shadowJar)
tasks.prepareSpigotPlugins.dependsOn(shadowJar)
test {
useJUnitPlatform()
testLogging {
events "skipped", "failed"
}
ignoreFailures = false
}
processResources {
project.properties.put("version", this.version)
expand project.properties
}
defaultTasks 'build'