blob: 03e1c7b486769745799ffa1f1fd4b1425bbad958 [file] [log] [blame]
<project name="dist" default="build" basedir=".">
<property name="gwt.root" location=".." />
<property name="project.tail" value="distro-source" />
<import file="${gwt.root}/platforms.ant.xml" />
<import file="common.ant.xml" />
<property name="project.dist" location="${gwt.build.dist}/${project.distname}.zip" />
<target name="clean" description="Cleans this project's intermediate and output files">
<delete dir="${gwt.build.dist}" failonerror="false" />
<delete dir="${gwt.build.staging}" failonerror="false" />
<delete file="${project.dist}" failonerror="false" />
</target>
<target name="merge_codeserver">
<echo message="Merge gwt-dev.jar and gwt-codeserver.jar" />
<gwt.jar destfile="${gwt.build.out}/gwt-dev-merged.jar">
<zipfileset src="${gwt.build.lib}/gwt-dev.jar"/>
<zipfileset src="${gwt.build.lib}/gwt-codeserver.jar"/>
</gwt.jar>
<echo message="Overwriting gwt-dev.jar with merged gwt-dev.jar" />
<move file="${gwt.build.out}/gwt-dev-merged.jar" tofile="${gwt.build.lib}/gwt-dev.jar"/>
</target>
<target name="build" depends="filter, merge_codeserver" description="Packages the distro">
<!-- TODO: figure out how to share most of this across platforms -->
<mkdir dir="${gwt.build.dist}" />
<mkdir dir="${gwt.build.out}/samples-scripts"/>
<zip destfile="${project.dist}">
<!-- jars -->
<zipfileset file="${gwt.build.lib}/gwt-dev.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-user.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-servlet.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-codeserver.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-servlet-deps.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-api-checker.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/requestfactory*.jar" prefix="${project.distname}" />
<!-- external libs -->
<zipfileset file="${gwt.tools}/lib/javax/validation/validation-api-1.0.0.GA.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.tools}/lib/javax/validation/validation-api-1.0.0.GA-sources.jar" prefix="${project.distname}" />
<!-- raw files -->
<zipfileset dir="${dist.resources}" prefix="${project.distname}" />
<zipfileset filemode="755" dir="src" prefix="${project.distname}" />
<!-- doc -->
<zipfileset dir="${gwt.build.out}" prefix="${project.distname}">
<include name="doc" />
<include name="doc/html/**" />
<include name="doc/css/**" />
<include name="doc/javadoc/**" />
</zipfileset>
<!-- samples -->
<zipfileset dir="${gwt.build.out}" prefix="${project.distname}">
<include name="samples" />
<include name="samples/*" />
<include name="samples/*/build.xml" />
<include name="samples/*/pom.xml" />
<include name="samples/*/README-MAVEN.txt" />
<include name="samples/*/src/**" />
<include name="samples/*/war/**" />
</zipfileset>
<zipfileset dir="${gwt.build.out}/samples-scripts" prefix="${project.distname}/samples">
<include name="*/*" />
</zipfileset>
</zip>
<!--
Unzip distro into the staging directory.
-->
<mkdir dir="${gwt.build.staging}" />
<unzip src="${project.dist}" dest="${gwt.build.staging}" />
<!-- cute. zipinfo says the zip has good perms, unzip gets it right, but
ant <unzip> leaves the perms as non-executable... go figure. -->
<chmod perm="uga+rx">
<fileset dir="${gwt.build.staging}/gwt-${gwt.version}">
<patternset refid="chmod.executables"/>
</fileset>
</chmod>
</target>
</project>