From: Steve F. <sm...@us...> - 2002-09-09 21:25:44
|
Update of /cvsroot/mockobjects/mockobjects-java/doc In directory usw-pr-cvs1:/tmp/cvs-serv10538/doc Modified Files: site.xml Log Message: reworked site build script removed old implementation added gzip and (untested) upload target from original build.xml Index: site.xml =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/doc/site.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- site.xml 9 Sep 2002 00:44:50 -0000 1.4 +++ site.xml 9 Sep 2002 21:25:41 -0000 1.5 @@ -1,60 +1,81 @@ <?xml version="1.0" encoding="UTF-8"?> <project name="site" default="site" basedir="."> - <target name="copy-stylesheet"> - <copy file="html/stylesheet.css" todir="out"/> - </target> - - <target name="site" depends="copy-stylesheet"> - <javac srcdir="."> - <include name="SiteHack.java"/> - </javac> - <java classname="SiteHack"> - <classpath path="."/> - <arg value="html/template.txt"/> - <arg value="html/alt.html"/> - <arg value="html/changes.html"/> - <arg value="html/coding_conventions.html"/> - <arg value="html/downloads.html"/> - <arg value="html/endotesting.html"/> - <arg value="html/index.html"/> - <arg value="html/license.html"/> - <arg value="html/naming_conventions.html"/> - <arg value="html/papers.html"/> - <arg value="html/release_process.html"/> - <arg value="html/todo.html"/> - <arg value="html/index.html"/> - <arg value="html/faq.html"/> - </java> - </target> - - - <target name="clean"> - <delete quiet="true"> - <fileset dir="out" /> - <fileset includes="**/*.class" /> - </delete> - </target> - - <target name="add-task"> - <javac srcdir="." /> - <taskdef name="template" - classname="com.mockobjects.doc.SiteTemplate" - classpath="."/> - </target> - - <target name="create-out-dir"> - <mkdir dir="out" /> - </target> - - <target name="format" - depends="add-task, create-out-dir, copy-stylesheet" - description="Create the output directory and copy templated files over."> - <template - templatefile="html/template.txt" - todir="out" - dir="html" - includes="*.html"/> - </target> + <target name="project-properties"> + <property name="project.name" value="mockobjects" /> + <property name="site.name" value="${project.name}-website" /> + <property name="out.dir" value="out" /> + <property name="site.tar" value="${site.name}.tar" /> + </target> + + <target name="copy-stylesheet"> + <copy file="html/stylesheet.css" todir="out"/> + </target> + + <target name="clean" + depends="project-properties"> + <delete quiet="true"> + <fileset dir="${out.dir}"/> + <fileset includes="**/*.class"/> + </delete> + </target> + + <target name="add-task"> + <javac srcdir="."/> + <taskdef name="template" + classname="com.mockobjects.doc.SiteTemplate" + classpath="."/> + </target> + + <target name="site" + depends="project-properties, add-task, copy-stylesheet" + description="Create the output directory and copy templated files over."> + <mkdir dir="${out.dir}"/> + <template + templatefile="html/template.txt" + todir="${out.dir}" + dir="html" + includes="*.html"/> + </target> + + <target name="archive.site" + depends="site"> + <tar tarfile="${site.tar}" + basedir="${out.dir}" /> + + <gzip zipfile="${site.tar}.gz" + src="${site.tar}" /> + + <delete file="${site.tar}" /> + </target> + + <!-- + ======================================================================== + Deploy the web site to SourceForge, using the 'scp' + and 'ssh' commands. The variable "username" need to be passed to Ant + when calling this target and represent your username on SourceForge. + + Ex: ant -Dusername=vmassol deploy-site + + ======================================================================== + --> + <target name="deploy-site" + depends="project-properties" + if="username" + description="Deploy the web site to SourceForge (see target for details)"> + + <property name="deploy.homepage" value="/home/groups/m/mo/mockobjects/htdocs"/> + <property name="deploy.host" value="mockobjects.sourceforge.net"/> + + <exec dir="." executable="scp"> + <arg value="${site.tar}.gz"/> + <arg value="${username}@${deploy.host}:${deploy.homepage}"/> + </exec> + + <exec dir="." executable="ssh"> + <arg + line="-l ${username} ${deploy.host} 'cd ${deploy.homepage};gunzip ${site.tar}.gz;tar xvf ${site.tar};rm ${site.tar}'"/> + </exec> + </target> </project> |