forked from ucsb-cs56-projects/cs56-scrapers-ucsb-curriculum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
167 lines (140 loc) · 6.7 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
<?xml version="1.0" encoding="utf-8"?>
<project default="compile">
<!-- build.xml for cs56-scrapers-ucsb-curriculum
Authors:
Richard Young, CS56, F16
Jim Vargas, CS56, F16
Kevin Zaragoza, CS56, W16
Natasha Lee, CS56, W16
Kevin Mai, CS56, W14
James Neally, CS56, W12
Mark Nguyen, CS56, S13
Daniel Vicory, CS56, S13
P. Conrad, CS56, S13 -->
<property environment="env" /> <!-- load the environment variables -->
<property name="webRoot" value="${env.HOME}/public_html/" />
<property name="webBaseUrl" value="http://www.cs.ucsb.edu/~${env.USER}/" />
<property name="course" value="cs56" />
<property name="quarter" value="W14" />
<property name="issueNum" value="0000660" />
<property name="mainClass" value="edu.ucsb.cs56.projects.scrapers.ucsb_curriculum.UCSBCurriculumSearch" />
<property name="installCert" value="edu.ucsb.cs56.projects.scrapers.ucsb_curriculum.InstallCert"/>
<property name="GUI" value="edu.ucsb.cs56.projects.scrapers.ucsb_curriculum.UCSBgui" />
<property name="golder_gui" value="edu.ucsb.cs56.projects.scrapers.ucsb_curriculum.SearchGui_Curriculum" />
<property name="projectName" value="${course}_${quarter}_${issueNum}" />
<property name="projectPath" value="edu/ucsb/cs56/projects/scrapers/ucsb-curriculum" />
<property name="javadocDest" value="${webRoot}/cs56/cs56-scrapers-ucsb-curriculum/javadoc" />
<property name="javadocURL" value="${webBaseUrl}cs56/cs56-scrapers-ucsb-curriculum/javadoc" />
<property name="jar.file" value="CurriculumScraper-v1.0.1.jar"/>
<property name="javadoc_path" location="javadoc"/>
<property name="public_javadoc_path" location="../cs56-scrapers-ucsb-curriculum-javadoc/javadoc"/>
<path id="project.class.path">
<pathelement location="build" />
<pathelement location="lib/junit-4.8.2.jar" />
</path>
<pathconvert property="mf.classpath" pathsep=" ">
<path refid="project.class.path"/>
<mapper>
<chainedmapper>
<flattenmapper/>
<globmapper from="*.jar" to="lib/*.jar"/>
</chainedmapper>
</mapper>
</pathconvert>
<target name="-check-ssl-file" unless="file.exists">
<available property="file.exists" file="jssecacerts" />
</target>
<target name="setup"
depends="compile,-check-ssl-file"
description="downloads ssl certificate for curriculum search page"
unless="${file.exists}">
<java classname="${installCert}" inputstring="1">
<arg value="my.sa.ucsb.edu:443" />
<classpath refid="project.class.path" />
</java>
</target>
<target name="compile" description="compile the code">
<mkdir dir="build" />
<javac srcdir="src" destdir="build" debug="true" debuglevel="lines,source" includeantruntime="false">
<classpath refid="project.class.path" />
</javac>
</target>
<target name="golderJar" depends="compile" description="create a jar">
<mkdir dir="build/jar"/>
<jar destfile="temp.jar" basedir="build">
<manifest>
<attribute name="Main-Class" value="edu.ucsb.cs56.projects.scrapers.ucsb_curriculum.SearchGui_Curriculum"/>
</manifest>
</jar>
<jar destfile="${jar.file}" basedir="build" filesetmanifest="skip">
<zipgroupfileset dir="build" includes="*.jar"/>
<zipgroupfileset dir="lib" includes="*.jar"/>
<manifest>
<attribute name="Class-Path" value="${mf.classpath}"/>
<attribute name="Main-Class" value="edu.ucsb.cs56.projects.scrapers.ucsb_curriculum.SearchGui_Curriculum"/>
</manifest>
</jar>
</target>
<target name="run" depends = "compile,setup" description="run the gui">
<java fork="true" classpathref="project.class.path" classname="${GUI}" />
</target>
<target name="golderTest" depends = "compile,setup" description="run golder search gui">
<java fork="true" classpathref="project.class.path" classname="${golder_gui}" />
</target>
<target name="cli" depends="compile,setup" description="run the main">
<java classname="${mainClass}">
<classpath refid="project.class.path" />
</java>
</target>
<target name="clean" description="get rid of unnecessary files">
<delete failonerror="false" verbose="true">
<fileset dir="build" includes="**/*.class" />
</delete>
<delete dir="javadoc" quiet="true" />
<delete dir="dist" quiet="true" />
<delete dir="download" quiet="true" />
<delete dir="temp" quiet="true" />
</target>
<target name="test" depends="compile,setup" description="run junit tests">
<junit haltonerror="no" haltonfailure="no">
<classpath refid="project.class.path" />
<batchtest fork="yes">
<fileset dir="src">
<!-- this will pick up every class with a name ending in Test -->
<include name="**/*Test.java" />
</fileset>
</batchtest>
<formatter type="plain" usefile="false" />
</junit>
</target>
<property name="javadoc_absolute_path" location="javadoc"/>
<property name="public_javadoc_absolute_path" location="../cs56-scrapers-ucsb-curriculum-javadoc/javadoc/"/>
<target name="javadoc" depends="compile">
<delete quiet="true">
<fileset dir="javadoc" />
</delete>
<javadoc destdir="javadoc">
<fileset dir="src/edu/ucsb/cs56/projects/scrapers/ucsb_curriculum/" >
<include name="*.java"/>
</fileset>
<classpath refid="project.class.path" />
<link href="https://docs.oracle.com/javase/8/docs/api/" />
</javadoc>
<echo>
javadoc written to file://${javadoc_absolute_path}/index.html
copying to ${public_javadoc_absolute_path}/index.html
</echo>
<delete quiet="true">
<fileset dir="${public_javadoc_absolute_path}" />
</delete>
<mkdir dir="${public_javadoc_absolute_path}" />
<copy todir="${public_javadoc_absolute_path}">
<fileset dir="javadoc" />
</copy>
<echo>
javadoc copied to ${public_javadoc_absolute_path}/index.html
TO PUBLISH: cd into that repo, then git add javadoc;
git commit -m "update javadoc"; git push origin gh-pages
</echo>
</target>
</project>