diff options
Diffstat (limited to 'build/build.xml')
-rw-r--r-- | build/build.xml | 344 |
1 files changed, 77 insertions, 267 deletions
diff --git a/build/build.xml b/build/build.xml index 8a052b1a89..4e00d0248c 100644 --- a/build/build.xml +++ b/build/build.xml @@ -6,28 +6,16 @@ basedir="../" default="package-all"> <!--Call one of package-* targets unless you understand what you are doing. --> - <target name="package-all" depends="clean-all, package-init, init, build, docs, internal-package-zip, internal-package-war, internal-package-liferay" description="Build public packages."> + <target name="package-all" depends="clean-all, init, build, docs, internal-package-war, differences, internal-package-liferay" description="Build public packages."> </target> - <target name="package-zip" depends="clean-all, package-init, init, build, docs, internal-package-zip"> + <target name="package-jar" depends="clean-result, init, vaadin.jar" description="Create vaadin-x.y.z.jar file."> </target> - <target name="package-jar" depends="clean-result, package-init, init, vaadin.jar" description="Create vaadin-x.y.z.jar file."> + <target name="package-war" depends="clean-result, init, build, docs, internal-package-war, differences"> </target> - <!-- Compiles only the default widgetset. --> - <target name="package-jar-quick" depends="clean-result, package-init, init" description="Create vaadin-x.y.z.jar file quick."> - <property name="compile.only.default-widgetset" value="1"/> - <antcall target="vaadin.jar"/> - </target> - - <target name="package-war" depends="clean-result, package-init, init, build, docs, internal-package-zip, internal-package-war"> - </target> - - <target name="package-liferay-zip" depends="clean-result, package-init, init, build, docs, internal-package-zip, internal-package-liferay"> - </target> - - <target name="package-test" depends="clean-result, nightly-init, package-init, init, build, docs, internal-package-zip, nightly-publish"> + <target name="package-liferay-zip" depends="clean-result, init, build, docs, internal-package-liferay, differences"> </target> <!-- Locations of Ant task JARs - build properties not yet read at this point --> @@ -48,22 +36,6 @@ uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" /> - <!-- internal tests for packaging --> - - <target name="test-build" depends="clean-result, init, build" description="used for testing build.xml"> - </target> - - <target name="test-package" depends="init" description="used for testing build.xml"> - <antcontrib:var name="eclipse-launch-vmargs" value="-XstartOnFirstThread -Xms128M -Xmx512M" /> - <antcall target="add-misc-files" inheritAll="true" inheritRefs="true" /> - <delete file="${result-path}/eclipse-test" followsymlinks="false" /> - <exec executable="ln" failonerror="false"> - <arg line="-s" /> - <arg line="${output-dir}" /> - <arg line="${result-path}/eclipse-test" /> - </exec> - </target> - <!-- Clean results - - - - - - - - - - - - - - - - - - - - - - - - - --> <target name="clean-result" depends=""> <property file="build/build.properties" /> @@ -107,10 +79,6 @@ <!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- ================================================================== --> - <!-- Called only when building installation packages. --> - <target name="package-init"> - </target> - <target name="init" depends="check-java-version"> <property file="build/build.properties" /> <property file="build/VERSION.properties" /> @@ -168,13 +136,14 @@ <!-- WebContent/VAADIN/widgetsets, which needs to be set in --> <!-- init-nonpackage target before calling this main init target. --> <property name="widgetsets-output-dir" value="${output-dir}/WebContent/VAADIN/widgetsets" /> + <!-- Create Output Directory Hierarchy --> <mkdir dir="${output-dir}/WebContent" /> <mkdir dir="${output-dir}/WebContent/demo" /> <mkdir dir="${output-dir}/WebContent/docs" /> <mkdir dir="${output-dir}/WebContent/docs/api" /> - <mkdir dir="${output-dir}/WebContent/docs/example-source" /> + <mkdir dir="${output-dir}/WebContent/tests" /> <mkdir dir="${output-dir}/WebContent/WEB-INF" /> <mkdir dir="${output-dir}/WebContent/WEB-INF/lib" /> <mkdir dir="${output-dir}/WebContent/WEB-INF/classes" /> @@ -205,38 +174,24 @@ </path> </target> - <target name="internal-package-zip" depends="init"> - <antcontrib:var name="eclipse-launch-vmargs" value="-Xms256M -Xmx512M" /> - <antcall target="add-misc-files" inheritAll="true" inheritRefs="true" /> - <zip zipfile="${result-path}/${base-name}.zip"> - <zipfileset prefix="${base-name}" dir="${result-path}/${base-name}"> - <patternset> - <include name="**/*" /> - </patternset> - </zipfileset> - <zipfileset prefix="${base-name}/gwt" dir="${gwt-dir}"> - <patternset> - <include name="**/*" /> - <exclude name="doc**"/> - <exclude name="samples**"/> - <exclude name="**/*-noservlet.jar"/> - </patternset> - </zipfileset> - </zip> - - <!-- Notice that the differences comparison is conditional. --> - <antcall target="differences"/> - </target> - <target name="internal-package-war"> - <echo>Building WAR</echo> + <echo>Building Test WAR</echo> <!-- Add the files. --> - <antcontrib:var name="eclipse-launch-vmargs" value="-Xms256M -Xmx512M" /> - <antcall target="add-misc-files" inheritAll="true" inheritRefs="true" /> + <antcall target="add-test-war-files" inheritAll="true" inheritRefs="true" /> + + <property name="test-war-filename" value="${product-file}-tests-${version.full}.war"/> - <war warfile="${result-path}/${product-file}-demo-${version.full}.war"> + <war warfile="${result-path}/${test-war-filename}"> <fileset dir="${output-dir}/WebContent"> + <!-- Already in JAR --> + <exclude name="themes/base/**/*" /> + <exclude name="themes/chameleon/**/*" /> + <exclude name="themes/liferay/**/*" /> + <exclude name="themes/runo/**/*" /> + <exclude name="themes/reindeer/**/*" /> + <exclude name="widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/**/*" /> + <include name="**/*" /> </fileset> </war> @@ -267,15 +222,35 @@ <echo>##teamcity[publishArtifacts '${result-path}/${base-name}-liferay.zip']</echo> </target> - <target name="add-misc-files"> - <delete includeemptydirs="true" defaultexcludes="false"> + <!-- TODO some files should go to the JAR instead of test WAR --> + <target name="add-test-war-files"> + <echo>Adding test class files and launcher configuration.</echo> + <copy todir="${output-dir}/WebContent/WEB-INF/classes"> + <fileset dir="${result-path}/classes"> + <include name="${toolkit-package}/tests/**/*" /> + <include name="${toolkit-package}/launcher/**" /> + </fileset> + <fileset dir="${result-path}/src/core"> + <include name="${toolkit-package}/launcher/**" /> + <exclude name="${toolkit-package}/launcher/**/*.java" /> + </fileset> + </copy> + + <echo>Adding test resources.</echo> + <copy todir="${output-dir}/WebContent/WEB-INF/classes"> + <fileset dir="tests/src"> + <include name="${toolkit-package}/tests/**/*" /> + <!-- These come from pre-processing --> + <exclude name="**/*.java" /> + <exclude name="**/*.html" /> + <exclude name="**/*.css" /> + <exclude name="**/*.xml" /> + </fileset> + </copy> + + <delete includeemptydirs="true" defaultexcludes="false"> <fileset dir="${output-dir}"> - <include name=".*" /> - <include name="*.launch" /> <include name="*.txt" /> - <include name="*.bat" /> - <include name="*.sh" /> - <include name="*.app" /> <include name="build-widgetset.xml" /> </fileset> </delete> @@ -308,77 +283,27 @@ <include name="license/*.txt" /> </fileset> </copy> - <copy file="build/package/readme.txt" tofile="${output-dir}/readme.txt"> - <filterchain> - <expandproperties /> - <replacetokens begintoken="@" endtoken="@"> - <token key="version" value="${version.full}" /> - </replacetokens> - </filterchain> - </copy> <copy todir="${output-dir}"> <filterchain> <expandproperties /> - <!-- .classpath, *.launch, build-widgetset.xml --> <replacetokens begintoken="@" endtoken="@"> <token key="version" value="${version.full}" /> </replacetokens> - <!-- .classpath --> - <replacetokens begintoken="<" endtoken=">"> - <token key="platform-specific-entries" value="<classpathentry kind="lib" path="gwt/gwt-dev.jar" />" /> - <token key="/platform-specific-entries" value="" /> - </replacetokens> - <!-- .project, *.launch --> - <replacetokens begintoken="<" endtoken=">"> - <token key="eclipse-workspace-name" value="${eclipse-workspace-name}" /> - <token key="/eclipse-workspace-name" value="" /> - </replacetokens> - <!-- HostedMode.launch --> - <replacetokens begintoken="<" endtoken=">"> - <token key="eclipse-launch-vmargs" value="${eclipse-launch-vmargs}" /> - <token key="/eclipse-launch-vmargs" value="" /> - </replacetokens> </filterchain> <fileset dir="build/package"> - <include name="eclipse-classpath" /> - <include name="eclipse-project" /> - <include name="eclipse*launch" /> + <include name="readme.txt" /> <include name="build-widgetset.xml" /> - <include name="eclipse-org.eclipse.core.resources.prefs" /> - <include name="eclipse-org.eclipse.jdt.core.prefs" /> </fileset> </copy> - <move file="${output-dir}/build-widgetset.xml" tofile="${output-dir}/WebContent/docs/example-source/build-widgetset.xml" /> - <move file="${output-dir}/eclipse-classpath" tofile="${output-dir}/.classpath" /> - <move file="${output-dir}/eclipse-project" tofile="${output-dir}/.project" /> - <move file="${output-dir}/eclipse-GWT Development Mode-launch" tofile="${output-dir}/GWT Development Mode.launch" /> - <move file="${output-dir}/eclipse-Vaadin Development Server-launch" tofile="${output-dir}/Vaadin Development Server.launch" /> - <mkdir dir="${output-dir}/.settings" /> - <move file="${output-dir}/eclipse-org.eclipse.core.resources.prefs" tofile="${output-dir}/.settings/org.eclipse.core.resources.prefs" /> - <move file="${output-dir}/eclipse-org.eclipse.jdt.core.prefs" tofile="${output-dir}/.settings/org.eclipse.jdt.core.prefs" /> - - <copy todir="${output-dir}"> - <fileset dir="build/package"> - <include name="start.bat" /> - <include name="start.sh" /> - </fileset> - </copy> - - <!-- TODO: Why is this set both with <chmod> and <exec>? --> - <chmod file="${output-dir}/start.sh" perm="ugo+x" /> - <exec executable="chmod" failonerror="false"> - <arg line="ugo+x" /> - <arg line="${output-dir}/start.sh" /> - </exec> </target> - <!-- Build server-side, client-side, libraries, and demos. --> + <!-- Build server-side, client-side, libraries, and tests. --> <!-- The client-side needs to be built before vaadin.jar, because the vaadin.jar --> <!-- require the default widgetset and doing otherwise would build it twice. --> <!-- However, since compiling the server-side is required by the client-side --> <!-- compilation, the server-side will actually be built before it. --> <target name="build" - depends="compile-server-side, compile-client-side, vaadin.jar, vaadin-sources.jar, demo" + depends="compile-server-side, compile-client-side, vaadin.jar, vaadin-sources.jar" description="Build package required files, without packing them."> </target> @@ -399,8 +324,6 @@ Java/HTML/CSS/XML files are filtered so the license is added and the version is set. Other files are just copied. - - If build.include.tests is not set, then "{$result-path}/src/tests" is created but no files are copied to it. --> <loadfile property="ITMillApache2LicenseForJavaFiles" srcFile="build/ITMillApache2LicenseForJavaFiles.txt" /> @@ -442,17 +365,12 @@ </fileset> </copy> - <antcontrib:if> - <isset property="build.include.tests"/> - <then> - <copy todir="${result-path}/src/tests"> - <filterset refid="version-and-license"/> - <fileset dir="tests/src"> - <patternset refid="preprocessable-files" /> - </fileset> - </copy> - </then> - </antcontrib:if> + <copy todir="${result-path}/src/tests"> + <filterset refid="version-and-license"/> + <fileset dir="tests/src"> + <patternset refid="preprocessable-files" /> + </fileset> + </copy> <!-- Unify mix usage of mac/Linux/Win characters --> <echo>Unifying mix usage of Mac/Linux/Win linefeeds for java/html/css/xml files.</echo> @@ -465,16 +383,11 @@ <patternset refid="non-preprocessable-files" /> </fileset> </copy> - <antcontrib:if> - <isset property="build.include.tests"/> - <then> - <copy todir="${result-path}/src/tests"> - <fileset dir="tests/src"> - <patternset refid="non-preprocessable-files" /> - </fileset> - </copy> - </then> - </antcontrib:if> + <copy todir="${result-path}/src/tests"> + <fileset dir="tests/src"> + <patternset refid="non-preprocessable-files" /> + </fileset> + </copy> </target> @@ -483,17 +396,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <target name="webcontent" depends="preprocess-src,defaulttheme"> - <!-- copy 3rd part libraries used by demo --> - <copy todir="${output-dir}/WebContent/demo/lib"> + <!-- copy 3rd part libraries used by tests --> + <copy todir="${output-dir}/WebContent/tests/lib"> <fileset dir="lib/core"> <include name="jetty/**/*" /> </fileset> </copy> - <copy todir="${output-dir}/WebContent/demo/lib"> - <fileset dir="lib/core"> - <include name="portlet/**/*" /> - </fileset> - </copy> <!-- Add WebContent --> <echo>Adding VAADIN/themes, demo and hsqldb.jar files.</echo> @@ -501,10 +409,6 @@ <fileset dir="WebContent"> <exclude name="**/.svn" /> <!-- TODO check what is necessary --> - <!-- These are needed for running tests, but are copied during testing. --> - <exclude name="VAADIN/themes/tests*"/> - <exclude name="VAADIN/themes/tests*/**/*"/> - <include name="demo/**/*" /> <include name="WEB-INF/lib/hsqldb.jar" /> <include name="VAADIN/themes/**/*" /> @@ -512,18 +416,12 @@ </fileset> </copy> - <!-- Add portlet configuration files from WebContent --> + <!-- Add servlet and portlet configuration files from WebContent --> <copy todir="${output-dir}/WebContent/WEB-INF"> <fileset dir="WebContent/WEB-INF"> <include name="liferay-*.xml" /> <include name="portlet.xml" /> - </fileset> - </copy> - <!-- Add package specific WebContent files from build/package/WebContent --> - <copy todir="${output-dir}/WebContent"> - <fileset dir="build/package/WebContent"> - <exclude name="**/.*" /> - <include name="**/*" /> + <include name="web.xml" /> </fileset> </copy> </target> @@ -536,8 +434,6 @@ <javac source="1.5" target="1.5" classpathref="compile.classpath.server-side" destdir="${result-path}/classes" debug="true" encoding="UTF-8"> <src path="${result-path}/src/core"/> <src path="${result-path}/src/tests"/> - - <exclude name="${toolkit-package}/tests/**" unless="build.include.tests"/> </javac> </target> @@ -585,22 +481,6 @@ <delete dir="${widgetsets-output-dir}/WEB-INF" includeemptydirs="true" failonerror="false" /> </target> - <!-- Note: Probably not needed any longer as all sources need to be compiled. --> - <target name="compile-widgetset-generator-only" depends="init, preprocess-src, compile-java"> - <mkdir dir="${result-path}/classes"/> - <javac source="1.5" target="1.5" destdir="${result-path}/classes" debug="true" encoding="UTF-8"> - <src path="${result-path}/src/core"/> - <include name="com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java" /> - <!-- <exclude name="**"/> --> - <classpath> - <pathelement location="${lib-gwt-user}" /> - <pathelement location="${lib-gwt-dev}" /> - <pathelement location="${result-path}/classes" /> - <pathelement location="${result-path}/src/core" /> - </classpath> - </javac> - </target> - <!-- The widgetset generator is currently compiled along with rest of server-side Java. --> <target name="compile-widgetset-generator" depends="init, preprocess-src, compile-java"/> @@ -649,18 +529,10 @@ </antcall> </target> - <!-- Builds the client-side engine, i.e., the widgetsets sequentially. --> - <!-- Notice that antcall does not fulfill dependencies. --> - <target name="compile-client-side-sequential" unless="build.parallel"> - <echo>Compiling widget sets sequentially.</echo> - <!-- We can't call these with 'depends' because of the 'unless' specifier. --> - <antcall target="compile-widgetset-default"/> - <antcall target="compile-widgetset-portal-default"/> - </target> - - <!-- Builds the client-side engine, i.e., the widgetsets in parallel. --> - <!-- Notice that antcall does not fulfill dependencies. --> - <target name="compile-client-side-parallel" if="build.parallel"> + <!-- Compiles all widgetsets. --> + <!-- This is called when building packages and when compiling all --> + <!-- widgetsets, but not when compiling individual widgetsets. --> + <target name="compile-client-side" depends="compile-server-side"> <echo>Compiling widget sets in parallel.</echo> <parallel threadsperprocessor="1"> <antcall target="compile-widgetset-default"/> @@ -668,13 +540,6 @@ </parallel> </target> - <!-- Compiles all widgetsets. --> - <!-- This is called when building packages and when compiling all --> - <!-- widgetsets, but not when compiling individual widgetsets. --> - <!-- Builds widgetsets either sequentially or in parallel, depending --> - <!-- on the 'build.parallel' property. --> - <target name="compile-client-side" depends="compile-server-side, compile-client-side-sequential, compile-client-side-parallel"/> - <!-- Definitions for building local components, i.e., not for an installation package. --> <target name="init-nonpackage"> <property file="build/build.properties" /> @@ -700,7 +565,7 @@ <target name="widgetset-portal-default" depends="init-nonpackage, init, compile-widgetset-generator, compile-widgetset-portal-default"/> <!-- ================================================================== --> - <!-- Libraries and Demos --> + <!-- Libraries and Tests --> <!-- ================================================================== --> <!-- Compile the Vaadin library JAR. --> @@ -774,29 +639,6 @@ </jar> </target> - <!-- Demos - - - - - - - - - - - - - - - - - - - - - - - - - - - --> - <target name="demo" depends="vaadin.jar"> - <echo>Building demos</echo> - <echo>Adding demo class files and launcher configuration.</echo> - <copy todir="${output-dir}/WebContent/WEB-INF/classes"> - <fileset dir="${result-path}/classes"> - <include name="${toolkit-package}/tests/integration/**/*" /> - <include name="${toolkit-package}/launcher/**" /> - </fileset> - <fileset dir="${result-path}/src/core"> - <include name="${toolkit-package}/launcher/**" /> - <exclude name="${toolkit-package}/launcher/**/*.java" /> - </fileset> - </copy> - - <echo>Adding test resources.</echo> - <copy todir="${output-dir}/WebContent/WEB-INF/classes"> - <fileset dir="tests/src"> - <include name="${toolkit-package}/tests/integration/*.gif" /> - </fileset> - </copy> - </target> - <!-- ================================================================== --> <!-- Documentation --> <!-- ================================================================== --> @@ -847,9 +689,6 @@ </concat> </target> - <!-- java2html converter --> - <taskdef name="java2html" classname="de.java2html.anttasks.Java2HtmlTask" classpath="build/lib/java2html.jar" /> - <!-- ================================================================== --> <!-- Difference to previous release package. --> <!-- ================================================================== --> @@ -869,7 +708,7 @@ <!-- ================================================================== --> <!-- Main target for the custom build. --> - <target name="custom-build" depends="clean-result, custom-build-init, nightly-init, package-init, init, build"> + <target name="custom-build" depends="clean-result, custom-build-init, nightly-init, init, build"> </target> @@ -903,7 +742,7 @@ <!-- ================================================================== --> <!-- Main target for the nightly build. --> - <target name="nightly" depends="clean-result, nightly-init, package-init, init, build, docs, internal-package-zip"> + <target name="nightly" depends="clean-result, nightly-init, init, build, docs, differences"> </target> @@ -963,13 +802,13 @@ </target> <!-- Copies the nightly build artifacts to the download server. --> - <target name="nightly-demo-publish" if="nightly.demo.publish" depends="internal-package-war"> + <target name="nightly-tests-publish" if="nightly.demo.publish" depends="internal-package-war"> <fail unless="version.major" message="Major version must be defined in version.major"/> <fail unless="version.minor" message="Major version must be defined in version.minor"/> <!-- Publish to the demo server. --> - <property name="src" value="${result-path}/${product-file}-demo-${version.full}.war"/> + <property name="src" value="${result-path}/${test-war-filename}"/> <property name="target" value="${nightly.demo.publish}/${version.major}.${version.minor}-${build.tag}.war"/> <echo>Installing ${src} to ${target}</echo> @@ -984,7 +823,7 @@ <echo>Result: ${nightly.install.scp.result}</echo> </target> - <target name="nightly-publish" depends="nightly-teamcity-publish, nightly-download-publish, nightly-demo-publish"> + <target name="nightly-publish" depends="nightly-teamcity-publish, nightly-download-publish, nightly-tests-publish"> </target> @@ -1005,34 +844,6 @@ <target name="nightly-maven-publish" depends="nightly-maven-pom.xml"> <property file="${gpg.passphrase.file}" /> -<!-- - - <echo>Publishing ${result-path}/${lib-javadoc-jar-name} to Maven repository</echo> - <artifact:mvn> - <arg value="gpg:sign-and-deploy-file"/> - <sysproperty key="file" value="../${result-path}/${lib-javadoc-jar-name}" /> - <sysproperty key="pomFile" value="maven/pom.xml" /> - <sysproperty key="repositoryId" value="vaadin-snapshots" /> - <sysproperty key="url" value="${snapshot.repository.url}" /> - <sysproperty key="classifier" value="javadoc" /> - <sysproperty key="uniqueVersion" value="false" /> - <sysproperty key="gpg.passphrase" value="${gpg.passphrase}" /> - </artifact:mvn> - - <echo>Publishing ${result-path}/${lib-sources-jar-name} to Maven repository</echo> - <artifact:mvn> - <arg value="gpg:sign-and-deploy-file"/> - <sysproperty key="file" value="../${result-path}/${lib-sources-jar-name}" /> - <sysproperty key="pomFile" value="maven/pom.xml" /> - <sysproperty key="repositoryId" value="vaadin-snapshots" /> - <sysproperty key="url" value="${snapshot.repository.url}" /> - <sysproperty key="classifier" value="sources" /> - <sysproperty key="uniqueVersion" value="false" /> - <sysproperty key="gpg.passphrase" value="${gpg.passphrase}" /> - </artifact:mvn> - ---> - <echo>Publishing ${output-dir}/WebContent/${lib-jar-name} to Maven repository</echo> <artifact:mvn> <arg value="gpg:sign-and-deploy-file"/> @@ -1115,8 +926,7 @@ <property name="package.name" value="${base-name}"/> <!-- Only Linux tests allowed. TODO: Generalize this. --> - <property name="package.filename" value="${result-path}/${package.name}.zip"/> - <property name="package.dir" value="${result-path}/${package.name}.zip"/> + <property name="package.filename" value="${result-path}/${test-war-filename}"/> <!-- Run the separate test script. --> <ant antfile="tests/test.xml" target="test-package" inheritall="false" inheritrefs="true"> @@ -1148,7 +958,7 @@ <!-- Empty passphrase if no passphrase defined --> <property name="passphrase" value="" /> - <property name="demo.war" location="${result-path}/${product-file}-demo-${version.full}.war" /> + <property name="tests.war" location="${result-path}/${test-war-filename}" /> <!-- Sleep before running integration tests so testbench tests have time to compile and start --> <sleep minutes="4" /> @@ -1163,7 +973,7 @@ <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}"/> <property name="sshkey.file" value="${sshkey.file}" /> <property name="passphrase" value="${passphrase}" /> - <property name="demo.war" value="${demo.war}"/> + <property name="demo.war" value="${tests.war}"/> </ant> </target> </project> |