blob: b516843d0e9cbcda74532d153e1278984ca76e6b [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!-- This script can be run "stand alone" for testing, but
normally is called from the uimaj-distr POM when assembly:assembly
goal is being run
-->
<!-- set the basedir value to point to the top level of the project -->
<project name="build update site" default="all" basedir=".">
<!-- will be overridden by maven caller -->
<property name="project.version" value="2.2.2.incubating-SNAPSHOT"/>
<condition property="eclipse.home" value="${uima-maven-build-eclipse-home}">
<not><equals arg1="${uima-maven-build-eclipse-home}" arg2="$${uima-maven-build-eclipse-home}"/></not>
</condition>
<property environment="envVar"/>
<condition property="eclipse.home" value="${envVar.ECLIPSE_HOME}">
<isset property="envVar.ECLIPSE_HOME"/>
</condition>
<fail unless="eclipse.home" message="********** Please set up and use a maven profile with the property uima-maven-build-eclipse-home set to an Eclipse installation at level 3.3 or later, e.g. c:/eclipses/3.3/eclipse"/>
<property name="eclipse.home" location="${uima-maven-build-eclipse-home}"/>
<!-- note: jar signing not done here, but rather as part of uimaj-distr POM processing -->
<target name="all" depends="init,
build-runtime,
build-tools,
pack-jars,
copy-features,
build-digest,
clean-snapshots"/>
<target name="init">
<delete dir="target"/>
<delete dir="work"/>
<mkdir dir="work"/>
<mkdir dir="target"/>
<mkdir dir="target/eclipse-update-site"/>
<mkdir dir="target/eclipse-update-site/features"/>
<mkdir dir="target/eclipse-update-site/plugins"/>
<copy todir="target/eclipse-update-site/web">
<fileset dir="web"/>
</copy>
<copy todir="target/eclipse-update-site" file="index.html"/>
<copy todir="target/eclipse-update-site" file="site.xml"/>
<!-- get path to equinox jar inside ${eclipse.home} folder (copy/rename actual jar) -->
<copy tofile="${eclipse.home}/plugins/org.eclipse.equinox.launcher.jar">
<!-- the first -> sort -> date picks the latest instance of the set of files
that match the pattern of the contained fileset, if there is more than one -->
<first>
<sort>
<date xmlns="antlib:org.apache.tools.ant.types.resources.comparators"/>
<fileset dir="${eclipse.home}/plugins"
includes="**/org.eclipse.equinox.launcher_*.jar"/>
</sort>
</first>
</copy>
</target>
<macrodef name="makeFeatureJar">
<attribute name="org-name"/>
<attribute name="project-name"/>
<sequential>
<copy todir="work/features/@{org-name}_${project.version}">
<fileset dir="../@{project-name}" includes="feature.xml feature.properties"/>
</copy>
<copy todir="work/features/@{org-name}_${project.version}/META-INF">
<fileset dir="../uimaj-distr/src/main/readme"
includes="LICENSE NOTICE DISCLAIMER"/>
</copy>
<jar destfile="target/eclipse-update-site/features/@{org-name}_${project.version}.jar"
basedir="work/features/@{org-name}_${project.version}"/>
</sequential>
</macrodef>
<macrodef name="makePluginJar">
<attribute name="project-name"/>
<attribute name="org-name"/>
<sequential>
<copy todir="target/eclipse-update-site/plugins"
file="../@{project-name}/target/@{org-name}_${project.version}.jar"/>
</sequential>
</macrodef>
<target name="build-runtime">
<makeFeatureJar project-name="uimaj-eclipse-feature-runtime" org-name="org.apache.uima.runtime"/>
<makePluginJar project-name="uimaj-ep-runtime" org-name="org.apache.uima.runtime"/>
</target>
<target name="build-tools">
<makeFeatureJar project-name="uimaj-eclipse-feature-tools" org-name="org.apache.uima.tools" />
<makePluginJar project-name="uimaj-ep-jcasgen" org-name="org.apache.uima.jcas.jcasgenp"/>
<makePluginJar project-name="uimaj-ep-debug" org-name="org.apache.uima.debug"/>
<makePluginJar project-name="uimaj-ep-pear-packager" org-name="org.apache.uima.pear"/>
<makePluginJar project-name="uimaj-ep-configurator" org-name="org.apache.uima.desceditor"/>
<makeFeatureJar project-name="uimaj-eclipse-feature-deployeditor" org-name="org.apache.uima.as.deployeditor" />
<makePluginJar project-name="uimaj-ep-deployeditor" org-name="org.apache.uima.deployeditor"/>
<makePluginJar project-name="uimaj-ep-runtime-deployeditor" org-name="org.apache.uima.runtime-deployeditor"/>
</target>
<target name="normalize-jars">
<java jar="${eclipse.home}/plugins/org.eclipse.equinox.launcher.jar"
fork="true" failonerror="true" maxmemory="256m" >
<arg line="-application org.eclipse.update.core.siteOptimizer"/>
<arg line="-jarProcessor -processAll -repack"/>
<arg line="-outputDir target/eclipse-update-site/plugins"/>
<arg line="target/eclipse-update-site/plugins"/>
</java>
</target>
<target name="pack-jars">
<java jar="${eclipse.home}/plugins/org.eclipse.equinox.launcher.jar"
fork="true" failonerror="true" maxmemory="256m" >
<arg line="-application org.eclipse.update.core.siteOptimizer"/>
<arg line="-jarProcessor -verbose -processAll -pack"/>
<arg line="-outputDir target/eclipse-update-site/plugins"/>
<arg line="target/eclipse-update-site/plugins"/>
</java>
</target>
<target name="copy-features">
<!-- copy the new features built above to features, so they
can be saved in SVN for use when next version is built -->
<copy todir="features">
<fileset dir="target/eclipse-update-site/features"/>
</copy>
<!-- copy all the features to the work area for the build-digest step -->
<copy todir="target/eclipse-update-site/features">
<fileset dir="features"/>
</copy>
</target>
<target name="build-digest">
<!-- see http://wiki.eclipse.org/Update_Site_Optimization -->
<java jar="${eclipse.home}/plugins/org.eclipse.equinox.launcher.jar"
fork="true" failonerror="true" maxmemory="256m">
<arg line="-application org.eclipse.update.core.siteOptimizer"/>
<arg line="-digestBuilder -digestOutputDir=target/eclipse-update-site"/>
<arg line="-siteXML=target/eclipse-update-site/site.xml"/>
</java>
</target>
<target name="clean-snapshots">
<delete dir="features" includes="*-SNAPSHOT.jar"/>
</target>
<!--target name="move-to-uimaj-distr-target">
<delete dir="../uimaj-distr/target/eclipse-update-site" quiet="true"/>
<mkdir dir="../uimaj-distr/target/eclipse-update-site"/>
<copy todir="../uimaj-distr/target/eclipse-update-site">
<fileset dir="target/eclipse-update-site"/>
</copy>
</target-->
</project>