generated from TobiasDeBruijn/BaseBukkitPlugin
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
164 lines (132 loc) · 4.56 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
import org.apache.tools.ant.filters.ReplaceTokens
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.0.0'
}
allprojects {
version = pluginVersion
group = 'dev.array21'
sourceCompatibility = 1.16
targetCompatibility = 1.16
repositories {
mavenLocal()
mavenCentral()
maven{ url "https://hub.spigotmc.org/nexus/content/repositories/snapshots" }
maven{ url "https://oss.sonatype.org/content/repositories/snapshots" }
maven {
name 'm2-dv8tion'
url 'https://m2.dv8tion.net/releases'
}
}
processResources {
from(sourceSets.main.resources.srcDirs) {
filter ReplaceTokens, tokens: [version: version]
}
}
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.17-R0.1-SNAPSHOT'
implementation 'dev.array21:httplib:1.2.2'
implementation 'dev.array21:classvalidator:1.0.1'
implementation 'dev.array21:bukkit-reflection-util:1.3.1'
// JDA and related dependencies
implementation 'org.slf4j:slf4j-log4j12:1.7.29'
implementation('net.dv8tion:JDA:4.2.1_266') {
exclude module: 'opus-java'
}
}
configurations.all {
// check for dependency updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
task testJar(type: ShadowJar) {
dependsOn('copyDependenciesDebug')
description 'Build a test Jar'
archiveClassifier = 'DEV'
from sourceSets.main.output
configurations = [project.configurations.runtimeClasspath]
destinationDirectory = file("$rootDir/server/plugins")
}
task releaseJar(type: ShadowJar) {
dependsOn('copyDependenciesRelease')
description 'Build a release Jar'
archiveClassifier = 'RELEASE'
from sourceSets.main.output
configurations = [project.configurations.runtimeClasspath]
destinationDirectory = file("$rootDir/releases")
}
task copyDependenciesDebug() {
dependsOn('copyLinuxLibraryDebugX86')
}
task copyDependenciesRelease() {
dependsOn('copyLinuxLibraryReleaseX86')
dependsOn('copyLinuxLibraryReleaseAarch64')
dependsOn('copyLinuxLibraryReleaseArmhf')
dependsOn('copyDarwinLibraryReleaseX86')
dependsOn('copyDarwinLibraryReleaseAarch64')
dependsOn('copyWindowsLibraryRelease')
}
// Linux X86 Xenial - Release
task copyLinuxLibraryReleaseX86(type: Copy) {
from "$rootDir/lib/target/x86_64-unknown-linux-gnu/release/libskinfixer.so"
into "$buildDir/resources/main/x86_64/linux"
}
// Linux Aarch64 - Release
task copyLinuxLibraryReleaseAarch64(type: Copy) {
from "$rootDir/lib/target/aarch64-unknown-linux-gnu/release/libskinfixer.so"
into "$buildDir/resources/main/aarch64/linux"
}
// Linux Armhf - Release
task copyLinuxLibraryReleaseArmhf(type: Copy) {
from "$rootDir/lib/target/arm-unknown-linux-gnueabihf/release/libskinfixer.so"
into "$buildDir/resources/main/armhf/linux"
}
// Darwin x86_64 - Release
task copyDarwinLibraryReleaseX86(type: Copy) {
from "$rootDir/lib/target/x86_64-apple-darwin/release/libskinfixer.dylib"
into "$buildDir/resources/main/x86_64/darwin"
}
// Darwin Aarch64 - Release
task copyDarwinLibraryReleaseAarch64(type: Copy) {
from "$rootDir/lib/target/aarch64-apple-darwin/release/libskinfixer.dylib"
into "$buildDir/resources/main/aarch64/darwin"
}
// Windows - Release
task copyWindowsLibraryDebug(type: Copy) {
from "$rootDir/lib/target/x86_64-pc-windows-gnu/debug/libskinfixer.dll"
into "$buildDir/resources/main/x86_64/windows"
}
// Linux X86 - Debug
task copyLinuxLibraryDebugX86(type: Copy) {
from "$rootDir/lib/target/x86_64-unknown-linux-gnu/debug/libskinfixer.so"
into "$buildDir/resources/main/x86_64/linux"
}
// Linux Aarch64 - Debug
task copyLinuxLibraryDebugAarch64(type: Copy) {
from "$rootDir/lib/target/aarch64-unknown-linux-gnu/debug/libskinfixer.so"
into "$buildDir/resources/main/aarch64/linux"
}
// Linux Armhf - Debug
task copyLinuxLibraryDebugArmhf(type: Copy) {
from "$rootDir/lib/target/arm-unknown-linux-gnueabihf/debug/libskinfixer.so"
into "$buildDir/resources/main/armhf/linux"
}
// Darwin x86_64 - Debug
task copyDarwinLibraryDebugX86(type: Copy) {
from "$rootDir/lib/target/x86_64-apple-darwin/debug/libskinfixer.dylib"
into "$buildDir/resources/main/x86_64/darwin"
}
// Darwin Aarch64 - Debug
task copyDarwinLibraryDebugAarch64(type: Copy) {
from "$rootDir/lib/target/aarch64-apple-darwin/debug/libskinfixer.dylib"
into "$buildDir/resources/main/aarch64/darwin"
}
// Windows - Debug
task copyWindowsLibraryRelease(type: Copy) {
from "$rootDir/lib/target/x86_64-pc-windows-gnu/release/libskinfixer.dll"
into "$buildDir/resources/main/x86_64/windows"
}