forked from citygml4j/citygml4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
maven-build.xml
142 lines (119 loc) · 5.6 KB
/
maven-build.xml
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
<?xml version="1.0" standalone="yes"?>
<!--
* citygml4j - The Open Source Java API for CityGML
* https://github.com/citygml4j
*
* Copyright 2013-2017 Claus Nagel <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<project name="citygml4j-maven" default="deploy" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<!-- load external property sets -->
<property file="default.properties" />
<!-- register maven lib -->
<path id="maven-ant-tasks.classpath" path="${dir.resources.maven}/lib/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
<!-- local properties -->
<available file="${dir.dist.lib}/${citygml4j.jar}" property="citygml4j.jar.present" />
<available file="${dir.dist.javadoc}/index.html" property="citygml4j.javadoc.present" />
<available file="${dir.src-gen}/org/citygml4j/jaxb" property="citygml4j.src-gen.present" />
<target name="init">
<mkdir dir="${dir.maven.dist}" />
</target>
<target name="generate_jaxb_binding" unless="${citygml4j.src-gen.present}">
<subant target="generate_jaxb_binding">
<fileset dir="." includes="build.xml" />
</subant>
</target>
<target name="generate_jar" unless="${citygml4j.jar.present}">
<subant target="generate_jar">
<fileset dir="." includes="build.xml" />
</subant>
</target>
<target name="generate_javadoc" unless="${citygml4j.javadoc.present}">
<subant target="generate_javadoc">
<fileset dir="." includes="build.xml" />
</subant>
</target>
<target name="deploy" depends="init" description="deploy snapshot version to Maven snapshot repository">
<!-- build citygml4j.jar if required -->
<antcall target="generate_jar" />
<!-- copy the main artifact -->
<copy file="${dir.dist.lib}/${citygml4j.jar}" tofile="${dir.maven.dist}/${maven.main.snapshot.jar}" />
<!-- copy pom.xml -->
<copy file="${dir.resources.maven}/pom.xml" tofile="${dir.maven.dist}/pom.xml" />
<replace file="${dir.maven.dist}/pom.xml" token="!citygml4j.version!" value="${maven.snapshot.version}" />
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file" />
<arg value="-Durl=${maven.snapshots.repository.url}" />
<arg value="-DrepositoryId=${maven.snapshots.repository.id}" />
<arg value="-DpomFile=${dir.maven.dist}/pom.xml" />
<arg value="-Dfile=${dir.maven.dist}/${maven.main.snapshot.jar}" />
</artifact:mvn>
<!-- clean up -->
<delete dir="${dir.maven.dist}" />
</target>
<target name="stage" depends="init" description="deploy release version to Maven staging repository">
<!-- generate JAXB classes if required -->
<antcall target="generate_jaxb_binding" />
<!-- generate javadoc if required -->
<antcall target="generate_javadoc" />
<!-- build citygml4j.jar if required -->
<antcall target="generate_jar" />
<!-- copy the main artifact -->
<copy file="${dir.dist.lib}/${citygml4j.jar}" tofile="${dir.maven.dist}/${maven.main.jar}" />
<!-- copy pom.xml -->
<copy file="${dir.resources.maven}/pom.xml" tofile="${dir.maven.dist}/pom.xml" />
<replace file="${dir.maven.dist}/pom.xml" token="!citygml4j.version!" value="${citygml4j.version}" />
<!-- build the sources artifact -->
<jar jarfile="${dir.maven.dist}/${maven.sources.jar}">
<fileset dir="${dir.src}" />
<fileset dir="${dir.src-gen}" />
</jar>
<!-- build the javadoc artifact -->
<jar jarfile="${dir.maven.dist}/${maven.javadoc.jar}">
<fileset dir="${dir.dist.javadoc}" />
</jar>
<!-- sign and deploy the main artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${maven.staging.repository.url}" />
<arg value="-DrepositoryId=${maven.staging.repository.id}" />
<arg value="-DpomFile=${dir.maven.dist}/pom.xml" />
<arg value="-Dfile=${dir.maven.dist}/${maven.main.jar}" />
<arg value="-Pgpg" />
</artifact:mvn>
<!-- sign and deploy the sources artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${maven.staging.repository.url}" />
<arg value="-DrepositoryId=${maven.staging.repository.id}" />
<arg value="-DpomFile=${dir.maven.dist}/pom.xml" />
<arg value="-Dfile=${dir.maven.dist}/${maven.sources.jar}" />
<arg value="-Dclassifier=sources" />
<arg value="-Pgpg" />
</artifact:mvn>
<!-- sign and deploy the javadoc artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${maven.staging.repository.url}" />
<arg value="-DrepositoryId=${maven.staging.repository.id}" />
<arg value="-DpomFile=${dir.maven.dist}/pom.xml" />
<arg value="-Dfile=${dir.maven.dist}/${maven.javadoc.jar}" />
<arg value="-Dclassifier=javadoc" />
<arg value="-Pgpg" />
</artifact:mvn>
<!-- clean up -->
<delete dir="${dir.maven.dist}" />
</target>
</project>