-<project name="xwt" default="run" basedir=".">
+<project name="xwt" default="compile" basedir=".">
<!-- required so that libgcj.jar doesn't interfere with non-gcj compilation -->
<property name="build.sysclasspath" value="first"/>
<property name="build.compiler" value="jikes"/>
<property environment="env"/>
- <!-- the hostname of a cygwin machine running sshd; used for .cab-signing and running Win32 binaries -->
- <property name="cygwin-host" value="vmware"/>
-
- <!-- a path on ${cygwin-host} which maps to the root of this XWT tree; usually exported from the build machine using samba -->
- <property name="cygwin-path" value="z:/xwt"/>
-
<!-- set up our classpath -->
<path id="classpath">
<pathelement path="${envCLASSPATH}"/>
<pathelement path="bin/"/>
- <fileset dir="www/webapps/lib">
- <include name="**/*.jar"/>
- </fileset>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<!-- purges binaries we've built -->
<target name="clean">
- <bash>
- find . -name \*\~ | xargs rm -f
- find . -name \#\*\# | xargs rm -f
- rm -rf bin-* bin xwt/html/dist/
- </bash>
- </target>
-
- <!-- creates javadoc documentation -->
- <target name="genjavadoc" unless="javadoc_ok">
- <javadoc sourcepath="src" destdir="www/html/javadoc/" package="yes" protected="no" packagenames="org.xwt.*"/>
- </target>
-
- <!-- creates javasrc documentation -->
- <target name="genjavasrc" unless="javasrc_ok">
- <java classname="javasrc.app.JavaSrc" fork="yes">
- <classpath refid="classpath"/>
- <jvmarg value="-Doutdir=www/html/javasrc/"/>
- <arg value="src/org/xwt/"/>
- </java>
+ <delete quiet="true" dir="bin"/>
+ <delete quiet="true">
+ <fileset dir="./" casesensitive="yes" defaultexcludes="no">
+ <include name="bin-*"/>
+ <include name="**/*~"/>
+ <include name="**/#*#"/>
+ <exclude name="**/.#*"/>
+ <exclude name="**/%*%"/>
+ <exclude name="**/._*"/>
+ <exclude name="**/CVS"/>
+ <exclude name="**/CVS/**"/>
+ <exclude name="**/.cvsignore"/>
+ <exclude name="**/SCCS"/>
+ <exclude name="**/SCCS/**"/>
+ <exclude name="**/vssver.scc"/>
+ <exclude name="**/.svn"/>
+ <exclude name="**/.svn/**"/>
+ </fileset>
+ </delete>
</target>
<!-- compiles all .java files into .class files; all other tasks predepend on this since they need the <taskdef/>'s -->
<target name="compile">
<mkdir dir="bin/"/>
- <echo message="compiling .java -> .class"/>
+ <echo message="compiling .java -> .class [xwt]"/>
<javac destdir="bin/" deprecation="no">
<src path="src/"/>
<include name="**/*.java"/>
<classpath>
+
<!-- don't EVER include the following line anywhere else; it causes really bizarre errors -->
<pathelement location="${gcc-path}/share/libgcj.jar"/>
<path refid="classpath"/>
+
+ <!-- this is for people who don't have libgcj.jar -->
+ <pathelement location="lib/libgcj-minimal.jar"/>
+
</classpath>
</javac>
- <taskdef name="bash" classname="org.xwt.tasks.BashTask">
- <classpath path="bin/"/>
- </taskdef>
+ <echo message="updating .xwt -> .xwar"/>
+ <zip update="true" zipfile="bin/org/xwt/builtin.xwar" basedir="src" includes="org/xwt/builtin/*.png,org/xwt/builtin/*.xwt,org/xwt/builtin/*.xwf"/>
</target>
<target name="build" depends="compile">
- <mkdir dir="www/html/dist/"/>
<ant dir="." antfile="src/org/xwt/plat/${plat}.xml" target="build"/>
</target>
- <target name="run" depends="compile,build">
- <ant dir="." antfile="src/org/xwt/plat/${plat}.xml" target="run"/>
- </target>
-
- <!-- rebuild the www/ area -->
- <target name="www" depends="compile">
- <mkdir dir="www/html/javadoc/"/>
- <mkdir dir="www/html/javasrc/"/>
- <uptodate property="javadoc_ok" targetfile="www/html/javadoc/index.html">
- <srcfiles dir= "src/" includes="**/*.java"/>
- </uptodate>
- <uptodate property="javasrc_ok" targetfile="www/html/javasrc/index.html">
- <srcfiles dir= "src/" includes="**/*.java"/>
- </uptodate>
- <bash>
- # throw on the prefix/suffix where needed
- for A in `find www/html -name \*.html_`
- do (cat www/html/prefix.html; cat $A; cat www/html/suffix.html; cat "$A"_ 2>/dev/null; cat www/html/tagline.html) > `echo $A | sed s/_\$//g`
- done
- </bash>
- </target>
-
- <target name="staging">
- <property name="staging-flag" value="-Dstaging"/>
- <property name="host" value="xwt-staging.org"/>
- <antcall target="really-push"/>
- </target>
-
- <target name="production">
- <antcall target="genjavadoc"/>
- <antcall target="genjavasrc"/>
- <property name="staging-flag" value=""/>
- <property name="host" value="xwt.org"/>
- <antcall target="really-push"/>
- </target>
-
- <target name="newbuild" depends="compile">
- <taskdef name="build-id" classname="org.xwt.tasks.BuildIdTask">
- <classpath path="bin/"/>
- </taskdef>
- <build-id/>
- <bash> cvs commit -m "automatically updated build-id via org.xwt.tasks.BuildIdTask" build.properties </bash>
- <property file="build.properties"/>
-
- <mkdir dir="www/html/dist/"/>
-
- <!-- rebuild distributions -->
- <property name="plat" value="Win32"/>
- <ant dir="." antfile="src/org/xwt/plat/Win32.xml" target="build"/>
- <ant dir="." antfile="src/org/xwt/plat/Win32.xml" target="dist"/>
- <property name="plat" value="Java2"/>
- <ant dir="." antfile="src/org/xwt/plat/Java12.xml" target="build"/>
- <ant dir="." antfile="src/org/xwt/plat/Java12.xml" target="dist"/>
-
- <!-- sign stuff -->
- <bash> /home/megacz/bin/sign/sign ${build-id} </bash>
- </target>
-
- <!-- required packages: bind, apache, libapache-mod-ssl, libapache-mod-jk, sshd, rsync, j2sdk, tomcat, gnuchess -->
- <target name="really-push" depends="compile,www">
-
- <!-- update demo xwars -->
- <zip update="true" zipfile="www/html/demo.xwar" basedir="src" includes="org/xwt/demo/**,xwt/standard/**,org/xwt/themes/**"/>
- <zip update="true" zipfile="www/html/demo.xwar" basedir="src/org/xwt/demo/" includes="main.xwt"/>
- <zip update="true" zipfile="www/html/chess.xwar" basedir="src" includes="org/xwt/chess/**,xwt/standard/**,org/xwt/themes/**"/>
- <zip update="true" zipfile="www/html/chess.xwar" basedir="src/org/xwt/chess/" includes="main.xwt"/>
- <zip update="true" zipfile="www/html/mail.xwar" basedir="src"
- includes="org/xwt/mail/**,xwt/standard/**,org/xwt/themes/**,org/gimp/tigert/**,org/xwt/fonts/**"
- excludes="org/xwt/mail/main.xwt"
- />
- <zip update="true" zipfile="www/html/mail.xwar" basedir="src/org/xwt/mail/" includes="main.xwt"/>
-
- <mkdir dir="www/webapps/classes/"/>
- <copy todir="www/webapps/classes/">
- <fileset dir="bin/" includes="org/xwt/server/**"/>
- </copy>
-
- <bash host="root@${host}">
- # first, clone the currently running copy of xwt, so we can use rsync to save bandwidth
- rm -rf /xwt-new
- mkdir -p /xwt
- mkdir -p /xwt-new
- cd /xwt
- tar cf - . | tar xf - -C /xwt-new
- </bash>
-
- <bash>
- # tidy up and rsync our changes
- find www/html -name \*~ | xargs rm -f
- rsync -Pv --delete --exclude=html/dist/\* -rze ssh www/ root@${host}:/xwt-new/www/
- rsync -u -Pv -rze ssh www/html/dist/ root@${host}:/xwt-new/www/html/dist/
- </bash>
-
- <bash host="root@${host}">
- # stop services
- /sbin/start-stop-daemon --stop --pidfile /var/log/xwt/apache.pid --exec /usr/sbin/apache
- /sbin/start-stop-daemon --stop --pidfile /var/log/xwt/tomcat.pid --user www-data
-
- rm -rf /xwt-old
- mv /xwt /xwt-old
- mv /xwt-new /xwt
-
- mkdir /var/log/xwt &>/dev/null
- chown www-data /var/log/xwt/
-
- ln -s /xwt/www/webapps /xwt/www/webapps/ROOT
- ln -s /xwt/www/webapps /xwt/www/webapps/WEB-INF
- ln -s /xwt/www/launch /xwt/www/launch/ROOT
- ln -s /xwt/www/launch /xwt/www/launch/WEB-INF
-
- export JAVA_HOME=/usr/lib/j2sdk1.3
- export CLASSPATH=$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/tools.jar:/usr/share/tomcat/classes:/usr/share/tomcat/lib/tomcat.jar
-
- touch /var/log/xwt/tomcat.log
- chown www-data /var/log/xwt/tomcat.log
-
- test ${host} == "xwt-staging.org" && echo -e "User-agent: *\nDisallow: /\n" > /xwt/www/html/robots.txt
-
- /sbin/start-stop-daemon \
- --start --pidfile /var/log/xwt/tomcat.pid --make-pidfile --chuid www-data --exec \
- /usr/lib/j2sdk1.3/bin/java -- -server -Dtomcat.home=/usr/share/tomcat -Xmx500M \
- org.apache.tomcat.startup.Main -config /xwt/www/etc/server.xml start \
- >> /var/log/xwt/tomcat.log 2>&1 &
-
- /sbin/start-stop-daemon --start --pidfile /var/log/xwt/apache.pid --exec /usr/sbin/apache -- -f /xwt/www/etc/httpd.conf ${staging-flag}
- </bash>
- </target>
-
-
</project>
-
-
- <!-- old javago optimization code - - reintegrate at some point
- lib/javago.`uname` -threshold 300 -not-inline-constructor -not-use-invokespecial org/xwt/Box.class
- lib/javago.`uname` -threshold 300 -not-inline-constructor -not-use-invokespecial org/xwt/Box.class
- lib/javago.`uname` -threshold 200 -not-inline-constructor -not-use-invokespecial org/xwt/Surface.class
- lib/javago.`uname` -threshold 50 -not-inline-constructor -not-use-invokespecial org/xwt/GetPutHandler*
- lib/javago.`uname` -threshold 200 -not-inline-constructor -not-use-invokespecial org/xwt/util/DirtyList.class
- -->