-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
74 lines (63 loc) · 2.07 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0" ?>
<project name="open-fortran-parser-xml" default="jar">
<property name="debuglevel" value="source,lines,vars" />
<property name="python" value="python3" />
<exec executable="${python}" outputproperty="version" resultproperty="version.error">
<arg value="-m" />
<arg value="version_query" />
<arg value="-p" />
<arg value="." />
</exec>
<fail message="Failed to query project version: ${version}">
<condition>
<not>
<equals arg1="${version.error}" arg2="0" />
</not>
</condition>
</fail>
<property name="src.dir" value="src" />
<property name="bin.dir" value="bin" />
<property name="lib.dir" value="lib" />
<property name="dist.dir" value="dist" />
<property name="jar.name" value="OpenFortranParserXML-${version}.jar" />
<property name="mainclass" value="fortran.ofp.Xml" />
<path id="ofp.classpath">
<pathelement location="${bin.dir}" />
<fileset dir="${lib.dir}" includes="*.jar" />
</path>
<target name="clean">
<delete dir="${bin.dir}" />
<delete file="dist/${jar.name}" />
<delete>
<fileset dir="open_fortran_parser" includes="*.jar" />
</delete>
</target>
<target name="init">
<mkdir dir="${bin.dir}" />
<copy includeemptydirs="false" todir="${bin.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="build" depends="clean,init">
<echo message="${ant.project.name}: ${ant.file}" />
<javac debug="true" debuglevel="${debuglevel}" destdir="${bin.dir}" includeantruntime="false" encoding="UTF-8">
<src path="${src.dir}" />
<classpath refid="ofp.classpath" />
</javac>
</target>
<target name="jar" depends="build">
<jar jarfile="${dist.dir}/${jar.name}" basedir="bin" includes="**/*.class">
<manifest>
<attribute name="Main-Class" value="${mainclass}" />
</manifest>
<metainf file="LICENSE" />
<metainf file="NOTICE" />
</jar>
<copy file="${dist.dir}/${jar.name}" tofile="open_fortran_parser/${jar.name}" />
<copy todir="open_fortran_parser">
<fileset dir="${lib.dir}" includes="*.jar" />
</copy>
</target>
</project>