forked from EngineHub/CraftBook
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
189 lines (168 loc) · 5.77 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
186
187
188
189
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
*******************************************
"""
buildscript {
repositories {
mavenCentral()
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
configurations.all {
resolutionStrategy {
force 'com.google.guava:guava:21.0'
}
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:4.0.3"
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5'
classpath 'org.ajoberstar:gradle-git:1.7.2'
}
}
if (!project.hasProperty("artifactory_contextUrl")) ext.artifactory_contextUrl = "http://localhost"
if (!project.hasProperty("artifactory_user")) ext.artifactory_user = "guest"
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'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.jfrog.artifactory'
group = pluginGroup
version = pluginVersion
ext.internalVersion = version + ";" + gitCommitHash
sourceCompatibility = 1.8
targetCompatibility = 1.8
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 = 'http://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'
}
}
dependencies {
compile 'org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT'
compile 'com.sk89q.worldedit:worldedit-core:7.1.0-SNAPSHOT'
compile 'com.sk89q.worldedit:worldedit-bukkit:7.1.0-SNAPSHOT'
compile 'com.sk89q.worldguard:worldguard-core:7.0.0-SNAPSHOT'
compile 'com.sk89q.worldguard:worldguard-legacy:7.0.0-SNAPSHOT'
compile "io.papermc:paperlib:1.0.2"
compile 'com.sk89q:squirrelid:0.1.0'
compile 'com.github.MilkBowl:VaultAPI:1.7'
compile 'com.comphenix.protocol:ProtocolLib:4.5.0'
compile 'fr.neatmonster:nocheatplus:3.15.1-RC'
compile 'org.bstats:bstats-bukkit:1.7'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.powermock', name: 'powermock-api-mockito', version: '1.6.1'
testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: '1.6.1'
}
if (JavaVersion.current().isJava8Compatible()) {
// Java 8 turns on doclint which we fail
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives shadowJar
archives sourcesJar
archives javadocJar
}
build.dependsOn(sourcesJar)
build.dependsOn(javadocJar)
jar {
manifest {
attributes("Class-Path": "CraftBook/WorldEdit.jar lib/WorldEdit.jar ../lib/WorldEdit.jar ../WorldEdit.jar",
"WorldEdit-Version": version)
}
}
shadowJar {
classifier 'dist'
dependencies {
include(dependency('io.papermc:paperlib'))
include(dependency('com.sk89q:squirrelid'))
relocate ("org.bstats", "com.sk89q.craftbook.bukkit.bstats") {
include(dependency("org.bstats:bstats-bukkit:1.7"))
}
}
relocate 'com.sk89q.squirrelid', 'com.sk89q.craftbook.util.profile'
relocate 'io.papermc.lib', 'com.sk89q.craftbook.bukkit.paperlib'
exclude 'GradleStart**'
exclude '.cache'
exclude 'LICENSE*'
}
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = project.version.contains("SNAPSHOT") ? 'libs-snapshot-local' : 'libs-release-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
resolve {
repository {
repoKey = 'repo'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
}
processResources {
from (sourceSets.main.resources.srcDirs) {
expand 'internalVersion': project.internalVersion
include 'plugin.yml'
}
from (sourceSets.main.resources.srcDirs) {
exclude 'plugin.yml'
}
}
}