Removing the old Ant build

WW-1384


git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@425635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Donald J. Brown
2006-07-26 05:46:24 +00:00
parent 612834a163
commit 201ee5279c
7 changed files with 0 additions and 538 deletions
-296
View File
@@ -1,296 +0,0 @@
<project name="struts2-webapps" default="help" basedir=".">
<property file="../build.properties" />
<target name="help">
<echo>
o To create a new webapp structure, simply run
ant new
o To build a webapp, simply run:
ant build -Dwebapp=XXX
... Where XXX is the name of the webapp you want to build.
After the build is finished, the fully-built war file can
be found in the dist directory. You may deploy this file
to any servlet container.
For example:
ant build -Dwebapp=sandbox
o To build a portlet webapp, simply run:
ant build-portlet
You can use the 'container' system property to target a specific container, e.g. '-Dcontainer=exo'.
Supported containers are exo, gridsphere, liferay-3.6.1, jboss-portal-2.0, jboss-portal-2.2 and jetspeed2.
For IBM WebSphere Portal 5.1 and Apache Pluto 1.0.1, no container property is required.
For example:
ant build-portlet -Dcontainer=jboss-portal-2.2
</echo>
</target>
<path id="cp">
<fileset dir="../lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="..">
<include name="struts2-*.jar" />
</fileset>
<!-- used so that we can build wars w/o building the whole distribution -->
<path path="../build/java" />
</path>
<macrodef name="compile">
<attribute name="srcdir" />
<attribute name="destdir" />
<attribute name="classpath" default="" />
<attribute name="classpathref" default="cp" />
<attribute name="excludes" default="" />
<attribute name="source" default="1.4" />
<attribute name="target" default="1.4" />
<sequential>
<mkdir dir="@{destdir}" />
<javac srcdir="@{srcdir}" destdir="@{destdir}" classpath="@{classpath}" classpathref="@{classpathref}" debug="on" source="@{source}" target="@{target}" />
<copy filtering="no" todir="@{destdir}">
<fileset dir="@{srcdir}">
<exclude name="**/*.java" />
<exclude name="**/package.html" />
</fileset>
</copy>
</sequential>
</macrodef>
<target name="build">
<condition property="hasWebAppLocation">
<isset property="webapplocation"/>
</condition>
<!-- prepare -->
<delete dir="${basedir}/tmp" />
<mkdir dir="${basedir}/tmp" />
<mkdir dir="${basedir}/dist" />
<antcall target="buildWithWebAppLocation" />
<antcall target="buildWithoutWebAppLocation" />
<!-- war up the app -->
<war file="${basedir}/dist/${webapp}.war" webxml="tmp/WEB-INF/web.xml">
<zipfileset dir="tmp" prefix="" />
<!-- only these configurations are needed for now. Also, these are probably more than
needed, but we're just picking a single set of jars that each webapp can use -->
<zipfileset dir="${basedir}/../lib/ajax" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../lib/default" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../lib/fileupload" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../lib/sitemesh" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../lib/portlet" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../lib/jasperreports" prefix="WEB-INF/lib" excludes="commons-collections.jar" />
<zipfileset dir="${basedir}/../lib/spring" prefix="WEB-INF/lib" includes="*.jar" excludes="commons-logging.jar" />
<zipfileset dir="${basedir}/../lib/velocity" prefix="WEB-INF/lib" includes="velocity*.jar" />
<zipfileset dir="${basedir}/../lib/quickstart" prefix="WEB-INF/lib" includes="log4j.jar, commons-io.jar, commons-lang.jar, commons-collections.jar" />
<zipfileset dir="${basedir}/../lib/jfree" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../build" prefix="WEB-INF/lib" includes="${name}-${version}.jar" />
<zipfileset dir="${basedir}/.." prefix="WEB-INF/lib" includes="${name}-${version}.jar" />
</war>
</target>
<target name="buildWithoutWebAppLocation" unless="hasWebAppLocation">
<!-- copy over the webapp -->
<copy todir="${basedir}/tmp">
<fileset dir="${basedir}/${webapp}/src/main/webapp" />
</copy>
<!-- compile the sources -->
<mkdir dir="${basedir}/tmp/WEB-INF/classes" />
<compile srcdir="${basedir}/${webapp}/src/main/java" destdir="${basedir}/tmp/WEB-INF/classes" />
</target>
<target name="buildWithWebAppLocation" if="hasWebAppLocation">
<!-- copy over the webapp -->
<copy todir="${basedir}/tmp">
<fileset dir="${webapplocation}/${webapp}/src/main/webapp" />
</copy>
<!-- compile the sources -->
<mkdir dir="${basedir}/tmp/WEB-INF/classes" />
<compile srcdir="${webapplocation}/${webapp}/src/main/java" destdir="${basedir}/tmp/WEB-INF/classes" />
</target>
<target name="new" description="Create a new webapp project with the specified name and packages">
<echo level="info">
+=============================================================+
| -- Create a new web application -- |
+=============================================================+
</echo>
<echo/>
<!-- Prompt the user for input -->
<input message="Enter the name of your new application [myapp]?" addproperty="new.app.name"
defaultvalue="myapp" />
<input message="Enter the location of your new application [${basedir}]?" addproperty="new.app.location"
defaultvalue="${basedir}" />
<echo level="info">Creating '${new.app.location}/${new.app.name}' web application...</echo>
<copy todir="${new.app.location}/${new.app.name}">
<fileset dir="${basedir}/blank">
<exclude name="tmp/**"/>
<exclude name="build/**"/>
<include name="**"/>
<exclude name=".#**"/>
<exclude name="*.iml"/>
<exclude name="*.classpath"/>
<exclude name="CVS/**"/>
<exclude name="**/CVS"/>
</fileset>
</copy>
<!-- Commented out cause idea & eclipse file are missing -->
<!-- Copy the IDEA project file(s) -->
<!--copy file="blank/blank.iml" tofile="${new.app.name}/${new.app.name}.iml"/>
<replace dir="${new.app.name}" value="${new.app.name}" token="blank">
<include name="${new.app.name}.i*"/>
</replace -->
<!-- Copy the Eclipse project file(s) -->
<!--copy file="blank/.classpath" tofile="${new.app.name}/.classpath"/>
<replace file="${new.app.name}/.classpath" value="${basedir}/.." token="@STRUTS2_HOME@"/>
<replace file="${new.app.name}/.classpath" value="${version}" token="@STRUTS2_VERSION@"/>
<copy file="blank/.project" tofile="${new.app.name}/.project"/>
<replace file="${new.app.name}/.project" value="${new.app.name}" token="@PROJECT_NAME@"/ -->
<condition property="hasWebAppLocation">
<not>
<equals arg1="${new.app.location}" arg2="${basedir}" casesensitive="true" trim="true"/>
</not>
</condition>
<ant target="printConfigMessageWithWebAppLocation" />
<ant target="printConfigMessageWithoutWebAppLocation" />
</target>
<target name="printConfigMessageWithWebAppLocation" if="hasWebAppLocation">
<echo level="info">
+=============================================================================+
| -- Your Web Application was created successfully! -- |
| |
| Or if you have changed the default web app location: |
| > ant build -Dwebapp=${new.app.name} -Dwebapplocation=${new.app.location} |
| |
+=============================================================================+
</echo>
</target>
<target name="printConfigMessageWithoutWebAppLocation" unless="hasWebAppLocation">
<echo level="info">
+=============================================================================+
| -- Your Web Application was created successfully! -- |
| |
| Now you should be able to build your application with: |
| > ant build -Dwebapp=${new.app.name} |
| |
+=============================================================================+
</echo>
</target>
<target name="build-portlet" depends="prepare-portlet,prepare-portlet-deploy" description="Builds the portlet application. You can use the 'container' system property to target a specific container, e.g. '-Dcontainer=exo'. Supported containers are exo, gridsphere, jboss-portal-2.0, jboss-portal-2.2 and jetspeed2">
<!-- war up the app -->
<war file="${basedir}/dist/struts2-portlet.war" webxml="tmp/WEB-INF/web.xml">
<zipfileset dir="tmp" prefix="" />
<!-- only these configurations are needed for now. Also, these are probably more than
needed, but we're just picking a single set of jars that each webapp can use -->
<zipfileset dir="${basedir}/../lib/ajax" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../lib/default" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../lib/cewolf" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../lib/fileupload" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../lib/freemarker" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../lib/sitemesh" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../lib/spring" prefix="WEB-INF/lib" includes="*.jar" excludes="commons-logging.jar" />
<zipfileset dir="${basedir}/../lib/velocity" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../lib/quickstart" prefix="WEB-INF/lib" includes="log4j.jar, commons-lang.jar" />
<zipfileset dir="${basedir}/../lib/jfree" prefix="WEB-INF/lib" includes="*.jar" />
<zipfileset dir="${basedir}/../build" prefix="WEB-INF/lib" includes="${name}-${version}.jar" />
<zipfileset dir="${basedir}/.." prefix="WEB-INF/lib" includes="${name}-${version}.jar" />
</war>
</target>
<target name="prepare-portlet">
<property name="webapp" value="portlet" />
<!-- prepare -->
<delete dir="${basedir}/tmp" />
<mkdir dir="${basedir}/tmp" />
<mkdir dir="${basedir}/dist" />
<!-- copy over the webapp -->
<copy todir="${basedir}/tmp">
<fileset dir="${basedir}/${webapp}/src/webapp" />
</copy>
<!-- compile the sources -->
<mkdir dir="${basedir}/tmp/WEB-INF/classes" />
<compile srcdir="${basedir}/${webapp}/src/java" destdir="${basedir}/tmp/WEB-INF/classes" />
</target>
<target name="prepare-portlet-deploy" if="container">
<!-- Prepare descriptors and potential extra jars -->
<property name="deploy.src.dir" value="${basedir}/portlet/src/etc" />
<antcall target="prepare-${container}" />
</target>
<target name="prepare-exo">
<copy file="${deploy.src.dir}/exo/web.xml" tofile="tmp/WEB-INF/web.xml" overwrite="true" />
</target>
<target name="prepare-jboss-portal-2.2">
<copy todir="tmp/WEB-INF/">
<fileset dir="${deploy.src.dir}/jbossportal2.2">
<include name="*.*" />
</fileset>
</copy>
</target>
<target name="prepare-jboss-portal-2.0">
<copy todir="tmp/WEB-INF/" overwrite="true">
<fileset dir="${deploy.src.dir}/jbossportal2.0">
<include name="*.*" />
</fileset>
</copy>
</target>
<target name="prepare-jetspeed2">
<copy todir="tmp/WEB-INF/" overwrite="true">
<fileset dir="${deploy.src.dir}/jetspeed2">
<include name="*.*" />
</fileset>
</copy>
</target>
<target name="prepare-gridsphere">
<copy todir="tmp/WEB-INF/" overwrite="true">
<fileset dir="${deploy.src.dir}/gridsphere">
<include name="*.xml" />
<include name="*.txt" />
</fileset>
</copy>
<copy todir="tmp/WEB-INF/lib/" overwrite="true">
<fileset dir="${deploy.src.dir}/gridsphere">
<include name="*.jar" />
</fileset>
</copy>
</target>
<target name="prepare-liferay-3.6.1">
<copy todir="tmp/WEB-INF/" overwrite="true">
<fileset dir="${deploy.src.dir}/liferay3.6.1">
<include name="*.xml" />
</fileset>
</copy>
</target>
</project>
-242
View File
@@ -1,242 +0,0 @@
<project name="action" default="jar" basedir=".">
<!-- overridden properties (must be before the import!) -->
<!--property name="src.test" value="action/src/test"/-->
<property name="src.xdt" value="core/src/main/xdt"/>
<property name="compile.version" value="1.5"/>
<property name="test.compile.version" value="1.5"/>
<property name="optional.sources" value="org/apache/struts2/views/jasperreports/**,
org/apache/struts2/dispatcher/multipart/PellMultiPartRequest.java,
org/apache/struts2/dispatcher/ChartResult.java
" />
<property name="optional.test.sources" value="org/apache/struts2/dispatcher/ChartResultTest.java" />
<import file="ant-build/osbuild.xml"/>
<!-- overriding the one found in osbuild.xml to exclude xwork-tiger,
which breaks the unit tests currently -->
<path id="cp">
<fileset dir="lib">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
<exclude name="**/jalopy/**"/>
<exclude name="**/tiger/**"/>
</fileset>
</path>
<mkdir dir="${build}/xwork-src"/>
<path id="javadoc.path">
<path path="${src.java}"/>
<path path="${build}/xwork-src"/>
</path>
<property name="build.tagdocs" value="${build}/tagdocs"/>
<property name="docs.tags" value="${docs}/tags"/>
<target name="init" depends="common.init" unless="skip.ivy">
<echo>
The default build only retrieves dependencies that released under a license compatible
with the Apache Software Foundation. To optionally download the optional LGPL dependencies
and compile the dependent Struts code, run the 'compile-optional' task.
</echo>
<taskdef file="ant-build/ivy-tasks.properties" classpathref="cp" />
<ivy-configure file="ant-build/ivyconf.xml" />
<ivy-resolve file="ant-build/ivy.xml" />
<ivy-retrieve conf="build,default,source,ajax,freemarker,velocity,fileupload,sitemesh,quickstart,xslt,portlet,spring,pico,plexus,tiger,tiles" />
</target>
<target name="javadocs" depends="common.init">
<!-- first, unzip the xwork-src jar so we can generate unified javadocs -->
<unjar src="${lib}/source/xwork-src.jar" dest="${build}/xwork-src"/>
<antcall target="common.javadocs"/>
</target>
<target name="ivyrep.copy-ivy" depends="init">
<ivy-deliver deliverpattern="${ivyrep.path}/opensymphony/${name}/[artifact]-[revision].[ext]"
pubrevision="${version}-${TIME}" pubdate="${TIME}"/>
</target>
<target name="reports" depends="common.reports">
<mkdir dir="${dist.docs}/dependencies"/>
<!--
<ivy-report todir="${dist.docs}/dependencies" graph="false"/>
-->
</target>
<macrodef name="webapp">
<attribute name="name"/>
<sequential>
<mkdir dir="${dist}/apps/@{name}/src"/>
<copy todir="${dist}/apps/@{name}/src">
<fileset dir="apps/@{name}/src" includes="**/**"/>
</copy>
</sequential>
</macrodef>
<target name="predist">
<!-- grab the README.txt file -->
<copy file="${src}/etc/README.txt" todir="${dist}"/>
<mkdir dir="${dist}/dist" />
<move file="${build}/${name}-nostatic-${version}.jar" todir="${dist}/dist" />
<move file="${build}/${name}-static-${version}.zip" todir="${dist}/dist" />
<!-- prepare the template project -->
<webapp name="blank"/>
<copy todir="${dist}/apps/blank">
<fileset dir="apps/blank/" includes="*.iml" />
</copy>
<!-- prepare each tutorial/example -->
<webapp name="starter"/>
<webapp name="showcase"/>
<webapp name="shopping-cart"/>
<webapp name="portlet"/>
<!-- copy over elements required to build the final wars -->
<copy file="apps/build.xml" todir="${dist}/apps"/>
</target>
<target name="xdoclet-taglib" depends="init">
<taskdef
name="xdoclet"
classname="xdoclet.DocletTask"
classpathref="cp"
/>
<xdoclet destdir="${src.resources}/META-INF"
excludedtags="@version,@author,@return,@exception,@todo"
verbose="false"
force="true"
>
<!--
mergedir="src/etc"
-->
<fileset dir="${src.java}">
<include name="org/apache/struts2/views/**/*.java"/>
<include name="org/apache/struts2/components/**/*.java"/>
</fileset>
<configParam name="Jspversion" value="1.2"/>
<configParam name="Taglibversion" value="${version}"/>
<configParam name="Description" value="Struts 2 JSP Taglib"/>
<configParam name="Shortname" value="Struts 2 Taglib"/>
<configParam name="Displayname" value="Struts 2 Taglib"/>
<configParam name="Smallicon" value=""/>
<configParam name="Largeicon" value=""/>
<configParam name="Uri" value="/tags"/>
<xmlTemplate templateFile="${src.xdt}/tags_tld.xdt" destinationfile="tags.tld"/>
</xdoclet>
</target>
<target name="xdoclet-tagdoc" depends="init">
<mkdir dir="${build.tagdocs}"/>
<taskdef name="xdoclet" classname="xdoclet.DocletTask" classpathref="cp"/>
<xdoclet destdir="${build.tagdocs}"
excludedtags="@version,@author,@return,@exception"
verbose="false"
force="true"
>
<fileset dir="${src.java}">
<include name="org/apache/struts2/views/**/*.java"/>
<include name="org/apache/struts2/components/**/*.java"/>
</fileset>
<xmlTemplate templateFile="${src.xdt}/tagdoc.xdt" destinationfile="{0}.html"/>
</xdoclet>
<xdoclet destdir="${build.tagdocs}"
excludedtags="@version,@author,@return,@exception"
verbose="false"
force="true"
>
<fileset dir="${src.java}">
<include name="org/apache/struts2/views/**/*.java"/>
<include name="org/apache/struts2/components/**/*.java"/>
</fileset>
<configParam name="Taglibversion" value="${version}"/>
<template templateFile="${src.xdt}/tagdoc-toc.xdt" destinationfile="index.html"/>
</xdoclet>
<mkdir dir="${docs.tags}"/>
<copy todir="${docs.tags}" flatten="true" includeemptydirs="false" overwrite="true">
<fileset dir="${build.tagdocs}" includes="**/*.html">
<size value="10" when="more"/>
</fileset>
</copy>
</target>
<target name="mavenrep" depends="jar">
<!-- struts2 -->
<copy file="pom.xml" tofile="/opt/repository/ibiblio.org/opensymphony/poms/${name}-${version}-SNAPSHOT.pom"/>
<copy file="${build}/${name}-${version}.jar" tofile="/opt/repository/ibiblio.org/opensymphony/jars/${name}-${version}-SNAPSHOT.jar"/>
<copy file="${build}/${name}-src-${version}.jar" tofile="/opt/repository/ibiblio.org/opensymphony/jars/${name}-src-${version}-SNAPSHOT.jar"/>
</target>
<!-- overridden targets -->
<target name="jar" depends="compile">
<mkdir dir="${build}"/>
<jar basedir="${build.java}" jarfile="${build}/${name}-${version}.jar">
<manifest>
<attribute name="Main-Class" value="org.apache.struts2.Main"/>
<attribute name="Implementation-Title" value="${fullname}"/>
<attribute name="Implementation-Version" value="${version}"/>
</manifest>
</jar>
<jar basedir="${src.java}" jarfile="${build}/${name}-src-${version}.jar">
<zipgroupfileset file="lib/source/xwork-src.jar"/>
<manifest>
<attribute name="Implementation-Title" value="${fullname}"/>
<attribute name="Implementation-Version" value="${version}"/>
</manifest>
</jar>
<jar jarfile="${build}/${name}-nostatic-${version}.jar">
<fileset dir="${build.java}">
<exclude name="org/apache/struts2/static/**/*" />
</fileset>
<manifest>
<attribute name="Main-Class" value="org.apache.struts2.Main"/>
<attribute name="Implementation-Title" value="${fullname}"/>
<attribute name="Implementation-Version" value="${version}"/>
</manifest>
</jar>
<zip destfile="${build}/${name}-static-${version}.zip">
<zipfileset dir="${build.java}/org/apache/struts2/static" prefix="struts2" />
</zip>
</target>
<target name="dist" depends="common.dist" description="generate distribution zip file">
<propertyfile file="${dist}/build.properties">
<entry key="skip.ivy" value="true"/>
</propertyfile>
</target>
<target name="clean" depends="common.clean">
<delete dir="apps/base/build"/>
<delete dir="apps/blank/build"/>
<delete dir="apps/showcase/build"/>
<delete dir="apps/starter/build"/>
<delete dir="apps/ajax/build"/>
<delete dir="apps/shopping-cart/build"/>
<delete dir="apps/portlet/build"/>
<!--
<delete dir="apps/wwia/build"/>
-->
</target>
<target name="init-optional" depends="init" unless="skip.ivy">
<echo>
This task retrieves optional dependencies that are released under licenses that are
not endorsed by the Apache Software Foundation. In particular, these dependencies
use the LGPL license - http://opensource.org/licenses/lgpl-license.php
</echo>
<!--
<taskdef name="ivy-retrieve" classname="fr.jayasoft.ivy.ant.IvyRetrieve" classpathref="cp"/>
-->
<ivy-retrieve conf="fileupload-pell,jasperreports,jfree,cewolf" />
</target>
<target name="compile-optional" depends="compile, init-optional" description="compile optional files">
<compile srcdir="extras/src/main/java" destdir="${build.java}" />
</target>
</project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.