-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
193 lines (163 loc) · 4.64 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
buildscript {
apply plugin: 'java'
repositories {
mavenCentral()
jcenter()
maven {
name = "gt"
url = "https://gregtech.overminddl1.com/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url = "https://plugins.gradle.org/m2/"
}
}
}
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
}
}
apply plugin: 'eclipse'
eclipse {
classpath {
downloadJavadoc = true
downloadSources = true
}
}
apply plugin: 'idea'
idea{
module {
downloadJavadoc = true
downloadSources = true
}
}
repositories {
mavenCentral()
jcenter()
maven {
name = "gt"
url = "https://gregtech.overminddl1.com/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
group = "net.alkalus"
archivesBaseName = "AlkLib"
version = "<UNKNOWN>"
//Compile against UTF-8
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava {
options.bootClasspath = org.gradle.internal.jvm.Jvm.current().getJre().getHomeDir().toString() +"/lib/rt.jar"
}
configurations {
shade
compile.extendsFrom shade
}
sourceSets {
main {
java { srcDirs = ["$projectDir/src/main/java"] }
resources { srcDirs = ["$projectDir/src/main/resources"] }
}
}
dependencies {
//compile fileTree(dir: 'libs', include: '*.jar')
// https://mvnrepository.com/artifact/org.ow2.asm/asm
compile 'org.ow2.asm:asm:5.0.3'
// https://mvnrepository.com/artifact/com.google.guava/guava
compile 'com.google.guava:guava:17.0'
// https://mvnrepository.com/artifact/com.google.code.gson/gson
compile 'com.google.code.gson:gson:2.2.4'
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api
compile 'org.apache.logging.log4j:log4j-api:2.0-beta9'
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core
compile 'org.apache.logging.log4j:log4j-core:2.0-beta9'
// https://mvnrepository.com/artifact/org.apache.commons/commons-math3
shade 'org.apache.commons:commons-math3:3.6.1'
// https://mvnrepository.com/artifact/org.apache.commons/commons-configuration2
shade 'org.apache.commons:commons-configuration2:2.4'
// https://mvnrepository.com/artifact/org.apache.commons/commons-collections4
shade 'org.apache.commons:commons-collections4:4.3'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
compile 'org.apache.httpcomponents:httpclient:4.3.3'
// https://mvnrepository.com/artifact/commons-logging/commons-logging
compile 'commons-logging:commons-logging:1.1.3'
// https://mvnrepository.com/artifact/commons-io/commons-io
compile 'commons-io:commons-io:2.4'
// https://mvnrepository.com/artifact/commons-codec/commons-codec
compile 'commons-codec:commons-codec:1.9'
// https://mvnrepository.com/artifact/commons-net/commons-net
shade 'commons-net:commons-net:3.6'
}
task buildInfo {
def matcher = "v6.[0-9]*"
def cmdTag = "git describe --match ${matcher} --abbrev=0 --exact-match --dirty"
def procTag = cmdTag.execute()
procTag.waitFor()
if (procTag.exitValue() == 0) {
ext.isRelease = true
ext.tag = "${procTag.text.trim().substring(1)}" // Full Release
ext.version = ext.tag
} else {
ext.isRelease = false
def cmdLat = "git describe --match ${matcher} --dirty"
def procLat = cmdLat.execute()
procLat.waitFor()
if (procLat.exitValue() == 0) {
ext.tag = procLat.text.trim().substring(1)
} else {
def cmdDes = "git describe --dirty"
def procDes = cmdDes.execute()
procDes.waitFor()
if (procDes.exitValue() == 0) {
ext.tag = "DEV-${procDes.text.trim()}"
} else {
ext.tag = "NOGIT" // No tags at all?!
}
}
if (System.getenv().VERSION_FALLBACK != null) {
ext.version = System.getenv().VERSION_FALLBACK
} else {
ext.version = ext.tag
}
}
}
if (System.getenv().ARTIFACT_VERSION == null) {
version = "${project.buildInfo.version}"
} else {
version = "${System.getenv().ARTIFACT_VERSION}"
}
sourceSets.main.java.srcDir "$buildDir/generated-source/java"
task wrapper(type: Wrapper) {
gradleVersion = '3.5.1'
}
jar {
configurations.shade.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
}
task sourceJar(type: Jar) {
manifest {}
classifier = 'sources'
from sourceSets.main.allSource
exclude 'assets/**', 'logos/**'
}
task changelog(type: Copy) {
from('./CHANGELOG.md') {
rename '.*', "$archivesBaseName-$version-changelog.md"
}
into './build/libs'
ext.output = new File("./build/libs/$archivesBaseName-$version-changelog.md")
}
jar.dependsOn changelog