1 Star 0 Fork 21

favorerwh / qing-automation

forked from xhyspring / qing-automation 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.xml 15.22 KB
一键复制 编辑 原始数据 按行查看 历史
xhyspring 提交于 2014-12-02 16:32 . 小改动
<project name="Fitnesse" default="all" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
Fitnesse is a wiki wrapper for fit, an acceptance test framework.
</description>
<property environment="env"/>
<property name="env.FITNESSE_TEST_PORT" value="8080"/>
<property name="src.dir" location="src"/>
<property name="test.src.dir" location="test"/>
<property name="classes.dir" location="classes"/>
<property name="test.classes.dir" location="test-classes"/>
<property name="fitnesseRoot" value="FitNesseRoot"/>
<property name="results.dir" location="test-results"/>
<property name="dist.dir" location="dist"/>
<property name="javadoc.dir" location="javadoc"/>
<property name="lib.dir" location="lib"/>
<property name="antlib.dir" location="antlib"/>
<property name="baseUrl" value="http://localhost:8001/"/>
<property name="port" value="8001"/>
<target name="all" depends="unit_tests, acceptance_tests" description="Run this target any time you change code or acceptance tests. It will clean, then compile the source, run all the unit test and fitnesse acceptance tests."/>
<target name="build" depends="clean, compile" description="clean, then compile the source"/>
<target name="unit_tests" depends="clean, unit_test" description="builds code from scratch, runs all the unit tests"/>
<zipfileset id="wikipages.fileset" prefix="Resources/FitNesseRoot" dir="FitNesseRoot">
<include name="FitNesse/**"/>
<include name="FrontPage/**"/>
<include name="PageHeader/**"/>
<include name="PageFooter/**"/>
<include name="TemplateLibrary/**"/>
<exclude name="**/*.zip"/>
</zipfileset>
<target name="run" depends="compile, compile-bootstrap-less, retrieve" description="Start FitNesse from the command line">
<java classpathref="classpath" classname="fitnesseMain.FitNesseMain" fork="true" failonerror="true">
<arg value="-o" />
<arg value="-v" />
<arg value="-p" />
<arg value="${port}" />
</java>
</target>
<!--
Bundling
-->
<target name="jar" depends="compile, compile-bootstrap-less, createUpdateLists" description="generate the jar file">
<mkdir dir="${dist.dir}" />
<delete file="${dist.dir}/fitnesse.jar" />
<jar jarfile="${dist.dir}/fitnesse.jar" basedir="${classes.dir}">
<include name="**" />
<zipfileset refid="wikipages.fileset" />
<manifest>
<attribute name="Built-By" value="Object Mentor, Inc." />
<attribute name="Main-Class" value="fitnesseMain.FitNesseMain" />
</manifest>
</jar>
</target>
<target name="standalone-jar" depends="jar" description="generate the standalone jar file">
<ivy:cachefileset setid="standalone.jar.fileset" conf="standalone" />
<jar jarfile="${dist.dir}/fitnesse-standalone.jar">
<zipfileset src="${dist.dir}/fitnesse.jar" />
<zipgroupfileset refid="standalone.jar.fileset" />
<manifest>
<attribute name="Built-By" value="Object Mentor, Inc." />
<attribute name="Main-Class" value="fitnesseMain.FitNesseMain" />
</manifest>
</jar>
</target>
<target name="sources-jar" depends="stamp-version">
<jar jarfile="${dist.dir}/fitnesse-sources.jar" basedir="src">
<include name="**" />
<zipfileset refid="wikipages.fileset" />
</jar>
</target>
<target name="javadoc-jar" depends="compile">
<mkdir dir="${javadoc.dir}" />
<javadoc sourcepath="${src.dir}" destdir="${javadoc.dir}" classpathref="classpath" />
<jar jarfile="${dist.dir}/fitnesse-javadoc.jar" basedir="${javadoc.dir}" />
</target>
<target name="createUpdateLists" depends="compile" description="creates two lists of files to be updated">
<mkdir dir="${classes.dir}/Resources" />
<java classpath="${classes.dir}" classname="fitnesse.updates.UpdateFileList" failonerror="true">
<arg value="-baseDirectory:." />
<arg value="-outputDirectory:${classes.dir}/Resources" />
<arg value="-doNotReplace:FitNesseRoot/FrontPage/content.txt" />
<arg value="-doNotReplace:FitNesseRoot/FrontPage/properties.xml" />
<arg value="-doNotReplace:FitNesseRoot/PageHeader/content.txt" />
<arg value="-doNotReplace:FitNesseRoot/PageHeader/properties.xml" />
<arg value="-doNotReplace:FitNesseRoot/PageFooter/content.txt" />
<arg value="-doNotReplace:FitNesseRoot/PageFooter/properties.xml" />
<arg value="-doNotReplace:FitNesseRoot/PageFooter/properties.xml" />
<arg value="-doNotReplace:FitNesseRoot/TemplateLibrary/content.txt" />
<arg value="-doNotReplace:FitNesseRoot/TemplateLibrary/properties.xml" />
<arg value="-doNotReplace:FitNesseRoot/TemplateLibrary/StaticPage/content.txt" />
<arg value="-doNotReplace:FitNesseRoot/TemplateLibrary/StaticPage/properties.xml" />
<arg value="-doNotReplace:FitNesseRoot/TemplateLibrary/SuitePage/content.txt" />
<arg value="-doNotReplace:FitNesseRoot/TemplateLibrary/SuitePage/properties.xml" />
<arg value="-doNotReplace:FitNesseRoot/TemplateLibrary/TestPage/content.txt" />
<arg value="-doNotReplace:FitNesseRoot/TemplateLibrary/TestPage/properties.xml" />
<arg value="FitNesseRoot/FitNesse" />
<arg value="FitNesseRoot/FrontPage" />
<arg value="FitNesseRoot/PageFooter" />
<arg value="FitNesseRoot/PageHeader" />
<arg value="FitNesseRoot/TemplateLibrary" />
</java>
</target>
<target name="compile" depends="stamp-version, resolve" description="compile the source (make)">
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" debug="true" source="1.7" target="1.7" includeantruntime="false" encoding="UTF-8"/>
<copy todir="${classes.dir}">
<fileset dir="${src.dir}/fitnesse">
<include name="fitnesse/resources/**" />
<include name="**/*.properties" />
</fileset>
</copy>
</target>
<target name="test-compile" depends="compile" description="compile the source (make)">
<mkdir dir="${test.classes.dir}" />
<javac srcdir="${test.src.dir}" destdir="${test.classes.dir}" classpathref="classpath" debug="true" source="1.6" target="1.6" includeantruntime="false" />
</target>
<target name="post-compile" depends="stamp-version, retrieve" description="post-compile steps, use those in your IDE" />
<target name="bootstrap-needs-update">
<uptodate property="bootstrap-css-up-to-date" targetfile="${classes.dir}/fitnesse/resources/bootstrap/css/fitnesse-bootstrap.css" >
<srcfiles dir="${src.dir}/fitnesse/fitnesse/resources/bootstrap/less" includes="*.less" />
</uptodate>
</target>
<target name="compile-bootstrap-less" depends="ivy-init, bootstrap-needs-update" description="compile bootstrap less.js scripts" unless="bootstrap-css-up-to-date">
<mkdir dir="${classes.dir}/fitnesse/resources/bootstrap/css" />
<ivy:cachepath pathid="lesscss.classpath" conf="lesscss" />
<java classname="org.mozilla.javascript.tools.shell.Main"
classpathref="lesscss.classpath"
failonerror="true"
fork="true"
output="${classes.dir}/fitnesse/resources/bootstrap/css/fitnesse-bootstrap.css">
<arg value="extra/lesscss/less-rhino-1.7.0.js" />
<arg value="${src.dir}/fitnesse/fitnesse/resources/bootstrap/less/fitnesse-bootstrap.less" />
</java>
</target>
<condition property="phantomjs-present">
<or>
<available file="/usr/local/bin/phantomjs" />
<available file="/usr/bin/phantomjs" />
</or>
</condition>
<target name="jasmine" description="Runs Javascript Unit Tests" if="phantomjs-present">
<exec executable="phantomjs" failonerror="true">
<arg line="extra/phantomjs/run-jasmine.js" />
<arg line="src/fitnesse/resources/javascript/javascript-test.html" />
</exec>
<exec executable="phantomjs" failonerror="true">
<arg line="extra/phantomjs/run-jasmine.js" />
<arg line="src/fitnesse/resources/wysiwyg/wysiwyg-test.html" />
</exec>
</target>
<target name="set-version-if-not-manualy-set" unless="version">
<tstamp />
<property name="version" value="${DSTAMP}" />
</target>
<target name="stamp-version" depends="set-version-if-not-manualy-set" >
<echo message="Stamping fitnesse with version ${version}" />
<mkdir dir="${classes.dir}/META-INF" />
<echo message="v${version}" file="${classes.dir}/META-INF/FitNesseVersion.txt" />
</target>
<target name="clean" description="delete everything in the classes directory">
<delete dir="${classes.dir}" />
<delete dir="${test.classes.dir}" />
<delete dir="${results.dir}" />
<delete dir="${lib.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${javadoc.dir}" />
<delete file="updateList"/>
<delete file="updateDoNotCopyOverList"/>
</target>
<target name="unit_test" depends="test-compile" description="run the unit tests">
<mkdir dir="${results.dir}" />
<junit forkmode="once" fork="yes" printsummary="no" haltonfailure="yes" haltonerror="yes" dir="${basedir}">
<classpath refid="classpath" />
<formatter type="xml" usefile="true" />
<formatter type="plain" usefile="false" />
<batchtest todir="${results.dir}">
<fileset dir="${test.src.dir}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="load_fitnesse_taskdef">
<taskdef classpathref="classpath" resource="tasks.properties" />
</target>
<target name="release" depends="unit_tests, acceptance_tests, pom" />
<target name="release_xml" depends="unit_tests, acceptance_tests_xml" />
<target name="release_jar" depends="unit_tests, jar, standalone-jar, sources-jar, javadoc-jar"/>
<target name="acceptance_tests_xml" depends="standalone-jar">
<java jar="${dist.dir}/fitnesse-standalone.jar" failonerror="true" fork="true" output="fitnesse-results.xml">
<arg value="-c" />
<arg value="FitNesse.SuiteAcceptanceTests?suite&amp;format=xml" />
<arg value="-p" />
<arg value="9234" />
</java>
</target>
<target name="acceptance_tests" depends="standalone-jar">
<java jar="${dist.dir}/fitnesse-standalone.jar" failonerror="false" fork="true">
<arg value="-c" />
<arg value="FrontPage.DemoSuite?suite&amp;format=text" />
<arg value="-p" />
<arg value="9234" />
</java>
<java classpath="${classes.dir}" jar="${dist.dir}/fitnesse-standalone.jar" failonerror="true" fork="true" maxmemory="256m" output="${results.dir}/result.temp">
<arg value="-c" />
<arg value="FrontPage.DemoSuite?pageHistory&amp;resultDate=latest&amp;format=xml" />
<arg value="-p" />
<arg value="9235" />
</java>
<java classname="com.junqing.file.utility.XmlFitNesseResultsCleaner" classpath="${classes.dir}" fork="true">
<arg value="${results.dir}/result.temp" />
<arg value="${results.dir}/result.xml" />
</java>
</target>
<target name="convert-fitnesse-results-to-html">
<xslt in="${results.dir}/result.xml" out="${results.dir}/report.html" style="src/java/xsl/fitnesseResultsToHtmlExternal.xsl">
<param expression="${baseUrl}" name="baseUrl" />
</xslt>
</target>
<target name="run_jenkins_suite" depends="acceptance_tests,convert-fitnesse-results-to-html"/>
<target name="retrieve" depends="resolve" description="Copy dependencies to lib/, mainly for Acceptance tests and IDE's">
<ivy:retrieve pattern="${lib.dir}/[artifact].[ext]" conf="standalone,default,test" />
</target>
<target name="resolve" depends="ivy-init">
<ivy:resolve />
<ivy:cachepath pathid="lib.classpath" />
<path id="classpath">
<pathelement path = "${lib.dir}/ganymed-ssh2-build210.jar"/>
<pathelement path = "${lib.dir}/selenium-java-2.37.0.jar"/>
<pathelement path = "${lib.dir}/log4j-1.2.16.jar"/>
<pathelement path = "${lib.dir}/mongo-java-driver-2.10.0.jar"/>
<pathelement path = "${lib.dir}/c3p0-0.9.5-pre8.jar"/>
<pathelement path = "${lib.dir}/selenium-server-standalone-2.37.0.jar"/>
<pathelement path = "${lib.dir}/dom4j-2.0.0-ALPHA-2.jar"/>
<pathelement path = "${lib.dir}/joda-time-2.3.jar"/>
<pathelement path = "${lib.dir}/json.jar"/>
<pathelement path = "${lib.dir}/aws-java-sdk-1.6.3.jar"/>
<pathelement path = "${lib.dir}/commons-logging-1.1.1.jar"/>
<pathelement path = "${lib.dir}/slf4j-api-1.7.2.jar"/>
<pathelement path = "${lib.dir}/rabbitmq-client.jar"/>
<pathelement path = "${lib.dir}/commons-collections4-4.0.jar"/>
<pathelement path = "${lib.dir}/jackson-core-asl-1.9.10.jar"/>
<pathelement path = "${lib.dir}/jackson-mapper-asl-1.9.7.jar"/>
<pathelement path = "${lib.dir}/commons-beanutils-1.8.3.jar"/>
<pathelement path = "${classes.dir}" />
<pathelement path = "${test.classes.dir}" />
<path refid="lib.classpath" />
</path>
</target>
<target name="pom" depends="resolve,set-version-if-not-manualy-set">
<ivy:deliver deliverpattern="${dist.dir}/ivy.xml" pubrevision="${version}" status="release" />
<ivy:makepom ivyfile="${dist.dir}/ivy.xml" templatefile="extra/maven/pom.xml.template" pomfile="${dist.dir}/fitnesse.pom" conf="standalone,default,test">
<mapping conf="standalone" scope="compile" />
<mapping conf="test" scope="test" />
</ivy:makepom>
</target>
<target name="snapshot" depends="resolve,pom">
<ivy:publish resolver="sonatype-nexus-snapshots"
pubrevision="${version}"
publishivy="false">
<artifacts pattern="${dist.dir}/[artifact](-[classifier]).[ext]" />
</ivy:publish>
</target>
<target name="publish" depends="set-version-if-not-manualy-set,jar,pom,standalone-jar,sources-jar,javadoc-jar">
<fail unless="upload.user" message="supply upload.user on the command line"/>
<fail unless="upload.password" message="supply upload.password on the command line"/>
<fail unless="pgp.password" message="supply pgp.password on the command line"/>
<ivy:settings id="ivy.publish.instance"
file="ivysettings-sonatype.xml" />
<ivy:publish resolver="sonatype-nexus-staging"
pubrevision="${version}"
publishivy="false"
settingsref="ivy.publish.instance"
overwrite="true">
<artifacts pattern="${dist.dir}/[artifact](-[classifier]).[ext]" />
</ivy:publish>
</target>
<!--
Dependency management boilerplate
-->
<property name="maven.central.url" value="http://repo2.maven.org/maven2" />
<available file="${antlib.dir}/ivy.jar" type="file" property="have.ivy.jar"/>
<available file="${antlib.dir}/bcprov.jar" type="file" property="have.bcprov.jar"/>
<available file="${antlib.dir}/bcpg.jar" type="file" property="have.bcpg.jar"/>
<condition property="ivy.download.not.required">
<and>
<istrue value="${have.ivy.jar}" />
<istrue value="${have.bcprov.jar}" />
<istrue value="${have.bcpg.jar}" />
</and>
</condition>
<target name="ivy-init" depends="ivy-download">
<path id="ivy.class.path">
<fileset dir="${antlib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant"
classpathref="ivy.class.path" />
</target>
<target name="ivy-download" unless="ivy.download.not.required">
<mkdir dir="${antlib.dir}" />
<get src="${maven.central.url}/org/apache/ivy/ivy/2.3.0/ivy-2.3.0.jar" dest="${antlib.dir}/ivy.jar" usetimestamp="true" verbose="true" />
<!-- The following libs are used for signing artifacts
when deployed to Maven Central. -->
<get src="${maven.central.url}/org/bouncycastle/bcprov-jdk16/1.46/bcprov-jdk16-1.46.jar" dest="${antlib.dir}/bcprov.jar" usetimestamp="true" verbose="true" />
<get src="${maven.central.url}/org/bouncycastle/bcpg-jdk16/1.46/bcpg-jdk16-1.46.jar" dest="${antlib.dir}/bcpg.jar" usetimestamp="true" verbose="true" />
</target>
</project>
1
https://gitee.com/favorer/qing-automation.git
git@gitee.com:favorer/qing-automation.git
favorer
qing-automation
qing-automation
master

搜索帮助