-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
193 lines (179 loc) · 8.56 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?xml version="1.0" encoding="UTF-8"?>
<project name="Java2DF" default="build" basedir=".">
<property file="build.properties" />
<property name="srcDir" location="src" />
<property name="libDir" location="lib" />
<property name="tmpDir" location="tmp" />
<property name="buildDir" location="target" />
<property name="toolsDir" location="tools" />
<property name="testsDir" location="tests" />
<property name="input" location="${testsDir}/basic_return.java" />
<property name="output" location="${tmpDir}/out.graph" />
<property name="out_xml" location="${tmpDir}/out.xml" />
<property name="out_html" location="${tmpDir}/out.html" />
<path id="build.classpath">
<pathelement location="${libDir}/bcel-6.2.jar"/>
<pathelement location="${libDir}/junit-4.13.1.jar"/>
<pathelement location="${libDir}/xmlunit-1.6.jar"/>
<pathelement location="${libDir}/sqlite-jdbc-3.34.0.jar"/>
<pathelement location="${libDir}/org.eclipse.jdt.core-3.25.0.jar"/>
<pathelement location="${libDir}/org.eclipse.core.resources-3.14.0.jar"/>
<pathelement location="${libDir}/org.eclipse.core.runtime-3.20.100.jar"/>
<pathelement location="${libDir}/org.eclipse.core.filesystem-1.7.700.jar"/>
<pathelement location="${libDir}/org.eclipse.core.expressions-3.7.100.jar"/>
<pathelement location="${libDir}/org.eclipse.core.jobs-3.10.1100.jar"/>
<pathelement location="${libDir}/org.eclipse.core.contenttype-3.7.900.jar"/>
<pathelement location="${libDir}/org.eclipse.equinox.common-3.14.100.jar"/>
<pathelement location="${libDir}/org.eclipse.equinox.registry-3.10.100.jar"/>
<pathelement location="${libDir}/org.eclipse.equinox.preferences-3.8.200.jar"/>
<pathelement location="${libDir}/org.eclipse.equinox.app-1.5.100.jar"/>
<pathelement location="${libDir}/org.eclipse.text-3.11.0.jar"/>
<pathelement location="${libDir}/org.eclipse.osgi-3.16.200.jar"/>
</path>
<target name="build" depends="compile">
</target>
<target name="clean">
<delete dir="${buildDir}" />
<delete>
<fileset dir="${testsDir}" includes="**/*.err" />
</delete>
</target>
<target name="compile">
<mkdir dir="${buildDir}" />
<javac destdir="${buildDir}"
nowarn="false"
debug="true"
optimize="false"
deprecation="true"
verbose="false"
includeAntRuntime="false">
<compilerarg value="-Xlint" />
<src path="${srcDir}" />
<include name="main/**" />
<include name="test/**" />
<exclude name="**/.*/**"/>
<classpath refid="build.classpath"/>
</javac>
</target>
<target name="run" depends="build">
<mkdir dir="${tmpDir}" />
<java classname="net.tabesugi.fgyama.Java2DF" fork="yes">
<jvmarg value="-ea" />
<jvmarg value="-Xss256k" /> <!-- deliberately use a small stack -->
<jvmarg value="-XX:MaxJavaStackTraceDepth=1000000" /> <!-- show all stacktraces -->
<arg value="-v" />
<arg value="-v" />
<arg value="-S" />
<arg value="-F" />
<arg value="-o" />
<arg file="${output}" />
<arg file="${input}" />
<classpath location="${buildDir}" />
<classpath refid="build.classpath"/>
</java>
</target>
<target name="graph" depends="run">
<exec executable="python" failonerror="true">
<arg value="${toolsDir}/graph2gv.py" />
<arg value="-H" />
<arg value="-o" />
<arg file="${out_html}" />
<arg file="${output}" />
</exec>
</target>
<target name="package" depends="compile">
<mkdir dir="${tmpDir}" />
<jar jarfile="${tmpDir}/Java2DF.jar"
compress="true"
index="false"
basedir="${buildDir}">
<manifest>
<attribute name="Main-Class" value="net.tabesugi.fgyama.Java2DF"/>
</manifest>
</jar>
</target>
<target name="sample" depends="build">
<java classname="net.tabesugi.fgyama.Java2DF">
<arg value="-v" />
<arg value="-a" />
<arg value="-S" />
<arg value="-o" />
<arg file="tests/Hello.graph" />
<arg file="tests/Hello.java" />
<classpath location="${buildDir}" />
<classpath refid="build.classpath"/>
</java>
<java classname="net.tabesugi.fgyama.Java2DF">
<arg value="-v" />
<arg value="-a" />
<arg value="-S" />
<arg value="-o" />
<arg file="tests/App1.graph" />
<arg file="tests/App1.java" />
<classpath location="${buildDir}" />
<classpath refid="build.classpath"/>
</java>
</target>
<target name="test" depends="build">
<junit fork="yes">
<jvmarg value="-ea" />
<formatter type="plain" usefile="false" />
<classpath location="${buildDir}" />
<classpath refid="build.classpath"/>
<test name="net.tabesugi.fgyama.UnitTestDF" />
</junit>
</target>
<target name="java2xml" depends="build">
<java classname="net.tabesugi.fgyama.Java2Xml">
<classpath location="${buildDir}" />
<classpath refid="build.classpath"/>
<arg value="-o" />
<arg file="${out_xml}" />
<arg file="${input}" />
</java>
</target>
<target name="comm" depends="build">
<java classname="CommentExtractor">
<classpath location="${buildDir}" />
<classpath refid="build.classpath"/>
<arg file="${input}" />
</java>
</target>
<target name="get-deps" description="Download all dependencies">
<mkdir dir="${libDir}"/>
<get src="https://repo.maven.apache.org/maven2/org/apache/bcel/bcel/6.2/bcel-6.2.jar"
dest="${libDir}/bcel-6.2.jar" />
<get src="https://repo.maven.apache.org/maven2/junit/junit/4.13.1/junit-4.13.1.jar"
dest="${libDir}/junit-4.13.1.jar" />
<get src="https://repo.maven.apache.org/maven2/xmlunit/xmlunit/1.6/xmlunit-1.6.jar"
dest="${libDir}/xmlunit-1.6.jar" />
<get src="https://repo.maven.apache.org/maven2/org/xerial/sqlite-jdbc/3.34.0/sqlite-jdbc-3.34.0.jar"
dest="${libDir}/sqlite-jdbc-3.34.0.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/jdt/org.eclipse.jdt.core/3.25.0/org.eclipse.jdt.core-3.25.0.jar"
dest="${libDir}/org.eclipse.jdt.core-3.25.0.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/platform/org.eclipse.core.resources/3.14.0/org.eclipse.core.resources-3.14.0.jar"
dest="${libDir}/org.eclipse.core.resources-3.14.0.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/platform/org.eclipse.core.runtime/3.20.100/org.eclipse.core.runtime-3.20.100.jar"
dest="${libDir}/org.eclipse.core.runtime-3.20.100.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/platform/org.eclipse.core.filesystem/1.7.700/org.eclipse.core.filesystem-1.7.700.jar"
dest="${libDir}/org.eclipse.core.filesystem-1.7.700.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/platform/org.eclipse.core.expressions/3.7.100/org.eclipse.core.expressions-3.7.100.jar"
dest="${libDir}/org.eclipse.core.expressions-3.7.100.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/platform/org.eclipse.core.jobs/3.10.1100/org.eclipse.core.jobs-3.10.1100.jar"
dest="${libDir}/org.eclipse.core.jobs-3.10.1100.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/platform/org.eclipse.core.contenttype/3.7.900/org.eclipse.core.contenttype-3.7.900.jar"
dest="${libDir}/org.eclipse.core.contenttype-3.7.900.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/platform/org.eclipse.equinox.common/3.14.100/org.eclipse.equinox.common-3.14.100.jar"
dest="${libDir}/org.eclipse.equinox.common-3.14.100.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/platform/org.eclipse.equinox.registry/3.10.100/org.eclipse.equinox.registry-3.10.100.jar"
dest="${libDir}/org.eclipse.equinox.registry-3.10.100.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/platform/org.eclipse.equinox.preferences/3.8.200/org.eclipse.equinox.preferences-3.8.200.jar"
dest="${libDir}/org.eclipse.equinox.preferences-3.8.200.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/platform/org.eclipse.equinox.app/1.5.100/org.eclipse.equinox.app-1.5.100.jar"
dest="${libDir}/org.eclipse.equinox.app-1.5.100.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/platform/org.eclipse.text/3.11.0/org.eclipse.text-3.11.0.jar"
dest="${libDir}/org.eclipse.text-3.11.0.jar" />
<get src="https://repo.maven.apache.org/maven2/org/eclipse/platform/org.eclipse.osgi/3.16.200/org.eclipse.osgi-3.16.200.jar"
dest="${libDir}/org.eclipse.osgi-3.16.200.jar" />
</target>
</project>