[jboss-cvs] JBossAS SVN: r82288 - in trunk: build and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Dec 15 17:02:17 EST 2008


Author: pgier
Date: 2008-12-15 17:02:17 -0500 (Mon, 15 Dec 2008)
New Revision: 82288

Modified:
   trunk/build/build.xml
   trunk/pom.xml
Log:
[JBBUILD-475] Add calls to maven for building and cleaning mavenized modules.

Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml	2008-12-15 20:07:40 UTC (rev 82287)
+++ trunk/build/build.xml	2008-12-15 22:02:17 UTC (rev 82288)
@@ -981,7 +981,7 @@
   <!-- ================================================================== -->
 
   <!-- Clean up all build output -->
-  <target name="clean" depends="createthirdparty, _buildmagic:clean, modules-clean"
+  <target name="clean" depends="createthirdparty, maven-clean, _buildmagic:clean, modules-clean"
 	  description="Cleans up most generated files.">
   </target>
 
@@ -1002,7 +1002,7 @@
   <target name="all" depends="createthirdparty, modules-all, install"
 	  description="Executes all modules and builds everything."/>
 
-  <target name="most" depends="createthirdparty, modules-most, install"
+  <target name="most" depends="createthirdparty, maven-install, modules-most, install"
 	  description="Executes all modules and builds most everything."/>
 
   <target name="release" depends="most" />
@@ -1012,50 +1012,100 @@
 
   <!-- Define a macro for calling maven -->
   <macrodef name="maven">
-      <attribute name="options"/>
-      <attribute name="goal" />
-      <attribute name="basedir" />
-      <element name="args" implicit="true" optional="true" />
-      <sequential>
-          <echo message="Calling mvn command located in ${maven.dir}"/>
-          <java classname="org.codehaus.classworlds.Launcher" fork="true" 
-                dir="@{basedir}" resultproperty="maven.result">
-              <classpath>
-                  <fileset dir="${maven.dir}/boot">
-                      <include name="*.jar" />
-                  </fileset>
-                  <fileset dir="${maven.dir}/lib">
-                      <include name="*.jar" />
-                  </fileset>
-              </classpath>
-              <sysproperty key="classworlds.conf" value="${maven.dir}/bin/m2.conf" />
-              <sysproperty key="maven.home" value="${maven.dir}" />
-              <arg line="--batch-mode @{options} @{goal}" />
-          </java>
-      </sequential>
-  </macrodef> 
+    <attribute name="options" default="" />
+    <attribute name="goal" />
+    <attribute name="basedir" />
+    <attribute name="resultproperty" default="maven.result" />
+    <element name="args" implicit="true" optional="true" />
+    <sequential>
+      <echo message="Calling mvn command located in ${maven.home}" />
+      <java classname="org.codehaus.classworlds.Launcher" fork="true" 
+            dir="@{basedir}" resultproperty="@{resultproperty}">
+        <jvmarg value="-Xmx512m"/>
+        <classpath>
+          <fileset dir="${maven.home}/boot">
+            <include name="*.jar" />
+          </fileset>
+          <fileset dir="${maven.home}/lib">
+            <include name="*.jar" />
+          </fileset>
+        </classpath>
+        <sysproperty key="classworlds.conf" value="${maven.home}/bin/m2.conf" />
+        <sysproperty key="maven.home" value="${maven.home}" />
+        <arg line="--batch-mode @{options} @{goal}" />
+      </java>
+    </sequential>
+  </macrodef>
   
-   <!-- create the thirdparty folder from items in the repository -->
-   <!-- then generate a new libraries.ent file and include it in  -->
-   <!-- the build                                                 -->
+  <target name="maven-init">
+    <property name="maven.home" location="${basedir}/../tools/maven"/>
+    <echo message="Maven Home set to ${maven.home}"/>
+  </target>
+  
+   <!-- Call maven to create the thirdparty folder from artifacts in the maven repository -->
    <target name="createthirdparty" unless="inhibit.downloads"
       depends="init, check.inhibit.downloads, set.proxy">
      
-      <property name="maven.dir" value="${basedir}/../tools/maven"/>
+      <property name="maven.home" location="${basedir}/../tools/maven"/>
       <property name="thirdparty.maven.opts" value=""/>
 
-      <maven basedir="${basedir}/../thirdparty" options="${thirdparty.maven.opts}" goal="generate-resources"/>
+      <maven basedir="${basedir}/../thirdparty" 
+             options="${thirdparty.maven.opts}" 
+             goal="generate-resources"
+             resultproperty="maven.thirdparty.result"/>
       
       <fail message="Unable to build thirdparty directory.  See maven output for details.">
         <condition>
           <not>
-            <equals arg1="${maven.result}" arg2="0"/>
+            <equals arg1="${maven.thirdparty.result}" arg2="0"/>
           </not>
         </condition>
       </fail>
       
    </target>
 
+  <!-- Call maven to build the mavenized modules -->
+  <target name="maven-install" depends="init">
+    
+     <property name="maven.home" value="${basedir}/../tools/maven"/>
+     <property name="maven.install.opts" value="-Pintegrated-build"/>
+
+     <maven basedir="${basedir}/.." 
+            options="${maven.install.opts}" 
+            goal="install"
+            resultproperty="maven.install.result"/>
+     
+     <fail message="Unable to build maven modules.  See maven output for details.">
+       <condition>
+         <not>
+           <equals arg1="${maven.install.result}" arg2="0"/>
+         </not>
+       </condition>
+     </fail>
+     
+  </target>
+
+  <!-- Call maven to clean the mavenized modules -->
+  <target name="maven-clean" depends="init">
+    
+     <property name="maven.home" value="${basedir}/../tools/maven"/>
+     <property name="maven.clean.opts" value="-Pintegrated-build "/>
+
+     <maven basedir="${basedir}/.." 
+            options="${maven.clean.opts}" 
+            goal="clean"
+            resultproperty="maven.clean.result"/>
+     
+     <fail message="Unable to clean maven modules.  See maven output for details.">
+       <condition>
+         <not>
+           <equals arg1="${maven.clean.result}" arg2="0"/>
+         </not>
+       </condition>
+     </fail>
+     
+  </target>
+
    <!-- check if thirdparty libraries are to be downloaded -->
    <target name="check.inhibit.downloads">
       <condition property="inhibit.downloads">

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2008-12-15 20:07:40 UTC (rev 82287)
+++ trunk/pom.xml	2008-12-15 22:02:17 UTC (rev 82288)
@@ -148,40 +148,6 @@
     </plugins>
   </build>
   
-  <modules>
-    <!-- The build module contains the parent pom for the other modules-->
-    <module>component-matrix</module>
-    <module>main</module>
-    <module>bootstrap</module>
-    <module>j2se</module>
-    <module>mbeans</module>
-    <module>jmx</module>
-    <module>system</module>
-    <module>system-jmx</module>
-    <module>security</module>
-    <module>server</module>
-    <module>deployment</module>
-    <module>jbossas</module>
-    <module>messaging</module>
-    <module>cluster</module>
-    <module>varia</module>
-    <module>iiop</module>
-    <module>aspects</module>
-    <module>profileservice</module>
-    <module>connector</module>
-    <module>management</module>
-    <module>ejb3</module>
-    <module>tomcat</module>
-    <module>webservices</module>
-    <module>hibernate-int</module>
-    <module>console</module>
-    <module>embedded</module>
-    <module>spring-int</module>
-    <module>jmx-remoting</module>
-    <module>client</module>
-    <module>build</module>
-  </modules>
-  
   <!-- Dependency Management -->
   <dependencyManagement>
     <dependencies>
@@ -406,4 +372,56 @@
     </pluginRepository>
   </pluginRepositories>
   
+  <profiles>
+    
+    <!-- By default build all modules -->
+    <profile>
+      <id>default-build</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <modules>
+        <module>component-matrix</module>
+        <module>main</module>
+        <module>bootstrap</module>
+        <module>j2se</module>
+        <module>mbeans</module>
+        <module>jmx</module>
+        <module>system</module>
+        <module>system-jmx</module>
+        <module>security</module>
+        <module>server</module>
+        <module>deployment</module>
+        <module>jbossas</module>
+        <module>messaging</module>
+        <module>cluster</module>
+        <module>varia</module>
+        <module>iiop</module>
+        <module>aspects</module>
+        <module>profileservice</module>
+        <module>connector</module>
+        <module>management</module>
+        <module>ejb3</module>
+        <module>tomcat</module>
+        <module>webservices</module>
+        <module>hibernate-int</module>
+        <module>console</module>
+        <module>embedded</module>
+        <module>spring-int</module>
+        <module>jmx-remoting</module>
+        <module>client</module>
+        <module>build</module>
+      </modules>
+    </profile>
+    
+    <!-- This profile is used by the ant/buildmagic build -->
+    <profile>
+      <id>integrated-build</id>
+      <modules>
+        <module>component-matrix</module>
+      </modules>
+    </profile>
+    
+  </profiles>
+  
 </project>




More information about the jboss-cvs-commits mailing list