/
build.xml
60 lines (47 loc) · 2.26 KB
/
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
<?xml version="1.0"?>
<project name="yanel-resource" default="compile">
<!-- TODO: Check this build code for resource specific build instructions and possibly replace it with the generic import of resource-type.build.xml (src/resources/file/build.xml) -->
<!-- For example set within build.sh ... -->
<property name="yanel.home" value="${yanel.source.home}"/>
<!-- See yanel.home ... -->
<property file="${user.home}/.ant-global.properties"/>
<echo>YANEL_HOME is set to: ${yanel.home}</echo>
<property file="${yanel.home}/src/build/local.build.properties"/>
<property file="${yanel.home}/src/build/build.properties"/>
<import file="src/build/dependencies.xml"/>
<target name="init" description="Initialize build" depends="dependencies">
<echo>Initialize build</echo>
<dirname property="resource.home.dir" file="${ant.file}"/>
<echo>Resource Home Directory: ${resource.home.dir}</echo>
<property file="${resource.home.dir}/src/build/local.build.properties"/>
<property file="${resource.home.dir}/src/build/build.properties"/>
<path id="classpath">
<pathelement path="${maven2.cp}"/>
<pathelement path="${maven2.resource.cp}"/>
</path>
<property name="resource.build.dir" value="${resource.home.dir}/build"/>
<property name="resource.classes.dir" value="${resource.build.dir}/classes"/>
<property name="resource.lib.dir" value="${resource.build.dir}/lib"/>
<property name="resource.java.dir" value="${resource.home.dir}/src/java"/>
</target>
<target name="compile" description="Compile Java classes" depends="init">
<mkdir dir="${resource.classes.dir}"/>
<javac srcdir="${resource.java.dir}" destdir="${resource.classes.dir}"
classpathref="classpath"
debug="true"
/>
<mkdir dir="${resource.lib.dir}"/>
<jar destfile="${resource.lib.dir}/yanel-resource-${resource.name}-${resource.version}.jar"
basedir="${resource.classes.dir}"
/>
</target>
<target name="clean" depends="init">
<delete dir="${resource.build.dir}"/>
</target>
<target name="copy-dependencies" depends="init">
<copy todir="${build.dir}/webapps/${servlet.context.prefix}/WEB-INF/lib">
<fileset refid="maven2.resource.fileset"/>
<mapper type="flatten"/>
</copy>
</target>
</project>