-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
76 lines (64 loc) · 2.31 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
<project name="BLikeLang" default="rebuild">
<property name="app" value="asm"/>
<property name="build" value=".build"/>
<property name="build.classes" value="${build}/classes"/>
<property name="build.jars" value="${build}/jars"/>
<property file="user.properties"/>
<path id="classpath">
<pathelement location="src/main/lib/antlr-runtime-4.7.2.jar"/>
</path>
<path id="classpath.compile">
<path refid="classpath"/>
<pathelement location="src/main/lib/annotations.jar"/>
</path>
<target name="rebuild">
<delete dir="${build}" failonerror="false"/>
<mkdir dir="${build.classes}"/>
<javac destdir="${build.classes}" debug="on" optimize="off" deprecation="on" includeantruntime="false" >
<src path="src/main/src"/>
<src path="src/main/src-antlr-grammar4-generated"/>
<classpath refid="classpath.compile"/>
</javac>
<mkdir dir="${build.jars}"/>
<jar destfile="${build.jars}/${app}.jar">
<fileset dir="${build.classes}"/>
<manifest>
<attribute name="Main-Class" value="Main"/>
</manifest>
</jar>
<copy todir="${build.jars}" flatten="true">
<path refid="classpath"/>
</copy>
</target>
<target name="rebuild.dist" depends="rebuild" if="dest.dir">
<echo>Copy from "${build.jars}" to "${dest.dir}"...</echo>
<copy todir="${dest.dir}">
<fileset dir="${build.jars}"/>
</copy>
</target>
<target name="analyze" depends="rebuild">
<delete dir="${basedir}/config"/>
<java fork="true" classname="Main" failonerror="true">
<jvmarg value="-agentlib:native-image-agent=config-output-dir=${basedir}/config"/>
<classpath>
<pathelement location="${build.jars}/${app}.jar"/>
<pathelement location="${build.jars}/antlr-runtime-4.7.2.jar"/>
</classpath>
<arg value="src/main/examples/es4.0.asm"/>
</java>
</target>
<target name="native">
<exec executable="native-image.cmd" dir="${build.jars}" failonerror="true">
<arg value="--verbose"/>
<arg value="-H:Name=${app}"/>
<arg value="-cp"/>
<arg value="${app}.jar;antlr-runtime-4.7.2.jar"/>
<arg value="--no-fallback"/>
<arg value="-H:JNIConfigurationFiles=${basedir}/config/jni-config.json"/>
<arg value="-H:+PrintClassInitialization"/>
<arg value="--initialize-at-build-time=*"/>
<arg value="Main"/>
</exec>
<move file="${build.jars}/${app}.exe" todir="${build}"/>
</target>
</project>