-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
131 lines (128 loc) · 6.42 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="copy_to_server" name="NetBang">
<property environment="env" />
<property name="ECLIPSE_HOME" value="../../../../Program Files/eclipse" />
<property name="debuglevel" value="source,lines,vars" />
<property name="target" value="1.6" />
<property name="source" value="1.6" />
<property name="version.num" value="0.8" />
<path id="NetBang.classpath">
<pathelement location="classes" />
</path>
<target name="init">
<mkdir dir="classes" />
<copy includeemptydirs="false" todir="classes">
<fileset dir="src" excludes="**/*.launch, **/*.java" />
</copy>
</target>
<target name="clean">
<delete dir="classes" />
</target>
<target depends="clean" name="cleanall" />
<target depends="build-subprojects,build-project" name="build" />
<target name="build-subprojects" />
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}" />
<javac debug="true" debuglevel="${debuglevel}" destdir="classes" source="${source}" target="${target}">
<src path="src" />
<classpath refid="NetBang.classpath" />
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects" />
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar" />
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar" />
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar" />
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" />
<antcall target="build" />
</target>
<target name="Bang">
<java classname="netbang.core.Bang" failonerror="true" fork="yes">
<classpath refid="NetBang.classpath" />
</java>
</target>
<target name="Client">
<java classname="netbang.network.Client" failonerror="true" fork="yes">
<classpath refid="NetBang.classpath" />
</java>
</target>
<target name="Host">
<java classname="netbang.launchers.Host" failonerror="true" fork="yes">
<classpath refid="NetBang.classpath" />
</java>
</target>
<target name="Server">
<java classname="netbang.network.Server" failonerror="true" fork="yes">
<classpath refid="NetBang.classpath" />
</java>
</target>
<target name="ServerBrowser">
<java classname="netbang.network.ServerBrowser" failonerror="true" fork="yes">
<classpath refid="NetBang.classpath" />
</java>
</target>
<target name="Test2">
<java classname="netbang.launchers.Test2" failonerror="true" fork="yes">
<classpath refid="NetBang.classpath" />
</java>
</target>
<target name="Test4">
<java classname="netbang.launchers.Test4" failonerror="true" fork="yes">
<classpath refid="NetBang.classpath" />
</java>
</target>
<target name="create_run_jar" depends="build,find_revision">
<jar destfile="bang.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="netbang.network.ServerBrowser" />
<attribute name="Class-Path" value="." />
<attribute name="Implementation-Vendor" value="NetBang Team" />
<attribute name="Implementation-Title" value="NetBang" />
<attribute name="Implementation-Version" value="${version.num}r${svn.revision}" />
</manifest>
<fileset dir="classes" />
<fileset file="revision.txt" />
</jar>
</target>
<target name="create_updater_jar" depends="build,find_revision">
<jar destfile="updater.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="updater.Updater" />
<attribute name="Class-Path" value="." />
<attribute name="Implementation-Vendor" value="NetBang Team" />
<attribute name="Implementation-Title" value="NetBang" />
<attribute name="Implementation-Version" value="${version.num}r${svn.revision}" />
</manifest>
<fileset dir="classes" includes="updater/**"/>
</jar>
</target>
<target name="copy_to_server" depends="find_revision,create_run_jar,create_updater_jar">
<input message="Please enter username:" addproperty="scpuser" defaultvalue="ibrahima" />
<input message="Please enter password:" addproperty="scppw" />
<scp file="bang.jar" trust="yes" remoteToFile="${scpuser}:${scppw}@cory.eecs.berkeley.edu:~/public_html/bang/bangr${svn.revision}.jar">
</scp>
<scp file="updater.jar" trust="yes" remoteToFile="${scpuser}:${scppw}@cory.eecs.berkeley.edu:~/public_html/bang/updater.jar">
</scp>
<sshexec host="cory.eecs.berkeley.edu" username="${scpuser}" password="${scppw}" trust="yes" command="chmod 644 ~/public_html/bang/bangr${svn.revision}.jar" />
<sshexec host="cory.eecs.berkeley.edu" username="${scpuser}" password="${scppw}" trust="yes" command="ln -s -f ~/public_html/bang/bangr${svn.revision}.jar ~/public_html/bang/bang.jar" />
<scp file="revision.txt" trust="yes" todir="${scpuser}:${scppw}@cory.eecs.berkeley.edu:~/public_html/bang">
</scp>
</target>
<target name="find_revision" description="Sets property 'build.num' to the next revision">
<buildnumber file="revision.txt" />
<echo>Revision: ${build.number}</echo>
</target>
</project>