-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
105 lines (93 loc) · 3.48 KB
/
build.xml
File metadata and controls
105 lines (93 loc) · 3.48 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<property name="lib.dir" value="lib"/>
<property name="src.dir" value="src"/>
<property name="dest.dir" value="bin/"/>
<property name="grammar.dir" value="resources/grammar"/>
<property name="version.major" value="1"/>
<property name="version.minor" value="0"/>
<property name="version.state" value="beta"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<target name="find_revision" description="Sets property 'revision.number' to the head svn revision">
<property name="revision" value="HEAD"/>
<!-- find out revision number of HEAD, need svn.exe installed on local machine -->
<exec executable="svn" output="svnlog.out">
<arg line="info ${src.dir}/../build.xml"/>
</exec>
<loadproperties srcfile="svnlog.out"/>
<echo>current revision is ${Revision}</echo>
<delete file="svnlog.out"/>
</target>
<target name="cleangrammar">
<delete includeemptydirs="true">
<fileset dir="${grammar.dir}">
<include name="**/*.java"/>
<include name="**/*.smap"/>
<include name="**/*.txt"/>
</fileset>
</delete>
</target>
<target name="invokeantlr" depends="cleangrammar">
<java classname="antlr.Tool"
dir="${grammar.dir}"
fork="true"
failonerror="true"
maxmemory="128m">
<arg value="phpLexer.g"/>
<classpath>
<pathelement location="${lib.dir}/antlr.jar"/>
</classpath>
</java>
<java classname="antlr.Tool"
failonerror="true"
dir="${grammar.dir}"
fork="true"
maxmemory="128m">
<arg value="phpOutTheCode.g"/>
<classpath>
<pathelement location="${lib.dir}/antlr.jar"/>
</classpath>
</java>
<java classname="antlr.Tool"
failonerror="true"
fork="true"
dir="${grammar.dir}"
maxmemory="128m">
<arg value="php.g"/>
<classpath>
<pathelement location="${lib.dir}/antlr.jar"/>
</classpath>
</java>
<mkdir dir="${src.dir}/php/parser/antlr/"/>
<move todir="${src.dir}/php/parser/antlr/">
<fileset dir="${grammar.dir}">
<include name="**/*.java"/>
</fileset>
</move>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target name="build" depends="find_revision,clean,invokeantlr">
<mkdir dir="${dest.dir}"/>
<javac srcdir="${src.dir}" destdir="${dest.dir}" classpathref="classpath"/>
</target>
<target name="testjar" depends="build">
<property name="jar.filename" value="php-parser.${version.major}.${version.minor}.r${Revision}.${version.state}.jar"/>
<mkdir dir="bin/jar"/>
<manifestclasspath property="manifest_cp" jarfile="${jar.filename}">
<classpath refid="classpath" />
</manifestclasspath>
<jar destfile="bin/jar/${jar.filename}" basedir="${dest.dir}">
<zipgroupfileset dir="${lib.dir}" includes="*.jar" />
<manifest>
<attribute name="Main-Class" value="php.parser.util.console.Main"/>
<!-- <attribute name="Class-Path" value="."/> -->
<attribute name="Implementation-Version"
value="${version.major}.${version.minor}.r${Revision}.${version.state}"/>
</manifest>
</jar>
</target>
</project>