-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
106 lines (93 loc) · 2.69 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
import java.text.SimpleDateFormat
plugins {
id 'java-library'
id "me.champeau.gradle.jmh" version "0.5.0"
id 'com.github.johnrengelman.shadow' version '6.1.0'
}
def projectName = 'jcli'
group 'com.github.wnebyte'
version '0.0.1'
sourceCompatibility = "1.8";
targetCompatibility = "1.8";
compileJava {
options.compilerArgs.add("-parameters")
}
sourceSets {
test {
java {
srcDirs = ["src/test/java"]
}
resources {
srcDirs = ["src/test/resources"]
}
}
jmh {
java {
srcDirs = ["src/jmh/java"]
}
resources {
srcDirs = ["src/jmh/resources"]
}
}
sample {
java {
srcDirs = ["src/sample/java"]
}
resources {
srcDirs = ["src/sample/resources"]
}
}
}
javadoc {
sourceSets.main.allJava
}
java {
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation group: 'org.reflections', name: 'reflections', version: '0.9.11'
testImplementation group: 'junit', name: 'junit', version: '4.12'
jmh group: 'org.openjdk.jmh', name: 'jmh-core', version: '1.28'
jmh group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version: '1.28'
jmh group: 'org.reflections', name: 'reflections', version: '0.9.11'
jmh fileTree(dir: "libs", include: ["*.jar"])
sampleCompile sourceSets.main.output
sampleImplementation fileTree(dir: "libs", include: ["*.jar"])
sampleImplementation group: 'org.reflections', name: 'reflections', version: '0.9.11'
}
jar{
manifest{
attributes(
"Name": projectName,
"Implementation-Title": projectName,
"Implementation-Version": project.version,
"Class-Path": configurations.runtimeClasspath.files.collect { it.getName() }.join(' '),
'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']}) " +
"${System.properties['java.vm.version']}"
)
}
archiveBaseName.set(projectName)
}
javadocJar {
archiveBaseName.set(projectName)
archiveClassifier.set('javadoc')
archiveVersion.set(project.version)
from(javadoc)
}
sourcesJar {
archiveBaseName.set(projectName)
archiveClassifier.set('sources')
archiveVersion.set(project.version)
from(sourceSets.main.allJava)
}
shadowJar {
archiveBaseName.set(projectName)
archiveClassifier.set('fat')
archiveVersion.set(project.version)
}