forked from Mojang/DataFixerUpper
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
212 lines (191 loc) · 7.33 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
import groovy.io.FileType
import com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider
import com.amazonaws.services.s3.AmazonS3Client
apply plugin: 'java-library'
apply plugin: 'maven-publish'
group = 'com.mojang'
version = project.hasProperty('buildNumber') ? "${project.majorMinor}.${project.buildNumber}" : "${project.majorMinor}.0-SNAPSHOT"
task wrapper(type: Wrapper) {
gradleVersion = '4.0'
}
buildscript {
repositories {
mavenCentral()
maven {
url "https://libraries.minecraft.net"
}
}
dependencies {
classpath 'com.amazonaws:aws-java-sdk:1.11.33'
}
}
repositories {
maven {
url "https://libraries.minecraft.net"
}
mavenCentral()
maven {
url "https://jitpack.io"
}
}
configurations {
jaxDoclet
}
dependencies {
compile 'com.google.code.findbugs:jsr305:2.0.1'
compile 'com.google.code.gson:gson:2.8.0'
compile 'org.apache.logging.log4j:log4j-api:2.8.1'
compile 'com.google.guava:guava:21.0'
compile 'org.apache.commons:commons-lang3:3.5'
compile 'it.unimi.dsi:fastutil:7.1.0'
testCompile 'junit:junit-dep:4.10'
jaxDoclet 'com.github.kvverti:dfu-jd-doclet:2.2.1'
}
javadoc {
options {
docletpath = configurations.jaxDoclet.files as List
doclet = "com.outerthoughts.html5doclet.standard.Standard"
overview = "src/main/resources/overview.html"
}
((StandardJavadocDocletOptions)options).links = [
"https://docs.oracle.com/javase/8/docs/api/",
"https://javadoc.io/doc/com.google.code.findbugs/jsr305/3.0.2/",
"https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.0/",
"https://logging.apache.org/log4j/2.x/log4j-api/apidocs/",
"https://guava.dev/releases/21.0/api/docs/",
"https://commons.apache.org/proper/commons-lang/javadocs/api-3.5/"
]
((StandardJavadocDocletOptions)options).tags = [
"apiNote:a:API Note:",
"implSpec:a:Implementation Requirements:",
"implNote:a:Implementation Note:",
"param",
"return",
"throws",
"since",
"version",
"serialData",
"see"
]
((CoreJavadocOptions)options).addMultilineMultiValueOption("shape").setValue([
["java.util.function.BiConsumer", "(%0,%1) %.->. void"],
["java.util.function.BiFunction", "(%0,%1) %.->. %2"],
["java.util.function.BinaryOperator", "(%0,%0) %.->. %0"],
["java.util.function.BooleanSupplier", "%.by-name. boolean"],
["java.util.function.Consumer", "(%0) %.->. void"],
["java.util.function.DoubleBinaryOperator", "(double, double) %.->. double"],
["java.util.function.DoubleConsumer", "(double) %.->. void"],
["java.util.function.DoubleFunction", "(double) %.->. %0"],
["java.util.function.DoublePredicate", "(double) %.->. boolean"],
["java.util.function.DoubleSupplier", "%.by-name. double"],
["java.util.function.DoubleToIntFunction", "(double) %.->. int"],
["java.util.function.DoubleToLongFunction", "(double) %.->. long"],
["java.util.function.DoubleUnaryOperator", "(double) %.->. double"],
["java.util.function.Function", "(%0) %.->. %1"],
["java.util.function.IntBinaryOperator", "(int,int) %.->. int"],
["java.util.function.IntConsumer", "(int) %.->. void"],
["java.util.function.IntFunction", "(int) %.->. %0"],
["java.util.function.IntPredicate", "(int) %.->. boolean"],
["java.util.function.IntSupplier", "%.by-name. int"],
["java.util.function.IntToDoubleFunction", "(int) %.->. double"],
["java.util.function.IntToLongFunction", "(int) %.->. long"],
["java.util.function.IntUnaryOperator", "(int) %.->. int"],
["java.util.function.LongBinaryOperator", "(long,long) %.->. long"],
["java.util.function.LongConsumer", "(long) %.->. void"],
["java.util.function.LongFunction", "(long) %.->. %0"],
["java.util.function.LongPredicate", "(long) %.->. boolean"],
["java.util.function.LongSupplier", "%.by-name. long"],
["java.util.function.LongToDoubleFunction", "(long) %.->. double"],
["java.util.function.LongToIntFunction", "(long) %.->. int"],
["java.util.function.LongUnaryOperator", "(long) %.->. long"],
["java.util.function.ObjDoubleConsumer", "(%0,double) %.->. void"],
["java.util.function.ObjIntConsumer", "(%0,int) %.->. void"],
["java.util.function.ObjLongConsumer", "(%0,long) %.->. void"],
["java.util.function.Predicate", "(%0) %.->. boolean"],
["java.util.function.Supplier", "%.by-name. %0"],
["java.util.function.ToDoubleBiFunction", "(%0,%1) %.->. double"],
["java.util.function.ToDoubleFunction", "(%0) %.->. double"],
["java.util.function.ToIntBiFunction", "(%0,%1) %.->. int"],
["java.util.function.ToIntFunction", "(%0) %.->. int"],
["java.util.function.ToLongBiFunction", "(%0,%1) %.->. long"],
["java.util.function.ToLongFunction", "(%0) %.->. long"],
["java.util.function.UnaryOperator", "(%0) %.->. %0"],
])
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
sourceSets {
main {
java {
srcDirs = ['src/main/java']
}
resources {
srcDirs = ['src/main/resources']
}
}
test {
java {
srcDirs = ['src/test/java']
}
resources {
srcDirs = ['src/test/resources']
}
}
}
artifacts {
archives jar
archives sourcesJar
}
test {
testLogging {
events "failed", "skipped"
showStandardStreams = true
showExceptions true
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
}
}
}
task report {
doLast {
println "##teamcity[buildNumber '${project.version}']"
}
}
def publishDir = file("$buildDir/repo")
def uploadFile(s3, bucket, path, filename) {
println "Uploading $filename to $bucket as $path"
s3.putObject(bucket, path, filename)
}
clean.doLast {
delete publishDir
}
if (version.endsWith("SNAPSHOT")) {
publishing.repositories {
mavenLocal()
}
} else {
publishing.repositories {
maven {
url "$buildDir/repo"
}
}
publish.doLast {
def AWSRoleARN = (System.getenv("AWS_ROLE_ARN") != null && System.getenv("AWS_ROLE_ARN") != "" ? System.getenv("AWS_ROLE_ARN") : null)
if (AWSRoleARN == null) throw new GradleException("AWS Role has not been configured, use the `AWS_ROLE_ARN` environment variable")
def auth = new STSAssumeRoleSessionCredentialsProvider.Builder(AWSRoleARN, "DataFixerUpperPublish").build()
def s3 = new AmazonS3Client(auth)
publishDir.eachFileRecurse {
if (!it.name.contains(".xml") && !it.name.contains(".md5") && it.isFile()) {
def relPath = publishDir.toPath().relativize(it.toPath()).toFile().toString().replaceAll('\\\\', '/')
uploadFile(s3, "minecraft-libraries", relPath, it)
}
}
}
}