blob: be758c2e1986c28b538a8b4f010f1eb6fe31217a [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.
-->
<!--
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
The instructions below that talk about the "new" way of doing
things appear to be just a plan. There are no poms in the
feature projects, and the features and updated site are still
built the "old" way. Just set an eclipse.home property and run
the default target.
-->
<!-- This script is run from ant and builds a new update site.
Usage:
place any new feature - jars into the features directory
place any new plugin jars into the plugins directory
NOTE: both of these should come from the official release
candidate that was approved
update the site.xml to reference the new feature(s)
run "ant"
Output will be in target/eclipse-update-site
-->
<!--
====================================================================
An Eclipse update site consists of:
The top level site, changed for every update, but not "versioned"
digest.zip (signed)
index.html
site.xml
a web dir with a site.css and site.xsl file
a Features dir, containing
for each feature,
for each release of that feature,
a jar (Apache-signed)
a Plugins dir, containing:
for each plugin (which may belong to more than one feature),
for each release of that plugin,
a jar (Apache-signed)
a jar.pack.gz
NOTE: The signing process needs updating,
because the jar.pack.gz is the thing actually downloaded,
and Eclipse can check the signature, but this process
requires a "certificate" of some kind
The current signing process creates signatures
that are not checked by Eclipse when downloaded.
There is an Apache process that checks the signatures are present,
though, at upload time.
Versioning:
The update site itself has no version;
It is only a container for the versions of the
components contained within it, each of which
have their own version(s).
Build process:
There are two parts to the build process.
(The 2nd part:) Creating the update site from the set of features
This is done when a release is approved.
(The 1st part:) Creating the features and plugins
This is done when a release is built.
The Feature Jar is built from the Feature project
(old process: by this script, and stored in this
project's svn in the features/ directory;
new process: by maven/pom in the feature project)
The plugins Jars are built from the individual plugin-projects.
This script will optimize those jars for deploying, using a
2 step process: the Jars are "normalized" and then packed using
the pack200 standard, which Java 5 (and later) and
Eclipse installers support; this reduces the size of the
download jars considerably (e.g. 1/9th for large files)..
The normalization and packing are done using facilities
from Eclipse, so ECLIPSE_HOME or alternative needs to be set.
see http://wiki.eclipse.org/Update_Site_Optimization
Sources and sinks:
Process: normalizing and compressing jars:
ant target: pack-jars
Source: this project/plugins
>>>>> Place official released jars for the eclipse
>>>>> plugins here; all will be compressed
Sink: this project/target/eclipse-update-site/plugins
Process: building the update site:
ant target: build-site
Source: this project:
site.xml
web/*
target/eclipse-update-site/features (not sure if needed)
Target: target/eclipse-update-site ("digests" are created)
NOTE: the "all" target does both of the above 2 process steps
(Temporary process for older builds)
Process: building the feature jars
Source: the feature projects
-->
<!-- set the basedir value to point to the top level of the project -->
<project name="build update site" default="all" basedir=".">
<!-- Set this to your eclipse installation
<property name="eclipse.home" location=""/> -->
<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 an ant property 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}"/>
<target name="all" depends="pack-jars, build-site"/>
<target name="clean">
<delete dir="target"/>
</target>
<target name="init">
<mkdir dir="target"/>
<mkdir dir="target/eclipse-update-site"/>
<mkdir dir="target/eclipse-update-site/features"/>
<mkdir dir="target/eclipse-update-site/plugins"/>
<!-- 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"/>
<attribute name="version"/>
<sequential>
<delete dir="work" quiet="true"/>
<mkdir dir="work"/>
<copy todir="work/@{org-name}_@{version}">
<fileset dir="../@{project-name}" includes="feature.xml feature.properties"/>
</copy>
<copy todir="work/@{org-name}_@{version}/META-INF">
<fileset dir="../uimaj-distr/src/main/readme" includes="LICENSE NOTICE DISCLAIMER"/>
</copy>
<jar
destfile="target/eclipse-update-site/features/@{org-name}_@{version}.jar"
basedir="work/@{org-name}_@{version}"/>
</sequential>
</macrodef>
<!-- OLD Process to make the feature jar;
new process will make this jar as part of maven build for that component -->
<target name="build-uima-as" depends="init">
<makeFeatureJar project-name="uimaj-eclipse-feature-deployeditor"
org-name="org.apache.uima.as.deployeditor"
version="2.2.2.incubating"/>
</target>
<!-- temp work-around for no feature jars being built - build them here
to use this, call this out as an explicit ant target to run -->
<target name="build-features" depends="init">
<makeFeatureJar project-name="uimaj-eclipse-feature-deployeditor"
org-name="org.apache.uima.deployeditor"
version="2.3.0.incubating"/>
<makeFeatureJar project-name="uimaj-eclipse-feature-runtime"
org-name="org.apache.uima.runtime"
version="2.3.0.incubating"/>
<makeFeatureJar project-name="uimaj-eclipse-feature-tools"
org-name="org.apache.uima.tools"
version="2.3.0.incubating"/>
</target>
<target name="pack-jars" depends="init">
<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="plugins"/>
</java>
</target>
<target name="build-site" depends="init">
<copy todir="target/eclipse-update-site/web" preservelastmodified="true">
<fileset dir="web"/>
</copy>
<copy todir="target/eclipse-update-site" file="index.html" preservelastmodified="true"/>
<copy todir="target/eclipse-update-site" file="site.xml" preservelastmodified="true"/>
<!-- copy all the features to the target -->
<copy todir="target/eclipse-update-site/features" preservelastmodified="true" >
<fileset dir="features"/>
</copy>
<!-- 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>
</project>