forked from plaidgroup/plaid-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-common.xml
executable file
·128 lines (115 loc) · 5.52 KB
/
build-common.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
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the common build file for all of the build files in the sub-projects
for Plaid. It also is the place where all dependencies between all
sub-projects are imported. The build files in the sub-projects only have
to declare which folders they care about in terms of building (see
typechecker/build.xml for an example). All the dependencies are declared in
dependencies.xml.
See http://www.exubero.com/ant/dependencies.html for more information on
how and why the build infrastructure is laid out in this fashion.
-->
<project name="build-common" default="compile">
<property name="ant.build.javac.source" value="1.5"/>
<import file="dependencies.xml" />
<target name="default" depends="init,compile" />
<target name="init">
<mkdir dir="${COMPILE.BIN}"/>
<condition property="outsideEclipse">
<equals arg1="${eclipse.pdebuild.home}" arg2="$${eclipse.pdebuild.home}"/>
</condition>
</target>
<target name="clean" depends="init">
<echo message="${ant.project.name} - Cleaning up generated Java code..." />
<mkdir dir="${JAVA.SRC}"/>
<delete includeemptydirs="true">
<fileset dir="${JAVA.SRC}" includes="**/*" excludes=".placeholder" />
</delete>
<delete includeemptydirs="true">
<fileset dir="${COMPILE.BIN}" includes="**/*" excludes=".placeholder" />
</delete>
<delete file="${JAR.NAME}" />
</target>
<target name="compile-plaid-standalone" depends="init" if="outsideEclipse">
<echo message="${ant.project.name} - Compiling Plaid code..." />
<mkdir dir="${COMPILE.BIN}"/>
<java classname="plaid.compilerjava.CompilerCore" failonerror="true" fork="true">
<classpath>
<pathelement path="${CLASSPATH}"/>
<pathelement location="../compilerjava/json_simple-1.1.jar"/>
</classpath>
<!-- <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/> -->
<jvmarg value="-Xmx1024m"/>
<arg value="-V" />
<arg value="-t" />
<arg value="${basedir}/${JAVA.SRC}" />
<arg value="-d" />
<arg value="${basedir}/${PLAID.SRC}" />
<arg value="-p" />
<arg value="${PLAIDPATH}" />
<arg value="-k" />
<arg value="-n" /> <!-- do not invoke java compiler -->
<!-- <arg value="-g" /> enable for debugging -->
<arg value="-r" /> <!-- enable to pretty print -->
</java>
<javac srcdir="${basedir}/${JAVA.SRC}"
fork="true"
destdir="${basedir}/${COMPILE.BIN}"
includeAntRuntime="false"
classpath="${CLASSPATH}"
memoryMaximumSize="1024m"/>
<!--
<eclipse.convertPath fileSystemPath="${basedir}/${JAVA.SRC}" property="resourcePath"/>
<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
<eclipse.convertPath fileSystemPath="${basedir}/${COMPILE.BIN}" property="resourcePath"/>
<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
-->
</target>
<target name="compile-plaid-eclipse" depends="init" unless="outsideEclipse">
<echo message="${ant.project.name} - Compiling Plaid code..." />
<mkdir dir="${COMPILE.BIN}"/>
<java classname="plaid.compilerjava.CompilerCore" failonerror="true" fork="true">
<classpath>
<pathelement path="${CLASSPATH}"/>
<pathelement location="../compilerjava/json_simple-1.1.jar"/>
</classpath>
<!-- <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/> -->
<jvmarg value="-Xmx1024m"/>
<arg value="-o" />
<arg value="${basedir}/${COMPILE.BIN}" />
<arg value="-t" />
<arg value="${basedir}/${JAVA.SRC}" />
<arg value="-d" />
<arg value="${basedir}/${PLAID.SRC}" />
<arg value="-p" />
<arg value="${PLAIDPATH}" />
<arg value="-k" />
<arg value="-n" /> <!-- do not invoke java compiler -->
<!-- <arg value="-g" /> enable for debugging -->
<arg value="-r" /> <!-- enable to pretty print -->
</java>
<!--
<eclipse.convertPath fileSystemPath="${basedir}/${JAVA.SRC}" property="resourcePath"/>
<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
<eclipse.convertPath fileSystemPath="${basedir}/${COMPILE.BIN}" property="resourcePath"/>
<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
-->
</target>
<target name="dist" depends="compile">
<echo message="${ant.project.name} - Compiling distributable..." />
</target>
<target name="compile" depends="compile-plaid-eclipse, compile-plaid-standalone">
<echo message="${ant.project.name} - Compiling distributable..." />
</target>
<target name="clean.dependencies"
description="Deletes files created during the build (includes dependencies)">
<antcall target="depend.${ant.project.name}">
<param name="dependency.target" value="clean"/>
</antcall>
</target>
<target name="dist.dependencies">
<antcall target="depend.${ant.project.name}">
<param name="dependency.target" value="dist"/>
</antcall>
</target>
</project>