-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
137 lines (114 loc) · 3.3 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
}
}
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'jacoco'
apply plugin: 'com.bmuschko.nexus'
defaultTasks 'clean', 'build'
repositories {
// Fetch the dependencies from Maven Central
mavenCentral()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
def lombokVersion = '1.18.20'
dependencies {
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
implementation 'commons-lang:commons-lang:2.4'
implementation 'net.java.dev.stax-utils:stax-utils:20070216@jar'
testImplementation localGroovy()
testImplementation 'junit:junit:4.8.1'
}
jar {
manifest {
attributes += [ "Artifact-Group": "${project.group}" ]
attributes += [ "Artifact-Name": "${project.name}" ]
attributes += [ "Artifact-Version": "${project.version}" ]
attributes += [ "Built-On": "${new java.text.SimpleDateFormat('yyyy-MM-dd HH:mm:ss (Z)').format(new Date())}" ]
attributes += [ "Built-By": "${System.properties['user.name']}" ]
attributes += [ "Java-Version": "${System.properties['java.version']}" ]
}
}
sourceSets {
samples {
java {
// The samples need the main classes to compile & the compile dependencies
compileClasspath += sourceSets.main.output + sourceSets.main.compileClasspath
}
}
}
task delombok(type: JavaExec, dependsOn: compileJava) {
ext.outputDir = file("${buildDir}/delombok")
classpath = configurations.compileClasspath
mainClass = 'lombok.launch.Main'
args = [ 'delombok', 'src/main/java', '-d', ext.outputDir ]
}
javadoc {
dependsOn delombok
// Generate the javadoc from the delomboked files
source = delombok.ext.outputDir // sourceSets.main.allJava
classpath = configurations.compileClasspath + configurations.annotationProcessor
}
// Compile the samples before packaging them
task distribution(type: Zip, dependsOn: samplesClasses) {
archiveClassifier = 'dist'
from jar, {
into 'lib'
}
from javadoc, {
into 'docs/javadoc'
}
from sourceSets.samples.allSource, {
into 'samples'
}
from file('LICENSE')
}
artifacts {
// Upload the distribution file too
archives tasks.distribution
}
jacoco {
toolVersion = "0.7.1.201405082137"
}
build.dependsOn distribution, jacocoTestReport
modifyPom {
project {
name 'Graphml4J'
description 'A simple Java API for generating GraphML files for yEd.'
url 'https://github.com/fritaly/graphml4j'
inceptionYear '2014'
packaging 'jar'
scm {
url 'https://github.com/fritaly/graphml4j'
connection 'scm:git:https://github.com/fritaly/graphml4j.git'
developerConnection 'scm:[email protected]:fritaly/graphml4j.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'fritaly'
name 'Francois Ritaly'
email '[email protected]'
}
}
}
}
nexus {
sign = false
}