forked from citygml4j/citygml4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
184 lines (162 loc) · 4.95 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
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'java-library'
id 'distribution'
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
}
allprojects {
group 'org.citygml4j'
version '2.11.4'
description 'The Open Source Java API for CityGML'
repositories {
mavenCentral()
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
ext {
genSrcDir = 'src-gen/main/java'
date = new Date()
}
sourceSets {
main.java.srcDir genSrcDir
}
configurations {
jaxb
}
dependencies {
api 'org.citygml4j:citygson:1.1.3'
api 'org.glassfish.jaxb:jaxb-runtime:2.3.2'
api 'org.glassfish.jaxb:xsom:2.3.2'
jaxb 'org.glassfish.jaxb:jaxb-xjc:2.3.2'
jaxb 'org.jvnet.jaxb2_commons:jaxb2-basics:0.12.0'
jaxb 'org.slf4j:slf4j-simple:1.7.25'
}
task generateJaxb(group: 'jaxb') {
outputs.dir genSrcDir
doLast {
mkdir genSrcDir
System.setProperty('javax.xml.accessExternalSchema', 'file')
ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJC2Task', classpath: configurations.jaxb.asPath)
ant.xjc(destdir: genSrcDir,
schema: 'resources/jaxb/citygml4j.xsd',
binding: 'resources/jaxb/binding.xjb',
extension: 'true',
encoding: 'UTF-8') {
produces(dir: genSrcDir, includes: '**/*.java')
arg(line: '-Xsetters -Xsetters-mode=direct')
}
delete "$genSrcDir/org/citygml4j"
}
}
task cleanJaxb(type: Delete, group: 'jaxb') {
delete 'src-gen'
}
javadoc {
include "org/citygml4j/**"
options {
overview "$buildDir/tmp/javadoc/overview.html"
header "citygml4j $project.version"
bottom """
<a target="_blank" href="https://github.com/citygml4j/citygml4j/issues">Report a bug or suggest an enhancement</a><br>
citygml4j is open source and licensed under the <a target="_blank" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a><br>
Official website and more information at: <a target="_blank" href="https://github.com/citygml4j">https://github.com/citygml4j</a><br>
Copyright © 2013-${date.format('yyyy')}<br>
Claus Nagel <[email protected]>
""".replaceAll("[\r|\n]+", "")
addStringOption('doctitle', project.name + ' - ' + project.description)
}
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
doFirst {
copy {
from 'resources/javadoc/overview.html'
into "$buildDir/tmp/javadoc"
filter(ReplaceTokens, tokens: [
version: project.version
])
}
}
}
jar {
manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': project.version
)
}
into('META-INF') {
from 'LICENSE'
}
}
distributions.main.contents {
from('resources/doc/README') {
filter(ReplaceTokens, tokens: [
version: project.version,
date: date.format('yyyy-MM-dd'),
copyright: date.format('yyyy'),
javaCompatibility: sourceCompatibility.toString(),
jar: jar.archiveFileName.get(),
groupId: project.group,
artifactId: project.name
])
}
into('lib') {
from jar
from configurations.compileClasspath
}
into('javadoc') {
from javadoc
}
into('license') {
from 'LICENSE'
}
into('samples') {
from tasks.getByPath(':citygml4j-samples:copySamples').outputs
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = project.name
description = project.description
url = 'https://github.com/citygml4j'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
developers {
developer {
id = 'clausnagel'
name = 'Claus Nagel'
email = '[email protected]'
roles = ['architect', 'developer']
timezone = '+1'
}
}
scm {
url = 'https://github.com/citygml4j/citygml4j'
connection = 'scm:git:https://github.com/citygml4j/citygml4j.git'
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
nexusPublishing {
repositories {
sonatype()
}
}