forked from MilkBowl/Vault
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
107 lines (88 loc) · 2.49 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
plugins {
id 'com.gradleup.shadow' version '8.3.1'
id 'maven-publish'
id 'java'
}
group = 'net.milkbowl'
version = '2.4.8'
description = project.name
// Set the project's language level
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
repositories {
// Maven repositories
mavenCentral()
mavenLocal()
// Local libraries
flatDir {
dirs 'libs'
}
maven {
name 'Sonatype Central'
url 'https://oss.sonatype.org/content/repositories/central'
}
maven {
name 'Sonatype Snapshots'
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
maven {
name 'Spigot Snapshots'
url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots'
content {
includeGroup 'org.bukkit'
includeGroup 'org.spigotmc'
}
}
}
dependencies {
// Spigot API - necessary for project
// Note: Keep the version at 1.20.3-R0.1-SNAPSHOT for Java 8 compatibility
// https://hub.spigotmc.org/nexus/content/repositories/snapshots
compileOnly group: 'org.spigotmc', name: 'spigot-api', version: '1.20.3-R0.1-SNAPSHOT'
// JetBrains Annotations - for code inspection and documentation
// https://mvnrepository.com/artifact/org.jetbrains/annotations
compileOnly group: 'org.jetbrains', name: 'annotations', version: '26.0.2'
// Lombok - for reducing boilerplate code
// https://projectlombok.org
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.36'
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.36'
}
tasks {
jar {
archiveFileName.set("${project.name}-${project.version}-default.jar")
}
shadowJar {
archiveFileName.set("${project.name}-${project.version}.jar")
enableRelocation = true
relocationPrefix = 'net.milkbowl.vault.shaded'
minimize()
}
compileJava {
dependsOn(clean)
options.encoding = 'UTF-8'
}
build {
dependsOn(shadowJar)
}
processResources {
filesMatching('**/plugin.yml') {
expand(project.properties)
}
}
tasks.register('sourceJar', Jar) {
from sourceSets.main.allJava
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'net.milkbowl.vault'
artifactId = project.name
version = project.version
from components.java
}
}
}