Author: nickboldt
Date: 2010-04-16 12:40:29 -0400 (Fri, 16 Apr 2010)
New Revision: 21543
Modified:
branches/modular_build/genpom.xml
Log:
fix recursive generation when only doing a single component dir
Modified: branches/modular_build/genpom.xml
===================================================================
--- branches/modular_build/genpom.xml 2010-04-16 16:38:12 UTC (rev 21542)
+++ branches/modular_build/genpom.xml 2010-04-16 16:40:29 UTC (rev 21543)
@@ -2,9 +2,10 @@
<!-- Configuration Start -->
<property name="projectName" value="org.jboss.tools" />
<property name="pathToParentPom" value="" />
+ <property name="COMPONENT" value="trunk" />
<property name="pomVersion" value="0.0.1-SNAPSHOT" />
<property name="dirsToExclude"
- value="**/*.sdk.*, **/doc*, **/download.jboss.org, **/util, **/test,
**/builders, **/contrib, **/releng, ."
+ value="**/*.sdk.*, **/doc*, **/download.jboss.org, **/util/**, **/test,
**/builders, **/contrib, **/releng/**, ."
/>
<!-- Configuration Ends -->
@@ -15,8 +16,7 @@
cd /home/nboldt/workspace36/jbosstools-modular_build; ant -f genpom.xml -q
or, to build a specific module only:
cd /home/nboldt/workspace36/jbosstools-modular_build; \
- ant -f genpom.xml -q -DpathToParentPom=../
-DWORKINGDIR=/home/nboldt/workspace36/jbosstools-modular_build/as
-
+ ant -f genpom.xml -q -DCOMPONENT=common
-->
<target name="get.ant-contrib"
unless="ant-contrib.jar.exists">
@@ -96,15 +96,15 @@
casesensitive="true"
override="true"
/>
- <echo level="debug"> Agg dir: ${activeDir}, artifactType:
${artifactType}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion},
parentpom: @{parentpom}</echo>
+ <echo level="verbose"> Agg dir: ${activeDir}, artifactType:
${artifactType}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion},
parentpom: @{parentpom}</echo>
<echo file="(a){dir}/pom.xml">&lt;project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
- <relativePath>@{parentpom}</relativePath>
- <groupId>${projectName}</groupId>
- <artifactId>${projectName}.parent.pom</artifactId>
- <version>${pomVersion}</version>
+ <relativePath>@{parentpom}</relativePath>
+ <groupId>${projectName}</groupId>
+ <artifactId>${projectName}.parent.pom</artifactId>
+ <version>${pomVersion}</version>
</parent>
<groupId>${projectName}</groupId>
<artifactId>${artifactId}</artifactId>
@@ -170,7 +170,7 @@
casesensitive="true"
override="true"
/>
- <echo level="debug"> Mod dir: ${activeDir}, artifactType:
${artifactType}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion},
parentpom: @{parentpom}</echo>
+ <echo level="verbose"> Mod dir: ${activeDir}, artifactType:
${artifactType}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion},
parentpom: @{parentpom}</echo>
<echo file="(a){dir}/pom.xml">&lt;project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
@@ -228,13 +228,27 @@
<attribute name="artifactId" default="" />
<attribute name="artifactVersion" default="" />
<sequential>
-
+ <if>
+ <equals arg1="${COMPONENT}" arg2="trunk" />
+ <then>
+ <path id="trunkDir">
+ <dirset dir="@{dir}" excludes="${dirsToExclude}"
includes="*" />
+ </path>
+ </then>
+ <else>
+ <path id="trunkDir">
+ <dirset dir="@{dir}/${pathToParentPom}"
+ excludes="${dirsToExclude}"
+ includes="${COMPONENT}/*/*, ${COMPONENT}/plugins,
${COMPONENT}/features, ${COMPONENT}/tests, ${COMPONENT}/site"
+ />
+ </path>
+ </else>
+ </if>
<for param="subdir" delimiter=",
">
- <path>
- <dirset dir="@{dir}" excludes="${dirsToExclude}"
includes="*" />
- </path>
+ <path refid="trunkDir" />
<sequential>
+ <echo level="debug">@{subdir}</echo>
<var name="aggregate" value="false" />
<if>
<or>
@@ -245,10 +259,10 @@
</or>
<then>
<!-- valid place to create a pom -->
- <writeModulePom dir="@{subdir}"
parentpom="../@{parentpom}" />
+ <writeModulePom dir="@{subdir}"
parentpom="../${pathToParentPom}@{parentpom}" />
</then>
<else>
- <for list="plugins tests features" param="type"
delimiter=" ">
+ <for list="plugins tests features site" param="type"
delimiter=" ">
<sequential>
<basename property="artifactIdAgg" file="@{subdir}"
/>
<if>
@@ -256,7 +270,7 @@
<then>
<var name="aggregate" value="true" />
<generateAggregator dir="@{subdir}/@{type}"
- parentpom="../../@{parentpom}"
+
parentpom="../../${pathToParentPom}@{parentpom}"
artifactId="${artifactIdAgg}.@{type}"
artifactVersion="@{artifactVersion}"
/>
@@ -270,9 +284,18 @@
<istrue value="${aggregate}" />
<else>
<basename property="artifactIdAgg" file="@{subdir}"
/>
+ <if>
+ <equals arg1="${COMPONENT}" arg2="trunk" />
+ <then>
+ <var name="artifactId" value="${artifactIdAgg}.all"
/>
+ </then>
+ <else>
+ <var name="artifactId"
value="${COMPONENT}.${artifactIdAgg}" />
+ </else>
+ </if>
<writeAggregatePom dir="@{subdir}"
parentpom="../${pathToParentPom}parent-pom.xml"
- artifactId="${artifactIdAgg}.all"
+ artifactId="${artifactId}"
artifactVersion="@{artifactVersion}"
/>
@@ -280,6 +303,7 @@
<echo level="verbose">Aggregated:
${artifactIdAgg}</echo>
<var name="artifactIdAgg" unset="true" />
+ <var name="artifactId" unset="true" />
</else>
</if>
</else>
@@ -301,6 +325,17 @@
</then>
</if>
+ <if>
+ <not>
+ <equals arg1="${COMPONENT}" arg2="trunk" />
+ </not>
+ <then>
+ <var name="pathToParentPom" unset="true" />
+ <var name="pathToParentPom" value="../" />
+ </then>
+ </if>
+ <echo level="verbose">COMPONENT = ${COMPONENT}, pathToParentPom =
${pathToParentPom}</echo>
+
<!-- if set, compare values in tags file to values found in manifests and report
discrepancies -->
<!--<property name="tagsFile"
value="/home/nboldt/eclipse/workspace-jboss/devstudio-trunk/releng/org.jboss.ide.eclipse.releng/builders/product/versionTags/jbosstools/3.1.0.GA.tags"
@@ -320,12 +355,25 @@
<var name="aggregatorcountstring" value="" />
<var name="modulecountstring" value="" />
- <!-- call generateAggregator for overall -->
- <generateAggregator dir="${WORKINGDIR}"
- parentpom="${pathToParentPom}parent-pom.xml"
- artifactId="trunk"
- artifactVersion="${pomVersion}"
- />
+ <if>
+ <equals arg1="${COMPONENT}" arg2="trunk" />
+ <then>
+ <!-- call generateAggregator for overall -->
+ <generateAggregator dir="${WORKINGDIR}"
+ parentpom="${pathToParentPom}parent-pom.xml"
+ artifactId="${COMPONENT}"
+ artifactVersion="${pomVersion}"
+ />
+ </then>
+ <else>
+ <!-- call generateAggregator for component -->
+ <generateAggregator dir="${WORKINGDIR}/${COMPONENT}"
+ parentpom="${pathToParentPom}parent-pom.xml"
+ artifactId="${COMPONENT}"
+ artifactVersion="${pomVersion}"
+ />
+ </else>
+ </if>
<!-- summary -->
<length string="${modulecountstring}" property="modulecount"
/>
<length string="${aggregatorcountstring}"
property="aggregatorcount" />