Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 767a7af229
Fetching contributors…

Cannot retrieve contributors at this time

402 lines (335 sloc) 17.15 kb
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2010 Mark Mandel
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="narwhal" default="deploy">
<!-- GENERAL PROPERTIES -->
<property name="src" location="./coldspring" />
<property name="tmp" location="/tmp" />
<property name="coldspring.version" value="2.0" />
<property name="coldspring.server" value="www.coldspringframework.org"/>
<property name="coldspring.server.schema" value="/Application/schema"/>
<property name="coldspring.sourceforge.server" value="web.sourceforge.net"/>
<property name="coldspring.sourceforge.webroot" value="/home/project-web/coldspring/htdocs" />
<property name="coldspring.sourceforge.docs" value="${coldspring.sourceforge.webroot}/ber/docs"/>
<property name="coldspring.sourceforge.files" value="frs.sourceforge.net"/>
<property name="coldspring.sourceforge.fileroot" value="/home/pfs/project/c/co/coldspring" />
<property name="coldspring.localserver" value="coldspring"/>
<property name="coldspring.localport" value="80"/>
<property name="coldspring.defaultcontext" value="/cf9"/>
<property name="test.results" location="./results"/>
<property name="docs" location="./docs"/>
<property name="docs.xsddoc" location="${docs}/xsd"/>
<property name="docs.api" location="${docs}/api"/>
<property name="xsddoc" location="${docs}/gen/xsddoc"/>
<property name="xsddoc.lib" location="${xsddoc}/lib"/>
<property name="xsddoc.templates" location="${xsddoc}/templates"/>
<property name="antlr.src" location="./antlr"/>
<property name="antlr.lib" location="${antlr.src}/lib"/>
<property name="antlr.jar" location="${src}/core/java/lib/" />
<property name="antlr.cp" location="${antlr.lib}/antlr-3.3-complete.jar"/>
<property name="varscoper.results" location="${test.results}/varscoper"/>
<property name="varscoper.filePath" value="/home/mark/tomcat6/webapps/cf9/coldspring"/>
<property name="varscoper.url" value="${coldspring.localserver}:${coldspring.localport}${coldspring.defaultcontext}/varscoper/varScoper.cfm"/>
<property name="build" location="./build" />
<taskdef name="mxunittask" classname="org.mxunit.ant.MXUnitAntTask" classpath="${build}/mxunit-ant.jar"/>
<taskdef resource="net/jtools/classloadertask/antlib.xml" classpath="${build}/ant-classloadertask.jar"/>
<classloader loader="system" classpath="${build}/commons-net-2.0.jar"/>
<taskdef name="ftp" classname="org.apache.tools.ant.taskdefs.optional.net.FTP"/>
<!-- =================================
target: deploy-jenkins
================================= -->
<target name="integrate" description="script for continuous integration to run">
<antcall target="clean-results" />
<antcall target="aop-parser-test"/>
<antcall target="unittest"/>
<antcall target="varscoper"/>
<echo message="Unit Tests Passes, generating documentation" />
<antcall target="colddoc"/>
<antcall target="xsddoc"/>
</target>
<!-- =================================
target: deploy
================================= -->
<target name="deploy" depends="" description="Deploy the current build of ColdSpring">
<antcall target="upload-schemas"/>
<antcall target="xsddoc"/>
<antcall target="colddoc"/>
<antcall target="upload-documentation"/>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: varscoper
- - - - - - - - - - - - - - - - - -->
<target name="varscoper">
<mkdir dir="${test.results}/varscoper" />
<get src="http://${varscoper.url}?filePath=${varscoper.filePath}&amp;submitButton=start&amp;displayFormat=screen&amp;recursiveDirectory=true&amp;parseCfscript=true"
dest="${test.results}/varscoper/index.html" />
</target>
<!-- - - - - - - - - - - - - - - - - -
target: clean-results
- - - - - - - - - - - - - - - - - -->
<target name="clean-results">
<delete dir="${test.results}"/>
<mkdir dir="${test.results}"/>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: unittest
- - - - - - - - - - - - - - - - - -->
<target name="unittest">
<antcall target="run-tests">
<param name="test.context" value="/cf9"/>
<param name="test.package" value="tests.cf9"/>
</antcall>
<antcall target="run-tests">
<param name="test.context" value="/cf8"/>
<param name="test.excludes" value="cf9"/>
<param name="test.package" value="tests.cf8"/>
</antcall>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: run-tests
- - - - - - - - - - - - - - - - - -->
<target name="run-tests">
<echo message="Running unit tests for ${test.context}"/>
<property name="test.results.path" location="${test.results}/${test.context}"/>
<mkdir dir="${test.results.path}"/>
<property name="test.excludes" value=""/>
<mxunittask server="${coldspring.localserver}" port="${coldspring.localport}"
mxunithome="${test.context}/mxunit"
haltonerror="false"
haltonfailure="false"
defaultrunner="${test.context}/unittests/HttpAntRunner.cfc"
verbose="true"
outputdir="${test.results.path}"
>
<directory path="/unittests" componentpath="unittests" recurse="true" excludes="${test.excludes}" packagename="${test.package}"/>
</mxunittask>
<junitreport todir="${test.results.path}">
<fileset dir="${test.results.path}">
<include name="*.xml"/>
</fileset>
<report format="frames" todir="${test.results.path}" styledir="${build}/xsl"/>
</junitreport>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: uploadSchemas
- - - - - - - - - - - - - - - - - -->
<target name="upload-schemas" description="upload schemas to the ColdSpring website">
<input addproperty="schema-upload.do" message="Should we upload the XSDs?" validargs="Y,N" />
<antcall target="upload-schemas-${schema-upload.do}" />
</target>
<target name="upload-schemas-Y">
<echo message="Uploading Schemas to ${coldspring.server}"/>
<input addproperty="upload.schema.user" message="What is the FTP Username?"></input>
<input addproperty="upload.schema.password" message="What is the FTP Password?"></input>
<ftp server="${coldspring.server}" userid="${upload.schema.user}" password="${upload.schema.password}"
remotedir="${coldspring.server.schema}">
<fileset file="${src}/beans/xml/config/coldspring-beans-${coldspring.version}.xsd"/>
<fileset file="${src}/beans/xml/config/coldspring-util-${coldspring.version}.xsd"/>
<fileset file="${src}/aop/config/coldspring-aop-${coldspring.version}.xsd"/>
</ftp>
</target>
<target name="upload-schemas-N"/>
<!-- - - - - - - - - - - - - - - - - -
target: colddoc
- - - - - - - - - - - - - - - - - -->
<target name="colddoc" depends="colddoc-clean">
<get src="http://${coldspring.localserver}:${coldspring.localport}${coldspring.defaultcontext}/docs/gen/colddoc/run.cfm" dest="${tmp}/colddoc.html" />
<loadfile property="colddoc.return" srcfile="${tmp}/colddoc.html"></loadfile>
<echo message="Colddoc: ${colddoc.return}"></echo>
<condition property="colddoc.complete">
<contains string="${colddoc.return}" substring="Done!" casesensitive="false" />
</condition>
<echo message="Colddoc: ${colddoc.complete}"></echo>
<antcall target="colddoc-${colddoc.complete}" />
</target>
<target name="colddoc-true"></target>
<target name="colddoc-false">
<fail message="Error with ColdDoc"/>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: colddoc-clean
- - - - - - - - - - - - - - - - - -->
<target name="colddoc-clean">
<delete dir="${docs.api}/coldspring"/>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: xsddoc
Generates each of the xsddoc generation
- - - - - - - - - - - - - - - - - -->
<target name="xsddoc" depends="xsddoc-clean">
<mkdir dir="${docs.xsddoc}/beans"/>
<!-- beans documentation -->
<property name="cp" value="${xsddoc.lib}/xml-apis.jar;${xsddoc.lib}/xercesImpl.jar;${xsddoc.lib}/docflex-xml-re.jar"/>
<!--
Execute the DocFlex/XML generator.
IMPORTANT: The 'maxmemory' attribute sets the maximum heap size
available to Java VM when running DocFlex/XML.
Check this attribute when you need to process large quantities of data
(e.g. when you generate documentation by XML schemas with a great number
of component definitions).
The 'fork' attribute forces Ant to launch a separate instance of JVM.
This is needed to ensure that the memory specified in the 'maxmemory'
attribute will be allocated indeed. However, you may remain using Ant's
JVM instance, if you have already specified for it that much of memory.
-->
<java classname="com.docflex.xml.Generator" classpath="${cp}" maxmemory="512m" fork="true">
<!-- specify the template -->
<arg value="-template"/>
<arg value="${xsddoc.templates}/XSDDoc/FramedDoc.tpl"/>
<!-- specify the output format -->
<arg value="-format"/>
<arg value="HTML"/>
<!-- specify the output directory -->
<arg value="-d"/>
<arg value="${docs.xsddoc}/beans"/>
<!-- specify to not launch the generator GUI -->
<arg value="-nodialog"/>
<!-- specify to not launch the default viewer for the output file -->
<arg value="-launchviewer=false"/>
<!-- pass the template parameter (the documentation title, in this case) -->
<arg value="-p:docTitle=ColdSpring ${coldspring.version} Schemas"/>
<arg value="-p:html.renderLineBreaks=true"/>
<!--
Specify the data source XML file to be processed by the specified template.
(In this case, it is the XML schema to be documented.)
Easiest to grab it all off the web, as then it all resolves nicely.
-->
<arg value="http://${coldspring.server}/schema/coldspring-beans-${coldspring.version}.xsd"/>
<arg value="http://${coldspring.server}/schema/coldspring-util-${coldspring.version}.xsd"/>
<arg value="http://${coldspring.server}/schema/coldspring-aop-${coldspring.version}.xsd"/>
</java>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: xsddoc-clean
- - - - - - - - - - - - - - - - - -->
<target name="xsddoc-clean">
<delete dir="${docs.xsddoc}/beans"/>
</target>
<target name="upload-documentation">
<input addproperty="upload-documentation.do" message="Should we upload the Documentation to Sourceforge?" validargs="Y,N" />
<antcall target="upload-documentation-${upload-documentation.do}" />
</target>
<target name="upload-documentation-N"/>
<target name="upload-documentation-Y">
<input addproperty="upload-documentation.user" message="What is the Sourceforge Username?"></input>
<echo message="Rsync Schemas from ${coldspring.sourceforge.server}"/>
<property name="rsync.line" value="-rv --delete --exclude=/gen ./ ${upload-documentation.user}@${coldspring.sourceforge.server}:${coldspring.sourceforge.docs}"/>
<echo message="rsync ${rsync.line}"/>
<exec executable="rsync" dir="${docs}" logerror="true">
<arg line="${rsync.line}"/>
</exec>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: aop-parser
- - - - - - - - - - - - - - - - - -->
<target name="build-aop-parser" depends="aop-parser-clean">
<echo message="Generating Lexer &amp; Parser"/>
<java classname="org.antlr.Tool" classpath="${antlr.cp}" fork="true" dir="${antlr.src}">
<arg value="-report"/>
<arg value="${antlr.src}/com/coldspring/aop/expression/AopExpression.g"/>
</java>
<javac classpath="${antlr.cp}" srcdir="${antlr.src}" debug="true" debuglevel="lines,vars,source">
</javac>
<jar destfile="${antlr.jar}/aop-parser.jar" basedir="${antlr.src}" >
<include name="**/*.class"/>
</jar>
</target>
<!-- =================================
target: aop-parser-test
================================= -->
<target name="aop-parser-test" description="description">
<echo message="Running gUnit Tests"/>
<!-- need this, as gunit was foobar'd on the 3.3 release -->
<property name="gunit.cp" location="${antlr.lib}/gunit-3.3.1-SNAPSHOT.jar"/>
<property name="aop-parser.cp" location="${src}/core/java/lib/aop-parser.jar"/>
<echo message="classpath: ${gunit.cp};${antlr.cp};${aop-parser.cp};"></echo>
<java classname="org.antlr.gunit.Interp" classpath="${gunit.cp};${antlr.cp};${aop-parser.cp};" fork="true">
<arg value="${antlr.src}/com/coldspring/aop/expression/AopExpression.gunit"/>
</java>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: aop-parser-clean
- - - - - - - - - - - - - - - - - -->
<target name="aop-parser-clean">
<delete dir="${antlr.src}">
<include name="**/*.java"/>
<include name="**/*.class"/>
<include name="**/*.tokens"/>
</delete>
<delete dir="${antlr.src}/output"/>
</target>
<!-- =================================
target: release
================================= -->
<target name="release" depends="xsddoc,colddoc" description="description">
<input addproperty="release.user" message="Sourceforge username" />
<input addproperty="release.version" message="Version for release" defaultvalue="${coldspring.version}" />
<input addproperty="release.message" message="Tag message" />
<property name="release.sourceforge.docs" value="${coldspring.sourceforge.webroot}/${release.version}"/>
<property name="release.sourceforge.files" value="${coldspring.sourceforge.fileroot}/${release.version}"/>
<property name="release.dir" location="${tmp}/coldspring-release" />
<property name="release.dir.file" location="${release.dir}/files" />
<property name="release.dir.file.version" location="${release.dir.file}/${release.version}" />
<property name="release.filename" value="coldspring-v${release.version}.zip" />
<property name="release.dir.docs" location="${release.dir}/docs" />
<property name="release.dir.docs.version" location="${release.dir.docs}/${release.version}" />
<!-- clean it all up -->
<delete dir="${release.dir}" />
<!-- make directories -->
<mkdir dir="${release.dir.file.version}"/>
<mkdir dir="${release.dir.docs.version}"/>
<zip destfile="${release.dir.file.version}/${release.filename}" >
<zipfileset dir="${src}" prefix="coldspring"></zipfileset>
</zip>
<property name="rsync.line1" value="-rv --delete --exclude=/gen ./ ${release.dir.docs.version}/docs"/>
<echo message="rsync ${rsync.line1}"/>
<exec executable="rsync" dir="${docs}" logerror="true">
<arg line="${rsync.line1}"/>
</exec>
<echo message="Rsync documents to ${coldspring.sourceforge.server}"/>
<property name="rsync.line3" value="-rv --delete ${release.dir.docs.version}/ ${release.user}@${coldspring.sourceforge.server}:${release.sourceforge.docs}/"/>
<echo message="rsync ${rsync.line3}"/>
<exec executable="rsync" logerror="true">
<arg line="${rsync.line3}"/>
</exec>
<echo message="Rsync files to ${coldspring.sourceforge.files}"/>
<property name="rsync.line2" value="-rv --delete ${release.dir.file.version}/ ${release.user}@${coldspring.sourceforge.files}:${release.sourceforge.files}/"/>
<echo message="rsync ${rsync.line2}"/>
<exec executable="rsync" logerror="true">
<arg line="${rsync.line2}"/>
</exec>
<git command="tag">
<args>
<arg value="-a" />
<arg value="${release.version}" />
<arg value="-m ${release.message}" />
</args>
</git>
</target>
<!--
macro for git.
http://tlrobinson.net/blog/2008/11/13/ant-tasks-for-git/
-->
<macrodef name = "git">
<attribute name = "command" />
<attribute name = "dir" default = "" />
<element name = "args" optional = "true" />
<sequential>
<echo message = "git @{command}" />
<exec executable = "git" dir = "@{dir}">
<arg value = "@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
</project>
Jump to Line
Something went wrong with that request. Please try again.