-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
148 lines (121 loc) · 3.65 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
plugins {
id 'java'
id 'maven'
id 'idea'
id 'eclipse'
id 'com.github.johnrengelman.shadow' version '2.0.2'
}
configurations {
deployerJars
}
repositories {
mavenCentral()
maven {
name = 'FTB'
url = 'http://ftb.cursecdn.com/FTB2/maven'
}
}
dependencies {
compile 'com.google.code.gson:gson:2.2.4'//JSON support
compile 'com.squareup.okhttp3:okhttp:3.4.1'
//these are versions used by minecraft which is one of the known planned uses of this library
compile 'commons-io:commons-io:2.4'//general utility classes
compile 'org.apache.commons:commons-lang3:3.3.2'
compile 'com.google.guava:guava:17.0'//general utility classes
compile 'com.google.code.findbugs:jsr305:1.3.9'//nonnull stuff
compile 'org.apache.commons:commons-compress:1.8.1'//bz2 decompression
compile 'org.projectlombok:lombok:1.16.8'
compile 'org.slf4j:slf4j-api:1.7.21'
compile 'org.isomorphism:token-bucket:1.6' //rate limiting
runtime 'org.slf4j:slf4j-simple:1.7.21'
compile 'org.javers:javers-core:3.7.8'
// test frameworks
testCompile 'junit:junit:4.12'
testCompile 'uk.co.datumedge:hamcrest-json:0.2'
testCompile 'org.powermock:powermock-module-junit4:1.6.3'
testCompile 'org.powermock:powermock-api-mockito:1.6.3'
testCompile 'org.powermock:powermock-module-junit4-rule-agent:1.6.3'
testCompile 'org.openjdk.jmh:jmh-core:1.12'
testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.12'
testCompile 'com.squareup.okhttp3:mockwebserver:3.4.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
deployerJars 'org.apache.maven.wagon:wagon-ssh:2.2'
}
project.ext {
currentYear = '2018'
}
if (System.getenv().BUILD_NUMBER != null) {
ext.buildNum = System.getenv().BUILD_NUMBER
} else {
ext.buildNum = "9999999"
}
group = 'com.feed_the_beast'
version = "0.0.1.${project.buildNum}"
description = "Java CurseForge library"
sourceCompatibility = 1.8
targetCompatibility = 1.8
shadowJar {
dependencies {
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
exclude dependency('org.projectlombok:lombok')
}
classifier = 'all'
}
build.dependsOn(shadowJar)
jar {
manifest {
attributes 'Launcher-Jenkins': project.buildNum
}
}
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task sourceJar(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 jar
archives sourceJar
archives javadocJar
}
def gitSha() {
return 'git rev-parse HEAD'.execute().text.trim()
}
if (project.hasProperty("local_maven")) {
apply plugin: 'maven'
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file://${local_maven}")
}
}
}
}
if (project.hasProperty("remote_maven") && project.hasProperty("sftp_pass")) {
apply plugin: 'maven'
uploadArchives {
repositories.mavenDeployer {
configuration = configurations.deployerJars
repository(url: "sftp://${remote_maven}") {
authentication(userName: "${ftp_username}", password: "${sftp_pass}")
}
}
}
}
task dependencySizes << {
def size = 0
configurations.compile.files.each { file ->
println file.getName() + " " + file.size() + " bytes"
size += file.size()
}
println "Dependencies size: $size bytes"
}