-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathbuild.gradle
90 lines (69 loc) · 1.75 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
plugins {
id 'java'
}
defaultTasks 'build'
group 'org.hurricanegames'
version '3.0'
import java.nio.file.Path
import java.nio.file.Paths
import java.nio.file.Files
Path projectDirectoryPath = projectDir.toPath().toAbsolutePath()
sourceCompatibility = JavaVersion.VERSION_1_8
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['resources']
}
}
test {
java {
srcDirs = ['tests']
}
}
}
repositories {
mavenCentral()
jcenter()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url 'https://papermc.io/repo/repository/maven-public/'
}
maven {
url 'https://maven.enginehub.org/repo/'
}
maven {
url 'https://jitpack.io'
}
}
dependencies {
compileOnly group: 'com.destroystokyo.paper', name: 'paper-api', version: '1.16.1-R0.1-SNAPSHOT'
compileOnly group: 'com.github.MilkBowl', name: 'VaultAPI', version: '1.7'
compileOnly group: 'com.sk89q.worldedit', name: 'worldedit-core', version: '7.2.0-SNAPSHOT'
compileOnly group: 'com.sk89q.worldedit', name: 'worldedit-bukkit', version: '7.2.0-SNAPSHOT'
compileOnly group: 'com.sk89q.worldguard', name: 'worldguard-bukkit', version: '7.0.4-SNAPSHOT'
}
compileJava {
options.encoding = 'UTF-8'
options.incremental = false
}
jar {
from sourceSets.main.java.srcDirs
from 'LICENSE'
archiveName = jar.archiveName
}
task copyFinalJarToTarget(type: DefaultTask) {doLast{
Path targetJarDirectory = projectDirectoryPath.resolve("target")
Files.createDirectories(targetJarDirectory)
java.nio.file.Files.copy(
jar.archivePath.toPath().toAbsolutePath(),
targetJarDirectory.resolve(jar.baseName + '.jar'),
java.nio.file.StandardCopyOption.REPLACE_EXISTING
)
}}
compileJava.dependsOn(clean)
jar.finalizedBy(copyFinalJarToTarget)