forked from Shevchik/Chairs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
95 lines (76 loc) · 1.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
buildscript {
dependencies {
classpath 'org.jdom:jdom2:2.0.6'
classpath 'org.ow2.asm:asm:5.1'
classpath 'org.ow2.asm:asm-commons:5.1'
classpath 'commons-io:commons-io:2.5'
classpath 'org.apache.ant:ant:1.9.7'
classpath 'org.codehaus.plexus:plexus-utils:3.0.24'
classpath 'org.vafer:jdependency:1.1'
classpath files('gradle/plugins/shadowPlugin.jar')
}
repositories {
mavenCentral()
}
}
plugins {
id 'java'
}
apply plugin: com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
tasks.withType(AbstractCompile) {
classpath += configurations.shadow
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
group 'chairs'
version '4.2'
sourceCompatibility = JavaVersion.VERSION_1_8
import java.text.MessageFormat
File dlDepsDir = new File('dllibs')
dlDepsDir.mkdirs()
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['resources']
}
}
test {
java {
srcDirs = ['tests']
}
}
}
repositories {
mavenCentral()
}
dependencies {
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
}
task copyFinalJarToTarget(type: Copy) {
// JitPack searches for the output jar at the standard Gradle output directory (jar.archivePath)
// By copying it from there to our target destination JitPack can archive it in a Maven repository
from jar.archivePath.getPath()
into 'target'
//remove version suffix
rename (jar.archiveName, jar.baseName + '.jar')
}
shadowJar {
doFirst {
new File(destinationDir, archiveName).delete()
}
from sourceSets.main.java.srcDirs
from 'LICENSE'
//remove the -all suffix
archiveName = jar.archiveName
minimizeJar = true
exclude 'META-INF/**'
}
compileJava.dependsOn(clean)
compileJava.finalizedBy(test)
jar.enabled = false
jar.finalizedBy(shadowJar)
shadowJar.finalizedBy(copyFinalJarToTarget)