Author: nickboldt
Date: 2012-10-16 16:11:54 -0400 (Tue, 16 Oct 2012)
New Revision: 44532
Added:
trunk/build/aggregate/remove-uninstallable.xsl
Modified:
trunk/build/aggregate/build.xml
Log:
fix build.xml so it can be called by central site builder w/o extra processing in the
pom.xml; JBIDE-12389: exclude features/plugins with 'do not install' in their name
or description
Modified: trunk/build/aggregate/build.xml
===================================================================
--- trunk/build/aggregate/build.xml 2012-10-16 20:05:22 UTC (rev 44531)
+++ trunk/build/aggregate/build.xml 2012-10-16 20:11:54 UTC (rev 44532)
@@ -26,8 +26,13 @@
<tempfile property="tmpdir" destDir="${java.io.tmpdir}"
prefix="aggregate-site-build"/>
<mkdir dir="${tmpdir}" />
- <property name="update.site.source.dir"
value="${output.dir}/target/site" />
+ <property name="project.build.directory"
value="${output.dir}/target"/>
+ <!-- look for target/repository (new) or target/site (old) -->
+ <condition property="update.site.source.dir"
value="${project.build.directory}/site"
else="${project.build.directory}/repository">
+ <available file="${project.build.directory}/site" type="dir"
/>
+ </condition>
+
<!-- load properties from file -->
<condition property="associate.properties"
value="${output.dir}/associate.properties">
<available file="${output.dir}/associate.properties" type="file"
/>
@@ -39,7 +44,7 @@
<echo level="verbose">Loaded associate sites from
${associate.properties}</echo>
<property name="web.content.files" value="index.html, web/*.css,
README*, *directory.xml, site.xml, site.properties" />
- <property name="target.zip"
value="${output.dir}/target/repository.zip"/>
+ <property name="target.zip"
value="${project.build.directory}/site_assembly.zip"/>
<target name="init">
<echo>
@@ -61,7 +66,7 @@
<antcall target="get.saxon" />
</target>
- <target name="basic.build" description="JBT aggregate update site
extra processing steps"
depends="init,check.target,add.repo.properties,unpack.content.jar,remove.references,add.associate.sites,remove.uncategorized.category,add.web.content,pack.content.jar,pack.zip,cleanup"
/>
+ <target name="basic.build" description="JBT aggregate update site
extra processing steps"
depends="init,check.target,add.repo.properties,unpack.content.jar,remove.references,add.associate.sites,remove.uncategorized.category,remove.uninstallable,add.web.content,pack.content.jar,pack.zip,cleanup"
/>
<target name="custom.build" description="JBT aggregate update site
extra processing steps"
depends="basic.build,collect.zips,collect.metadata,create.summary.file,cleanup"
/>
<target name="get.ant-contrib"
unless="ant-contrib.jar.exists">
@@ -448,6 +453,11 @@
<xslt style="remove-uncategorized.xsl"
in="${update.site.source.dir}/content.old.xml"
out="${update.site.source.dir}/content.xml" />
</target>
+ <target name="remove.uninstallable">
+ <copy file="${update.site.source.dir}/content.xml"
tofile="${update.site.source.dir}/content.old.xml" overwrite="true"
/>
+ <xslt style="remove-uninstallable.xsl"
in="${update.site.source.dir}/content.old.xml"
out="${update.site.source.dir}/content.xml" />
+ </target>
+
<target name="unpack.content.jar">
<if>
<available file="${update.site.source.dir}/content.jar"
type="file" />
@@ -473,30 +483,41 @@
</target>
<target name="check.target">
+
+ <!-- support eclipse-repository (new) and eclipse-update-site (old): put
category.xml in correct folder -->
<if>
- <or>
- <and> <!-- Old school eclipse-update-site -->
- <available file="${output.dir}/target/site" type="dir" />
- <available file="${output.dir}/target/site_assembly.zip"
type="file" />
- </and>
- <and> <!-- eclipse-repository -->
- <available file="${output.dir}/target/repository"
type="dir"/>
- <available file="${output.dir}/target/repository.zip"
type="file" />
- </and>
- </or>
+ <available file="${project.build.directory}/category.xml"
type="file"/>
<then>
- <if>
- <available file="${output.dir}/target/site_assembly.zip"
type="file" />
- <then>
- <var name="target.zip" unset="true"/>
- <var name="target.zip"
value="${output.dir}/target/site_assembly.zip"/>
- </then>
- </if>
+ <move file="${project.build.directory}/category.xml"
tofile="${project.build.directory}/site/category.xml" />
</then>
- <else>
+ </if>
+ <!-- support eclipse-repository (new) and eclipse-update-site (old): rename
central.site-1.1.0-SNAPSHOT.zip to site_assembly.zip to be compatible with publish.sh
script -->
+ <if>
+ <not><available file="${project.build.directory}/site_assembly.zip"
type="file"/></not>
+ <then>
+ <move tofile="${project.build.directory}/site_assembly.zip">
+ <fileset dir="${project.build.directory}" includes="*.zip"
excludes="site.zip, site_assembly.zip"/>
+ </move>
+ </then>
+ </if>
+
+ <if>
+ <not>
+ <or>
+ <and> <!-- Old school eclipse-update-site -->
+ <available file="${project.build.directory}/site" type="dir"
/>
+ <available file="${project.build.directory}/site_assembly.zip"
type="file" />
+ </and>
+ <and> <!-- eclipse-repository -->
+ <available file="${project.build.directory}/repository"
type="dir"/>
+ <available file="${project.build.directory}/site_assembly.zip"
type="file" />
+ </and>
+ </or>
+ </not>
+ <then>
<fail>
--
-Could not find ${output.dir}/target/site and one of
${output.dir}/target/site_assembly.zip or ${output.dir}/target/repository.zip
+Could not find ${project.build.directory}/site and one of
${project.build.directory}/site_assembly.zip or ${project.build.directory}/*.zip
Cannot adjust an update site w/o first building it!
--
Using maven: mvn3 clean install -U -B -fae -q -e
@@ -504,7 +525,7 @@
Using ant: ant basic.build -f ../build.xml -Doutput.dir=`pwd`
Using ant: ant custom.build -f ../build.xml -Doutput.dir=`pwd`
-DinputRepo=http://download.jboss.org/jbosstools/builds/staging/_composite_/core/trunk/
</fail>
- </else>
+ </then>
</if>
</target>
Added: trunk/build/aggregate/remove-uninstallable.xsl
===================================================================
--- trunk/build/aggregate/remove-uninstallable.xsl (rev 0)
+++ trunk/build/aggregate/remove-uninstallable.xsl 2012-10-16 20:11:54 UTC (rev 44532)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
+
+<xsl:template match="/">
+ <xsl:apply-templates select="*"/>
+</xsl:template>
+
+
+<xsl:template match="*">
+ <xsl:copy >
+ <xsl:for-each select="@*">
+ <xsl:copy />
+ </xsl:for-each>
+ <xsl:apply-templates />
+ </xsl:copy>
+</xsl:template>
+
+<!-- remove uninstallable features/plugins based on their names/descriptions
+<properties>
+<property name="df_LT.bundleName" value="... do not install
..."/>
+<property name="df_LT.featureName" value="... do not install
..."/>
+<property name="df_LT.description" value="... do not install
..."/>
+</properties>
+-->
+<xsl:template match="unit[*/property[contains(@value,'do not
install')]]" />
+
+</xsl:stylesheet>
\ No newline at end of file