forked from opendcs/opendcs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.xml
More file actions
132 lines (112 loc) · 6.15 KB
/
common.xml
File metadata and controls
132 lines (112 loc) · 6.15 KB
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
<project name="common" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="ivy.install.version" value="2.5.0"/>
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME"/>
</condition>
<property name="ivy.home" value="${user.home}/.ant"/>
<property name="ivy.jar.dir" value="${ivy.home}/lib"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<property environment="env"/>
<tstamp>
<format property="snapshot.time" pattern="yyyyMMdd.hhmmss-1"/>
</tstamp>
<property name="project.dir" value="${basedir}"/>
<property name="src.dir" value="src/main/java"/>
<property name="resources.dir" value="src/main/resources"/>
<property name="src.test.dir" value="src/test/java"/>
<property name="resources.test.dir" value="src/test/resources"/>
<property name="build.dir" value="build"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.lib" value="${build.dir}/lib"/>
<property name="build.test.classes" value="${build.dir}/test-classes"/>
<property name="build.test.lib" value="${build.dir}/test-libs"/>
<property name="dist.jar" value="${build.lib}/opendcs.jar"/>
<!-- VERSION NUMBERS -->
<property name="MAJ_VER" value="7"/>
<property name="MIN_VER" value="0"/>
<loadfile property="RCNUM" srcFile="${project.dir}/rcnum.txt">
<filterchain><striplinebreaks/></filterchain>
</loadfile>
<echo message="RCNUM=${RCNUM}"/>
<property name="version" value="${MAJ_VER}.${MIN_VER}.${RCNUM}"/>
<echo message="VERSION=${version}"/>
<target name="download-ivy" unless="offline">
<echo message="IVY jar dir ${ivy.jar.dir}"/>
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<get src="https://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="init-ivy" depends="download-ivy,-get-junitlauncher">
<!-- try to load Ivy here from Ivy home, in case the user has not already dropped
it into Ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
Ivy is in at least one of Ant's lib dir or the local lib dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" 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" description="--> retreive dependencies with ivy" depends="init-ivy">
<ivy:retrieve conf="runtime,test,test_platform"
sync="true"
pattern="build/ivy/[conf]/[artifact].[ext]"
/>
<ivy:cachepath pathid="runtime.classpath" conf="runtime"/>
<ivy:cachepath pathid="test.classpath" conf="test"/>
<ivy:cachepath pathid="junit.platform.libs.classpath" conf="test_platform"/>
</target>
<target name="resolve.build" depends="init-ivy" description="--> retrieve build script dependencies">
<ivy:retrieve conf="build,groovy,izpack"
sync="true"
pattern="build/ivy/[conf]/[artifact].[ext]"
/>
<ivy:cachepath pathid="izpack.classpath" conf="izpack"/>
<ivy:cachepath pathid="groovy.classpath" conf="groovy"/>
<ivy:cachepath pathid="build.classpath" conf="build"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="build.classpath"/>
<taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"
classpathref="build.classpath"/>
</target>
<target name="report" depends="resolve" description="--> generates a report of dependencies">
<ivy:report todir="${build.dir}"/>
</target>
<target name="izpack.dependencies" depends="resolve">
<taskdef name="izpack" classname="com.izforge.izpack.ant.IzPackTask" classpathref="izpack.classpath"/>
</target>
<macrodef name="publish">
<sequential>
<ivy:deliver deliverpattern="build/ivy.xml"/>
<if>
<isset property="DEPLOY_RELEASE"/>
<then>
<property name="deploy.resolver" value="maven-releases"/>
<property name="deploy.version" value="${ivy.revision}"/>
<property name="deploy.status" value="release"/>
<property name="deploy.update" value="false"/>
</then>
<else>
<property name="deploy.resolver" value="maven-snapshots"/>
<property name="deploy.version" value="${ivy.revision}-SNAPSHOT"/>
<property name="deploy.status" value="integration"/>
<property name="deploy.update" value="true"/>
</else>
</if>
<ivy:makepom ivyfile="build/ivy.xml" pomfile="build//lib/${ivy.module}.pom"/>
<ivy:publish resolver="${deploy.resolver}" organisation="com.opendcs" module="opendcs"
update="${deploy.update}" overwrite="${deploy.update}" publishivy="false"
pubrevision="${deploy.version}" status="${deploy.status}">
<artifacts pattern="build/lib/[artifact].[ext]"/>
</ivy:publish>
</sequential>
</macrodef>
<target name="-get-junitlauncher" unless="junitlauncherPresent">
<echo message="You're environment doesn't have the junitlauncher jar. getting it for you"/>
<antversion property="ant_version"/>
<get src="https://repo1.maven.org/maven2/org/apache/ant/ant-junitlauncher/${ant_version}/ant-junitlauncher-${ant_version}.jar"
dest="${build.dir}/ant-junitlauncher.jar" usetimestamp="true"/>
<taskdef name="junitlauncher" classname="org.apache.tools.ant.taskdefs.optional.junitlauncher.confined.JUnitLauncherTask"
classpath="${build.dir}/ant-junitlauncher.jar"/>
</target>
</project>