-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
106 lines (96 loc) · 3.14 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
<project name="CS364AntFile" default="dist" basedir=".">
<description>
Build file for CS 364 S21 P2
</description>
<!-- TODO update these values as needed -->
<property name="project-name" value="lexer"/>
<property name="main-class" value="Main"/>
<property name="flex-file" value="Lexer.flex"/>
<!-- END TODO -->
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<!-- add local and global classpath -->
<path id="classpath">
<fileset dir="lib" erroronmissingdir="false">
<include name="**/*.jar" />
</fileset>
<fileset dir="/java-libs" erroronmissingdir="false">
<include name="**/*.jar" />
</fileset>
</path>
<!-- create a JFlex task -->
<taskdef classname="jflex.anttask.JFlexTask" name="jflex">
<classpath>
<path refid="classpath"/>
</classpath>
</taskdef>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}/classes"/>
</target>
<target name="compile" depends="init"
description="compile the source">
<!-- Create JFlex class -->
<jflex
file="${src}/${flex-file}"
destdir="${build}/generated/" />
<!-- Compile the Java code from ${src} into ${build} -->
<javac destdir="${build}/classes">
<src path="${build}/generated" />
<src path="${src}" />
<src path="." />
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution">
<!-- Put everything in ${build} into the ${ant.project.name}.jar file -->
<jar jarfile="${project-name}.jar" basedir="${build}/classes" >
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>
<target name="clean"
description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete file="${project-name}.jar"/>
<delete file="fullsubmit.tar.gz"/>
</target>
<target name="fullsubmit" depends="clean"
description="Create a tar.gz file to upload to the autograder">
<tar destfile="fullsubmit.tar.gz" compression="gzip">
<tarfileset dir="${src}" prefix="src/">
<include name="*.java" />
<include name="*.flex" />
</tarfileset>
<tarfileset dir="${src}">
<include name="test*txt"/>
<include name="good.cl"/>
<include name="bad.cl"/>
</tarfileset>
<tarfileset dir=".">
<include name="*.java" />
<include name="*.flex" />
<include name="test*.txt"/>
<include name="build.xml"/>
<include name="good.cl"/>
<include name="bad.cl"/>
<include name="references.txt"/>
<include name="readme.txt"/>
<include name="team.txt"/>
</tarfileset>
</tar>
<echo message="Contents of fullsubmit.tar.gz:" />
<exec executable="tar">
<arg value="tzf" />
<arg file="fullsubmit.tar.gz" />
</exec>
</target>
</project>