blob: 6f5d802f1fef71e687e2892a8a05c7e4f8b25d6f [file] [log] [blame]
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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="lenya-ide">
<description>
IDE targets
</description>
<!-- Build the Eclipse projects files -->
<target name="eclipse-project" depends="prepare" description="Generate the Eclipse project files">
<echo message="Building Eclipse Project Files"/>
<xmlproperty file="${cocoon.src.dir}/.project"/>
<fail unless="projectDescription.name">
Please call "./build.sh eclipse-project" in the Cocoon source directory first.
</fail>
<!-- prepare the various paths that will form the project -->
<path id="srcs">
<!-- Ant tasks -->
<pathelement path="tools/anttasks/src"/>
<!-- API source dirs -->
<pathelement path="${src.java.api.dir}"/>
<!-- implementation source dirs -->
<pathelement path="${src.java.impl.dir}"/>
<pathelement path="${src.test.impl.dir}"/>
<dirset dir="src/pubs">
<include name="*/java/src"/>
<include name="*/java/test"/>
<include name="*/modules/*/java/src"/>
<include name="*/modules/*/java/test"/>
</dirset>
<dirset dir="src/modules">
<include name="*/java/src"/>
<include name="*/java/test"/>
</dirset>
<dirset dir="src/modules-core">
<include name="*/java/src"/>
<include name="*/java/test"/>
</dirset>
<dirset dir="src/modules-optional">
<include name="*/java/src"/>
<include name="*/java/test"/>
</dirset>
</path>
<path id="libs">
<!-- Cocoon libs -->
<fileset dir="${cocoon.src.dir}/${lib.dir}">
<include name="core/*.jar"/>
<!-- Currently, we have no JVM dependent libraries
<include name="core/jvm${target.vm}/*.jar"/>
-->
<include name="optional/*.jar"/>
<include name="local/*.jar"/>
<include name="endorsed/*.jar"/>
</fileset>
<!-- Cocoon blocks lib -->
<fileset dir="${cocoon.src.dir}/src/blocks">
<include name="**/*.jar"/>
</fileset>
<!-- Cocoon tools libs -->
<fileset dir="${cocoon.src.dir}/tools/lib">
<include name="*.jar"/>
<exclude name="xalan*.jar"/>
<exclude name="xml-api*.jar"/>
<exclude name="xerces*.jar"/>
</fileset>
<!-- main libs -->
<fileset dir="${lib.dir}">
<include name="*.jar"/>
<include name="endorsed/*.jar"/>
</fileset>
</path>
<!-- convert paths to properties -->
<property name="srcs" refid="srcs"/>
<property name="libs" refid="libs"/>
<!-- expand properties in the template file -->
<copy file="${src.resource.dir}/dev/eclipse/classpath-tmpl.xml"
tofile="${build.temp}/classpath-temp.xml"
filtering="yes"
overwrite="yes">
<filterset>
<filter token="SRC_DIRS" value="${srcs}"/>
<filter token="LIBS" value="${libs}"/>
<filter token="OUTPUT_DIR" value="${ide.eclipse.outputdir}"/>
</filterset>
</copy>
<!-- split the path in 'item' XML elements -->
<replace file="${build.temp}/classpath-temp.xml"
token="${path.separator}" value="&lt;/item&gt;&#xA; &lt;item&gt;"/>
<!-- relativize file names by removing the current directory -->
<replace file="${build.temp}/classpath-temp.xml"
token="${user}${file.separator}" value=""/>
<!-- and in case that fails, remove the base directory -->
<replace file="${build.temp}/classpath-temp.xml"
token="${basedir}${file.separator}" value=""/>
<!-- replace platform-dependent path separator by '/' -->
<replace file="${build.temp}/classpath-temp.xml"
token="${file.separator}" value="/"/>
<!-- now build the .classpath file -->
<xslt in="${build.temp}/classpath-temp.xml" out="${basedir}/.classpath"
processor="trax"
style="${src.resource.dir}/dev/eclipse/make-classpath.xsl">
<param name="exportlib" expression="${ide.eclipse.export.libs}"/>
<param name="cocoonProjectName" expression="${projectDescription.name}"/>
</xslt>
<!-- copy the project file (expand version) -->
<copy file="${src.resource.dir}/dev/eclipse/project"
tofile="${basedir}/.project"
filtering="yes"
overwrite="yes">
<filterset>
<filter token="COCOON_PROJECT" value="${projectDescription.name}"/>
<filter token="VERSION" value="${version}"/>
</filterset>
</copy>
</target>
<!-- Prepares the webapp to make it directly usable with the eclipse project -->
<target name="eclipse-webapp-prepare" depends="eclipse-webapp-delete-jars"
description="Prepares the webapp directory to make it usable within Eclipse"/>
<target name="eclipse-webapp-delete-jars" depends="prepare">
<!-- delete all jars and class files, they are already included in the project -->
<delete>
<fileset dir="${build.webapp}/WEB-INF">
<include name="lib/*.jar" />
<include name="classes/**/*.class" />
</fileset>
</delete>
</target>
</project>