-
-
Notifications
You must be signed in to change notification settings - Fork 163
/
build.gradle
185 lines (165 loc) · 5.73 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
buildscript {
ext {
asmAsmVersion = "9.6" // https://gitlab.ow2.org/asm/asm/-/tags
}
configurations {
classpath {
resolutionStrategy {
//in order to handle jackson's higher release version in shadow, this needs to be upgraded to latest.
force(group: "org.ow2.asm", name: "asm", version: asmAsmVersion)
force(group: "org.ow2.asm", name: "asm-commons", version: asmAsmVersion)
}
}
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id "com.jfrog.artifactory" version "5.2.2"
}
println """
*******************************************
You are building CraftBook!
If you encounter trouble:
1) Read CONTRIBUTING.md if you haven't yet
2) Try running 'build' in a separate Gradle run
3) Use gradlew and not gradle
4) If you still need help, ask on IRC! irc.esper.net #sk89q
Output files will be in [subproject]/build/libs
*******************************************
"""
if (!project.hasProperty("artifactory_contextUrl")) ext.artifactory_contextUrl = ""
if (!project.hasProperty("artifactory_user")) ext.artifactory_user = ""
if (!project.hasProperty("artifactory_password")) ext.artifactory_password = ""
if (!project.hasProperty("gitCommitHash")) {
try {
def repo = org.ajoberstar.grgit.Grgit.open(project.file('.'))
ext.gitCommitHash = repo.head().abbreviatedId
} catch (Exception e) {
ext.gitCommitHash = "no_git_id"
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
group = pluginGroup
version = pluginVersion
ext.internalVersion = version + ";" + gitCommitHash
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
withJavadocJar()
withSourcesJar()
}
tasks.test {
// FIXME: Obviously, this isn't what we want
enabled = false
}
repositories {
mavenLocal()
mavenCentral()
maven {
name = 'spigotmc-repo'
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
name = 'enginehub-repo'
url = 'https://maven.enginehub.org/repo/'
}
maven {
name = 'md_5-rep'
url = 'https://repo.md-5.net/content/repositories/releases/'
}
maven {
name = 'Vault Repo'
url = 'https://jitpack.io'
}
maven {
name = 'Dmulloy2 Repo'
url = 'https://repo.dmulloy2.net/nexus/repository/public/'
}
maven {
name = 'Destroystokyo Repo'
url = 'https://repo.destroystokyo.com/repository/maven-public/'
}
maven {
name = 'bstats repo'
url = 'https://repo.codemc.org/repository/maven-public'
}
maven {
name "papermc"
url "https://papermc.io/repo/repository/maven-public/"
}
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.21.3-R0.1-SNAPSHOT'
compileOnly 'com.sk89q.worldedit:worldedit-core:7.3.8-SNAPSHOT'
compileOnly 'com.sk89q.worldedit:worldedit-bukkit:7.3.8-SNAPSHOT'
compileOnly 'com.sk89q.worldguard:worldguard-core:7.0.11'
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.11'
compileOnly 'com.github.MilkBowl:VaultAPI:1.7'
compileOnly 'com.comphenix.protocol:ProtocolLib:5.3.0'
compileOnly 'fr.neatmonster:nocheatplus:3.15.1-RC'
implementation 'com.sk89q:squirrelid:0.1.0'
implementation "io.papermc:paperlib:1.0.7"
implementation 'org.bstats:bstats-bukkit:2.2.1'
testImplementation 'org.spigotmc:spigot-api:1.21.3-R0.1-SNAPSHOT'
testImplementation 'com.sk89q.worldedit:worldedit-core:7.3.8-SNAPSHOT'
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'org.powermock', name: 'powermock-api-mockito', version: '1.7.4'
testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: '1.7.4'
}
if (JavaVersion.current().isJava8Compatible()) {
// Java 8 turns on doclint which we fail
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
jar {
manifest {
attributes("CraftBook-Version": pluginVersion)
}
}
shadowJar {
archiveClassifier.set('dist')
dependencies {
include(dependency('io.papermc:paperlib'))
include(dependency('com.sk89q:squirrelid'))
include(dependency("org.bstats:"))
}
relocate 'org.bstats', 'com.sk89q.craftbook.bukkit.bstats'
relocate 'com.sk89q.squirrelid', 'com.sk89q.craftbook.util.profile'
relocate 'io.papermc.lib', 'com.sk89q.craftbook.bukkit.paperlib'
exclude 'GradleStart**'
exclude '.cache'
exclude 'LICENSE*'
}
build.dependsOn(shadowJar)
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = project.version.contains("SNAPSHOT") ? 'libs-snapshot-local' : 'libs-release-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
}
defaults {
publications("mavenJava")
}
}
}
processResources {
duplicatesStrategy DuplicatesStrategy.INCLUDE
from (sourceSets.main.resources.srcDirs) {
expand 'internalVersion': project.internalVersion
include 'plugin.yml'
}
}
}