-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathroma-build.xml
180 lines (152 loc) · 7.02 KB
/
roma-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
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
<?xml version="1.0" encoding="utf-8"?>
<project basedir="." default="compile" xmlns:ivy="antlib:org.apache.ivy.ant">
<property environment="env" />
<property name="project.src" value="src" />
<property name="project.test" value="test" />
<property name="project.lib" value="lib" />
<property name="project.bin" value="bin" />
<property name="project.wizard" value="wizard" />
<property name="project.config" value="config" />
<property name="project.build" value="build" />
<property name="project.build.src" value="${project.build}/src" />
<property name="project.build.test" value="${project.build}/test" />
<property name="project.scaffolding" value="scaffolding" />
<property name="project.mainclass" value="" />
<property name="project.debug" value="on" />
<property name="project.debuglevel" value="source,lines,vars" />
<property name="project.targetComp" value="1.5" />
<property name="project.dist" value="dist" />
<property name="ivy.install.version" value="2.2.0" />
<property name="ivy.jar.file" value="${project.lib}/ivy.jar" />
<available resource="org/apache/ivy/ant/antlib.xml" property="ivy.in.classpath" />
<target name="clean">
<delete dir="${project.build}" />
</target>
<target name="clean-dist">
<delete dir="${project.dist}" />
</target>
<target name="clean-ivy">
<delete dir="${project.lib}" />
</target>
<target name="clean-ivy-cache" depends="install-ivy">
<ivy:info />
<echo>${ivy.cache.dir}/org.romaframework/${ant.project.name}</echo>
<delete dir="${ivy.cache.dir}/org.romaframework/${ant.project.name}" />
</target>
<target name="clean-all" depends="clean,clean-dist,clean-ivy">
</target>
<target name="clean-local" depends="install-ivy">
<ivy:info />
<echo>${ivy.local.default.root}/org.romaframework</echo>
<delete dir="${ivy.local.default.root}/org.romaframework" />
</target>
<target name="download-ivy" unless="ivy.download.skip">
<mkdir dir="${project.lib}" />
<echo message="installing ivy..." />
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true" />
</target>
<target name="install-ivy" unless="ivy.in.classpath">
<available file="${ivy.jar.file}" property="ivy.download.skip" />
<antcall target="download-ivy" />
<path id="ivy.lib.path">
<fileset dir="${project.lib}" includes="*.jar" />
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
</target>
<target name="resolve-dependencies" depends="install-ivy">
<echo>Retrieving libs</echo>
<ivy:retrieve pattern="${project.lib}/[artifact].[ext]" />
</target>
<target name="compile" depends="install-ivy">
<ivy:cachepath pathid="project.classpath"/>
<echo message="------------------------------------------------------------------------" />
<echo message="${ant.project.name} - debug=${project.is-debug} - compiler=${project.targetComp}" />
<echo message="${ant.file}" />
<echo message="------------------------------------------------------------------------" />
<mkdir dir="${project.build.src}" />
<mkdir dir="${project.build.test}" />
<copy toDir="${project.build.src}">
<fileset dir="${project.src}">
<exclude name="**/*.java" />
</fileset>
</copy>
<javac destdir="${project.build.src}" debug="${project.debug}" debuglevel="source,lines,vars" source="${project.targetComp}" target="${project.targetComp}">
<src path="${project.src}" />
<classpath>
<path refid="project.classpath" />
</classpath>
</javac>
<available file="${project.build.test}" property="test.dir.exist" />
<antcall target="compile-test" />
</target>
<target name="compile-test" unless="test.dir.exist">
<javac destdir="${project.build.test}" debug="{project.is-debug}" source="${project.targetComp}" target="${project.targetComp}">
<src path="${project.test}" />
<classpath>
<path location="${project.build.src}">
</path>
<path refid="project.classpath" />
</classpath>
</javac>
</target>
<target name="dist" depends="compile,install-ivy">
<ivy:info />
<jar jarfile="${project.dist}/${ivy.module}.jar" compress="true">
<fileset dir="${project.build.src}">
<include name="**/*" />
</fileset>
<manifest>
<attribute name="Main-Class" value="${project.mainclass}" />
</manifest>
</jar>
<jar jarfile="${project.dist}/${ivy.module}-test.jar" compress="true">
<fileset dir="${project.build.test}">
<include name="**/*" />
</fileset>
<manifest>
<attribute name="Main-Class" value="${project.mainclass}" />
</manifest>
</jar>
<zip destfile="${project.dist}/${ivy.module}-wizard.zip">
<fileset dir=".">
<include name="${project.scaffolding}/**" />
<include name="${project.wizard}/**" />
<include name="${project.config}/**" />
<include name="${project.bin}/**" />
<include name="module-install.xml" />
</fileset>
</zip>
</target>
<target name="publish" depends="dist">
<ivy:publish resolver="local" overwrite="true" conf="default,wizard,test">
<ivy:artifacts pattern="${project.dist}/[artifact](-[classifier]).[ext]" />
</ivy:publish>
<antcall target="clean-ivy-cache" />
</target>
<target name="remote-publish" depends="dist,javadoc,sources">
<get src="https://github.com/romaframework/core/raw/master/pom-template.pom" dest="pom-template.pom" skipexisting="true" />
<ivy:settings file="${ivy.default.ivy.user.dir}/ivysettings.xml" id="pub" />
<ivy:deliver deliverpattern="${project.dist}/[artifact].[ext]" />
<ivy:makepom ivyfile="${project.dist}/ivy.xml" pomfile="${project.dist}/${ant.project.name}.pom" templatefile="pom-template.pom" printIvyInfo="false">
<mapping conf="default" scope="compile" />
</ivy:makepom>
<ivy:publish resolver="${resolver}" overwrite="true" settingsref="pub" conf="default,wizard,publish">
<ivy:artifacts pattern="${project.dist}/[artifact](-[classifier]).[ext]" />
<artifact name="${ant.project.name}" ext="pom" type="pom" />
<artifact name="${ant.project.name}" ext="jar" type="sources" classifier="sources" />
<artifact name="${ant.project.name}" ext="jar" type="javadoc" classifier="javadoc" />
</ivy:publish>
</target>
<target name="javadoc">
<ivy:cachepath pathid="project.classpath"/>
<javadoc access="public" author="true" doctitle="Roma MetaFramework JavaDoc" nodeprecated="false" splitindex="true" use="true" version="true" destdir="${project.build}/doc" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.5" sourcepath="${project.src}" packagenames="org.romaframework.*">
<classpath>
<path refid="project.classpath" />
</classpath>
</javadoc>
<zip destfile="${project.dist}/${ant.project.name}-javadoc.jar" basedir="${project.build}/doc" />
</target>
<target name="sources">
<zip destfile="${project.dist}/${ant.project.name}-sources.jar" basedir="src" />
</target>
</project>