[jbosstools-commits] JBoss Tools SVN: r22731 - in trunk/build: aggregate and 1 other directory.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Thu Jun 10 14:36:52 EDT 2010
Author: nickboldt
Date: 2010-06-10 14:36:51 -0400 (Thu, 10 Jun 2010)
New Revision: 22731
Added:
trunk/build/aggregate/
trunk/build/aggregate/TODO.txt
trunk/build/aggregate/aggregateRepos.jbds.properties.UNUSED
trunk/build/aggregate/aggregateRepos.jbosstools.properties
trunk/build/aggregate/aggregateRepos.m2eclipse.properties
trunk/build/aggregate/aggregateRepos.xml
Log:
add aggregator to merge JBT update site w/ pi4soa, tdesigner, etc.
Added: trunk/build/aggregate/TODO.txt
===================================================================
--- trunk/build/aggregate/TODO.txt (rev 0)
+++ trunk/build/aggregate/TODO.txt 2010-06-10 18:36:51 UTC (rev 22731)
@@ -0,0 +1,3 @@
+TODO: write ant script wrapper to pass in correct variables to aggregateRepos.xml script
+TODO: create Hudson job to aggregate update site zips into a new uberzip
+
Added: trunk/build/aggregate/aggregateRepos.jbds.properties.UNUSED
===================================================================
--- trunk/build/aggregate/aggregateRepos.jbds.properties.UNUSED (rev 0)
+++ trunk/build/aggregate/aggregateRepos.jbds.properties.UNUSED 2010-06-10 18:36:51 UTC (rev 22731)
@@ -0,0 +1,60 @@
+# aggregateRepos.xml properties file
+
+# basic config when used in JBT/JBDS build
+eclipse.home=${clean.eclipse.home}
+working.dir=${product.build.directory}/b3.aggregator
+
+# basic config when testing on local - be sure to replace reference to ${updateZip} with local JBT/JBDS update site zip
+#eclipse.home=/home/nboldt/eclipse/36clean2/eclipse
+#working.dir=/tmp/build.b3.aggregator
+# optional config when testing on local
+#requirement.build.root=${working.dir}
+#update.site.product.name=JBoss Tools
+#update.site.description=Nightly
+#product.versionTag=3.1.0.v201002111546N-H238-CR2
+
+# descriptions and labels used to name the resulting repo or to name categories
+repoName=${update.site.product.name} ${update.site.description} Update Site
+#product.versionTag=3.1.0.v200910281633N-RC1
+
+# location from which to install b3 aggregator
+b3.aggregator.repo=http://download.jboss.org/jbosstools/requirements/helios/b3.aggregator-repo-0.1.0.r01001_e36.zip
+b3.backup.repos=http://download.eclipse.org/eclipse/updates/3.6milestones/,http://download.eclipse.org/releases/helios/,http://download.jboss.org/jbosstools/requirements/helios/buckminster-repo-1.3.0.r11439_e36.zip
+
+# repos to aggregate - local paths require jar:file:/path/to.zip!/
+# repos to aggregate - remote paths to a zip will be prefetched and treated as local repo archive
+#jar:file:${product.build.directory}/all/${updateZip}!/,\
+#jar:file:${working.dir}/JBossTools-Update-3.1.0.v201002111546N-H238-CR2.zip!/,\
+# http://download.jboss.org/jbosstools/builds/nightly/3.2.helios/jbosstools-3.2.0.M1-Update-SNAPSHOT.zip,\
+repos=\
+http://download.jboss.org/jbosstools/builds/nightly/3.2.helios/jbosstools-3.2.0.M1-Update-SNAPSHOT.zip,\
+
+# associate sites to add to the resulting repo
+associate.sites=http://download.jboss.org/jbosstools/updates/helios/,\
+http://download.eclipse.org/birt/update-site/2.6-interim/,\
+http://download.eclipse.org/birt/update-site/2.6/,\
+http://download.eclipse.org/eclipse/updates/3.6milestones/,\
+http://download.eclipse.org/eclipse/updates/3.6/,\
+http://m2eclipse.sonatype.org/sites/m2e/,\
+http://m2eclipse.sonatype.org/sites/m2e-extras/
+
+# category to feature mappings: need a list of unique categoryIDs, then the list of features to assign to each category
+categories=SDKTools2,AllTools2,SOATools2
+SDKTools2.features=org.jboss.tools.jbpm3.sdk.feature
+#,org.jboss.tools.jmx.sdk.feature
+AllTools2.features=org.jbpm.gd.jpdl.feature
+#,org.jboss.tools.jmx.feature
+SOATools2.features=org.jbpm.gd.jpdl.feature
+#,org.jboss.tools.jmx.feature
+
+# for each repo zip input, list features to collect and assign to existing/new custom categories
+jbpm3-Update-N-SNAPSHOT.zip.features=org.jbpm.gd.jpdl.feature,org.jboss.tools.jbpm3.sdk.feature
+#JMX-Update-N-SNAPSHOT.zip.features=org.jboss.tools.jmx.feature,org.jboss.tools.jmx.sdk.feature
+
+# descriptions and labels for existing/new custom categories
+custom.category.label.SDKTools2=JBoss Developer Studio SDK
+custom.category.description.SDKTools2=JBoss Developer Studio SDK contains plugins where an SDK package exists. These contain both source and runtimes. Use these if you want to debug and/or provide patches to JBoss Developer Studio plugins.
+custom.category.label.AllTools2=All JBoss Developer Studio Tools - ${product.versionTag}
+custom.category.description.AllTools2=Contains ALL the plugins that are available from JBoss Tools except those related to integration with 3rd party plugins. Selecting this category will give you all tools needed for both Web, Seam and SOA Development.
+custom.category.label.SOATools2=SOA Development
+custom.category.description.SOATools2=Tools to help create SOA applications. Use these if you work with jBPM, Drools, JBoss ESB, JBoss WebServices or Smooks.
Added: trunk/build/aggregate/aggregateRepos.jbosstools.properties
===================================================================
--- trunk/build/aggregate/aggregateRepos.jbosstools.properties (rev 0)
+++ trunk/build/aggregate/aggregateRepos.jbosstools.properties 2010-06-10 18:36:51 UTC (rev 22731)
@@ -0,0 +1,62 @@
+# aggregateRepos.xml properties file
+
+# basic config when used in JBT/JBDS build
+eclipse.home=${clean.eclipse.home}
+working.dir=${product.build.directory}/b3.aggregator
+
+# basic config when testing on local - be sure to replace reference to ${updateZip} with local JBT/JBDS update site zip
+#eclipse.home=/home/nboldt/eclipse/36clean2/eclipse
+#working.dir=/tmp/build.b3.aggregator
+# optional config when testing on local
+#requirement.build.root=${working.dir}
+#update.site.product.name=JBoss Tools
+#update.site.description=Nightly
+#product.versionTag=3.1.0.v201002111546N-H238-CR2
+
+# descriptions and labels used to name the resulting repo or to name categories
+repoName=${update.site.product.name} ${update.site.description} Update Site
+#product.versionTag=3.1.0.v200910281633N-RC1
+
+# location from which to install b3 aggregator
+b3.aggregator.repo=http://download.jboss.org/jbosstools/requirements/helios/b3.aggregator-repo-0.1.0.r01001_e36.zip
+b3.backup.repos=http://download.eclipse.org/eclipse/updates/3.6milestones/,http://download.eclipse.org/releases/helios/,http://download.jboss.org/jbosstools/requirements/helios/buckminster-repo-1.3.0.r11439_e36.zip
+
+# repos to aggregate - local paths require jar:file:/path/to.zip!/
+# repos to aggregate - remote paths to a zip will be prefetched and treated as local repo archive
+# http://download.jboss.org/jbosstools/builds/nightly/3.2.helios/jbosstools-3.2.0.M1-Update-SNAPSHOT.zip,\
+repos=\
+http://download.jboss.org/jbosstools/builds/nightly/3.2.helios/jbosstools-3.2.0.M1.helios-Update-SNAPSHOT.zip,\
+http://hudson.qa.jboss.com/hudson/view/DevStudio_CBI/job/jbosstools-cbi-pi4soa/lastSuccessfulBuild/artifact/build/N-SNAPSHOT/pi4soa-Update-N-SNAPSHOT.zip,\
+http://download.jboss.org/jbosstools/builds/nightly/3.2.helios/jbosstools-teiid-designer-Update-SNAPSHOT.zip
+
+# associate sites to add to the resulting repo
+associate.sites=http://download.jboss.org/jbosstools/updates/helios/,\
+http://download.eclipse.org/birt/update-site/2.6-interim/,\
+http://download.eclipse.org/birt/update-site/2.6/,\
+http://download.eclipse.org/eclipse/updates/3.6milestones/,\
+http://download.eclipse.org/eclipse/updates/3.6/,\
+http://m2eclipse.sonatype.org/sites/m2e/,\
+http://m2eclipse.sonatype.org/sites/m2e-extras/,\
+http://subclipse.tigris.org/update_1.6.x/,\
+http://download.eclipse.org/technology/subversive/0.7/update-site/,\
+http://community.polarion.com/projects/subversive/download/eclipse/2.0/update-site/
+
+# category to feature mappings: need a list of unique categoryIDs, then the list of features to assign to each category
+categories=AllTools2,DataTools2
+AllTools2.features=org.pi4soa.core.feature,\
+org.teiid.datatools.connectivity.feature,org.teiid.designer.feature,org.teiid.designer.runtime.feature
+DataTools2.features=org.teiid.datatools.connectivity.feature,org.teiid.designer.feature,org.teiid.designer.runtime.feature
+
+# for each repo zip input, list features to collect and assign to existing/new custom categories
+pi4soa-Update-N-SNAPSHOT.zip.features=org.pi4soa.core.feature,org.pi4soa.sdk.feature
+jbosstools-teiid-designer-Update-SNAPSHOT.zip=org.teiid.datatools.connectivity.feature,org.teiid.designer.feature,org.teiid.designer.runtime.feature
+
+# descriptions and labels for existing/new custom categories
+custom.category.label.SDKTools2=JBoss Tools SDK
+custom.category.description.SDKTools2=JBoss Tools SDK contains plugins where an SDK package exists. These contain both source and runtimes. Use these if you want to debug and/or provide patches to JBoss Tools plugins.
+custom.category.label.AllTools2=All JBoss Tools - ${product.versionTag}
+custom.category.description.AllTools2=Contains ALL the plugins that are available from JBoss Tools except those related to integration with 3rd party plugins. Selecting this category will give you all tools needed for both Web, Seam and SOA Development.
+custom.category.label.SOATools2=SOA Development
+custom.category.description.SOATools2=Tools to help create SOA applications. Use these if you work with jBPM, Drools, JBoss ESB, JBoss WebServices or Smooks.
+custom.category.label.DataTools2=Data Services
+custom.category.description.DataTools2=Tools related to data services such as persistence and transformation.
Added: trunk/build/aggregate/aggregateRepos.m2eclipse.properties
===================================================================
--- trunk/build/aggregate/aggregateRepos.m2eclipse.properties (rev 0)
+++ trunk/build/aggregate/aggregateRepos.m2eclipse.properties 2010-06-10 18:36:51 UTC (rev 22731)
@@ -0,0 +1,24 @@
+# aggregateRepos.xml properties file
+
+# basic configuration
+eclipse.home=/home/nboldt/eclipse/36clean/eclipse
+working.dir=/tmp/build.b3.aggregator
+
+# descriptions and labels used to name the resulting repo or to name categories
+repoName=m2eclipse 0.10.0.20100209-0800 Updates
+product.versionTag=0.10.0.20100209-0800
+
+# location from which to install b3 aggregator
+b3.aggregator.repo=http://download.jboss.org/jbosstools/requirements/helios/b3.aggregator-repo-0.1.0.r01001_e36.zip
+b3.backup.repos=http://download.eclipse.org/eclipse/updates/3.6milestones/,http://download.eclipse.org/releases/helios/,http://download.jboss.org/jbosstools/requirements/helios/buckminster-repo-1.3.0.r11439_e36.zip
+
+# repos to aggregate - local paths require jar:file:/path/to.zip!/
+repos=\
+http://m2eclipse.sonatype.org/sites/m2e/,\
+http://m2eclipse.sonatype.org/sites/m2e-extras/
+
+associate.sites=http://download.eclipse.org/releases/galileo/,\
+http://download.eclipse.org/eclipse/updates/3.5/,\
+http://subclipse.tigris.org/update_1.6.x
+
+categories=
Added: trunk/build/aggregate/aggregateRepos.xml
===================================================================
--- trunk/build/aggregate/aggregateRepos.xml (rev 0)
+++ trunk/build/aggregate/aggregateRepos.xml 2010-06-10 18:36:51 UTC (rev 22731)
@@ -0,0 +1,631 @@
+<project default="run" name="aggregateRepos">
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath>
+ <pathelement path="${classpath}" />
+ <pathelement location="/usr/share/java/ant-contrib.jar" />
+ </classpath>
+ </taskdef>
+
+ <!-- Complete set of steps: init,prefetch.repo.zips,install.b3.aggregator,generate.build.file,run.build.file,add.associate.sites,zip.repo,cleanup -->
+ <target name="run"
+ depends="init,prefetch.repo.zips,install.b3.aggregator,generate.build.file,run.build.file,add.associate.sites,zip.repo,cleanup"
+ />
+
+ <target name="init">
+ <property name="aggregateRepos.properties" value="aggregateRepos.m2eclipse.properties" />
+ <property file="${aggregateRepos.properties}" />
+ <mkdir dir="${working.dir}" />
+ <!-- set these properties in aggregateRepos.properties file:
+ eclipse.home=/home/nboldt/eclipse/35clean/eclipse
+ working.dir=${java.io.tmpdir}/build.b3.aggregator
+ repoName=JBoss Tools Nightly Aggregate Update Site
+ product.versionTag=3.1.0.v200910281633N-RC1
+ repos=\
+ jar:file:${java.io.tmpdir}/build.b3.aggregator/JBossTools-Update-3.1.0.v200910281633N-RC1.zip!/,\
+ jar:file:${java.io.tmpdir}/build.b3.aggregator/pi4soa-Update-N-SNAPSHOT.zip!/,\
+ jar:file:${java.io.tmpdir}/build.b3.aggregator/jbpm3-Update-N-SNAPSHOT.zip!/,\
+ jar:file:${java.io.tmpdir}/build.b3.aggregator/jbpm4-Update-N-SNAPSHOT.zip!/
+ #repos=\
+ #jar:file:${java.io.tmpdir}/build.b3.aggregator/JBossTools-Update-3.1.0.v200910281633N-RC1.zip!/,\
+ #ttp://hudson.qa.jboss.com/hudson/view/DevStudio/job/jbosstools-cbi-pi4soa/lastStableBuild/artifact/build/N-SNAPSHOT/pi4soa-Update-N-SNAPSHOT.zip,\
+ #http://hudson.qa.jboss.com/hudson/view/DevStudio/job/jbosstools-cbi-jbpm3/lastStableBuild/artifact/build/N-SNAPSHOT/jbpm3-Update-N-SNAPSHOT.zip,\
+ #http://hudson.qa.jboss.com/hudson/view/DevStudio/job/jbosstools-cbi-jbpm4/lastStableBuild/artifact/build/N-SNAPSHOT/jbpm4-Update-N-SNAPSHOT.zip
+
+ associate.sites=\
+ http://download.eclipse.org/releases/galileo,\
+ http://download.eclipse.org/birt/update-site/2.5/,\
+ http://download.eclipse.org/eclipse/updates/3.5/,\
+ http://download.jboss.org/jbosstools/updates/m2eclipse/0.10/
+ # http://m2eclipse.sonatype.org/update-dev
+ -->
+ <property name="working.dir" value="/tmp/build.b3.aggregator" />
+ <property name="requirement.build.root" value="${working.dir}" />
+ </target>
+
+ <!-- prefetch remote update site zips as local archive repos -->
+ <target name="prefetch.repo.zips" description="prefetch repo zips and convert remote repo zips to local">
+ <antcallback return="prefetchRepoZips.return" target="prefetchRepoZips">
+ <param name="theList" value="${repos}" />
+ </antcallback>
+ <var name="repos" value="${prefetchRepoZips.return}" />
+ <var name="prefetchRepoZips.return" unset="true" />
+
+ <if>
+ <and>
+ <isset property="associate.sites" />
+ <not>
+ <equals arg1="${associate.sites}" arg2="" />
+ </not>
+ </and>
+ <then>
+ <antcallback return="prefetchRepoZips.return" target="prefetchRepoZips">
+ <param name="theList" value="${associate.sites}" />
+ </antcallback>
+ <var name="associate.sites" value="${prefetchRepoZips.return}" />
+ <var name="prefetchRepoZips.return" unset="true" />
+ </then>
+ </if>
+ </target>
+
+ <target name="install.b3.aggregator" description="b3 Aggregator requires Eclipse 3.6">
+ <!-- set these properties in aggregateRepos.properties file:
+ b3.aggregator.repo=http://download.jboss.org/jbosstools/requirements/helios/b3.aggregator-repo-0.1.0.r01001_e36.zip
+ b3.backup.repos=http://download.eclipse.org/eclipse/updates/3.6milestones/,http://download.eclipse.org/releases/helios/,http://download.jboss.org/jbosstools/requirements/helios/buckminster-repo-1.3.0.r11439_e36.zip
+ -->
+
+ <!-- prefetch remote update site zips as local archive repos -->
+ <antcallback return="prefetchRepoZips.return" target="prefetchRepoZips">
+ <param name="theList" value="${b3.aggregator.repo}" />
+ </antcallback>
+ <var name="b3.aggregator.repo" value="${prefetchRepoZips.return}" />
+ <var name="prefetchRepoZips.return" unset="true" />
+
+ <antcallback return="prefetchRepoZips.return" target="prefetchRepoZips">
+ <param name="theList" value="${b3.backup.repos}" />
+ </antcallback>
+ <var name="b3.backup.repos" value="${prefetchRepoZips.return}" />
+ <var name="prefetchRepoZips.return" unset="true" />
+
+ <chmod perm="+x" file="${eclipse.home}/eclipse" />
+ <exec executable="${eclipse.home}/eclipse"
+ failonerror="true"
+ dir="${eclipse.home}"
+ timeout="900000"
+ taskname="p2.dir"
+ >
+ <arg line=" -vm ${java.home}/bin/java" />
+ <!-- If using Eclipse 3.4, " -application org.eclipse.equinox.p2.director.app.application" -->
+ <arg line=" -application org.eclipse.equinox.p2.director" />
+ <arg line=" -nosplash --launcher.suppressErrors -consoleLog -flavor tooling -roaming -profile SDKProfile" />
+ <arg line=" -installIU org.eclipse.b3.aggregator.engine.feature.feature.group" />
+ <!-- optional for UI -->
+ <!-- <arg line=" -installIU org.eclipse.b3.aggregator.editor.feature.feature.group" /> -->
+ <arg line=" -destination ${eclipse.home} -bundlepool ${eclipse.home}" />
+ <arg line=" -metadataRepository ${b3.aggregator.repo},${b3.backup.repos},file:${eclipse.home}/p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile"
+ />
+ <arg line=" -artifactRepository ${b3.aggregator.repo},${b3.backup.repos},file:${eclipse.home}"
+ />
+ <arg line=" -profileProperties org.eclipse.update.install.features=true" />
+ <arg line=" -vmargs -Declipse.p2.data.area=${eclipse.home}/p2 -Declipse.p2.MD5Check=false" />
+ </exec>
+ </target>
+
+ <target name="prefetchRepoZips"
+ description="Support remote update site zips: if repoURL contains http: or ftp: and .zip, get then switch it to a jar:file: URL"
+ >
+ <property name="theList" value="" />
+ <property name="theTargetDir" value="${requirement.build.root}/p2repos" />
+ <mkdir dir="${theTargetDir}" />
+ <var name="prefetchRepoZips.return" value="${theList}" />
+ <for param="repoURL" list="${theList}" delimiter=",
+ ">
+ <sequential>
+ <if>
+ <and>
+ <contains string="@{repoURL}" substring=".zip" />
+ <or>
+ <contains string="@{repoURL}" substring="http://" />
+ <contains string="@{repoURL}" substring="https://" />
+ <contains string="@{repoURL}" substring="ftp://" />
+ <contains string="@{repoURL}" substring="file://" />
+ </or>
+ </and>
+
+ <then>
+ <var name="repoFile" unset="true" />
+ <propertyregex property="repoFile"
+ input="@{repoURL}"
+ defaultvalue="@{repoURL}"
+ regexp=".+/([^/]+.zip)"
+ replace="\1"
+ casesensitive="false"
+ override="true"
+ />
+ <propertyregex property="prefetchRepoZips.return"
+ input="${prefetchRepoZips.return}"
+ defaultvalue="${prefetchRepoZips.return}"
+ regexp="@{repoURL}"
+ replace="jar:file:${theTargetDir}/${repoFile}!/"
+ casesensitive="false"
+ override="true"
+ />
+ <get dest="${theTargetDir}/${repoFile}" src="@{repoURL}" usetimestamp="true" />
+ <var name="repoFile" unset="true" />
+ <!-- <echo>repoURL = ${prefetchRepoZips.return}</echo> -->
+ </then>
+ </if>
+ </sequential>
+ </for>
+ </target>
+
+ <target name="generate.build.file">
+ <property name="repoName" value="JBoss Tools Aggregate Update Site" />
+ <property name="platform.names" value="linux-gtk,linux-gtk-x86_64,win32,macosx-carbon,macosx-cocoa" />
+ <!-- packedStrategy = {SKIP, UNPACK, UNPACK_AS_SIBLING, COPY, VERIFY} -->
+ <!-- mavenResult="{true,false}" -->
+ <echo file="${working.dir}/repo.b3aggr"><?xml version="1.0" encoding="UTF-8"?>
+<aggregator:Aggregator xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:aggregator="http://www.eclipse.org/b3/2010/aggregator/1.0.0"
+ buildmaster="//@contacts[email='nickboldt at gmail.com']"
+ label="${repoName}" buildRoot="${working.dir}/output"
+ packedStrategy="COPY" type="N" mavenResult="false">
+ <contacts name="Nick Boldt" email="nickboldt at gmail.com"/>
+</echo>
+ <for param="platform" list="${platform.names}" delimiter=",">
+ <sequential>
+ <if>
+ <equals arg1="@{platform}" arg2="linux-gtk" />
+ <then>
+ <echo file="${working.dir}/repo.b3aggr" append="true"> <configurations operatingSystem="linux" windowSystem="gtk"/>
+</echo>
+ </then>
+ </if>
+ <if>
+ <equals arg1="@{platform}" arg2="win32" />
+ <then>
+ <echo file="${working.dir}/repo.b3aggr" append="true"> <configurations operatingSystem="win32" windowSystem="win32"/>
+</echo>
+ </then>
+ </if>
+ <if>
+ <equals arg1="@{platform}" arg2="linux-gtk-x86_64" />
+ <then>
+ <echo file="${working.dir}/repo.b3aggr" append="true"> <configurations operatingSystem="linux" windowSystem="gtk" architecture="x86_64"/>
+</echo>
+ </then>
+ </if>
+ <if>
+ <equals arg1="@{platform}" arg2="macosx-carbon" />
+ <then>
+ <echo file="${working.dir}/repo.b3aggr" append="true"> <configurations operatingSystem="macosx" windowSystem="carbon" architecture="x86"/>
+</echo>
+ </then>
+ </if>
+ <if>
+ <equals arg1="@{platform}" arg2="macosx-cocoa" />
+ <then>
+ <echo file="${working.dir}/repo.b3aggr" append="true"> <configurations operatingSystem="macosx" windowSystem="cocoa" architecture="x86"/>
+</echo>
+ </then>
+ </if>
+ </sequential>
+ </for>
+
+ <!-- store an array of ${featureID}_${featureVersion} values against which to check when echoing to repo.b3aggr file -->
+ <var name="unique.installableUnits" value="" />
+
+ <echo file="${working.dir}/repo.b3aggr" append="true">
+ <contributions label="repos" contacts="//@contacts[email='nickboldt at gmail.com']"></echo>
+ <!-- counter variable; repoID.string stores a series of R; repoID stores the string length -->
+ <var name="repoID.string" value="" />
+ <var name="repoID" value="0" />
+ <for param="repo" list="${repos}" delimiter=",
+ ">
+ <sequential>
+ <!-- get list of features+plugins in the repo -->
+ <var name="repoFile" unset="true" />
+ <var name="repoFilename" unset="true" />
+ <propertyregex property="repoFile"
+ input="@{repo}"
+ defaultvalue="@{repo}"
+ override="true"
+ regexp="jar:file:(.+)!/"
+ replace="\1"
+ />
+ <propertyregex property="repoFilename"
+ input="${repoFile}"
+ defaultvalue="${repoFile}"
+ override="true"
+ regexp=".+/([^/]+.zip)"
+ replace="\1"
+ />
+ <echo file="${working.dir}/repo.b3aggr" append="true">
+ <repositories location="@{repo}">
+</echo>
+ <!-- collect features into custom categories, if defined. See aggregateRepos.properties for how to define these mappings -->
+ <if>
+ <and>
+ <isset property="${repoFilename}.features" />
+ <isset property="categories" />
+ </and>
+ <then>
+ <!-- eg., pi4soa-Update-N-SNAPSHOT.zip.features=org.pi4soa.sdk.feature,org.pi4soa.core.feature -->
+ <propertycopy from="${repoFilename}.features"
+ property="repo.features"
+ override="true"
+ silent="true"
+ />
+ <var name="featureID.num" value="0" />
+ <for param="repo.feature" list="${repo.features}" delimiter=", ">
+ <sequential>
+ <!-- find the category to which this feature must be assigned -->
+ <!-- eg., categories=JBossToolsSDK,JBossTools,jBPMTools -->
+ <for param="categoryID" list="${categories}" delimiter=", ">
+ <sequential>
+ <if>
+ <not>
+ <isset property="custom.category.features.@{categoryID}" />
+ </not>
+ <then>
+ <var name="custom.category.features.@{categoryID}" value="" />
+ </then>
+ </if>
+
+ <if>
+ <and>
+ <!-- eg., JBossToolsSDK.features=org.pi4soa.sdk.feature,org.jboss.tools.jbpm3.sdk.feature,org.jboss.tools.jbpm4.sdk.feature
+ JBossTools.features=org.pi4soa.core.feature,org.pi4soa.core.source.feature -->
+ <isset property="@{categoryID}.features" />
+ <contains string="${@{categoryID}.features}"
+ substring="@{repo.feature}"
+ />
+ </and>
+ <then>
+ <antcallback target="getIndex" return="getIndex.return">
+ <param name="entry" value="@{repo.feature}" />
+ <param name="list" value="${repo.features}" />
+ </antcallback>
+ <var name="featureID.num" value="${getIndex.return}" />
+ <var name="getIndex.return" unset="true" />
+
+ <!-- eg., custom.category.label.JBossToolsSDK=JBoss Tools SDK - ${product.versionTag}
+ custom.category.description.JBossToolsSDK=JBoss Tools SDK helps JBoss and J2EE developers develop their applications quickly and painlessly. Contains runtimes and sources. -->
+ <antcallback target="addFeatureToCategories"
+ return="addFeatureToCategories.return, unique.installableUnits"
+ >
+ <param name="repoID" value="${repoID}" />
+ <param name="featureID.num" value="${featureID.num}" />
+ <param name="include"
+ value="features/@{repo.feature}_*, **/features/@{repo.feature}_*"
+ />
+ <param name="repoFile" value="${repoFile}" />
+ <param name="categories" value="${categories}" />
+ </antcallback>
+ <var name="custom.category.features.@{categoryID}"
+ value="${custom.category.features.@{categoryID}}${addFeatureToCategories.return}"
+ />
+ </then>
+ </if>
+ </sequential>
+ </for>
+ </sequential>
+ </for>
+ </then>
+ </if>
+ <echo file="${working.dir}/repo.b3aggr" append="true"> </repositories>
+</echo>
+ <var name="repoID.string" value="${repoID.string}R" />
+ <var name="repoID" unset="true" />
+ <length property="repoID" string="${repoID.string}" />
+ <!-- <echo>repoID = ${repoID}, repoID.string = ${repoID.string}</echo> -->
+ </sequential>
+ </for>
+
+ <echo file="${working.dir}/repo.b3aggr" append="true"> </contributions>
+
+</echo>
+ <!-- create custom categories to collect the features -->
+ <for param="custom.category.id" list="${categories}" delimiter=",
+ ">
+ <sequential>
+ <!-- trim prefix " " -->
+ <propertyregex property="custom.category.features.@{custom.category.id}"
+ defaultvalue="${custom.category.features.@{custom.category.id}}"
+ input="${custom.category.features.@{custom.category.id}}"
+ regexp=" (.+)"
+ replace="\1"
+ override="true"
+ />
+
+ <echo file="${working.dir}/repo.b3aggr" append="true"> <customCategories
+ identifier="@{custom.category.id}"
+ label="${custom.category.label.@{custom.category.id}}"
+ description="${custom.category.description.@{custom.category.id}}"
+ features="${custom.category.features.@{custom.category.id}}" />
+</echo>
+ </sequential>
+ </for>
+
+ <if>
+ <and>
+ <isset property="associate.sites" />
+ <not>
+ <equals arg1="${associate.sites}" arg2="" />
+ </not>
+ </and>
+ <then>
+ <for param="associate.site" list="${associate.sites}" delimiter=",
+ ">
+ <sequential>
+ <echo file="${working.dir}/repo.b3aggr" append="true">
+ <validationRepositories location="@{associate.site}" />
+</echo>
+ </sequential>
+ </for>
+ </then>
+ </if>
+
+ <echo file="${working.dir}/repo.b3aggr" append="true"></aggregator:Aggregator>
+</echo>
+ </target>
+
+ <target name="addFeatureToCategories">
+ <var name="addFeatureToCategories.return" value="" />
+ <property name="repoID" value="9" />
+ <property name="include" value="features/org.pi4soa.core.feature_*, **/features/org.pi4soa.core.feature_*" />
+ <property name="repoFile" value="${working.dir}/pi4soa-Update-N-SNAPSHOT.zip" />
+ <property name="categories" value="SDKTools2,SOATools2,AllTools2" />
+ <propertyregex property="repoFilename"
+ input="${repoFile}"
+ defaultvalue="${repoFile}"
+ regexp=".+/([^/]+.zip)"
+ replace="\1"
+ casesensitive="false"
+ override="true"
+ />
+
+ <if>
+ <and>
+ <!-- haven't already unzipped this -->
+ <not>
+ <available file="${repoFile}_" type="dir" />
+ </not>
+ </and>
+ <then>
+ <if>
+ <available file="${repoFile}" type="file" />
+ <then>
+ <unzip src="${repoFile}" dest="${repoFile}_" />
+ </then>
+ <else>
+ <fail>Error!
+ Cannot find ${repoFile} to unpack!
+ </fail>
+ </else>
+ </if>
+ </then>
+ </if>
+
+ <property name="featureID.num" value="0" />
+ <for param="entry" delimiter=",
+ ">
+ <fileset dir="${repoFile}_" includes="${include}" />
+ <sequential>
+ <!-- get featureID and featureVersion -->
+ <var name="featureID" unset="true" />
+ <var name="featureVersion" unset="true" />
+ <propertyregex property="featureID"
+ input="@{entry}"
+ defaultvalue="@{entry}"
+ regexp=".+/([^/_]+)_.+"
+ replace="\1"
+ />
+ <propertyregex property="featureVersion"
+ input="@{entry}"
+ defaultvalue="@{entry}"
+ regexp=".+/${featureID}_(.+).jar"
+ replace="\1"
+ />
+
+ <!-- for a given featureID, check each of the available ${categories}; for each @{category}, check if featureID in list of ${@{category}.features} -->
+ <var name="featureID.categories" value="" />
+ <for param="category" list="${categories}" delimiter=", ">
+ <sequential>
+ <if>
+ <isset property="@{category}.features" />
+ <then>
+ <for param="featureID" list="${@{category}.features}" delimiter=",
+">
+ <sequential>
+ <if>
+ <equals arg1="${featureID}" arg2="@{featureID}" />
+ <then>
+ <!-- given: SDKTools2,SOATools2,AllTools2
+ return:
+ //@customCategories[identifier='${category1}'] //@customCategories[identifier='${category2}'] //@customCategories[identifier='${categoryID3}']
+ eg.,
+ //@customCategories[identifier='SDKTools2'] //@customCategories[identifier='SOATools2'] //@customCategories[identifier='AllTools2'] -->
+ <var name="featureID.categories"
+ value="${featureID.categories} //@customCategories[identifier='@{category}']"
+ />
+ </then>
+ </if>
+ </sequential>
+ </for>
+ </then>
+ </if>
+ </sequential>
+ </for>
+ <!-- trim prefix " " -->
+ <propertyregex property="featureID.categories"
+ defaultvalue="${featureID.categories}"
+ input="${featureID.categories}"
+ regexp=" (.+)"
+ replace="\1"
+ override="true"
+ />
+
+ <var name="isNewInstallableUnit" value="true" />
+ <for param="installableUnit" list="${unique.installableUnits}" delimiter=", ">
+ <sequential>
+ <if>
+ <equals arg1="@{installableUnit}" arg2="${featureID}_${featureVersion}" />
+ <then>
+ <var name="isNewInstallableUnit" value="false" />
+ </then>
+ </if>
+ </sequential>
+ </for>
+ <if>
+ <!-- cannot echo the same <features> twice - must be ; store ${featureID}_${featureVersion} in an array and check if in array before echoing again -->
+ <istrue value="${isNewInstallableUnit}" />
+ <then>
+ <var name="unique.installableUnits"
+ value="${unique.installableUnits}, ${featureID}_${featureVersion}"
+ />
+ <echo file="${working.dir}/repo.b3aggr" append="true"> <features categories="${featureID.categories}" name="${featureID}.feature.group" versionRange="${featureVersion}" />
+</echo>
+ <echo level="info">${featureID}_${featureVersion}: add @repositories.${repoID}/@features.${featureID.num} to ${featureID.categories}</echo>
+ </then>
+ <else>
+ <echo level="info">${featureID}_${featureVersion} already added.</echo>
+ </else>
+ </if>
+ <var name="addFeatureToCategories.return"
+ value="${addFeatureToCategories.return} //@contributions[label='repos']/@repositories.${repoID}/@features.${featureID.num}"
+ />
+
+ </sequential>
+ </for>
+ <var name="featureID.categories" unset="true" />
+ <var name="isNewInstallableUnit" unset="true" />
+ </target>
+
+ <target name="run.build.file">
+ <chmod perm="+x" file="${eclipse.home}/eclipse" />
+ <exec executable="${eclipse.home}/eclipse"
+ failonerror="true"
+ dir="${eclipse.home}"
+ timeout="900000"
+ taskname="b3aggr"
+ >
+ <arg line=" -vm ${java.home}/bin/java" />
+ <arg line=" -application org.eclipse.b3.cli.headless" />
+ <arg line=" -nosplash --launcher.suppressErrors -consoleLog aggregate" />
+ <arg line=" --buildModel ${working.dir}/repo.b3aggr --action BUILD" />
+ <!-- To verify w/o actually doing the aggregation, use - -action VERIFY -->
+ </exec>
+ </target>
+
+ <!-- until https://bugs.eclipse.org/bugs/show_bug.cgi?id=303244 is fixed, do it manually -->
+ <target name="add.associate.sites">
+ <if>
+ <and>
+ <isset property="associate.sites" />
+ <not>
+ <equals arg1="${associate.sites}" arg2="" />
+ </not>
+ </and>
+ <then>
+ <if>
+ <available file="${working.dir}/output/final/content.jar" type="file" />
+ <then>
+ <unzip src="${working.dir}/output/final/content.jar" dest="${working.dir}/output/final" />
+ <delete file="${working.dir}/output/final/content.jar" />
+ </then>
+ </if>
+ <!-- counter variable -->
+ <var name="associate.sites.0" value="" />
+ <for param="associate.site" list="${associate.sites}" delimiter=",
+ ">
+ <sequential>
+ <var name="associate.sites.0" value="${associate.sites.0}00" />
+ </sequential>
+ </for>
+ <length property="associate.sites.length" string="${associate.sites.0}" />
+
+ <loadfile srcfile="${working.dir}/output/final/content.xml" property="content.xml">
+ <filterchain>
+ <tailfilter lines="-1" skip="1" />
+ </filterchain>
+ </loadfile>
+ <echo file="${working.dir}/output/final/content.xml" message="${content.xml}" />
+ <echo file="${working.dir}/output/final/content.xml" append="true"> <references size='${associate.sites.length}'>
+</echo>
+ <for param="associate.site" list="${associate.sites}" delimiter=",
+ ">
+ <sequential>
+ <!-- insert into content.xml -->
+ <echo file="${working.dir}/output/final/content.xml" append="true"> <repository uri='@{associate.site}' url='@{associate.site}' type='0' options='1'/>
+ <repository uri='@{associate.site}' url='@{associate.site}' type='1' options='1'/>
+</echo>
+ </sequential>
+ </for>
+ <echo file="${working.dir}/output/final/content.xml" append="true"> </references>
+</repository>
+</echo>
+ <zip destfile="${working.dir}/output/final/content.jar" basedir="${working.dir}/output/final" includes="content.xml"/>
+ <delete file="${working.dir}/output/final/content.xml" />
+ </then>
+ </if>
+ </target>
+
+ <!-- zip up the generated repo -->
+ <target name="zip.repo">
+ <zip destfile="${working.dir}/repo-from-packed-plugins.zip"
+ basedir="${working.dir}/output/final"
+ update="false"
+ />
+ </target>
+
+ <target name="cleanup">
+ <delete quiet="true" dir="${working.dir}/output" includeemptydirs="true" />
+ <!-- <delete quiet="true" file="${working.dir}/repo.b3aggr" /> -->
+ <for param="theZip" list="${repos}" delimiter=",
+ ">
+ <sequential>
+ <var name="zipFile" unset="true" />
+ <propertyregex property="zipFile"
+ input="@{theZip}"
+ defaultvalue="@{theZip}"
+ regexp=".+/([^/]+.zip).*"
+ replace="\1"
+ casesensitive="false"
+ override="true"
+ />
+ <if>
+ <available file="${working.dir}/${zipFile}_" type="dir" />
+ <then>
+ <delete dir="${working.dir}/${zipFile}_" quiet="true" includeemptydirs="true" />
+ </then>
+ </if>
+ </sequential>
+ </for>
+ </target>
+
+ <target name="getIndex">
+ <property name="getIndex.string" value="" />
+ <var name="getIndex.return" value="0" />
+ <property name="entry" value="" />
+ <property name="list" value="" />
+ <for param="this.entry" list="${list}" delimiter=", ">
+ <sequential>
+ <if>
+ <not>
+ <equals arg1="@{this.entry}" arg2="${entry}" />
+ </not>
+ <then>
+ <var name="getIndex.string" value="${getIndex.string}L" />
+ </then>
+ <else>
+ <var name="getIndex.return" unset="true" />
+ <length property="getIndex.return" string="${getIndex.string}" />
+ </else>
+ </if>
+
+ </sequential>
+ </for>
+ <!-- <echo> getIndex = ${getIndex.return} for ${entry} in ${list}</echo> -->
+ </target>
+
+</project>
More information about the jbosstools-commits
mailing list