-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathbuild.xml
148 lines (119 loc) · 4.95 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
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
<!-- Created by Jean Bovet -->
<project name="distribution" default="distribute" basedir=".">
<property file="build.properties" />
<property name="dist.dir" value="${basedir}/dist" />
<property name="build.dir" value="${dist.dir}/build" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="src.dist.dir" value="${dist.dir}/src" />
<property name="osx.dir" value="${basedir}/osx" />
<property name="osx.build.dir" value="${build.dir}/osx" />
<property name="jar.file" value="${dist.dir}/antlrworks-${version}.jar" />
<path id="classpath">
<fileset dir="${aw.lib}" includes="*.jar"/>
</path>
<condition property="is-macos">
<os family="mac" />
</condition>
<condition property="intellij.available">
<available file="${intellij.lib}" />
</condition>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="compile-mac" if="is-macos" description="Compile for the Mac">
<mkdir dir="${build.dir}"/>
<javac
destdir="${build.dir}"
source="1.5"
target="1.5"
debug="true"
excludes="org/antlr/works/test/**">
<classpath refid="classpath"/>
<src path="${aw.source}"/>
</javac>
</target>
<target name="compile-other" unless="is-macos" description="Compile for generic OS">
<mkdir dir="${build.dir}"/>
<javac
destdir="${build.dir}"
source="1.5"
target="1.5"
debug="true"
excludes="org/antlr/works/test/**, **/XJApplicationMacOS.java">
<classpath refid="classpath"/>
<src path="${aw.source}"/>
</javac>
</target>
<target name="build" depends="compile-mac, compile-other" description="Build antlrworks.jar">
<mkdir dir="${dist.dir}"/>
<jar jarfile="${jar.file}">
<fileset dir="${aw.resources}"/>
<fileset dir="${build.dir}" includes="**/*.class"/>
<zipfileset src="${aw.lib}/${antlr3.jar}" excludes="**/*.txt"/>
<zipfileset src="${aw.lib}/${jgoodies.jar}"/>
<manifest>
<attribute name="Version" value="${version}"/>
<attribute name="Main-Class" value="org.antlr.works.IDE"/>
</manifest>
</jar>
</target>
<target name="run" description="Launch ANTLRWorks">
<java jar="${jar.file}"
fork="true"
spawn="true"
>
<jvmarg value="-Xmx400m"/>
</java>
</target>
<target name="zip-source">
<mkdir dir="${src.dist.dir}"/>
<copy todir="${src.dist.dir}">
<fileset dir=".">
<include name="build.properties"/>
<include name="build.xml"/>
</fileset>
</copy>
<copy todir="${src.dist.dir}/resources">
<fileset dir="${aw.resources}"/>
</copy>
<copy todir="${src.dist.dir}/src/aw">
<fileset dir="${aw.source}"/>
</copy>
<copy todir="${src.dist.dir}/lib">
<fileset dir="${lib.dir}" excludes="junit.jar"/>
</copy>
<copy todir="${src.dist.dir}/osx">
<fileset dir="${osx.dir}"/>
</copy>
<zip destfile="${dist.dir}/antlrworks-${version}-src.zip"
basedir="${src.dist.dir}"
>
</zip>
</target>
<target name="prepare-osx" if="is-macos">
<copy todir="${osx.build.dir}">
<fileset dir="${osx.dir}" excludes="Info.plist"/>
</copy>
<copy file="${jar.file}" tofile="${osx.build.dir}/ANTLRWorks.app/Contents/Resources/Java/antlrworks.jar" overwrite="true"/>
<exec executable="chmod" dir="${osx.build.dir}/ANTLRWorks.app/Contents/MacOS/">
<arg value="+x"/>
<arg value="JavaApplicationStub"/>
</exec>
<copy file="${osx.dir}/Info.plist" tofile="${osx.build.dir}/ANTLRWorks.app/Contents/Info.plist" overwrite="true">
<filterset>
<filter token="VERSION" value="${version}"/>
</filterset>
</copy>
<!-- Use the Unix zip command because the ant zip task does not preserve the Unix permission needed
for the application to launch on Mac OS X -->
<exec executable="zip" dir="${osx.build.dir}">
<arg value="-r"/>
<arg value="${dist.dir}/antlrworks-${version}.zip"/>
<arg value="ANTLRWorks.app"/>
</exec>
</target>
<!--<target name="distribute" depends="clean, zip-source, build, build-plugin, build-noplugin, prepare-osx">-->
<target name="distribute" depends="clean, zip-source, build, prepare-osx">
</target>
</project>