[jboss-svn-commits] JBL Code SVN: r21091 - in labs/jbossbuild/jbossbuild/trunk: resources and 12 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Jul 17 16:29:05 EDT 2008
Author: pgier
Date: 2008-07-17 16:29:05 -0400 (Thu, 17 Jul 2008)
New Revision: 21091
Added:
labs/jbossbuild/jbossbuild/trunk/resources/
labs/jbossbuild/jbossbuild/trunk/resources/MANIFEST.MF
labs/jbossbuild/jbossbuild/trunk/resources/jbossbuild.xml
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/CopyRelease.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/GetWithSum.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/ReleaseDeploymentsTask.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/ResolveComponentRefsTask.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ClassPathDefinition.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/Deployment.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/DeploymentType.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/Profile.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/target/TargetInsertionDefinition.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphComponentInfoResolverVisitor.java
Removed:
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/ValidateLicenseHeaders.java
labs/jbossbuild/jbossbuild/trunk/src/resources/
Modified:
labs/jbossbuild/jbossbuild/trunk/resources/tasks.xml
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/targets/ArtifactDefinitionTarget.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/targets/ArtifactTarget.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/targets/ComponentTarget.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/BuildTask.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/GenerateLibrariesFile.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/RMICHelper.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/SynchronizeComponentsTask.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/AbstractDataType.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/Compatible.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/ComponentRef.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/Include.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/SourceSink.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/attributes/Version.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/build/Artifact.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/build/Build.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/build/Component.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ArtifactDefinition.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ComponentDefinition.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/SourceDefinition.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/DownloadUtil.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/FileUtil.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphClasspathVisitor.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphLicenseVisitor.java
labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/test/VersionTest.java
Log:
Update svn trunk with contents of CVS dev branch.
Copied: labs/jbossbuild/jbossbuild/trunk/resources (from rev 21063, labs/jbossbuild/jbossbuild/trunk/src/resources)
Added: labs/jbossbuild/jbossbuild/trunk/resources/MANIFEST.MF
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/resources/MANIFEST.MF (rev 0)
+++ labs/jbossbuild/jbossbuild/trunk/resources/MANIFEST.MF 2008-07-17 20:29:05 UTC (rev 21091)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Specification-Version: JBossBuild_1_1_5
Added: labs/jbossbuild/jbossbuild/trunk/resources/jbossbuild.xml
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/resources/jbossbuild.xml (rev 0)
+++ labs/jbossbuild/jbossbuild/trunk/resources/jbossbuild.xml 2008-07-17 20:29:05 UTC (rev 21091)
@@ -0,0 +1,1290 @@
+<?xml version="1.0"?>
+
+<!--
+ JBoss, the OpenSource J2EE webOS
+
+ Distributable under LGPL license.
+ See terms of license at gnu.org.
+-->
+
+<!-- ================================================================== -->
+<!-- JBossAS main build definition -->
+<!-- ================================================================== -->
+
+<project name="main.build.temp"
+ default="build"
+ basedir="."
+>
+
+ <!-- Import the types -->
+ <import file="../tools/etc/jbossbuild/tasks.xml"/>
+
+ <property file="synchronize.properties"/>
+ <property file="local.properties"/>
+
+ <!-- =============================================================== -->
+ <!-- The Main project definition -->
+ <!-- =============================================================== -->
+
+ <build id="jbossas"
+ impltitle="JBossAS"
+ implversion="5.0.0alpha"
+ implvendor="JBoss Inc."
+ implurl="http://www.jboss.org"
+ description="JBoss Application Server"
+ cvsroot="${cvs.prefix}"
+ thirdpartypath="../thirdparty/"
+ location="http://repository.jboss.com"
+ targetdefs="targets">
+
+
+ <componentref name="common"
+ module="jboss-common"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="j2se"
+ module="jboss-j2se"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="test"
+ module="test"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="j2ee"
+ module="jboss-j2ee"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="naming"
+ module="jnp"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="container"
+ module="container"
+ version="5.0-SNAPSHOT"
+ />
+
+
+ <componentref name="dependency"
+ module="jboss-dependency"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="kernel"
+ module="kernel"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="mbeans"
+ module="jboss-mbeans"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="jmx"
+ module="jmx"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="aop"
+ module="jboss-aop"
+ version="5.0-SNAPSHOT"
+ />
+
+
+ <componentref name="system"
+ module="jboss-system"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="transaction"
+ module="jboss-transaction"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="server"
+ module="jboss"
+ version="5.0-SNAPSHOT"
+ />
+
+
+ <componentref name="security"
+ module="jbosssx"
+ version="5.0-SNAPSHOT"
+ />
+
+
+ <componentref name="messaging"
+ module="jbossmq"
+ version="5.0-SNAPSHOT"
+ />
+
+
+ <componentref name="connector"
+ module="jbosscx"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="cluster"
+ module="jbossmx"
+ version="5.0-SNAPSHOT"
+ />
+
+
+ <componentref name="management"
+ module="jboss-management"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="varia"
+ module="contrib/varia"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="console"
+ module="jboss-console"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="deployment"
+ module="jboss-deployment"
+ version="5.0-SNAPSHOT"
+ />
+
+
+ <componentref name="aspects"
+ module="jboss-aspects"
+ version="5.0-SNAPSHOT"
+ />
+
+
+ <componentref name="jmx-remoting"
+ module="jmx-remoting"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="iiop"
+ module="contrib/iiop"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="jms"
+ module="jboss-jms"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="hibernate-int"
+ module="hibernate"
+ version="5.0-SNAPSHOT"
+
+ />
+
+ <componentref name="tomcat"
+ module="jboss-tomcat"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="ejb3x"
+ module="jboss-ejb3x"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="ejb3"
+ module="jboss-ejb3"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="webservice"
+ module="webservice"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="media"
+ module="jboss-media"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="admin-console"
+ module="jboss-admin-console"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="jbossas/remoting"
+ module="jbossas/remoting"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="jbossas/jmx-remoting"
+ module="jbossas/jmx-remoting"
+ version="5.0-SNAPSHOT"
+ />
+
+ <componentref name="testsuite"
+ module="jbosstest"
+ version="5.0-SNAPSHOT"
+ executable="false"
+ />
+
+ <!-- ============================================================ -->
+ <!-- Thirdparty binaries -->
+ <!-- -->
+ <!-- ============================================================ -->
+
+
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-struts -->
+ <!-- ============================================================ -->
+ <componentref name="apache-struts" version="1.2.6"/>
+
+
+
+
+ <!-- ============================================================ -->
+ <!-- sun-servlet -->
+ <!-- ============================================================ -->
+ <componentref name="sun-servlet" version="2.4"/>
+
+
+ <!-- ============================================================ -->
+ <!-- dom4j -->
+ <!-- ============================================================ -->
+ <componentref name="dom4j" version="1.5" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- jaxen -->
+ <!-- ============================================================ -->
+ <componentref name="jaxen" version="1.1beta4" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- qdox -->
+ <!-- ============================================================ -->
+ <componentref name="qdox" version="1.4" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- javassist -->
+ <!-- ============================================================ -->
+ <componentref name="javassist" version="3.1RC2" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- trove -->
+ <!-- ============================================================ -->
+ <componentref name="trove" version="2.1.1" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- xdoclet -->
+ <!-- ============================================================ -->
+ <componentref name="xdoclet" version="1.2b3" />
+
+
+ <!-- ============================================================ -->
+ <!-- oswego-concurrent -->
+ <!-- ============================================================ -->
+ <componentref name="oswego-concurrent" version="1.3.4" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- junit -->
+ <!-- ============================================================ -->
+ <componentref name="junit" version="3.8.1" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- sun-jaf -->
+ <!-- ============================================================ -->
+ <componentref name="sun-jaf" version="1.0.2" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- hibernate -->
+ <!-- ============================================================ -->
+ <componentref name="hibernate" version="3.1rc1" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- hibernate-entitymanager -->
+ <!-- ============================================================ -->
+ <componentref name="hibernate-entitymanager" version="3.1beta4" />
+
+
+ <!-- ============================================================ -->
+ <!-- hibernate-annotations -->
+ <!-- ============================================================ -->
+ <componentref name="hibernate-annotations" version="3.1beta6" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- cglib -->
+ <!-- ============================================================ -->
+ <componentref name="cglib" version="2.1.1" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-log4j -->
+ <!-- ============================================================ -->
+ <componentref name="apache-log4j" version="1.2.8" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- beanshsell -->
+ <!-- ============================================================ -->
+ <componentref name="beanshell" version="1.3.0" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-xerces -->
+ <!-- ============================================================ -->
+ <componentref name="apache-xerces" version="2.7.0" />
+
+
+ <!-- ============================================================ -->
+ <!-- jgroups -->
+ <!-- ============================================================ -->
+ <componentref name="jgroups" version="2.2.8" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- gnu-regexp -->
+ <!-- ============================================================ -->
+ <componentref name="gnu-regexp" version="1.1.14" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-xalan -->
+ <!-- ============================================================ -->
+ <componentref name="apache-xalan" version="j_2.6.0" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- sleepycat -->
+ <!-- ============================================================ -->
+ <componentref name="sleepycat" version="1.7.0" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- sun-jmx -->
+ <!-- ============================================================ -->
+ <componentref name="sun-jmx" version="1.2.8" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- sun-jaxp -->
+ <!-- ============================================================ -->
+ <componentref name="sun-jaxp" version="1.2.3" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-jaxme -->
+ <!-- ============================================================ -->
+ <componentref name="apache-jaxme" version="0.2-cvs" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- wutka-dtdparser -->
+ <!-- ============================================================ -->
+ <componentref name="wutka-dtdparser" version="1.2.1" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- sun-javamail -->
+ <!-- ============================================================ -->
+ <componentref name="sun-javamail" version="1.3.1" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- gnu-getopt -->
+ <!-- ============================================================ -->
+ <componentref name="gnu-getopt" version="1.0.10" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- jfreechart -->
+ <!-- ============================================================ -->
+ <componentref name="jfreechart" version="0.9.20" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- odmg -->
+ <!-- ============================================================ -->
+ <componentref name="odmg" version="3.0" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-avalon -->
+ <!-- ============================================================ -->
+ <componentref name="apache-avalon" version="4.1.5" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- jacorb -->
+ <!-- ============================================================ -->
+ <componentref name="jacorb" version="2.2.2jboss.patch3" />
+
+
+ <!-- ============================================================ -->
+ <!-- apache-bcel -->
+ <!-- ============================================================ -->
+ <componentref name="apache-bcel" version="5.1" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- sun-jmf -->
+ <!-- ============================================================ -->
+ <componentref name="sun-jmf" version="2.1.1b" />
+
+
+ <!-- ============================================================ -->
+ <!-- apache-scout -->
+ <!-- ============================================================ -->
+ <componentref name="apache-scout" version="1.0.HEAD" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- hsqldb -->
+ <!-- ============================================================ -->
+ <componentref name="hsqldb" version="1.7.2" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- gjt-jpl-utilxdoclet -->
+ <!-- ============================================================ -->
+ <componentref name="gjt-jpl-util" version="1.0" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- ibm-wsd14j -->
+ <!-- ============================================================ -->
+ <componentref name="ibm-wsdl4j" version="1.5.1" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-velocity -->
+ <!-- ============================================================ -->
+ <componentref name="apache-velocity" version="1.4" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- juddi -->
+ <!-- ============================================================ -->
+ <componentref name="juddi" version="0.8.0" />
+
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-xmlsec -->
+ <!-- ============================================================ -->
+ <componentref name="apache-xmlsec" version="1.2.97" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-beanutils -->
+ <!-- ============================================================ -->
+ <componentref name="apache-beanutils" version="1.7.0" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-codec -->
+ <!-- ============================================================ -->
+ <componentref name="apache-codec" version="1.2.0" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-collections -->
+ <!-- ============================================================ -->
+ <componentref name="apache-collections" version="2.1"/>
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-digester -->
+ <!-- ============================================================ -->
+ <componentref name="apache-digester" version="1.6" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-discovery -->
+ <!-- ============================================================ -->
+ <componentref name="apache-discovery" version="0.2" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-fileupload -->
+ <!-- ============================================================ -->
+ <componentref name="apache-fileupload" version="1.0" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-httpclient -->
+ <!-- ============================================================ -->
+ <componentref name="apache-httpclient" version="2.0" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-lang -->
+ <!-- ============================================================ -->
+ <componentref name="apache-lang" version="2.0" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-logging -->
+ <!-- ============================================================ -->
+ <componentref name="apache-logging" version="1.0.4jboss" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-logging-api -->
+ <!-- ============================================================ -->
+ <componentref name="apache-logging-api" version="1.0.3" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-pool -->
+ <!-- ============================================================ -->
+ <componentref name="apache-pool" version="1.0.1" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-asm -->
+ <!-- ============================================================ -->
+ <componentref name="asm" version="1.5.3" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-antlr -->
+ <!-- ============================================================ -->
+ <componentref name="antlr" version="2.7.5H3" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-tomcat -->
+ <!-- ============================================================ -->
+ <componentref name="apache-tomcat" version="5.5.12" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-slide -->
+ <!-- ============================================================ -->
+ <componentref name="apache-slide" version="2.0" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- jboss/remoting -->
+ <!-- ============================================================ -->
+ <componentref name="jboss/remoting" version="1.4.0_beta" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- sun-javacc -->
+ <!-- ============================================================ -->
+ <componentref name="sun-javacc" version="3.2" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- joesnmp -->
+ <!-- ============================================================ -->
+ <componentref name="joesnmp" version="0.3.3" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- jboss/axis -->
+ <!-- ============================================================ -->
+ <componentref name="jboss/axis" version="4.03RC1" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- codehaus-stax -->
+ <!-- ============================================================ -->
+ <componentref name="codehaus-stax" version="1.1.1" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-logkit -->
+ <!-- ============================================================ -->
+ <componentref name="apache-avalon-logkit" version="1.2" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-modeler -->
+ <!-- ============================================================ -->
+ <!--<componentref name="apache-modeler" version="1.1" /> -->
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-myfaces -->
+ <!-- ============================================================ -->
+ <componentref name="apache-myfaces" version="1.0.9m9" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- junitejb -->
+ <!-- ============================================================ -->
+ <componentref name="junitejb" version="1.4" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- xmlunit -->
+ <!-- ============================================================ -->
+ <componentref name="xmlunit-xmlunit" version="1.0" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- struts-tests-case -->
+ <!-- ============================================================ -->
+ <componentref name="struts-test-case" version="2.1.3" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- easymock -->
+ <!-- ============================================================ -->
+ <componentref name="easymock" version="1.1" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-validator -->
+ <!-- ============================================================ -->
+ <componentref name="apache-validator" version="1.1.3" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-taglibs -->
+ <!-- ============================================================ -->
+ <componentref name="apache-taglibs" version="1.1.2" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-oro -->
+ <!-- ============================================================ -->
+ <componentref name="apache-oro" version="2.0.8"/>
+
+
+
+ <!-- ============================================================ -->
+ <!-- spring -->
+ <!-- ============================================================ -->
+ <componentref name="spring" version="1.2.2" />
+
+
+ <!-- ============================================================ -->
+ <!-- apache-vfs -->
+ <!-- ============================================================ -->
+ <componentref name="apache-vfs" version="1.0-dev" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- jboss/cache -->
+ <!-- ============================================================ -->
+ <componentref name="jboss/cache" version="1.2.4" />
+
+
+
+ <!-- ============================================================ -->
+ <!-- apache-bsf -->
+ <!-- ============================================================ -->
+ <componentref name="apache-bsf" version="2.3.0"/>
+
+
+
+ <!-- ============================================================ -->
+ <!-- commons-el -->
+ <!-- ============================================================ -->
+ <componentref name="commons-el" version="1.0"/>
+
+
+
+
+ <profile id="lib" outputPath="lib">
+ <deployment component="apache-slide" artifact="webdavlib.jar" />
+ <deployment component="gnu-regexp" artifact="gnu-regexp.jar"/>
+ <deployment component="dom4j" artifact="dom4j.jar" />
+ <deployment component="oswego-concurrent" artifact="concurrent.jar"/>
+ <deployment component="common" artifact="jboss-common.jar" />
+ <deployment component="common" artifact="namespace.jar" />
+ <deployment component="apache-httpclient" artifact="commons-httpclient.jar"/>
+ <deployment component="j2se" artifact="jboss-j2se.jar" />
+ <deployment component="mbeans" artifact="jboss-mbeans.jar" />
+ <deployment component="jmx" artifact="jboss-jmx.jar"/>
+ <deployment component="system" artifact="jboss-system.jar"/>
+ <deployment component="system" artifact="log4j-boot.jar"/>
+ <deployment component="jaxen" artifact="jaxen-1.1-beta-4.jar" />
+ <deployment component="gnu-getopt" artifact="getopt.jar" />
+ <deployment component="apache-logging" artifact="commons-logging.jar" />
+
+ <deploymenttype type="endorsed">
+ <deployment component="apache-xerces" artifact="xercesImpl.jar" />
+ <deployment component="apache-xerces" artifact="xml-apis.jar" />
+ <deployment component="apache-xerces" artifact="resolver.jar"/>
+ <deployment component="apache-xalan" artifact="xalan.jar" />
+ </deploymenttype>
+ </profile>
+
+ <profile id="all" outputPath="server/all">
+ <deploymenttype type="lib">
+ <deployment component="cluster" artifact="jbossha.jar"/>
+ <deployment component="management" artifact="jboss-management.jar" />
+ <deployment component="management" artifact="jboss-jsr77.jar" />
+ <deployment component="connector" artifact="jboss-jca.jar" />
+ <deployment component="connector" artifact="jboss-common-jdbc-wrapper.jar" />
+ <deployment component="varia" artifact="mail-plugin.jar" />
+ <deployment component="varia" artifact="scheduler-plugin.jar"/>
+ <deployment component="varia" artifact="scheduler-plugin-example.jar"/>
+ <deployment component="varia" artifact="jboss-hsqldb.jar"/>
+ <deployment component="varia" artifact="hsqldb-plugin.jar"/>
+ <deployment component="varia" artifact="autonumber-plugin.jar"/>
+ <deployment component="varia" artifact="properties-plugin.jar"/>
+ <deployment component="varia" artifact="bindingservice-plugin.jar"/>
+ <deployment component="varia" artifact="jboss-monitoring.jar"/>
+ <deployment component="apache-httpclient" artifact="commons-httpclient.jar"/>
+ <deployment component="wutka-dtdparser" artifact="dtdparser121.jar"/>
+ <deployment component="apache-log4j" artifact="log4j.jar"/>
+ <deployment component="j2ee" artifact="jboss-j2ee.jar" />
+ <deployment component="j2ee" artifact="jboss-jaxrpc.jar" />
+ <deployment component="j2ee" artifact="jboss-saaj.jar" />
+ <deployment component="naming" artifact="jnpserver.jar" />
+ <deployment component="container" artifact="jboss-container.jar" />
+ <deployment component="server" artifact="jmx-adaptor-plugin.jar" />
+ <deployment component="sun-jaf" artifact="activation.jar" />
+ <deployment component="hibernate" artifact="hibernate3.jar" />
+ <deployment component="hibernate-entitymanager" artifact="ejb3-persistence.jar" />
+ <deployment component="hibernate-entitymanager" artifact="hibernate-entitymanager.jar" />
+ <deployment component="hibernate-annotations" artifact="hibernate-annotations.jar" />
+ <deployment component="cglib" artifact="cglib-2.1.1.jar" />
+ <deployment component="beanshell" artifact="bsh-1.3.0.jar" />
+ <deployment component="jgroups" artifact="jgroups.jar" />
+ <deployment component="sun-javamail" artifact="mail.jar" />
+ <deployment component="apache-avalon" artifact="avalon-framework.jar" />
+ <deployment component="jacorb" artifact="jacorb.jar" />
+ <deployment component="apache-bcel" artifact="bcel.jar" />
+ <deployment component="apache-scout" artifact="scout.jar" />
+ <deployment component="hsqldb" artifact="hsqldb.jar" />
+ <deployment component="gjt-jpl-util" artifact="jpl-util.jar" />
+ <deployment component="gjt-jpl-util" artifact="jpl-pattern.jar" />
+ <deployment component="apache-collections" artifact="commons-collections.jar" />
+ <deployment component="apache-logging" artifact="commons-logging.jar" />
+ <deployment component="asm" artifact="asm.jar" />
+ <deployment component="asm" artifact="asm-attrs.jar" />
+ <deployment component="antlr" artifact="antlr-2.7.5H3.jar" />
+ <deployment component="jboss/cache" artifact="jboss-cache.jar" />
+ <deployment component="apache-bsf" artifact="bsf.jar" />
+ <deployment component="codehaus-stax" artifact="stax-1.1.1.jar" />
+ <deployment component="jboss/remoting" artifact="jboss-remoting.jar" />
+ <deployment component="messaging" artifact="jbossmq.jar"/>
+ <deployment component="security" artifact="jbosssx.jar"/>
+ <deployment component="iiop" artifact="jboss-iiop.jar"/>
+ <deployment component="tomcat" artifact="javax.servlet.jsp.jar"/>
+ <deployment component="tomcat" artifact="javax.servlet.jar" />
+ <deployment component="hibernate-int" artifact="jboss-hibernate.jar" />
+ <deployment component="jms" artifact="jboss-messaging.jar"/>
+ <deployment component="jmx-remoting" artifact="jboss-jmx-remoting.jar" />
+ <deployment component="jbossas/remoting" artifact="jbossas-remoting.jar" />
+ <deployment component="transaction" artifact="jboss-transaction.jar" />
+ <deployment component="server" artifact="jboss.jar" />
+ <deployment component="console" artifact="snmp-support.jar" />
+ <deployment component="deployment" artifact="jboss-jsr88.jar" />
+ </deploymenttype>
+
+ <deploymenttype type="farm">
+ <deployment component="cluster" artifact="cluster-examples-service.xml" />
+ </deploymenttype>
+
+ <deploymenttype type="conf">
+ <deployment component="jacorb" artifact="jacorb.properties"/>
+ <deployment component="server" artifact="conf-jboss-service.xml" />
+ <deployment component="server" artifact="jndi.properties" />
+ <deployment component="server" artifact="log4j.xml" />
+ <deployment component="server" artifact="login-config.xml" />
+ <deployment component="server" artifact="standardjaws.xml" />
+ <deployment component="server" artifact="standardjboss.xml"/>
+ <deployment component="server" artifact="standardjbosscmp-jdbc.xml" />
+
+ <deploymenttype type="xmdesc">
+ <deployment component="server" artifact="AttributePersistenceService-xmbean.xml" />
+ <deployment component="server" artifact="ClientUserTransaction-xmbean.xml"/>
+ <deployment component="server" artifact="JNDIView-xmbean.xml" />
+ <deployment component="server" artifact="Log4jService-xmbean.xml"/>
+ <deployment component="server" artifact="NamingService-xmbean.xml"/>
+ <deployment component="server" artifact="TransactionManagerService-xmbean.xml"/>
+ <deployment component="server" artifact="org.jboss.deployment.MainDeployer-xmbean.xml"/>
+ <deployment component="server" artifact="org.jboss.deployment.JARDeployer-xmbean.xml" />
+ <deployment component="server" artifact="org.jboss.deployment.SARDeployer-xmbean.xml"/>
+ </deploymenttype>
+ </deploymenttype>
+
+ <deploymenttype type="deploy">
+ <deployment component="connector" artifact="jboss-local-jdbc.rar"/>
+ <deployment component="connector" artifact="jboss-ha-local-jdbc.rar"/>
+ <deployment component="connector" artifact="jboss-xa-jdbc.rar" />
+ <deployment component="connector" artifact="jboss-ha-xa-jdbc.rar" />
+ <deployment component="connector" artifact="mail-ra.rar" />
+ <deployment component="connector" artifact="hsqldb-ds.xml"/>
+ <deployment component="connector" artifact="jbossjca-service.xml" />
+ <deployment component="cluster" artifact="cluster-service.xml" />
+ <deployment component="cluster" artifact="deploy-hasingleton-service.xml" />
+ <deployment component="cluster" artifact="farm-service.xml" />
+ <deployment component="varia" artifact="schedule-manager-service.xml"/>
+ <deployment component="varia" artifact="scheduler-service.xml" />
+ <deployment component="varia" artifact="properties-service.xml"/>
+ <deployment component="varia" artifact="mail-service.xml" />
+ <deployment component="varia" artifact="monitoring-service.xml" />
+ <deployment component="varia" artifact="kerneldir" toname="kernel"/>
+ <deployment component="deployment" artifact="jsr88-service.xml"/>
+ <deployment component="server" artifact="uuid-key-generator.sar" />
+ <deployment component="server" artifact="sqlexception-service.xml" />
+ <deployment component="server" artifact="client-deployer-service.xml"/>
+ <deployment component="server" artifact="jboss-service.xml" />
+ <deployment component="server" artifact="bsh-deployer.xml" />
+ <deployment component="server" artifact="cache-invalidation-service.xml"/>
+ <deployment component="server" artifact="ear-deployer.xml"/>
+ <deployment component="server" artifact="ejb-deployer.xml" />
+ <deployment component="aspects" artifact="jboss-aop-jdk50.deployer" exploded="true" requiredJDK="1.5"/>
+ <deployment component="tomcat" artifact="tc5-cluster-service.xml" />
+ <deployment component="ejb3" artifact="ejb3-entity-cache-service.xml" requiredJDK="1.5" />
+ <deployment component="ejb3" artifact="ejb3-clustered-sfsbcache-service.xml" requiredJDK="1.5" />
+ <deployment component="ejb3" artifact="ejb3-interceptors-aop.xml" requiredJDK="1.5" />
+ <deployment component="iiop" artifact="iiop-service.xml" />
+ <deployment component="tomcat" artifact="tc5-cluster.aop" />
+ <deploymenttype type="all"/>
+ <deploymenttype type="default"/>
+ <deployment component="tomcat" artifact="jbossweb-tomcat55.sar"/>
+ <deployment component="webservice" artifact="jbossws.sar" requiredJDK="1.5" />
+ <deployment component="ejb3" artifact="ejb3.deployer" requiredJDK="1.5" />
+
+ <deploymenttype type="jboss-aop-jdk50.deployer" requiredJDK="1.5">
+ <deployment component="aspects" artifact="jboss-aspect-library-jdk50.jar" requiredJDK="1.5" />
+ <deployment component="aspects" artifact="jboss-aop-jdk50.deployer" exploded="true" requiredJDK="1.5"/>
+ </deploymenttype>
+
+ <deploymenttype type="jboss-aop.deployer" requiredJDK="1.4">
+ <deployment component="aspects" artifact="jboss-aop.deployer" exploded="true" requiredJDK="1.4"/>
+ </deploymenttype>
+
+ <deploymenttype type="management">
+ <deployment component="console" artifact="console-mgr.sar" exploded="true"/>
+ <deployment component="console" artifact="web-console.war" exploded="true"/>
+ </deploymenttype>
+
+ <deploymenttype type="snmp-adaptor.sar">
+ <deployment component="varia" artifact="snmp-adaptor.sar" exploded="true" />
+ </deploymenttype>
+
+ <deploymenttype type="juddi-service.sar">
+ <deployment component="varia" artifact="juddi-service.jar"/>
+ <deployment component="varia" artifact="jboss-juddiaxis.jar"/>
+ <deploymenttype type="META-INF">
+ <deployment component="varia" artifact="juddi_drop_db.ddl" />
+ <deployment component="varia" artifact="juddi_data.ddl" />
+ <deployment component="varia" artifact="varia-jboss-service.xml" />
+ <deployment component="varia" artifact="juddi_create_db.ddl"/>
+ </deploymenttype>
+
+ <deploymenttype type="juddi.war">
+ <deploymenttype type="all"/>
+ </deploymenttype>
+ </deploymenttype>
+
+ <deploymenttype type="hasingleton">
+ <deploymenttype type="jms">
+ <deployment component="connector" artifact="jms-ra.rar" />
+ <deployment component="connector" artifact="hajndi-jms-ds.xml" />
+ <deployment component="varia" artifact="jbossmq-httpil.sar" exploded="true" />
+ <deployment component="messaging" artifact="jvm-il-service.xml"/>
+ <deployment component="messaging" artifact="jbossmq-destinations-service.xml" />
+ <deployment component="messaging" artifact="hsqldb-jdbc-state-service.xml" />
+ </deploymenttype>
+ </deploymenttype>
+
+ <deploymenttype type="httpha-invoker.sar">
+ <deployment component="varia" artifact="httpha-invoker.sar" exploded="true" />
+ </deploymenttype>
+
+ <deploymenttype type="jmx-console.war">
+ <deployment component="varia" artifact="jmx-console.war" exploded="true"/>
+ </deploymenttype>
+ </deploymenttype>
+ </profile>
+
+
+<!-- **************** Default Profile ***************** -->
+ <profile id="default" outputPath="server/default">
+ <deploymenttype type="lib">
+ <deployment component="management" artifact="jboss-jsr77.jar"/>
+ <deployment component="management" artifact="jboss-management.jar"/>
+ <deployment component="connector" artifact="jboss-common-jdbc-wrapper.jar" />
+ <deployment component="connector" artifact="jboss-jca.jar"/>
+ <deployment component="varia" artifact="bsh-deployer.jar"/>
+ <deployment component="varia" artifact="hsqldb-plugin.jar"/>
+ <deployment component="varia" artifact="autonumber-plugin.jar" />
+ <deployment component="varia" artifact="properties-plugin.jar" />
+ <deployment component="varia" artifact="bindingservice-plugin.jar"/>
+ <deployment component="varia" artifact="jboss-monitoring.jar" />
+ <deployment component="console" artifact="snmp-support.jar"/>
+ <deployment component="deployment" artifact="jboss-jsr88.jar" />
+ <deployment component="apache-httpclient" artifact="commons-httpclient.jar" />
+ <deployment component="wutka-dtdparser" artifact="dtdparser121.jar" />
+ <deployment component="j2ee" artifact="jboss-j2ee.jar" />
+ <deployment component="j2ee" artifact="jboss-jaxrpc.jar" />
+ <deployment component="j2ee" artifact="jboss-saaj.jar" />
+ <deployment component="naming" artifact="jnpserver.jar" />
+ <deployment component="container" artifact="jboss-container.jar" />
+ <deployment component="server" artifact="jmx-adaptor-plugin.jar" />
+ <deployment component="sun-jaf" artifact="activation.jar" />
+ <deployment component="hibernate" artifact="hibernate3.jar" />
+ <deployment component="hibernate-entitymanager" artifact="ejb3-persistence.jar" />
+ <deployment component="hibernate-entitymanager" artifact="hibernate-entitymanager.jar" />
+ <deployment component="hibernate-annotations" artifact="hibernate-annotations.jar" />
+ <deployment component="cglib" artifact="cglib-2.1.1.jar" />
+ <deployment component="beanshell" artifact="bsh-1.3.0.jar" />
+ <deployment component="sun-javamail" artifact="mail.jar" />
+ <deployment component="apache-bcel" artifact="bcel.jar" />
+ <deployment component="apache-scout" artifact="scout.jar" />
+ <deployment component="hsqldb" artifact="hsqldb.jar" />
+ <deployment component="gjt-jpl-util" artifact="jpl-util.jar" />
+ <deployment component="gjt-jpl-util" artifact="jpl-pattern.jar" />
+ <deployment component="apache-collections" artifact="commons-collections.jar" />
+ <deployment component="apache-httpclient" artifact="commons-httpclient.jar" />
+ <deployment component="apache-logging" artifact="commons-logging.jar" />
+ <deployment component="asm" artifact="asm.jar" />
+ <deployment component="asm" artifact="asm-attrs.jar" />
+ <deployment component="antlr" artifact="antlr-2.7.5H3.jar" />
+ <deployment component="apache-bsf" artifact="bsf.jar" />
+ <deployment component="codehaus-stax" artifact="stax-1.1.1.jar" />
+ <deployment component="jboss/remoting" artifact="jboss-remoting.jar" />
+ <deployment component="jbossas/remoting" artifact="jbossas-remoting.jar" />
+ <deployment component="transaction" artifact="jboss-transaction.jar"/>
+ <deployment component="server" artifact="jboss.jar"/>
+ <deployment component="messaging" artifact="jbossmq.jar" />
+ <deployment component="security" artifact="jbosssx.jar" />
+ <deployment component="tomcat" artifact="javax.servlet.jsp.jar" />
+ <deployment component="tomcat" artifact="javax.servlet.jar"/>
+ <deployment component="hibernate-int" artifact="jboss-hibernate.jar" />
+ <deployment component="jms" artifact="jboss-messaging.jar" />
+ <deployment component="jmx-remoting" artifact="jboss-jmx-remoting.jar" />
+ </deploymenttype>
+
+ <deploymenttype type="conf">
+ <deployment component="server" artifact="conf-jboss-service.xml" filename="jboss-service.xml" />
+ <deployment component="server" artifact="jndi.properties" />
+ <deployment component="server" artifact="log4j.xml"/>
+ <deployment component="server" artifact="login-config.xml"/>
+ <deployment component="server" artifact="standardjaws.xml"/>
+ <deployment component="server" artifact="standardjboss.xml"/>
+ <deployment component="server" artifact="standardjbosscmp-jdbc.xml"/>
+ <deployment component="server" artifact="jmx-console-roles.properties" />
+ <deployment component="server" artifact="jmx-console-users.properties" />
+
+ <deploymenttype type="props">
+ <deployment component="server" artifact="jmx-console-roles.properties"/>
+ <deployment component="server" artifact="jmx-console-users.properties"/>
+ </deploymenttype>
+
+ <deploymenttype type="xmdesc">
+ <deployment component="server" artifact="AttributePersistenceService-xmbean.xml" />
+ <deployment component="server" artifact="ClientUserTransaction-xmbean.xml" />
+ <deployment component="server" artifact="JNDIView-xmbean.xml" />
+ <deployment component="server" artifact="Log4jService-xmbean.xml" />
+ <deployment component="server" artifact="NamingService-xmbean.xml"/>
+ <deployment component="server" artifact="TransactionManagerService-xmbean.xml" />
+ <deployment component="server" artifact="org.jboss.deployment.MainDeployer-xmbean.xml" />
+ <deployment component="server" artifact="org.jboss.deployment.SARDeployer-xmbean.xml" />
+ <deployment component="server" artifact="org.jboss.deployment.JARDeployer-xmbean.xml" />
+ </deploymenttype>
+
+ </deploymenttype>
+
+ <deploymenttype type="deploy">
+ <deployment component="connector" artifact="jboss-local-jdbc.rar" />
+ <deployment component="connector" artifact="jboss-ha-local-jdbc.rar"/>
+ <deployment component="connector" artifact="jboss-xa-jdbc.rar"/>
+ <deployment component="connector" artifact="jboss-ha-xa-jdbc.rar"/>
+ <deployment component="connector" artifact="mail-ra.rar" />
+ <deployment component="connector" artifact="jbossjca-service.xml" />
+ <deployment component="connector" artifact="hsqldb-ds.xml" />
+ <deployment component="varia" artifact="schedule-manager-service.xml" />
+ <deployment component="varia" artifact="scheduler-service.xml" />
+ <deployment component="varia" artifact="properties-service.xml"/>
+ <deployment component="varia" artifact="schedule-manager-service.xml"/>
+ <deployment component="varia" artifact="scheduler-service.xml" />
+ <deployment component="varia" artifact="properties-service.xml"/>
+ <deployment component="varia" artifact="mail-service.xml" />
+ <deployment component="varia" artifact="monitoring-service.xml" />
+ <deployment component="varia" artifact="kerneldir"/>
+ <deployment component="deployment" artifact="jsr88-service.xml" />
+ <deployment component="tomcat" artifact="jbossweb-tomcat55.sar" />
+ <deployment component="ejb3" artifact="ejb3.deployer" requiredJDK="1.5" />
+ <deployment component="webservice" artifact="jbossws.sar" requiredJDK="1.5" />
+ <deployment component="tomcat" artifact="tc5-cluster.aop" />
+ <deployment component="ejb3" artifact="ejb3-interceptors-aop.xml" requiredJDK="1.5" />
+ <deployment component="server" artifact="ear-deployer.xml" />
+ <deployment component="server" artifact="sqlexception-service.xml" />
+ <deployment component="server" artifact="uuid-key-generator.sar"/>
+ <deployment component="server" artifact="client-deployer-service.xml"/>
+ <deployment component="server" artifact="jboss-service.xml" filename="jmx-invoker-service.xml"/>
+ <deployment component="server" artifact="bsh-deployer.xml" />
+ <deployment component="server" artifact="cache-invalidation-service.xml" />
+ <deploymenttype type="jboss-aop-jdk50.deployer">
+ <deployment component="aspects" artifact="jboss-aop-jdk50.deployer" exploded="true" requiredJDK="1.5"/>
+ <deployment component="aspects" artifact="jboss-aspect-library-jdk50.jar" requiredJDK="1.5" />
+ <deployment component="aspects" artifact="jboss-aop.deployer" exploded="true" requiredJDK="1.4"/>
+ </deploymenttype>
+ <deploymenttype type="jmx-remoting.sar">
+ <deployment component="jbossas/jmx-remoting" artifact="jbossas-jmx-remoting.jar"/>
+ <deploymenttype type="META-INF">
+ <deployment component="jbossas/jmx-remoting" artifact="jbossas-jmx-remoting-jboss-service.xml" />
+ </deploymenttype>
+ </deploymenttype>
+ <deploymenttype type="management">
+ <deployment component="console" artifact="console-mgr.sar" exploded="true"/>
+ <deployment component="console" artifact="web-console.war" exploded="true"/>
+ </deploymenttype>
+ <deploymenttype type="all" />
+ </deploymenttype>
+ <deploymenttype type="http-invoker.sar">
+ <deployment component="varia" artifact="http-invoker.sar" exploded="true"/>
+ </deploymenttype>
+
+ <deploymenttype type="jms">
+ <deployment component="connector" artifact="jms-ra.rar"/>
+ <deployment component="messaging" artifact="jbossmq-service.xml" />
+ <deployment component="messaging" artifact="uil2-service.xml" />
+ <deployment component="messaging" artifact="jvm-il-service.xml"/>
+ <deployment component="messaging" artifact="hsqldb-jdbc-state-service.xml" />
+ <deployment component="messaging" artifact="jbossmq-destinations-service.xml" />
+ </deploymenttype>
+
+ <deploymenttype type="hasingleton">
+ <deploymenttype type="jms">
+ <deployment component="varia" artifact="jbossmq-httpil.sar" exploded="true" />
+ </deploymenttype>
+ </deploymenttype>
+ <deploymenttype type="jmx-console.war">
+ <deployment component="varia" artifact="jmx-console.war" exploded="true"/>
+ </deploymenttype>
+ </profile>
+
+ <profile id="minimal" outputPath="server/minimal">
+ <deploymenttype type="lib">
+ <deployment component="management" artifact="jboss-management.jar" />
+ <deployment component="apache-log4j" artifact="log4j.jar"/>
+ <deployment component="naming" artifact="jnpserver.jar" />
+ <deployment component="server" artifact="jboss-minimal.jar"/>
+ </deploymenttype>
+ <deploymenttype type="conf">
+ <deployment component="server" artifact="jboss-minimal.xml" tofile="jboss-service.xml"/>
+ <deployment component="server" artifact="jndi.properties"/>
+ <deployment component="server" artifact="log4j.xml"/>
+ </deploymenttype>
+ <deploymenttype type="deploy">
+ <deploymenttype type="all"/>
+ </deploymenttype>
+ </profile>
+
+ <profile id="client" outputPath="client">
+ <!--<deployment component="" artifact="client.jar" outputPath="client"/> -->
+ <deployment component="management" artifact="jboss-jsr77-client.jar" />
+ <deployment component="cluster" artifact="jbossha-client.jar" />
+ <deployment component="connector" artifact="jbosscx-client.jar"/>
+ <deployment component="varia" artifact="jboss-juddiaxis.jar"/>
+ <deployment component="varia" artifact="jbossjmx-ant.jar"/>
+ <deployment component="deployment" artifact="jboss-deployment.jar"/>
+ <deployment component="oswego-concurrent" artifact="concurrent.jar"/>
+ <deployment component="common" artifact="jboss-common-client.jar"/>
+ <deployment component="common" artifact="namespace.jar" />
+ <deployment component="j2se" artifact="jboss-j2se.jar" />
+ <deployment component="j2ee" artifact="jboss-j2ee.jar" />
+ <deployment component="j2ee" artifact="jboss-jaxrpc.jar" />
+ <deployment component="j2ee" artifact="jboss-saaj.jar" />
+ <deployment component="naming" artifact="jnp-client.jar" />
+ <deployment component="system" artifact="jboss-system-client.jar"/>
+ <deployment component="jmx" artifact="jmx-client.jar"/>
+ <deployment component="transaction" artifact="jboss-transaction-client.jar"/>
+ <deployment component="server" artifact="jboss-client.jar"/>
+ <deployment component="server" artifact="jmx-invoker-adaptor-client.jar"/>
+ <deployment component="sun-jaf" artifact="activation.jar" release="client"/>
+ <deployment component="sun-javamail" artifact="mail.jar" release="client"/>
+ <deployment component="gnu-getopt" artifact="getopt.jar" release="client"/>
+ <deployment component="apache-avalon" artifact="avalon-framework.jar" release="client"/>
+ <deployment component="jacorb" artifact="jacorb.jar" release="client"/>
+ <deployment component="ibm-wsdl4j" artifact="wsdl4j.jar" release="client"/>
+ <deployment component="jboss/remoting" artifact="jboss-remoting.jar" release="client"/>
+ <deployment component="apache-avalon-logkit" artifact="logkit.jar" release="client"/>
+ <deployment component="messaging" artifact="jbossmq-client.jar" release="client"/>
+ <deployment component="security" artifact="auth.conf" />
+ <deployment component="security" artifact="jbosssx-client.jar" />
+ <deployment component="iiop" artifact="jboss-iiop-client.jar"/>
+ <deployment component="webservice" artifact="jboss-ws4ee-client.jar" requiredJDK="1.4" />
+ <deployment component="webservice" artifact="jbossws-client.jar" requiredJDK="1.5"/>
+ <deployment component="admin-console" artifact="jbossall-client.jar"/>
+ </profile>
+
+ <profile id="docs" outputPath="docs">
+ <deploymenttype type="dtd">
+ <deployment component="connector" artifact="jboss-ds_1_0.dtd" />
+ <deployment component="connector" artifact="jboss-ds_1_5.dtd" />
+ <deployment component="mbeans" artifact="jboss_xmbean_1_0.dtd"/>
+ <deployment component="mbeans" artifact="jboss_xmbean_1_1.dtd"/>
+ <deployment component="mbeans" artifact="jboss_xmbean_1_2.dtd"/>
+ <deployment component="system" artifact="jboss-service_3_2.dtd"/>
+ <deployment component="system" artifact="jboss-service_4_0.dtd"/>
+ <deployment component="system" artifact="jboss-subscription.dtd"/>
+ <deployment component="server" artifact="XMLSchema.dtd" />
+ <deployment component="server" artifact="application-client_1_3.dtd" />
+ <deployment component="server" artifact="application_1_2.dtd" />
+ <deployment component="server" artifact="application_1_3.dtd" />
+ <deployment component="server" artifact="connector_1_0.dtd" />
+ <deployment component="server" artifact="datatypes.dtd" />
+ <deployment component="server" artifact="ejb-jar.dtd" />
+ <deployment component="server" artifact="ejb-jar_2_0.dtd" />
+ <deployment component="server" artifact="jaws.dtd" />
+ <deployment component="server" artifact="jaws_2_4.dtd" />
+ <deployment component="server" artifact="jaws_3_0.dtd" />
+ <deployment component="server" artifact="jboss-app_3_0.dtd" />
+ <deployment component="server" artifact="jboss-app_3_2.dtd" />
+ <deployment component="server" artifact="jboss-app_4_0.dtd" />
+ <deployment component="server" artifact="jboss-client_3_2.dtd" />
+ <deployment component="server" artifact="jboss-client_4_0.dtd" />
+ <deployment component="server" artifact="jboss-web.dtd" />
+ <deployment component="server" artifact="jboss-web_3_0.dtd" />
+ <deployment component="server" artifact="jboss-web_3_2.dtd" />
+ <deployment component="server" artifact="jboss-web_4_0.dtd" />
+ <deployment component="server" artifact="jboss.dtd" />
+ <deployment component="server" artifact="jboss_2_4.dtd" />
+ <deployment component="server" artifact="jboss_3_0.dtd" />
+ <deployment component="server" artifact="jboss_3_2.dtd" />
+ <deployment component="server" artifact="jboss_4_0.dtd" />
+ <deployment component="server" artifact="jbosscmp-jdbc_3_0.dtd" />
+ <deployment component="server" artifact="jbosscmp-jdbc_3_2.dtd" />
+ <deployment component="server" artifact="jbosscmp-jdbc_4_0.dtd" />
+ <deployment component="server" artifact="security_config.dtd" />
+ <deployment component="server" artifact="web-app_2_2.dtd" />
+ <deployment component="server" artifact="web-app_2_3.dtd" />
+ </deploymenttype>
+ <deploymenttype type="schema">
+ <deployment component="server" artifact="application-client_1_4.xsd" />
+ <deployment component="server" artifact="application_1_4.xsd" />
+ <deployment component="server" artifact="connector_1_5.xsd" />
+ <deployment component="server" artifact="ejb-jar_2_1.xsd" />
+ <deployment component="server" artifact="j2ee_1_4.xsd" />
+ <deployment component="server" artifact="j2ee_jaxrpc_mapping_1_1.xsd" />
+ <deployment component="server" artifact="j2ee_web_services_1_1.xsd" />
+ <deployment component="server" artifact="j2ee_web_services_client_1_1.xsd" />
+ <deployment component="server" artifact="jsp_2_0.xsd" />
+ <deployment component="server" artifact="web-app_2_4.xsd" />
+ <deployment component="server" artifact="web-jsptaglibrary_2_0.xsd" />
+ <deployment component="server" artifact="xml.xsd" />
+ <deployment component="server" artifact="java-properties_1_0.xsd" />
+ <deployment component="server" artifact="jbxb_1_0.xsd" />
+ <deployment component="server" artifact="jndi-binding-service_1_0.xsd" />
+ <deployment component="server" artifact="user-roles_1_0.xsd" />
+ <deployment component="server" artifact="security-config_4_1.xsd" />
+ </deploymenttype>
+ <deploymenttype type="examples">
+ <deploymenttype type="jmx">
+ <deployment component="management" artifact="ejb-management.jar"/>
+ </deploymenttype>
+ <deploymenttype type="netbook">
+ <deployment component="varia" artifact="netboot.war" />
+ </deploymenttype>
+ </deploymenttype>
+ </profile>
+
+ <profile id="bin" outputPath="bin">
+ <deployment component="server" artifact="deployer.bat"/>
+ <deployment component="server" artifact="deployer.sh"/>
+ <deployment component="server" artifact="jboss_init_redhat.sh"/>
+ <deployment component="server" artifact="jboss_init_suse.sh"/>
+ <deployment component="server" artifact="shutdown.bat"/>
+ <deployment component="server" artifact="shutdown.sh"/>
+ <deployment component="server" artifact="shutdown.jar"/>
+ <deployment component="console" artifact="twiddle.jar"/>
+ <deployment component="console" artifact="twiddle.sh"/>
+ <deployment component="console" artifact="twiddle.bat"/>
+ <deployment component="system" artifact="run.jar" />
+ <deployment component="system" artifact="run.sh" />
+ <deployment component="system" artifact="run.bat" />
+ <deployment component="system" artifact="run.conf"/>
+ <deployment component="system" artifact="classpath.sh"/>
+ </profile>
+
+
+
+ </build>
+
+ <resolvecomponents/>
+
+ <!-- Generate the targets -->
+ <generate generate="jbossas"/>
+
+</project>
+
\ No newline at end of file
Property changes on: labs/jbossbuild/jbossbuild/trunk/resources/jbossbuild.xml
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: labs/jbossbuild/jbossbuild/trunk/resources/tasks.xml
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/resources/tasks.xml 2008-07-16 15:06:21 UTC (rev 21063)
+++ labs/jbossbuild/jbossbuild/trunk/resources/tasks.xml 2008-07-17 20:29:05 UTC (rev 21091)
@@ -7,17 +7,50 @@
See terms of license at gnu.org.
-->
<project name="jboss.ant.tasks"
- default="help"
+ default="help-fragment"
>
- <!-- PROPERTIES -->
+<!-- ================================================================== -->
+<!-- Properties -->
+<!-- ================================================================== -->
- <!-- JBoss Tasks Classpath -->
+ <!-- because this file may be imported from various locations
+ locations must be referenced in an absolute fashion -->
+ <dirname property="imported.basedir" file="${ant.file.jboss.ant.tasks}"/>
+
+
+ <property file="${imported.basedir}/jbossbuild.properties"/>
+
<property name="jboss.tasks.path"
- value="output/eclipse-classes/main"
+ value="${imported.basedir}/../../../tools/lib/jbossbuild.jar" />
+
+ <!-- items required for javcc task -->
+ <property name="sun.javacc.lib"
+ value="${imported.basedir}/../../../${jbossbuild.thirdparty.dir}/sun-javacc/lib/"/>
+
+ <property name="jacorb.root"
+ value="${imported.basedir}/../../../${jbossbuild.thirdparty.dir}/jacorb"/>
+
+ <property name="apache.logkit.lib"
+ value="${imported.basedir}/../../../${jbossbuild.thirdparty.dir}/apache-avalon-logkit/lib"/>
+
+
+ <path id="jacorb.idl.classpath">
+ <pathelement path="${jacorb.root}/lib/idl.jar"/>
+ <pathelement path="${apache.logkit.lib}/logkit.jar"/>
+ </path>
+
+
+<!-- ================================================================== -->
+<!-- Type Definitions -->
+<!-- ================================================================== -->
+
+ <!-- The generate type -->
+ <typedef name="generate"
+ classname="org.jboss.ant.types.Generate"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
/>
- <!-- TYPEDEFS -->
-
<!-- The build type -->
<typedef name="build"
classname="org.jboss.ant.types.build.Build"
@@ -39,6 +72,13 @@
classpath="${jboss.tasks.path}"
/>
+ <!-- The component type -->
+ <typedef name="component"
+ classname="org.jboss.ant.types.build.Component"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
<!-- The includes type -->
<typedef name="includes"
classname="org.jboss.ant.types.Includes"
@@ -53,7 +93,9 @@
classpath="${jboss.tasks.path}"
/>
- <!-- TASKDEFS -->
+<!-- ================================================================== -->
+<!-- Task Definitions -->
+<!-- ================================================================== -->
<!-- Update ide info for the main build -->
<taskdef name="idemain"
@@ -68,74 +110,599 @@
loaderRef="jboss.tasks.path"
classpath="${jboss.tasks.path}"
/>
+
+ <!-- Generate a componentref graph and resolve the dependencies -->
+ <taskdef name="synchronizeinfo"
+ classname="org.jboss.ant.tasks.build.SynchronizeComponentsTask"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- Generate a componentref graph and resolve the components -->
+ <taskdef name="resolvecomponents"
+ classname="org.jboss.ant.tasks.build.ResolveComponentRefsTask"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- A task which allows a visitor to visit the graph -->
+ <taskdef name="visit-componentref-graph"
+ classname="org.jboss.ant.tasks.build.VisitComponentRefGraphTask"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- Generate libraries.ent with version number in paths -->
+ <taskdef name="gen-lib-file"
+ classname="org.jboss.ant.tasks.build.GenerateLibrariesFile"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- RMIC compilation logic -->
+ <taskdef name="rmic-helper"
+ classname="org.jboss.ant.tasks.build.RMICHelper"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
- <!-- DEFINITIONS -->
+ <!-- Executes a given target without reparsing the project file -->
+ <taskdef name="execute-target"
+ classname="org.jboss.ant.tasks.build.TargetExecutor"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- Copy with support for zipfile sets -->
+ <taskdef name="copy-zfs"
+ classname="org.jboss.ant.tasks.build.CopyWithZipFileSetSupport"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- File release task -->
+ <taskdef name="copy-release"
+ classname="org.jboss.ant.tasks.build.CopyRelease"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- File release task -->
+ <taskdef name="release-deployments"
+ classname="org.jboss.ant.tasks.build.ReleaseDeploymentsTask"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+
- <!-- The artifact types -->
- <artifacttype id="jar" outputtype="lib"/>
- <artifacttype id="api" outputtype="api"/>
+<!-- ================================================================== -->
+<!-- Artifact Definitions -->
+<!-- ================================================================== -->
- <!-- The default targets -->
+ <artifacttype type="jar" outputtype="lib"/>
+ <artifacttype type="zip" outputtype="lib"/>
+ <artifacttype type="sar" outputtype="lib"/>
+ <artifacttype type="rar" outputtype="lib"/>
+ <artifacttype type="war" outputtype="lib"/>
+ <artifacttype type="deployer" outputtype="lib"/>
+ <artifacttype type="api" outputtype="api"/>
+ <artifacttype type="xml" outputtype="resource"/>
+ <artifacttype type="policy" outputtype="resource"/>
+ <artifacttype type="properties" outputtype="resource"/>
+ <artifacttype type="sh" outputtype="bin"/>
+ <artifacttype type="bat" outputtype="bin"/>
+ <artifacttype type="conf" outputtype="bin"/>
+ <artifacttype type="dtd" outputtype="dtd"/>
+ <artifacttype type="xsd" outputtype="schema"/>
+ <artifacttype type="aop" outputtype="resource"/>
+ <artifacttype type="idl" outputtype="resource"/>
+ <artifacttype type="md5" outputtype="bin"/>
+ <artifacttype type="dir" outputtype="lib"/>
+ <artifacttype type="ddl" outputtype="resource"/>
+
+<!-- ================================================================== -->
+<!-- Target Definitions -->
+<!-- ================================================================== -->
+
<targets id="targets">
- <!-- Build All -->
+ <!-- ============================================================ -->
+ <!-- Build All -->
+ <!-- Builds everything (build, docs, tests and release archives) -->
+ <!-- ============================================================ -->
+
<targetdef target="all" description="Build All">
<main depends="build, doc, test, archives" components="none"/>
<component depends="build, doc, test"/>
</targetdef>
- <!-- Build -->
- <targetdef target="build" description="Build">
+ <!-- ============================================================ -->
+ <!-- Init -->
+ <!-- Basic initilization tasks and property setup -->
+ <!-- ============================================================ -->
+ <targetdef target="build.init" description="initilization tasks and property setup">
- <!-- Build the main release -->
+ <!-- for each componentdef in jbossbuild file, setup properties
+ in case a use wishes to access them
+ -->
+ <component>
+ <property name="build.module" value="@{parentDir}"/>
+ <property name="build.module.src" value="${build.module}/src"/>
+ <property name="build.module.resources" value="${build.module}/src/resources"/>
+ <property name="build.module.etc" value="${build.module}/src/etc"/>
+ <property name="build.module.output" value="@{output}"/>
+ <property name="build.module.output.gen-src" value="${build.module.output}/gen-src"/>
+ <property name="build.module.dir" value="@{output}"/>
+ <property name="build.module.output.resources" value="${build.module.output}/resources"/>
+ <property name="build.module.output.lib" value="${build.module.output}/lib"/>
+ <property name="build.module.output.classes" value="${build.module.output}/classes"/>
+ </component>
+ </targetdef>
+
+ <!-- ============================================================ -->
+ <!-- Build -->
+ <!-- Builds the artifacts and compiles all source -->
+ <!-- ============================================================ -->
+
+ <targetdef target="build" description="Build" >
+
+ <!-- Build the main release
+ Creates the main release directory and copies artifacts
+ to the specified location
+ -->
<main>
<mkdir dir="@{releaseDir}"/>
- <antCall target="release"/>
+ <execute-target target="release"/>
</main>
- <!-- Build the component -->
- <component>
- <mkdir dir="@{output}"/>
+
+ <!--
+ Build the component
+ Just makes the output folder
+ -->
+ <component depends="build.init, build.etc">
+ <mkdir dir="@{output}/etc"/>
+ <copy todir="@{output}/etc" filtering="yes">
+ <fileset dir="@{component.dir}/src/etc/" includes="**"/>
+ </copy>
</component>
- <!-- Compile the source -->
- <source>
+ <!-- Build resources if the component has a
+ resource node -->
+ <resource depends="build.resources"/>
+
+ <!-- JTREE-JAVACC source generation -->
+ <generatedsource when="@{jtree-javacc}">
+
+ <dirname file="/@{jtree-javacc}" property="@{id}.path"/>
+ <property name="@{id}.output.path" value="@{output}/${@{id}.path}"/>
+
+ <mkdir dir="${@{id}.output.path}"/>
+ <jjtree
+ target="src/@{srcdir}/@{jtree-javacc}"
+ outputdirectory="${@{id}.output.path}"
+ javacchome="${sun.javacc.lib}"/>
+
+ <basename file="@{jtree-javacc}"
+ property="@{id}.basename"
+ suffix="jjt"/>
+
+ <javacc
+ target="${@{id}.output.path}/${@{id}.basename}.jj"
+ javacchome="${sun.javacc.lib}"/>
+
+ </generatedsource>
+
+ <!-- JAVACC source generation -->
+ <generatedsource when="@{javacc}">
+
+ <dirname file="/@{javacc}" property="@{id}.path"/>
+ <property name="@{id}.output.path" value="@{output}/${@{id}.path}"/>
+
+ <mkdir dir="${@{id}.output.path}"/>
+
+ <javacc
+ target="src/@{srcdir}/@{javacc}"
+ javacchome="${sun.javacc.lib}"
+ static="@{static}"
+ outputdirectory="${@{id}.output.path}"/>
+
+ </generatedsource>
+
+ <!-- IDL compilation -->
+ <generatedsource when="@{idl}">
+
+ <!-- Task to compile idl files required by jacorb -->
+ <taskdef name="jacidl"
+ classname="org.jacorb.idl.JacIDL"
+ classpathref="jacorb.idl.classpath"
+ />
+
+ <property name="@{id}.output.path" value="@{output}/@{id}"/>
+
+ <mkdir dir="${@{id}.output.path}"/>
+
+ <jacidl
+ srcdir ="src/@{idl}"
+ destdir="${@{id}.output.path}"
+ includes="*.idl"
+ includepath="${jacorb.root}/resources/"
+ />
+
+ </generatedsource>
+
+
+ <!-- Compile the source
+ Runs depend on the source output then compiles the source
+ -->
+ <source if="@{compileable}">
+
<mkdir dir="@{output}"/>
- <depend srcdir="@{sourcePath}" destdir="@{output}">
+ <depend srcdir="@{sourcePath}"
+ destdir="@{output}"
+ >
<classpath>
- <pathelements/>
+ <buildpathelements/>
</classpath>
</depend>
- <javac srcdir="@{sourcePath}" destdir="@{output}">
+ <javac srcdir="@{sourcePath}"
+ destdir="@{output}"
+ debug="true"
+ deprecation="true"
+ excludes="@{excludes}"
+ target="@{jvmTarget}"
+ source="@{jvmSource}"
+ fork="true"
+ memoryMaximumSize="512M"
+ >
<classpath>
- <pathelements/>
+ <buildpathelements/>
</classpath>
+ <src path="@{sourcePath}"/>
+ <!-- allow multiple sources to be compiled at once to handle circular references -->
+ <srcelements/>
</javac>
+
+ <copy toDir="@{output}">
+ <fileset dir="@{sourcePath}">
+ <include name="**/*.properties"/>
+ </fileset>
+ </copy>
</source>
+
+ <source when="@{stubversion}">
+ <property name="jb.stubversion" value="@{stubversion}"/>
+ </source>
+
- <!-- Create a jar archive -->
- <jar>
+ <!-- Remote method call compilation. -->
+ <source when="@{rmic}">
+ <rmic-helper
+ base="@{output}"
+ includes="@{rmic}"
+ verify="true"
+ debug="false"
+ iiop="@{iiop}"
+ idl="false"
+ external="@{external}"
+ stubversion="${jb.stubversion}"
+
+ >
+ <classpath>
+ <buildpathelements/>
+ </classpath>
+ </rmic-helper>
+ </source>
+
+ <!-- Create a jar archive
+ Jars the inputs of the jar artifact
+ -->
+ <jar null="@{manifest}" if="@{buildable}">
<mkdir dir="@{parentDir}"/>
<jar destfile="@{output}">
+ <manifest>
+ <attribute name="Created-by" value="@{component.VMVersion} @{component.VMVendor}"/>
+ <attribute name="Specification-Title" value="@{component.specTitle}"/>
+ <attribute name="Specification-Version" value="@{component.specVersion}"/>
+ <attribute name="Specification-Vendor" value="@{component.specVendor}"/>
+ <attribute name="Implementation-Title" value="@{component.implTitle}"/>
+ <attribute name="Implementation-URL" value="@{component.implURL}"/>
+ <attribute name="Implementation-Version" value="@{component.implVersion}"/>
+ <attribute name="Implementation-Vendor" value="@{component.implVendor}"/>
+ <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
+ <attribute name="Class-Path" value="@{classpath}"/>
+ </manifest>
<filesets/>
</jar>
</jar>
+
+ <!-- Create an aop archive
+ Jars the inputs of the aop artifact
+ -->
+ <aop if="@{buildable}">
+ <mkdir dir="@{parentDir}"/>
+ <jar destfile="@{output}">
+ <filesets/>
+ </jar>
+ </aop>
+
+ <jar when="@{manifest}" if="@{buildable}">
+ <mkdir dir="@{parentDir}"/>
+ <jar destfile="@{output}"
+ manifest="@{component.output}/etc/manifest/@{manifest}">
+ <filesets/>
+ </jar>
+ </jar>
+
+
+
+ <!-- Create a sar archive
+ Jars the inputs of the sar artifact
+ -->
+ <sar null="@{manifest}">
+ <mkdir dir="@{parentDir}"/>
+ <jar destfile="@{output}">
+ <manifest>
+ <attribute name="Created-by" value="@{component.VMVersion} @{component.VMVendor}"/>
+ <attribute name="Specification-Title" value="@{component.specTitle}"/>
+ <attribute name="Specification-Version" value="@{component.specVersion}"/>
+ <attribute name="Specification-Vendor" value="@{component.specVendor}"/>
+ <attribute name="Implementation-Title" value="@{component.implTitle}"/>
+ <attribute name="Implementation-URL" value="@{component.implURL}"/>
+ <attribute name="Implementation-Version" value="@{component.implVersion}"/>
+ <attribute name="Implementation-Vendor" value="@{component.implVendor}"/>
+ <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
+ <attribute name="Class-Path" value="@{classpath}"/>
+ </manifest>
+ <filesets/>
+ </jar>
+ </sar>
+
+
+ <!-- Create a rar archive
+ Jars the inputs of the rar artifact
+ -->
+ <rar null="@{manifest}">
+ <mkdir dir="@{parentDir}"/>
+ <jar destfile="@{output}">
+ <manifest>
+ <attribute name="Created-by" value="@{component.VMVersion} @{component.VMVendor}"/>
+ <attribute name="Specification-Title" value="@{component.specTitle}"/>
+ <attribute name="Specification-Version" value="@{component.specVersion}"/>
+ <attribute name="Specification-Vendor" value="@{component.specVendor}"/>
+ <attribute name="Implementation-Title" value="@{component.implTitle}"/>
+ <attribute name="Implementation-URL" value="@{component.implURL}"/>
+ <attribute name="Implementation-Version" value="@{component.implVersion}"/>
+ <attribute name="Implementation-Vendor" value="@{component.implVendor}"/>
+ <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
+ <attribute name="Class-Path" value="@{classpath}"/>
+ </manifest>
+ <filesets/>
+ </jar>
+ </rar>
+
+ <!-- Create a war archive
+ Jars the inputs of the war artifact
+ -->
+ <war null="@{manifest}">
+ <mkdir dir="@{parentDir}"/>
+ <jar destfile="@{output}">
+ <manifest>
+ <attribute name="Created-by" value="@{component.VMVersion} @{component.VMVendor}"/>
+ <attribute name="Specification-Title" value="@{component.specTitle}"/>
+ <attribute name="Specification-Version" value="@{component.specVersion}"/>
+ <attribute name="Specification-Vendor" value="@{component.specVendor}"/>
+ <attribute name="Implementation-Title" value="@{component.implTitle}"/>
+ <attribute name="Implementation-URL" value="@{component.implURL}"/>
+ <attribute name="Implementation-Version" value="@{component.implVersion}"/>
+ <attribute name="Implementation-Vendor" value="@{component.implVendor}"/>
+ <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
+ <attribute name="Class-Path" value="@{classpath}"/>
+ </manifest>
+ <filesets/>
+ </jar>
+ </war>
+
+ <!-- Create a deployer archive
+ Jars the inputs of the war artifact
+ -->
+ <deployer null="@{manifest}" if="@{buildable}">
+ <mkdir dir="@{parentDir}"/>
+ <jar destfile="@{output}">
+ <manifest>
+ <attribute name="Created-by" value="@{component.VMVersion} @{component.VMVendor}"/>
+ <attribute name="Specification-Title" value="@{component.specTitle}"/>
+ <attribute name="Specification-Version" value="@{component.specVersion}"/>
+ <attribute name="Specification-Vendor" value="@{component.specVendor}"/>
+ <attribute name="Implementation-Title" value="@{component.implTitle}"/>
+ <attribute name="Implementation-URL" value="@{component.implURL}"/>
+ <attribute name="Implementation-Version" value="@{component.implVersion}"/>
+ <attribute name="Implementation-Vendor" value="@{component.implVendor}"/>
+ <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
+ <attribute name="Class-Path" value="@{classpath}"/>
+ </manifest>
+ <filesets/>
+ </jar>
+ </deployer>
+
+ <!-- Create a md5 checksumarchive -->
+ <md5 null="@{manifest}">
+ <mkdir dir="@{parentDir}"/>
+ <checksum>
+ <filesets/>
+ </checksum>
+ </md5>
+
+ <!-- create a directory and copy into it all of the filesets or zipfilesets -->
+ <dir if="@{buildable}">
+ <mkdir dir="@{output}"/>
+ <copy-zfs todir="@{output}">
+ <filesets/>
+ </copy-zfs>
+ </dir>
+
+
+ <!-- this is a hack. jbbuild will not allow artifacts with same id
+ varia requires a dir to be created called kernel, but cannot be created
+ because kernel already exists as a component. Only option is to create the dir
+ and rename it to kernel -->
+ <dir if="@{buildable}" when="@{rename}">
+ <mkdir dir="@{parentDir}/@{rename}"/>
+ <copy-zfs todir="@{parentDir}/@{rename}">
+ <filesets/>
+ </copy-zfs>
+ </dir>
+
+ <!-- copying of artifacts to new name -->
+ <artifactdef when="@{toname}">
+ <mkdir dir="@{parentDir}"/>
+ <copy toFile="@{parentDir}/@{toname}">
+ <filesets/>
+ </copy>
+ </artifactdef>
+
+ <sh depends="build.bin"/>
+ <bat depends="build.bin"/>
</targetdef>
- <!-- Build the release -->
+ <!-- Copy the etc -->
+ <targetdef target="build.etc">
+
+ <component>
+
+ <mkdir dir="@{output}/etc"/>
+ <mkdir dir="@{component.dir}/src/etc/"/>
+ <copy todir="@{output}/etc" filtering="yes">
+
+ <fileset dir="@{component.dir}/src/etc/" includes="**"/>
+ <filterset>
+ <filter token="java.vm.version" value="@{component.VMVersion}"/>
+ <filter token="java.vm.vendor" value="@{component.VMVendor}"/>
+ <filter token="specification.title" value="@{component.specTitle}"/>
+ <filter token="specification.version" value="@{component.specVersion}"/>
+ <filter token="specification.vendor" value="@{component.specVendor}"/>
+ <filter token="implementation.title" value="@{component.implTitle}"/>
+ <filter token="implementation.url" value="@{component.implURL}"/>
+ <filter token="implementation.version" value="@{component.implVersion}"/>
+ <filter token="implementation.vendor" value="@{component.implVendor}"/>
+ <filter token="implementation.vendor.id" value="@{component.implURL}"/>
+ </filterset>
+ </copy>
+ </component>
+
+ </targetdef>
+
+ <targetdef target="build.resources">
+
+ <component>
+ <mkdir dir="@{output}/resources"/>
+ <copy todir="@{output}" filtering="yes">
+ <fileset dir="@{component.dir}/src" includes="resources/**"/>
+ </copy>
+ </component>
+ </targetdef>
+
+
+
+ <targetdef target="build.bin">
+ <component>
+ <mkdir dir="@{output}/bin"/>
+ <copy todir="@{output}/bin" filtering="yes">
+ <fileset dir="@{component.dir}/src/bin">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
+
+ <fixcrlf srcdir="@{output}/bin"
+ eol="lf" eof="remove"
+ includes="**/*.sh"/>
+
+ <fixcrlf srcdir="@{output}/bin"
+ eol="crlf" eof="remove"
+ includes="**/*.bat, **/*.cmd"/>
+
+ <chmod perm="+x">
+ <fileset dir="@{output}/bin">
+ <include name="**/*.sh"/>
+ </fileset>
+ </chmod>
+
+ </component>
+ </targetdef>
+
+ <!-- ============================================================ -->
+ <!-- Release -->
+ <!-- Create the release by copying all artifacts that have a -->
+ <!-- release tag to that specified location. -->
+ <!-- ============================================================ -->
+
<targetdef target="release">
+
+ <main>
+ <echo message="target is being executed"/>
+ <release-deployments/>
+ </main>
+ <!-- Copy the artifact into the release
+ <artifact when="@{tofile}">
+ <copy-release release="@{release}" tofile="@{tofile}" requiredJDK="@{requiredJDK}"
+ exploded="@{exploded}" overwrite="@{overwrite}">
+ <output/>
+ </copy-release>
+ </artifact>
+
+ <artifact null="@{tofile}" when="@{release}" >
+ <copy-release release="@{release}"
+ exploded="@{exploded}"
+ requiredJDK="@{requiredJDK}"
+ overwrite="@{overwrite}"
+ >
+ <output/>
+ </copy-release>
+ </artifact> -->
+ </targetdef>
+
+ <!-- ============================================================ -->
+ <!-- Publish -->
+ <!-- Copy an artifact to the location specified by -->
+ <!-- ${jbossbuild.repository.root} -->
+ <!-- Used by the continous build to publish to the repository. -->
+ <!-- ============================================================ -->
+
+ <targetdef target="publish" if="@{local}">
+
+ <!-- copy the component-info.xml into the repository -->
+ <componentmain if="@{local}">
+ <fail unless="repository.root">
+ The publish target requires repository.root to be set.
+ </fail>
+ <mkdir dir="${repository.root}/@{relativePath}"/>
+ <copy failonerror="false" file="@{dir}/${jbossbuild.component.info}"
+ todir="${repository.root}/@{relativePath}"
+ />
+
+ </componentmain>
+
<!-- Copy the artifact into the release -->
- <artifact when="@{release}">
- <mkdir dir="@{release}"/>
- <copy todir="@{release}">
+ <artifact if="@{component.local}">
+ <fail unless="repository.root">
+ The publish target requires repository.root to be set.
+ </fail>
+ <mkdir dir="${repository.root}/@{relativePath}"/>
+ <copy todir="${repository.root}/@{relativePath}">
<output/>
</copy>
</artifact>
</targetdef>
+ <!-- ============================================================ -->
+ <!-- Archives -->
+ <!-- Builds the release archive(s) -->
+ <!-- ============================================================ -->
+
<!-- Build the release archives -->
- <targetdef target="archives">
+ <targetdef target="archives" description="Build the release archives">
<!-- Make the archives -->
<main>
@@ -147,14 +714,22 @@
</main>
</targetdef>
- <!-- Documentation -->
+ <!-- ============================================================ -->
+ <!-- Doc -->
+ <!-- Creates the documentation. -->
+ <!-- ============================================================ -->
+
<targetdef target="doc" description="Documentation">
<!-- Generate the documentation -->
<component depends="api"/>
</targetdef>
- <!-- Javadoc -->
+ <!-- ============================================================ -->
+ <!-- API -->
+ <!-- Creates the javadoc -->
+ <!-- ============================================================ -->
+
<targetdef target="api" description="Javadoc">
<!-- Generate the javadoc -->
@@ -189,61 +764,166 @@
</api>
</targetdef>
- <!-- Clean the output -->
+ <!-- ============================================================ -->
+ <!-- Clean -->
+ <!-- Deletes the output folder -->
+ <!-- ============================================================ -->
+
<targetdef target="clean" description="Clean">
<common>
- <delete dir="@{output}"/>
+ <echo message="executing common outputdir is @{output}"/>
+ <delete dir="@{output}" failonerror="false"/>
</common>
</targetdef>
- <!-- Clobber everything -->
+ <!-- ============================================================ -->
+ <!-- Clobber -->
+ <!-- Deletes the output folder and removes thirdparty -->
+ <!-- ============================================================ -->
+
<targetdef target="clobber" description="Clobber">
<main depends="clean">
<delete dir="@{thirdparty}"/>
</main>
</targetdef>
- <!-- Synchronize -->
+ <!-- ============================================================ -->
+ <!-- Synchronize -->
+ <!-- Resynchronizes the project with cvs -->
+ <!-- ============================================================ -->
+
<targetdef target="synchronize" description="Synchronize">
+
+ <!-- Update the main build folder and tools from cvs
+ then do the same for the components before running
+ the after synchronization processing
+ NOTE: Does not automatically invoke component builds
+ as the list of components maybe out-of-date at this point
+ and we need to conditionally do cvs co/update
+ -->
<main components="none">
- <echo>FIXME cvsupdate ${basedir}</echo>
- <execant target="synchronize.components"/>
- <execant target="synchronize.main.after"/>
+ <!-- cvs command="update -dP" failonerror="true"/-->
+ <!--invoke target="synchronize" dir="../tools"/-->
+ <execute-target target="synchronize.components" />
+ <!-- execant target="synchronize.after.main"/-->
</main>
- <component>
- <echo>FIXME cvsupdate ${basedir}</echo>
- <execant target="synchronize.component.after"/>
+
+ <componentmain unless="@{local}">
+ <mkdir dir="@{thirdpartyDir}"/>
+ <get src="@{location}/${jbossbuild.component.info}"
+ dest="@{thirdpartyDir}/${jbossbuild.component.info}"
+ useTimestamp="true"
+ verbose="true"
+ />
+ </componentmain>
+
+ <!-- If the component exists we just do a cvs update -->
+ <componentmain if="@{exists}">
+ <get src="@{location}/${jbossbuild.component.info}"
+ dest="@{dir}/${jbossbuild.component.info}"
+ useTimestamp="true"
+ verbose="true"
+ />
+
+ <cvs dest="@{dir}" command="update -dP"/>
+ <!-- NOTE: unable to delegate to component until JBBUILD-62 is resolved -->
+ <!--invoke target="synchronize" dir="@{dir}"/-->
+ <!--execant target="synchronize.after" dir="@{dir}"/-->
+ </componentmain>
+
+ <!-- If the component doesn't exist and we want to
+ get the source build check it out from cvs
+ -->
+ <componentmain unless="@{exists}" if="@{local}">
+ <echo message="doing component @{id}"/>
+ <cvs dest="@{dir.parent}">
+ <commandline>
+ <argument value="-d"/>
+ <argument value="@{build.cvsroot}"/>
+ <argument value="co"/>
+ <argument value="-d"/>
+ <argument value="@{id}"/>
+ <argument value="@{module}"/>
+ </commandline>
+ </cvs>
+ <!-- execant target="synchronize.after" dir="@{dir}"/-->
+ </componentmain>
+
+ <!-- The component already exists do a cvs update
+ and run the after synchronization
+ -->
+ <component nomain="true">
+ <cvs command="update -dP" failonerror="true"/>
+ <!--execant target="synchronize.after"/-->
</component>
- <artifact local="false">
- <echo>FIXME download/cvscheckout</echo>
+
+ <!-- If we are not doing a source checkout of this
+ component, download the artifacts to thirdparty
+ -->
+ <artifact unless="@{component.local}">
<mkdir dir="@{parentDir}"/>
<get src="@{location}"
dest="@{output}"
- useTimestamp="true"
+ useTimestamp="true"
verbose="true"
/>
</artifact>
</targetdef>
- <!-- Commit -->
+ <!-- ============================================================ -->
+ <!-- Commit -->
+ <!-- Commits the changes to cvs -->
+ <!-- ============================================================ -->
+
<targetdef target="commit" description="Commit">
- <common>
- <echo>FIXME cvscommit</echo>
- </common>
+ <!-- Commit the main build and tools -->
+ <main>
+ <fail message="Use -Dm="xxx" to specify the commit message" unless="m"/>
+ <cvs failonerror="true">
+ <commandline>
+ <argument value="commit"/>
+ <argument value="-m"/>
+ <argument value="${m}"/>
+ </commandline>
+ </cvs>
+ <invoke target="commit" dir="../tools"/>
+ </main>
+ <!-- Commit the component -->
+ <component>
+ <fail message="Use -Dm="xxx" to specify the commit message" unless="m"/>
+ <cvs failonerror="true">
+ <commandline>
+ <argument value="commit"/>
+ <argument value="-m"/>
+ <argument value="${m}"/>
+ </commandline>
+ </cvs>
+ </component>
</targetdef>
- <!-- Test -->
- <targetdef target="test" description="Run the Tests">
+ <!-- ============================================================ -->
+ <!-- Test -->
+ <!-- Builds and runs the tests -->
+ <!-- ============================================================ -->
+
+ <targetdef target="test" description="Build and run the tests">
<component depends="build, runtest"/>
</targetdef>
+ <!-- ============================================================ -->
+ <!-- RunTest -->
+ <!-- Runs the tests for sources marked with a test attribute -->
+ <!-- ============================================================ -->
+
<!-- Run the Test -->
- <targetdef target="runtest">
+ <targetdef target="runtest" description="Run tests">
<component/>
<source when="@{test}">
<mkdir dir="@{testDir}"/>
+ <delete file="@{testDir}/test.log"/>
<junit fork="true"
printSummary="true">
+ <sysproperty key="org.jboss.test.logfile" value="@{testDir}/test.log"/>
<formatter type="plain"/>
<classpath>
<pathElements/>
@@ -254,10 +934,67 @@
</junit>
</source>
</targetdef>
- </targets>
+
+ <!-- ============================================================ -->
+ <!-- Rebuild -->
+ <!-- Synchronizes then builds -->
+ <!-- ============================================================ -->
+
+ <!-- Rebuild -->
+ <targetdef target="rebuild" description="Synchronize then build">
+ <common depends="synchronize">
+ <execant target="build"/>
+ </common>
+ </targetdef>
+
+ <!-- ============================================================ -->
+ <!-- RebuildAll -->
+ <!-- Synchronizes then builds all -->
+ <!-- ============================================================ -->
+
+ <!-- Rebuild all -->
+ <targetdef target="rebuildall" description="Synchronize then build all">
+ <common depends="synchronize">
+ <execant target="all"/>
+ </common>
+ </targetdef>
- <!-- MACROS -->
+ <!-- ============================================================ -->
+ <!-- Synchronize.After -->
+ <!-- After synchronization processing -->
+ <!-- ============================================================ -->
+ <!-- After synchronization processing -->
+ <targetdef target="synchronize.after" description="After synchronization processing">
+ <main>
+ <idemain/>
+ </main>
+ <component>
+ <idecomponent/>
+ </component>
+ </targetdef>
+
+
+
+ </targets>
+
+<!-- ================================================================== -->
+<!-- Macro Definitions -->
+<!-- ================================================================== -->
+
+ <condition property="execant-executable" value="cmd.exe">
+ <os family="windows"/>
+ </condition>
+ <property name="execant-executable" value="ant"/>
+ <condition property="execant-prefix" value="/c ant">
+ <os family="windows"/>
+ </condition>
+ <property name="execant-prefix" value=""/>
+ <!-- Set the execant.args to empty unless it already exists -->
+ <condition property="execant.args" value="">
+ <not><isset property="execant.args"/></not>
+ </condition>
+
<!-- The execant macro -->
<macrodef name="execant">
<attribute name="dir"
@@ -267,12 +1004,16 @@
<attribute name="target"
description="The target"
/>
+ <attribute name="filename"
+ default="jbossbuild.xml"
+ description="The ant file to execute"
+ />
<sequential>
<!-- Invoke using a new ant -->
<exec dir="@{dir}"
- executable="ant"
+ executable="${execant-executable}"
>
- <arg line="@{target}"/>
+ <arg line="${execant-prefix} ${execant.args} -f @{filename} @{target}"/>
</exec>
</sequential>
</macrodef>
@@ -288,32 +1029,17 @@
/>
<sequential>
<!-- Invoke using a new ant -->
- <ant dir="@{dir}" target="@{target}"/>
+ <ant antfile="jbossbuild.xml" dir="@{dir}" target="@{target}" inheritRefs="false"/>
</sequential>
</macrodef>
- <!-- TARGETS -->
+<!-- ================================================================== -->
+<!-- Targets -->
+<!-- ================================================================== -->
- <target name="rebuild" depends="synchronize" description="Synchronize then build">
- <execant target="build"/>
- </target>
-
- <target name="rebuildall" depends="synchronize" description="Synchronize then build all">
- <execant target="all"/>
- </target>
-
- <!-- After synchronization processing for the main build -->
- <target name="synchronize.main.after">
- <idemain/>
- </target>
-
- <!-- After synchronization processing for a component -->
- <target name="synchronize.component.after">
- <idecomponent/>
- </target>
-
- <target name="help">
+ <target name="help-fragment">
<fail message="Do not execute this build fragment directly!"/>
</target>
+
+</project>
-</project>
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/targets/ArtifactDefinitionTarget.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/targets/ArtifactDefinitionTarget.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/targets/ArtifactDefinitionTarget.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -6,6 +6,7 @@
*/
package org.jboss.ant.targets;
+import java.util.ArrayList;
import java.util.List;
import org.jboss.ant.types.build.Artifact;
@@ -63,7 +64,19 @@
{
ArtifactDefinition artifactDefinition = (ArtifactDefinition) getDataType();
Artifact artifact = artifactDefinition.getArtifact();
- return getTargetDefinition().getElement(artifact.getArtifactType().getType());
+
+ //get a list of all dynamic types that are the same this artifact type
+ ArrayList elementList=getTargetDefinition().getElement(artifact.getArtifactType().getType());
+
+ //retrieve a list of dynamic types that are named "artifacdef"
+ ArrayList artifactDefElementList=getTargetDefinition().getElement("artifactdef");
+
+ if ((elementList==null) && (artifactDefElementList != null))
+ elementList=artifactDefElementList;
+ else if ((elementList !=null) && (artifactDefElementList !=null))
+ elementList.addAll(artifactDefElementList);
+
+ return elementList;
}
// Package protected ---------------------------------------------
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/targets/ArtifactTarget.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/targets/ArtifactTarget.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/targets/ArtifactTarget.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -51,7 +51,7 @@
*/
public ArtifactTarget(Artifact artifact, TargetDefinition targetDefinition)
{
- super(artifact, targetDefinition.getTarget() + "." + artifact.getId(), getDescription(artifact, targetDefinition), targetDefinition);
+ super(artifact, targetDefinition.getTarget() + "." + artifact.getComponent().getId() + "." + artifact.getId(), getDescription(artifact, targetDefinition), targetDefinition);
}
// Public --------------------------------------------------------
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/targets/ComponentTarget.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/targets/ComponentTarget.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/targets/ComponentTarget.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -25,7 +25,12 @@
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
-
+ /** The executable */
+ boolean executable=true;
+
+ /** The generated */
+ private boolean generated=false;
+
// Static --------------------------------------------------------
/**
@@ -55,6 +60,7 @@
public ComponentTarget(Component component, TargetDefinition targetDefinition)
{
super(component, targetDefinition.getTarget() + "." + component.getId(), getDescription(component, targetDefinition), targetDefinition);
+ this.executable=component.isExecutable();
}
// Public --------------------------------------------------------
@@ -68,6 +74,32 @@
// DynamicTarget overrides ---------------------------------------
+ public void execute()
+ {
+ if (generated == false)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Generating target '" + getName() + "' ...");
+ getDataType().validate();
+ generate();
+ generated = true;
+ }
+ try
+ {
+ if (executable)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Executing target '" + getName() + "' ...");
+ super.execute();
+ }
+
+ }
+ catch (Exception e)
+ {
+ DynamicTargetException.rethrow(getDataType().toShortString(), getName(), e);
+ }
+ }
+
protected void generate()
{
invokeComponent();
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/BuildTask.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/BuildTask.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/BuildTask.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -9,6 +9,7 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.jboss.ant.types.build.Build;
+import org.jboss.ant.util.LoggerUtil.Logger;
import org.jboss.ant.util.graph.Graph;
/**
@@ -19,7 +20,7 @@
*/
public class BuildTask extends Task
{
-
+ protected Logger log;
/**
* Create a new BuildTask.
*
@@ -27,7 +28,7 @@
*/
public BuildTask()
{
-
+ log = new Logger(this);
}
/**
Added: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/CopyRelease.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/CopyRelease.java (rev 0)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/CopyRelease.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -0,0 +1,254 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ant.tasks.build;
+
+import java.io.File;
+import java.util.Vector;
+
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.taskdefs.Copy;
+import org.apache.tools.ant.taskdefs.Expand;
+import org.apache.tools.ant.taskdefs.Mkdir;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.util.JavaEnvUtils;
+import org.jboss.ant.util.FileUtil;
+
+/**
+ * A task which handles various
+ * scenarios which may arrise when
+ * copying files to a release directory
+ *
+ * @author <a href="ruel.loehr at jboss.com">Ruel Loehr</a>
+ * @version $Revision$
+ */
+public class CopyRelease extends BuildTask
+{
+ /** A comma seperated string of release locations */
+ private String release;
+
+ /** The filesets associated with file to release*/
+ private Vector filesets;
+
+ /** The name of a file to copy a release file to */
+ private String tofile;
+
+ /** Whether the release structure should be exploded, true or false */
+ private String exploded;
+
+ /** The requiredJDK used to determine if a file should be released or not */
+ private String requiredJDK;
+
+ /** The overwrite */
+ private String overwrite;
+
+ /**
+ * Create a new CopyRelease.
+ *
+ *
+ */
+ public CopyRelease()
+ {
+ filesets = new Vector();
+ }
+
+ public void execute()
+ {
+ //release these files only if the the jdkVersion is match
+ String version = JavaEnvUtils.getJavaVersion();
+
+ if ((version.equalsIgnoreCase(this.getRequiredJDK())) || (this.getRequiredJDK().equalsIgnoreCase("default")))
+ {
+
+ //many files may be defined, split them up
+ String files[] = this.getRelease().split(", ");
+
+ //for each file we want to release first create the directory
+ //and then copy it
+ for (int j = 0; j < files.length; j++)
+ {
+ File outputDir = new File(files[j]);
+
+ //create the output directory
+ Mkdir mkdir = new Mkdir();
+ mkdir.setTaskName("mkdir");
+ mkdir.setProject(this.getProject());
+ mkdir.setDir(outputDir);
+ mkdir.execute();
+
+ //execute the exploded release
+ if (this.getExploded().equalsIgnoreCase("true"))
+ {
+ //copy the artifact to the output directory
+ Expand expand = new Expand();
+ expand.setTaskName("unzip");
+ expand.setProject(this.getProject());
+ expand.setDest(new File(files[j]));
+ if (this.getOverwrite() != null)
+ {
+ if (this.getOverwrite().equalsIgnoreCase("true"))
+ expand.setOverwrite(true);
+ else
+ expand.setOverwrite(false);
+ }
+
+ for (int i = 0; i < this.getFilesets().size(); i++)
+ {
+ expand.addFileset((FileSet) this.getFilesets().elementAt(i));
+ }
+
+ expand.execute();
+
+ }
+ //execute the standard copy release
+ if (this.getExploded().equalsIgnoreCase("false"))
+ {
+ //copy the artifact to the output directory
+ Copy copy = new Copy();
+ copy.setTaskName("copy");
+ copy.setProject(this.getProject());
+
+ if (this.getTofile() != null)
+ {
+ copy.setTofile(FileUtil.resolve(outputDir, this.getTofile()));
+ }
+ else
+ {
+ copy.setTodir(outputDir);
+ }
+ for (int i = 0; i < this.getFilesets().size(); i++)
+ {
+ copy.addFileset((FileSet) this.getFilesets().elementAt(i));
+ FileSet thisset = (FileSet) this.getFilesets().elementAt(i);
+ }
+
+ copy.execute();
+ }
+ }
+ }
+
+ }
+
+ /**
+ * Get the release.
+ *
+ * @return the release.
+ */
+ public String getRelease()
+ {
+ return release;
+ }
+
+ /**
+ * Set the release.
+ *
+ * @param release The release to set.
+ */
+ public void setRelease(String release)
+ {
+ this.release = release;
+ }
+
+ /**
+ * Get the filesets.
+ *
+ * @return the filesets.
+ */
+ public Vector getFilesets()
+ {
+ return filesets;
+ }
+
+ /**
+ * Set the filesets.
+ *
+ * @param filesets The filesets to set.
+ */
+ public void addFileset(FileSet fileset)
+ {
+ this.filesets.add(fileset);
+ }
+
+ /**
+ * Get the tofile.
+ *
+ * @return the tofile.
+ */
+ public String getTofile()
+ {
+ return tofile;
+ }
+
+ /**
+ * Set the tofile.
+ *
+ * @param tofile The tofile to set.
+ */
+ public void setTofile(String tofile)
+ {
+ this.tofile = tofile;
+ }
+
+ /**
+ * Get the exploded.
+ *
+ * @return the exploded.
+ */
+ public String getExploded()
+ {
+ return exploded;
+ }
+
+ /**
+ * Set the exploded.
+ *
+ * @param exploded The exploded to set.
+ */
+ public void setExploded(String exploded)
+ {
+ this.exploded = exploded;
+ }
+
+ /**
+ * Get the requiredJDK.
+ *
+ * @return the requiredJDK.
+ */
+ public String getRequiredJDK()
+ {
+ return requiredJDK;
+ }
+
+ /**
+ * Set the requiredJDK.
+ *
+ * @param requiredJDK The requiredJDK to set.
+ */
+ public void setRequiredJDK(String requiredJDK)
+ {
+ this.requiredJDK = requiredJDK;
+ }
+
+ /**
+ * Get the overwrite.
+ *
+ * @return the overwrite.
+ */
+ public String getOverwrite()
+ {
+ return overwrite;
+ }
+
+ /**
+ * Set the overwrite.
+ *
+ * @param overwrite The overwrite to set.
+ */
+ public void setOverwrite(String overwrite)
+ {
+ this.overwrite = overwrite;
+ }
+}
Property changes on: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/CopyRelease.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/GenerateLibrariesFile.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/GenerateLibrariesFile.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/GenerateLibrariesFile.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -77,7 +77,7 @@
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
//create a visitor to visit the graph and provide the writer it should use
- ComponentRefGraphClasspathVisitor visitor = new ComponentRefGraphClasspathVisitor( getProject() );
+ ComponentRefGraphClasspathVisitor visitor = new ComponentRefGraphClasspathVisitor(project);
visitor.setBufferedWriter(bufferedWriter);
//get the graph the visitor should visit
Added: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/GetWithSum.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/GetWithSum.java (rev 0)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/GetWithSum.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -0,0 +1,527 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ant.tasks.build;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Date;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.util.FileUtils;
+import org.apache.tools.ant.util.JavaEnvUtils;
+import org.jboss.ant.util.FileUtil;
+
+/**
+ * A replacement for ANT's default get task which instead of relying
+ * on the timestamp of a file, it uses an md5 hash.
+ *
+ * @author <a href="ruel.loehr at jboss.com">Ruel Loehr</a>
+ * @version $Revision$
+ */
+public class GetWithSum extends BuildTask
+{
+ private URL source; // required
+
+ private File dest; // required
+
+ private URL sourceMD5;
+
+ private File destMD5;
+
+ private boolean verbose = false;
+
+ private boolean useTimestamp = false; //off by default
+
+ private boolean ignoreErrors = false;
+
+ private String uname = null;
+
+ private String pword = null;
+
+ private boolean useSum = false;
+
+ private String sumType = "md5";
+
+ private boolean current = false;
+
+ private File temp = null;
+
+ /**
+ * Create a new GetWithSum.
+ */
+ public GetWithSum()
+ {
+ super();
+ }
+
+ public void execute()
+ {
+
+ if (source == null)
+ {
+ throw new BuildException("src attribute is required", getLocation());
+ }
+
+ if (dest == null)
+ {
+ throw new BuildException("dest attribute is required", getLocation());
+ }
+
+ if (dest.exists() && dest.isDirectory())
+ {
+ throw new BuildException("The specified destination is a directory", getLocation());
+ }
+
+ if (dest.exists() && !dest.canWrite())
+ {
+ throw new BuildException("Can't write to " + dest.getAbsolutePath(), getLocation());
+ }
+
+ try
+ {
+ super.log("Executing task GetWithSum", Project.MSG_VERBOSE);
+
+ sourceMD5 = new URL(source.getProtocol(), source.getHost(), source.getPort(), source.getFile() + "." + sumType);
+ destMD5 = new File(dest + "." + sumType);
+
+ super.log("The source md5 is " + sourceMD5.toString(), Project.MSG_VERBOSE);
+ super.log("The dest md5 is " + destMD5.toString(), Project.MSG_VERBOSE);
+
+ //set the timestamp to the file date.
+ long timestamp = 0;
+
+ //if the MD5 file exists locally we need to compare it to the one in
+ //in the repo, if they match, there is nothing to do, if they don't
+ //we want to refresh from the repo
+ if (destMD5.exists())
+ {
+ temp = destMD5.createTempFile("temp", null);
+
+ temp.deleteOnExit();
+
+ getRemoteFile(sourceMD5, temp);
+
+ current = compareSums(temp, destMD5);
+
+ }
+ else //if it doesn't exist, we need to get it
+ {
+ getRemoteFile(sourceMD5, destMD5);
+ }
+
+ //if the md5 is does not match what the repo has we need to
+ //update the artifact
+ if (!current)
+ {
+ //if we are dealing with a temp file e.g. the md5 already existed
+ //make it the new official md5 file
+ if (temp != null)
+ FileUtil.copy(temp, destMD5);
+
+ //get the remote artifact
+ getRemoteFile(source, dest);
+ }
+
+ }
+ catch (IOException ioe)
+ {
+ log("Error getting " + source + " to " + dest);
+ if (ignoreErrors)
+ {
+ return;
+ }
+ throw new BuildException(ioe, getLocation());
+ }
+
+ }
+
+ private boolean compareSums(File repo, File local)
+ {
+ String repoSum = parseCheckSum(FileUtil.readFile(repo));
+ String localSum = parseCheckSum(FileUtil.readFile(local));
+
+ if (repoSum.equals(localSum))
+ return true;
+ else
+ return false;
+
+ }
+
+
+ /**
+ * Parse a string and return the checksum
+ *
+ */
+ private String parseCheckSum(String sum)
+ {
+ // remove whitespaces at the end
+ sum = sum.trim();
+
+ // check for 'MD5 (name) = CHECKSUM'
+ if ( sum.startsWith( "MD5" ) )
+ {
+ int lastSpacePos = sum.lastIndexOf( ' ' );
+ sum = sum.substring( lastSpacePos + 1 );
+ }
+ else
+ {
+ // remove everything after the first space (if available)
+ int spacePos = sum.indexOf( ' ' );
+
+ if ( spacePos != -1 )
+ {
+ sum = sum.substring( 0, spacePos );
+ }
+ }
+ return sum;
+ }
+
+ /** Retrieve a remote file
+ *
+ * @throws IOException
+ * @throws FileNotFoundException
+ */
+ private void getRemoteFile(URL p_source, File p_dest) throws IOException, FileNotFoundException
+ {
+ log("Retrieving file: " + p_dest.getAbsolutePath() + " \nfrom URL: " + p_source.getProtocol() +
+ "://" + p_source.getHost() + p_source.getPath() + p_source.getFile());
+
+ //set up the URL connection
+ URLConnection connection = p_source.openConnection();
+
+ // prepare Java 1.1 style credentials
+ if (uname != null || pword != null)
+ {
+ String up = uname + ":" + pword;
+ String encoding;
+ // check to see if sun's Base64 encoder is available.
+ try
+ {
+ Object encoder = Class.forName("sun.misc.BASE64Encoder").newInstance();
+ encoding = (String) encoder.getClass().getMethod("encode", new Class[]
+ {byte[].class}).invoke(encoder, new Object[]
+ {up.getBytes()});
+
+ }
+ catch (Exception ex)
+ { // sun's base64 encoder isn't available
+ Base64Converter encoder = new Base64Converter();
+ encoding = encoder.encode(up.getBytes());
+ }
+ connection.setRequestProperty("Authorization", "Basic " + encoding);
+ }
+
+ //connect to the remote site (may take some time)
+ connection.connect();
+ //next test for a 304 result (HTTP only)
+ if (connection instanceof HttpURLConnection)
+ {
+ HttpURLConnection httpConnection = (HttpURLConnection) connection;
+ if (httpConnection.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED)
+ {
+ //not modified so no file download. just return
+ //instead and trace out something so the user
+ //doesn't think that the download happened when it
+ //didn't
+ log("Not modified - so not downloaded");
+ return;
+ }
+ // test for 401 result (HTTP only)
+ if (httpConnection.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED)
+ {
+ String message = "HTTP Authorization failure";
+ if (ignoreErrors)
+ {
+ log(message, Project.MSG_WARN);
+ return;
+ }
+ else
+ {
+ throw new BuildException(message);
+ }
+ }
+
+ }
+
+ //REVISIT: at this point even non HTTP connections may
+ //support the if-modified-since behaviour -we just check
+ //the date of the content and skip the write if it is not
+ //newer. Some protocols (FTP) don't include dates, of
+ //course.
+
+ InputStream is = null;
+ for (int i = 0; i < 3; i++)
+ {
+ try
+ {
+ is = connection.getInputStream();
+ break;
+ }
+ catch (IOException ex)
+ {
+ log("Error opening connection " + ex);
+ }
+ }
+ if (is == null)
+ {
+ log("Can't get " + p_source + " to " + p_dest);
+ if (ignoreErrors)
+ {
+ return;
+ }
+ throw new BuildException("Can't get " + p_source + " to " + p_dest, getLocation());
+ }
+
+ FileOutputStream fos = new FileOutputStream(p_dest);
+ boolean finished = false;
+ try
+ {
+ byte[] buffer = new byte[100 * 1024];
+ int length;
+ int dots = 0;
+
+ while ((length = is.read(buffer)) >= 0)
+ {
+ fos.write(buffer, 0, length);
+ if (verbose)
+ {
+ System.out.print(".");
+ if (dots++ > 50)
+ {
+ System.out.flush();
+ dots = 0;
+ }
+ }
+ }
+ if (verbose)
+ {
+ System.out.println();
+ }
+ finished = true;
+ }
+ finally
+ {
+ if (fos != null)
+ {
+ fos.close();
+ }
+ is.close();
+ // we have started to (over)write dest, but failed.
+ // Try to delete the garbage we'd otherwise leave
+ // behind.
+ if (!finished)
+ {
+ p_dest.delete();
+ }
+ }
+
+ //if (and only if) the use file time option is set, then
+ //the saved file now has its timestamp set to that of the
+ //downloaded file
+ if (useTimestamp)
+ {
+ long remoteTimestamp = connection.getLastModified();
+ if (verbose)
+ {
+ Date t = new Date(remoteTimestamp);
+ log("last modified = " + t.toString() + ((remoteTimestamp == 0) ? " - using current time instead" : ""));
+ }
+ if (remoteTimestamp != 0)
+ {
+ FileUtils.newFileUtils().setFileLastModified(p_dest, remoteTimestamp);
+ }
+ }
+
+ }
+
+ /**
+ * Set the URL to get.
+ *
+ * @param u URL for the file.
+ */
+ public void setSrc(URL u)
+ {
+ this.source = u;
+ }
+
+ /**
+ * Where to copy the source file.
+ *
+ * @param dest Path to file.
+ */
+ public void setDest(File dest)
+ {
+ this.dest = dest;
+ }
+
+ /**
+ * If true, show verbose progress information.
+ *
+ * @param v if "true" then be verbose
+ */
+ public void setVerbose(boolean v)
+ {
+ verbose = v;
+ }
+
+ /**
+ * If true, log errors but do not treat as fatal.
+ *
+ * @param v if "true" then don't report download errors up to ant
+ */
+ public void setIgnoreErrors(boolean v)
+ {
+ ignoreErrors = v;
+ }
+
+ /**
+ * If true, conditionally download a file based on the timestamp
+ * of the local copy.
+ *
+ * <p>In this situation, the if-modified-since header is set so
+ * that the file is only fetched if it is newer than the local
+ * file (or there is no local file) This flag is only valid on
+ * HTTP connections, it is ignored in other cases. When the flag
+ * is set, the local copy of the downloaded file will also have
+ * its timestamp set to the remote file time.</p>
+ *
+ * <p>Note that remote files of date 1/1/1970 (GMT) are treated as
+ * 'no timestamp', and web servers often serve files with a
+ * timestamp in the future by replacing their timestamp with that
+ * of the current time. Also, inter-computer clock differences can
+ * cause no end of grief.</p>
+ * @param v "true" to enable file time fetching
+ */
+ public void setUseTimestamp(boolean v)
+ {
+ if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1))
+ {
+ useTimestamp = v;
+ }
+ }
+
+ /**
+ * Username for basic auth.
+ *
+ * @param u username for authentication
+ */
+ public void setUsername(String u)
+ {
+ this.uname = u;
+ }
+
+ /**
+ * password for the basic authentication.
+ *
+ * @param p password for authentication
+ */
+ public void setPassword(String p)
+ {
+ this.pword = p;
+ }
+
+ /*********************************************************************
+ * BASE 64 encoding of a String or an array of bytes.
+ *
+ * Based on RFC 1421.
+ *
+ *********************************************************************/
+
+ private static class Base64Converter
+ {
+
+ public final char[] alphabet =
+ {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 0 to 7
+ 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 8 to 15
+ 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 16 to 23
+ 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', // 24 to 31
+ 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', // 32 to 39
+ 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', // 40 to 47
+ 'w', 'x', 'y', 'z', '0', '1', '2', '3', // 48 to 55
+ '4', '5', '6', '7', '8', '9', '+', '/'}; // 56 to 63
+
+ public String encode(String s)
+ {
+ return encode(s.getBytes());
+ }
+
+ public String encode(byte[] octetString)
+ {
+ int bits24;
+ int bits6;
+
+ char[] out = new char[((octetString.length - 1) / 3 + 1) * 4];
+
+ int outIndex = 0;
+ int i = 0;
+
+ while ((i + 3) <= octetString.length)
+ {
+ // store the octets
+ bits24 = (octetString[i++] & 0xFF) << 16;
+ bits24 |= (octetString[i++] & 0xFF) << 8;
+
+ bits6 = (bits24 & 0x00FC0000) >> 18;
+ out[outIndex++] = alphabet[bits6];
+ bits6 = (bits24 & 0x0003F000) >> 12;
+ out[outIndex++] = alphabet[bits6];
+ bits6 = (bits24 & 0x00000FC0) >> 6;
+ out[outIndex++] = alphabet[bits6];
+ bits6 = (bits24 & 0x0000003F);
+ out[outIndex++] = alphabet[bits6];
+ }
+
+ if (octetString.length - i == 2)
+ {
+ // store the octets
+ bits24 = (octetString[i] & 0xFF) << 16;
+ bits24 |= (octetString[i + 1] & 0xFF) << 8;
+ bits6 = (bits24 & 0x00FC0000) >> 18;
+ out[outIndex++] = alphabet[bits6];
+ bits6 = (bits24 & 0x0003F000) >> 12;
+ out[outIndex++] = alphabet[bits6];
+ bits6 = (bits24 & 0x00000FC0) >> 6;
+ out[outIndex++] = alphabet[bits6];
+
+ // padding
+ out[outIndex++] = '=';
+ }
+ else if (octetString.length - i == 1)
+ {
+ // store the octets
+ bits24 = (octetString[i] & 0xFF) << 16;
+ bits6 = (bits24 & 0x00FC0000) >> 18;
+ out[outIndex++] = alphabet[bits6];
+ bits6 = (bits24 & 0x0003F000) >> 12;
+ out[outIndex++] = alphabet[bits6];
+
+ // padding
+ out[outIndex++] = '=';
+ out[outIndex++] = '=';
+ }
+
+ return new String(out);
+ }
+ }
+
+ /**
+ * Set the useSum.
+ *
+ * @param useSum The useSum to set.
+ */
+ public void setUseSum(boolean useSum)
+ {
+ this.useSum = useSum;
+ }
+}
Property changes on: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/GetWithSum.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/RMICHelper.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/RMICHelper.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/RMICHelper.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -52,6 +52,8 @@
/** The nested classpath element*/
private Path classpath;
+
+ private String stubversion;
public RMICHelper()
{
@@ -98,7 +100,7 @@
rmic.setBase(new File(this.getBase()));
this.getProject().log("Base: " + this.getBase(), Project.MSG_DEBUG);
-
+
rmic.execute();
}
@@ -126,6 +128,9 @@
this.getProject().log("Base: " + this.getBase(), Project.MSG_DEBUG);
rmic.setBase(new File(this.getBase()));
+
+ this.getProject().log("Stubversion: " + this.getStubversion(), Project.MSG_DEBUG);
+ rmic.setStubVersion(this.getStubversion());
rmic.execute();
@@ -363,4 +368,22 @@
createClasspath().setRefid(ref);
}
+ /**
+ * Get the stubversion.
+ *
+ * @return the stubversion.
+ */
+ public String getStubversion()
+ {
+ return stubversion;
+ }
+ /**
+ * Set the stubversion.
+ *
+ * @param stubversion The stubversion to set.
+ */
+ public void setStubversion(String stubversion)
+ {
+ this.stubversion = stubversion;
+ }
}
Added: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/ReleaseDeploymentsTask.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/ReleaseDeploymentsTask.java (rev 0)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/ReleaseDeploymentsTask.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -0,0 +1,242 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ant.tasks.build;
+
+import java.io.File;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.taskdefs.Copy;
+import org.apache.tools.ant.taskdefs.Expand;
+import org.apache.tools.ant.taskdefs.Mkdir;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.util.JavaEnvUtils;
+import org.jboss.ant.types.build.Artifact;
+import org.jboss.ant.types.deployment.Deployment;
+import org.jboss.ant.types.deployment.DeploymentType;
+import org.jboss.ant.types.deployment.Profile;
+import org.jboss.ant.util.FileUtil;
+
+/**
+ * A Task which releases items to the appropriate locations.
+ *
+ * @author <a href="ruel.loehr at jboss.com">Ruel Loehr</a>
+ * @version $Revision$
+ */
+public class ReleaseDeploymentsTask extends BuildTask
+{
+
+ /**
+ * Create a new ReleaseDeploymentsTask.
+ *
+ *
+ */
+ public ReleaseDeploymentsTask()
+ {
+ super();
+ }
+
+ /**
+ * Execute the task
+ */
+ public void execute()
+ {
+ this.setTaskName("ReleaseDeploymentsTask");
+
+ if (log.isTraceEnabled())
+ log.trace("Executing: " + this.getTaskName());
+
+ if (this.getBuildInstance() != null)
+ {
+ //for every profile in the build
+ for (int i = 0; i < this.getBuildInstance().getProfiles().size(); i++)
+ {
+ Profile currentDeploymentProfile = (Profile) this.getBuildInstance().getProfiles().elementAt(i);
+
+ if (log.isTraceEnabled())
+ log.trace("Deploying Profile with id: " + currentDeploymentProfile.getId());
+
+ deployProfile(currentDeploymentProfile);
+ }
+
+ }
+ else
+ {
+ throw new BuildException("Build instance is null, unable to complete " + this.getTaskName());
+ }
+ }
+
+ /** Deploy a profile
+ *
+ * @param profile
+ */
+ private void deployProfile(Profile profile)
+ {
+ File outputDir = FileUtil.resolve(this.getBuildInstance().getReleaseDir(), profile.getOutputPath());
+
+ //deploy all deployments in a profile
+ for (int j = 0; j < profile.getDeployments().size(); j++)
+ {
+ Deployment currentDeployment = (Deployment) profile.getDeployments().elementAt(j);
+
+ if (log.isTraceEnabled())
+ log.trace("Deploying deployment with artifact: " + currentDeployment.getArtifactId());
+
+ deployDeployment(currentDeployment, outputDir);
+
+ }
+
+ //deploy all deployment types
+ for (int j = 0; j < profile.getDeploymentTypes().size(); j++)
+ {
+ DeploymentType currentDeploymentType = (DeploymentType) profile.getDeploymentTypes()
+ .elementAt(j);
+
+ deployDeploymentType(currentDeploymentType, outputDir);
+
+ }
+
+ }
+
+
+ /** Deploy a deploymentType to a given output directory
+ *
+ * @param deploymentType
+ * @param outputDir
+ */
+ private void deployDeploymentType(DeploymentType deploymentType, File outputDir)
+ {
+ //release these files only if the the jdkVersion matches
+ String version = JavaEnvUtils.getJavaVersion();
+
+ if ((!version.equalsIgnoreCase(deploymentType.getRequiredJDK()))
+ && (!deploymentType.getRequiredJDK().equalsIgnoreCase("default")))
+ return;
+
+ File typeOutputDir = FileUtil.resolve(outputDir, deploymentType.getType());
+
+
+ if (log.isTraceEnabled())
+ log.trace("Deploying deployment type: " + deploymentType.getType() + " to location " + outputDir.getAbsolutePath());
+
+ //deploy every deployment listed in the deployment type
+ for (int k = 0; k < deploymentType.getDeployments().size(); k++)
+ {
+ Deployment currentDeployment = (Deployment) deploymentType.getDeployments()
+ .elementAt(k);
+
+ if (log.isTraceEnabled())
+ log.trace("Deploying deployment with artifact: " + currentDeployment.getArtifactId());
+
+ deployDeployment(currentDeployment, typeOutputDir);
+ }
+
+
+ //deploy any additional deployment types
+ for (int j = 0; j < deploymentType.getDeploymentTypes().size(); j++)
+ {
+ DeploymentType currentDeploymentType = (DeploymentType) deploymentType.getDeploymentTypes().elementAt(j);
+
+ deployDeploymentType(currentDeploymentType, typeOutputDir);
+
+ }
+
+ }
+
+ /** Deploy a deployment to the given output location
+ *
+ * @param deployment
+ * @param outputDir
+ */
+ private void deployDeployment(Deployment deployment, File outputDir)
+ {
+
+ Artifact artifact = deployment.getArtifact();
+
+ if (artifact==null)
+ throw new BuildException("Unable to resolve artifact with id: " +
+ deployment.getArtifactId() + " while deploying");
+
+ //release these files only if the the jdkVersion is match
+ String version = JavaEnvUtils.getJavaVersion();
+
+ if ((version.equalsIgnoreCase(deployment.getRequiredJDK()))
+ || (deployment.getRequiredJDK().equalsIgnoreCase("default")))
+ {
+
+ //create the output directory
+ Mkdir mkdir = new Mkdir();
+ mkdir.setTaskName("mkdir");
+ mkdir.setProject(this.getProject());
+ mkdir.setDir(outputDir);
+ mkdir.execute();
+
+ //execute the exploded release
+ if (deployment.getExploded().equalsIgnoreCase("true"))
+ {
+ //copy the artifact to the output directory
+ Expand expand = new Expand();
+ expand.setTaskName("unzip");
+ expand.setProject(this.getProject());
+ expand.setDest(outputDir);
+ expand.setSrc(artifact.getOutput());
+ if (deployment.getOverwrite() != null)
+ {
+ if (deployment.getOverwrite().equalsIgnoreCase("true"))
+ expand.setOverwrite(true);
+ else
+ expand.setOverwrite(false);
+ }
+ expand.execute();
+
+ }
+ //execute the standard copy release
+ if (deployment.getExploded().equalsIgnoreCase("false"))
+ {
+ //copy the artifact to the output directory
+ Copy copy = new Copy();
+ copy.setTaskName("copy");
+ copy.setProject(this.getProject());
+ copy.setVerbose(true);
+
+ //if we are copying a directory insert a fileset to perfrom the copy
+ if (artifact.getArtifactType().type.equalsIgnoreCase("dir"))
+ {
+ FileSet f = new FileSet();
+ f.setDir(artifact.getOutput());
+ copy.addFileset(f);
+ if (deployment.getToName() != null)
+ {
+ copy.setTodir(FileUtil.resolve(outputDir, deployment.getToName()));
+ }
+ else
+ {
+ copy.setTodir(FileUtil.resolve(outputDir, artifact.getId()));
+ }
+
+ }
+ else //we are just copying a single file
+ {
+ copy.setFile(artifact.getOutput());
+ if (deployment.getToName() != null)
+ {
+ File renameFile = FileUtil.resolve(this.getBuildInstance().getReleaseDir(), deployment.getOutputPath());
+ renameFile = FileUtil.resolve(renameFile, deployment.getToName());
+ copy.setTofile(renameFile);
+ }
+ else
+ {
+ copy.setTofile(FileUtil.resolve(outputDir, artifact.getId()));
+ }
+ }
+ copy.execute();
+ }
+
+ }
+
+ }
+
+}
Property changes on: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/ReleaseDeploymentsTask.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/ResolveComponentRefsTask.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/ResolveComponentRefsTask.java (rev 0)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/ResolveComponentRefsTask.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -0,0 +1,394 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ant.tasks.build;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.SortedSet;
+import java.util.Vector;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.jboss.ant.types.Compatible;
+import org.jboss.ant.types.ComponentRef;
+import org.jboss.ant.types.Import;
+import org.jboss.ant.types.attributes.Version;
+import org.jboss.ant.types.build.Build;
+import org.jboss.ant.types.build.Component;
+import org.jboss.ant.util.DownloadUtil;
+import org.jboss.ant.util.FileUtil;
+import org.jboss.ant.util.ImportUtil;
+import org.jboss.ant.util.graph.ComponentRefGraphChildResolverVistor;
+import org.jboss.ant.util.graph.ComponentRefGraphComponentInfoResolverVisitor;
+import org.jboss.ant.util.graph.ComponentRefGraphFileResolverVisitor;
+import org.jboss.ant.util.graph.ComponentRefVertex;
+import org.jboss.ant.util.graph.Graph;
+import org.jboss.ant.util.graph.RootVertex;
+import org.jboss.ant.util.graph.Vertex;
+
+/**
+ * Task resolve component references
+ *
+ * @author <a href="ruel.loehr at jboss.com">Ruel Loehr </a>
+ * @version $Revision$
+ */
+public class ResolveComponentRefsTask extends BuildTask
+{
+
+ /**
+ * A task to resolves a list of component references to components
+ */
+
+ /** The build */
+ private String build;
+
+ public ResolveComponentRefsTask()
+ {
+ }
+
+ /**
+ * Synchronize all necessary third party dependencies
+ */
+ public void execute() throws BuildException
+ {
+ if (this.getBuildInstance().getGraph() == null)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Executing task ResolveComponentRefsTask");
+
+ this.setTaskName("ResolveComponentRefsTask");
+
+ //create a new graph to hold dependency information
+ Graph componentRefGraph = createInitialGraph();
+
+ //create a file resolver visitor used to visit the graph
+ ComponentRefGraphComponentInfoResolverVisitor componentInfoResolverVisitor = new ComponentRefGraphComponentInfoResolverVisitor();
+
+ //create a child expander visitor used to visit the graph
+ ComponentRefGraphChildResolverVistor childResolverVisitor = new ComponentRefGraphChildResolverVistor();
+
+ //traverse the graph and attempt to resolve all dependencies
+ resolveDependencies(componentRefGraph, componentInfoResolverVisitor, childResolverVisitor);
+
+ //store the graph in the build for later use
+ this.getBuildInstance().setGraph(componentRefGraph);
+ }
+ }
+
+ /**
+ * Traverse a graph and resolve the component
+ * dependencies found at each vertex
+ * @param componentGraph the graph to traverse
+ * @param fileResolver the visitor which visits the graph and determines if files have been downloaded
+ * @param childResolver the visitor which visits the graph and determines if vertexes are fully resolved
+ */
+ private void resolveDependencies(Graph componentGraph, ComponentRefGraphComponentInfoResolverVisitor fileResolver,
+ ComponentRefGraphChildResolverVistor childResolver) throws BuildException
+ {
+ if (log.isTraceEnabled())
+ log.trace("Resolving componentRefs");
+
+ do
+ {
+ //clear the unresolved components list
+ fileResolver.getUnresolvedComponents().clear();
+ childResolver.getUnexpandedVertexes().clear();
+
+ //clear the markings of the graph vertexes
+ componentGraph.clearMark();
+
+ //visit the tree and compile a list of any unresolved files
+ componentGraph.breadthFirstSearch(componentGraph.getVertex(0), fileResolver);
+
+ //download any unresolved items
+ downloadDependencies(fileResolver.getUnresolvedComponents());
+
+ //clear the markings of the graph vertexes-must clear before new traversal
+ componentGraph.clearMark();
+
+ //visit the tree and compile list of any unresolved nodes
+ componentGraph.breadthFirstSearch(componentGraph.getVertex(0), childResolver);
+
+ //import any unresolved componenents
+ importComponents(childResolver.getUnexpandedVertexes(), componentGraph);
+
+ }
+ while ((fileResolver.getUnresolvedComponents().size() != 0)
+ || (childResolver.getUnexpandedVertexes().size() != 0));
+
+ componentGraph.clearMark();
+ }
+
+ /** Import a a list of files which contain component information
+ *
+ * @param unexpandedVertexes the visitor which has determined the files to be imported
+ * @param graph the component reference graph
+ */
+ private void importComponents(Vector unexpandedVertexes, Graph graph) throws BuildException
+ {
+ if (log.isTraceEnabled())
+ log.trace("importComponents, unexpandedVertexes: " + unexpandedVertexes);
+
+ Project project = (Project) this.getProject();
+ //for each vertex has that has not been resolved
+ for (int i = 0; i < unexpandedVertexes.size(); i++)
+ {
+ //get the vertex and component reference information
+ ComponentRefVertex currentComponentVertex = (ComponentRefVertex) unexpandedVertexes.elementAt(i);
+ ComponentRef currentComponentRef = currentComponentVertex.getComponentRef();
+ if (log.isTraceEnabled())
+ log.trace("[" + i + "]: " + currentComponentRef.getName());
+
+ //check if a component already exists for this component ref in the ant project
+ Component newComponent = (Component) project.getReference(currentComponentRef.getName());
+
+ //if it does not, import the file for the component ref
+ if (newComponent == null)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Component with name " + currentComponentRef.getName()
+ + " does not exist in project, will import the component-info file");
+
+ //import the file which describes the component information
+ //this information is stored in the ant project hashtable
+ ImportUtil.importFile(currentComponentRef.getComponentFile(), project);
+
+ //get the component which we just imported from ant's hashtable
+ newComponent = (Component) project.getReference(currentComponentRef.getName());
+
+ if (log.isTraceEnabled())
+ log.trace("Successfully imported component " + newComponent);
+
+ if (newComponent == null)
+ throw new BuildException("Failed to retrieve the component: " + currentComponentRef.getName()
+ + " from the ANT hashtable");
+ }
+ else
+ {
+ if (log.isTraceEnabled())
+ log.trace("Component with name " + currentComponentRef.getName()
+ + " already exsists in the project, will compare it to componentRef " + newComponent);
+
+ //the component already exists as part of the project, it is a dependency for something else
+ //make sure the version of the exising component is agreeable with the current definition
+ if (log.isTraceEnabled())
+ log.trace("Creating a new version from string: " + newComponent.getVersion().toString()
+ + " . This version will be placed in a compatible.");
+
+ Version newVersion = newComponent.getVersion();
+ Compatible newVersionInfo = new Compatible(newVersion);
+ SortedSet oldVersions = currentComponentRef.getCompatibleVersions();
+ if (oldVersions != null && oldVersions.contains(newVersionInfo) == false)
+ {
+ String newCompID = newComponent.getId();
+ String importCompID = currentComponentRef.getImportingComponent().getId();
+ throw new BuildException("A versioning problem exists:\n" + "Component: " + newCompID
+ + " is at version: " + newVersion + "\n but it is also required to be compatible with: "
+ + oldVersions + "\n by: " + importCompID);
+ }
+ }
+
+ //determine if this component is already present in the build,
+ //if it is not, then add it to build's component list
+ if (!this.getBuildInstance().componentExists(newComponent))
+ {
+ newComponent.setExecutable(currentComponentRef.getExecutable());
+ this.getBuildInstance().addComponent(newComponent);
+ }
+
+ //add the component to the current component reference
+ currentComponentRef.setComponent(newComponent);
+
+ //for each import defined in the component, we will add a child node to the graph
+ //(an import == a component reference)
+ for (int j = 0; j < newComponent.getImports().size(); j++)
+ {
+ Import currentImport = (Import) newComponent.getImports().elementAt(j);
+
+ ComponentRef newComponentRef = new ComponentRef(currentImport);
+ newComponentRef.setProject(project);
+ newComponentRef.setName(currentImport.getComponentRef());
+
+ //each import describes a list of versions it is compatible with
+ SortedSet compatibles = currentImport.getCompatibleVersions();
+ //TODO figure out how compatibles is going to work
+
+ newComponentRef.setCompatibleVersions(compatibles);
+
+ //add this new component reference to the build
+ this.getBuildInstance().addComponentRef(newComponentRef);
+
+ //now adjust the graph to reflect the addition of a new component reference
+ ComponentRefVertex newComponentVertex = new ComponentRefVertex(newComponentRef.getId());
+ newComponentVertex.setComponentRef(newComponentRef);
+ graph.addVertex(newComponentVertex);
+ graph.addEdge(currentComponentVertex, newComponentVertex, 0);
+
+ }
+
+ }
+
+ }
+
+ /** Create the proper directory structure and download
+ * component description files from the repository
+ *
+ * @param unresolvedComponents
+ */
+ private void downloadDependencies(Vector unresolvedComponents)
+ {
+ //for each component in the list
+ for (int i = 0; i < unresolvedComponents.size(); i++)
+ {
+ //get the component ref information
+ ComponentRefVertex currentComponentVertex = (ComponentRefVertex) unresolvedComponents.elementAt(i);
+ ComponentRef currentComponentRef = currentComponentVertex.getComponentRef();
+ File filename;
+
+ //if the component-info file already exists, mark it as resolved otherwise, get it from the repos
+ if (componentInfoExists(currentComponentRef))
+ {
+ if (log.isTraceEnabled())
+ log.trace("Component-info.xml for component ref: " + currentComponentRef.getName() + " already exists in file system. ");
+
+ currentComponentRef.setFileResolved(true);
+ }
+ else
+ {
+ if (log.isTraceEnabled())
+ log.trace("Attempting to retrieve a component-info.xml from repository file for componentRef with name "
+ + currentComponentRef.getName());
+
+ createComponentInfoDir(currentComponentRef);
+
+ //attempt to retrieve the component information from the repository
+ URL repositoryFile = null;
+
+ try
+ {
+ repositoryFile = FileUtil.resolve(currentComponentRef.getLocation(), currentComponentRef.getFilename());
+ }
+ catch (MalformedURLException e)
+ {
+ throw (new BuildException(repositoryFile.getProtocol() + "://" + repositoryFile.getHost() + "/"
+ + repositoryFile.getPath() + "/" + repositoryFile.getFile(), e));
+ }
+
+ //download the file from the repository
+ File downloadedFile = DownloadUtil.getFile(currentComponentRef.getComponentFile(), repositoryFile, this.getProject());
+ currentComponentRef.setFileResolved(true);
+ }
+ }
+
+ }
+
+ private boolean componentInfoExists(ComponentRef componentRef)
+ {
+ File filename;
+
+ if (!componentRef.isLocal())
+ filename = FileUtil.resolve(componentRef.getThirdpartyDir(), componentRef.getFilename());
+ else
+ filename = FileUtil.resolve(componentRef.getDir(), componentRef.getFilename());
+
+ if (filename.exists())
+ return true;
+ else
+ return false;
+ }
+
+ private void createComponentInfoDir(ComponentRef componentRef)
+ {
+ File dir;
+
+ if (!componentRef.isLocal())
+ {
+ dir = componentRef.getThirdpartyDir();
+ }
+ else
+ {
+ dir = componentRef.getDir();
+ }
+
+ //create the directory structure if necessary
+ if (!dir.exists())
+ {
+ if (log.isTraceEnabled())
+ log.trace("Directory: " + dir.getAbsolutePath() + " does not exist. Creating...");
+
+ FileUtil.mkdir(dir, this.getProject());
+
+ }
+
+ }
+
+ /**Display the current list of unresolvedDependencies that a visitor has
+ *
+ * @param visitor
+ */
+ private void viewUnresolvedDependencies(ComponentRefGraphFileResolverVisitor visitor)
+ {
+ System.out.println("Currently the following components are unresolved:");
+ for (int i = 0; i < visitor.getUnresolvedComponents().size(); i++)
+ {
+ Component unresolvedComponent = (Component) visitor.getUnresolvedComponents().elementAt(i);
+
+ System.out.println(unresolvedComponent.getId());
+ }
+ }
+
+ /**
+ * Constructs a graph based upon the components contained
+ * in the build entity with a root vertex.
+ *
+ */
+ private Graph createInitialGraph()
+ {
+ Graph componentRefGraph = new Graph();
+
+ //create a root vertex
+ Vertex root = new RootVertex("ROOT");
+
+ //add it to the empty graph
+ componentRefGraph.addVertex(root);
+
+ Build mainBuild = getBuildInstance();
+
+ //add each component defined in the main build
+ for (int i = 0; i < mainBuild.getComponentRefs().size(); i++)
+ {
+ //look at the current component
+ ComponentRef currentComponentRef = (ComponentRef) mainBuild.getComponentRefs().elementAt(i);
+
+ //store in a vertex
+ ComponentRefVertex componentRefVertex = new ComponentRefVertex(currentComponentRef.getName());
+ componentRefVertex.setComponentRef(currentComponentRef);
+
+ //add the vertex to the graph
+ componentRefGraph.addVertex(componentRefVertex);
+ componentRefGraph.addEdge(root, componentRefVertex, 1);
+
+ }
+ return (componentRefGraph);
+ }
+
+ /**
+ * Create a visitor and associate it with the current
+ * ANT project
+ *
+ * @return the visitor
+ */
+ private ComponentRefGraphFileResolverVisitor createVisitor()
+ {
+ //create a visitor to the graph
+ ComponentRefGraphFileResolverVisitor visitor = new ComponentRefGraphFileResolverVisitor();
+
+ return visitor;
+ }
+
+}
Property changes on: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/ResolveComponentRefsTask.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/SynchronizeComponentsTask.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/SynchronizeComponentsTask.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/tasks/build/SynchronizeComponentsTask.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -103,7 +103,7 @@
//clear the markings of the graph vertexes-must clear before new traversal
componentGraph.clearMark();
- //visit the tree and compile list of any unresolved nodes
+ //visit the tree and compile list of any nodes which have not yet had a component created for them
componentGraph.breadthFirstSearch(componentGraph.getVertex(0), childResolver);
//import any unresolved componenents
@@ -165,19 +165,27 @@
//make sure the version of the exising component is agreeable with the current definition
super.log("Creating a new version from string: " + newComponent.getVersion().toString() +
" . This version will be placed in a compatible.", Project.MSG_VERBOSE);
-
+
Version newVersion = newComponent.getVersion();
Compatible newVersionInfo = new Compatible(newVersion);
SortedSet oldVersions = currentComponentRef.getCompatibleVersions();
if ( oldVersions != null && oldVersions.contains(newVersionInfo) == false )
{
- String newCompID = newComponent.getId();
- String importCompID = currentComponentRef.getImportingComponent().getId();
- throw new BuildException("A versioning problem exists:\n"
- + "Component: " + newCompID
- + " is at version: " + newVersion
- + "\n but it is also required to be compatible with: " + oldVersions
- + "\n by: "+importCompID);
+ //if the component is a snapshot, we assume that it is compatible
+ if (!newVersionInfo.getVersion().toString().equalsIgnoreCase("snapshot"))
+ {
+ String newCompID = newComponent.getId();
+ String importCompID = currentComponentRef.getImportingComponent().getId();
+
+ if (project.getProperty("disableVersionCheck") ==null)
+ {
+ throw new BuildException("A versioning problem exists:\n"
+ + "Component: " + newCompID
+ + " is at version: " + newVersion
+ + "\n but it is also required to be compatible with: " + oldVersions
+ + "\n by: "+importCompID);
+ }
+ }
}
}
@@ -239,7 +247,7 @@
//get the component ref information
ComponentRefVertex currentComponentVertex = (ComponentRefVertex) unresolvedComponents.elementAt(i);
ComponentRef currentComponentRef = currentComponentVertex.getComponentRef();
-
+
//get the local directory the the file should be found in
File filename = FileUtil.resolve(currentComponentRef.getThirdpartyDir(), currentComponentRef.getFilename());
File thirdpartyVersionedDir = currentComponentRef.getThirdpartyDir();
@@ -256,7 +264,7 @@
try
{
- repositoryFile = FileUtil.resolve(currentComponentRef.getLocationURL(), currentComponentRef.getFilename());
+ repositoryFile = FileUtil.resolve(currentComponentRef.getLocation(), currentComponentRef.getFilename());
}
catch (MalformedURLException e)
{
@@ -265,9 +273,36 @@
}
//download the file from the repository
- File downloadedFile = DownloadUtil.getFile(filename, repositoryFile, this.getProject());
- currentComponentRef.setFileResolved(true);
+ //if the component ref is a compatibility
+ if (currentComponentRef.getCompatibleVersions() != null)
+ {
+ if (!currentComponentRef.getCompatibleVersions().isEmpty() && filename.exists())
+ {
+ super.log("We are attempting to download dependencies, for a compatible. A component-info.xml " +
+ "already exists for this item " +
+ "We will not download this file",
+ Project.MSG_DEBUG);
+ currentComponentRef.setFileResolved(true);
+ }
+ else
+ {
+ if (!currentComponentRef.getCompatibleVersions().isEmpty() && !filename.exists())
+ {
+ super.log("We are attempting to download dependencies, for a compatible. A component-info.xml " +
+ "does not yet exist for this item ",
+ Project.MSG_DEBUG);
+ File downloadedFile = DownloadUtil.getFile(filename, repositoryFile, this.getProject());
+ currentComponentRef.setFileResolved(true);
+
+ }
+ }
+ }
+ else
+ {
+ File downloadedFile = DownloadUtil.getFile(filename, repositoryFile, this.getProject());
+ currentComponentRef.setFileResolved(true);
+ }
}
}
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/AbstractDataType.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/AbstractDataType.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/AbstractDataType.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -72,9 +72,7 @@
public void setId(String id)
{
this.id = id;
-
- if (log.isTraceEnabled())
- log.trace("Set id: " + id);
+
}
/**
@@ -179,7 +177,7 @@
throw new BuildException(context + " not set for " + toShortString());
Object object = getProject().getReference(refid);
if (object == null)
- throw new BuildException(context + " not found for " + toShortString());
+ throw new BuildException(context + " not found for " + toShortString() + " with refid " + refid);
if (clazz.isInstance(object) == false)
throw new BuildException(refid + " for " + context + " is not the correct type " + object.getClass().getName());
return (AbstractDataType) object;
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/Compatible.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/Compatible.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/Compatible.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -54,7 +54,8 @@
*/
public void setVersion(Version version)
{
- System.err.println("setVersion, version="+version);
+ if (log.isTraceEnabled())
+ log.trace("setVersion, version="+version);
this.version = version;
}
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/ComponentRef.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/ComponentRef.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/ComponentRef.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -10,10 +10,12 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.SortedSet;
+import java.util.Vector;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.jboss.ant.types.attributes.Version;
+import org.jboss.ant.types.build.Artifact;
import org.jboss.ant.types.build.Build;
import org.jboss.ant.types.build.Component;
import org.jboss.ant.util.FileUtil;
@@ -45,6 +47,9 @@
/** The version **/
private Version version;
+
+ /** the module name **/
+ private String module;
/** SortedSet<Compatible> for the versions that can be used */
private SortedSet compatibles;
@@ -58,7 +63,14 @@
/** The importing component */
private Component importingComponent;
+ /** The fileResolved */
private boolean fileResolved;
+
+ /** The componentInfo */
+ private File componentInfo;
+
+ /** The executable */
+ private boolean executable=true;
/**
* Create a new ComponentRef.
@@ -127,7 +139,10 @@
*/
public File getComponentFile()
{
- return FileUtil.resolve(getThirdpartyDir(), getComponentFilename());
+ if (isLocal())
+ return FileUtil.resolve(getDir(), getComponentFilename());
+ else
+ return FileUtil.resolve(getThirdpartyDir(), getComponentFilename());
}
/** get the filename of the file which describes a component
@@ -138,6 +153,11 @@
{
return this.filename;
}
+
+ private File getComponentInfo()
+ {
+ return FileUtil.resolve(this.getDir(), this.filename);
+ }
protected void doValidate()
{
@@ -162,7 +182,7 @@
* @return
* @throws MalformedURLException
*/
- public URL getLocationURL() throws MalformedURLException
+ public URL getLocation() throws MalformedURLException
{
URL locationURL = null;
if (location != null)
@@ -171,7 +191,7 @@
}
else
{
- locationURL = build.getLocationURL();
+ locationURL = build.getLocation();
}
URL componentLocation = FileUtil.resolve(locationURL, getName());
@@ -204,9 +224,9 @@
*/
public void setVersion(String version)
{
- this.getBuild().getProject().log(
- "Creating a new version from string: '" + version + "' for componentRef with name: " + getName(),
- Project.MSG_DEBUG);
+ if (log.isTraceEnabled())
+ log.trace("Creating a new version from string: '" + version + "' for componentRef with name: " + getName());
+
this.version = new Version(version);
}
@@ -373,5 +393,85 @@
sb.append('}');
return sb.toString();
}
-
+
+ /**
+ * Get the module.
+ *
+ * @return the module.
+ */
+ public String getModule()
+ {
+ return module;
+ }
+ /**
+ * Set the module.
+ *
+ * @param module The module to set.
+ */
+ public void setModule(String module)
+ {
+ this.module = module;
+ }
+
+ /**
+ * Get the component directory
+ *
+ * @return the component directory
+ */
+ public File getDir()
+ {
+ return FileUtil.resolve(FileUtil.getRoot(getProject()), getName());
+ }
+
+ public boolean isLocal()
+ {
+ return getExists() || (module != null && isCheckout());
+ }
+
+ /**
+ * Whether the component exists
+ *
+ * @return true when the component is exists
+ */
+ public boolean getExists()
+ {
+ return getDir().isDirectory();
+ }
+
+ /**
+ * Does the developer want this component to be checked as source?
+ *
+ * @return true if the component should be checked out.
+ */
+ private boolean isCheckout()
+ {
+ String checkout = getProject().getProperty("checkout." + getName());
+ if ("true".equalsIgnoreCase(checkout) || "yes".equalsIgnoreCase(checkout))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Get the executable.
+ *
+ * @return the executable.
+ */
+ public boolean getExecutable()
+ {
+ return executable;
+ }
+ /**
+ * Set the executable.
+ *
+ * @param executable The executable to set.
+ */
+ public void setExecutable(boolean executable)
+ {
+ this.executable = executable;
+ }
}
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/Include.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/Include.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/Include.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -8,13 +8,16 @@
import java.io.File;
import java.io.FileNotFoundException;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Vector;
import org.apache.tools.ant.BuildException;
+import org.jboss.ant.types.build.Build;
import org.jboss.ant.types.build.Component;
+import org.jboss.ant.util.DownloadUtil;
import org.jboss.ant.util.FileUtil;
import org.jboss.ant.util.ImportUtil;
@@ -256,13 +259,36 @@
try
{
+ if (log.isTraceEnabled())
+ log.trace("Attempting to import file: " + componentInfoFile.getAbsolutePath());
+
ImportUtil.importFile(componentInfoFile, getProject());
} catch (BuildException buildException)
{
if ( buildException.getCause() instanceof FileNotFoundException)
{
+ if (log.isTraceEnabled())
+ log.trace("Import of file failed. Attempting to locate it in thirdparty location...");
+
componentInfoFile = FileUtil.resolve(getThirdparty(), componentInfo);
- ImportUtil.importFile(componentInfoFile, getProject());
+ try
+ {
+ ImportUtil.importFile(componentInfoFile, getProject());
+ }
+ catch (BuildException f)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Import of file from thirdpary location failed.\n Giving up, please ensure the component is defined in top level build file and run the target synchronize.");
+
+ if (buildException.getCause() instanceof FileNotFoundException)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Possible future implementation of retrieving the component-info from the repository could go here.");
+
+ throw new BuildException("Unable to locate file: " + componentInfoFile.getAbsolutePath() +
+ "\nPlease ensure the component is defined in top level build and the target synchronize has been executed");
+ }
+ }
} else {
throw buildException;
}
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/SourceSink.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/SourceSink.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/SourceSink.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -46,10 +46,7 @@
{
Include include = new Include();
includes.add(include);
-
- if (log.isTraceEnabled())
- log.trace("Added include " + include + toShortString());
-
+
return include;
}
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/attributes/Version.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/attributes/Version.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/attributes/Version.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -25,16 +25,16 @@
{
/** The major portion of the version */
- private String major;
+ private String major = "0";
/** The minor portion of the version*/
- private String minor;
+ private String minor = "0";
/** The fix portion of the version*/
- private String fix;
+ private String fix = "0";
/** The string representation of the version */
- private String version;
+ private String version = "0";
/**
* Create a new version
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/build/Artifact.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/build/Artifact.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/build/Artifact.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -52,8 +52,17 @@
/** The filename, if it must differ from the id for uniqueness **/
private String filename;
+ /** The tofile, used if creating a new artifact with a unique file name */
+ private String tofile;
+
+ /** The requiredJDK version needed to construct the artifact */
+ private String requiredJDK="default";
+
+ /** Overwrite the artifact on release */
+ private boolean overwrite=false;
+
/** Should the artifact be exploded upon release **/
- private boolean exploded = false;;
+ private boolean exploded = false;
// Static --------------------------------------------------------
@@ -83,11 +92,11 @@
*
* @return the location
*/
- public URL getLocationURL() throws MalformedURLException
+ public URL getLocation() throws MalformedURLException
{
if (location == null)
{
- URL componentLocation = component.getLocationURL();
+ URL componentLocation = component.getLocation();
String path = getOutputPath();
if (path != null)
return new URL(componentLocation + "/" + path + "/" + getFilename());
@@ -111,16 +120,31 @@
}
/**
- * Get the release
+ * Get the release locations
*
* @return the location
*/
- public File getRelease()
+ public String getRelease()
{
+ StringBuffer sb = new StringBuffer();
+
if (release == null)
return null;
else
- return FileUtil.resolve(component.getBuild().getReleaseDir(), release);
+ {
+ String releases[] = release.split(", ");
+
+ for (int i=0; i < releases.length; i++)
+ {
+ File root=FileUtil.resolve(component.getBuild().getReleaseDir(), releases[i]);
+ sb.append(FileUtil.resolve(component.getBuild().getReleaseDir(), releases[i]));
+ if (i != releases.length-1)
+ {
+ sb.append(", ");
+ }
+ }
+ }
+ return sb.toString();
}
/**
@@ -304,7 +328,61 @@
{
this.exploded = exploded;
}
-
+
+ /**
+ * Get the tofile.
+ *
+ * @return the tofile.
+ */
+ public String getTofile()
+ {
+ return tofile;
+ }
+ /**
+ * Set the tofile.
+ *
+ * @param tofile The tofile to set.
+ */
+ public void setTofile(String tofile)
+ {
+ this.tofile = tofile;
+ }
+ /**
+ * Get the requiredJDK.
+ *
+ * @return the requiredJDK.
+ */
+ public String getRequiredJDK()
+ {
+ return requiredJDK;
+ }
+ /**
+ * Set the requiredJDK.
+ *
+ * @param requiredJDK The requiredJDK to set.
+ */
+ public void setRequiredJDK(String requiredJDK)
+ {
+ this.requiredJDK = requiredJDK;
+ }
+ /**
+ * Get the overwrite.
+ *
+ * @return the overwrite.
+ */
+ public boolean isOverwrite()
+ {
+ return overwrite;
+ }
+ /**
+ * Set the overwrite.
+ *
+ * @param overwrite The overwrite to set.
+ */
+ public void setOverwrite(boolean overwrite)
+ {
+ this.overwrite = overwrite;
+ }
// AbstractDataType overrides ------------------------------------
protected void doValidate()
@@ -452,4 +530,5 @@
// Private -------------------------------------------------------
// Inner classes -------------------------------------------------
+
}
\ No newline at end of file
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/build/Build.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/build/Build.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/build/Build.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -25,6 +25,7 @@
import org.jboss.ant.types.DynamicType;
import org.jboss.ant.types.Includes;
import org.jboss.ant.types.Source;
+import org.jboss.ant.types.deployment.Profile;
import org.jboss.ant.types.target.TargetDefinition;
import org.jboss.ant.types.target.TargetDefinitions;
import org.jboss.ant.util.FileUtil;
@@ -60,6 +61,9 @@
/** the component references */
private Vector componentrefs = new Vector();
+
+ /** the profiles */
+ private Vector profiles = new Vector();
/** The cvs root */
private String cvsRoot;
@@ -152,8 +156,10 @@
*/
public Build()
{
+ /*
if (buildInstance != null)
throw new BuildException("Duplicate build");
+ */
buildInstance = this;
}
@@ -204,6 +210,16 @@
log.trace("Add component: " + component.toShortString());
}
+ /**
+ * Add a deploymentProfile
+ *
+ * @param deploymentProfile the deploymentProfile to add
+ */
+ public void addProfile(Profile profile)
+ {
+ profiles.add(profile);
+ }
+
/** Determine if a component already exists
*
* @param component the component to check for existance
@@ -413,7 +429,7 @@
*
* @return the location
*/
- public URL getLocationURL() throws MalformedURLException
+ public URL getLocation() throws MalformedURLException
{
if (location == null)
return null;
@@ -645,6 +661,7 @@
resolveTargetDefinitions().validate();
validate(components);
validate(componentrefs);
+ validate(profiles);
}
protected void toString(StringBuffer buffer)
@@ -687,6 +704,9 @@
*/
protected void generateBuildTargets()
{
+ if (log.isTraceEnabled())
+ log.trace("Generating build targets");
+
Vector definitions = getTargetDefinitions();
for (int i = 0; i < definitions.size(); ++i)
{
@@ -708,6 +728,10 @@
if (mainTarget == null)
{
mainTarget = new MainTarget(this, definition);
+
+ if (log.isTraceEnabled())
+ log.trace("Created a new main target: " + main.toString());
+
addTarget(mainTarget);
}
addDepends(mainTarget, type);
@@ -733,7 +757,13 @@
if (definition.getElement("artifact") != null)
{
artifactsTarget = new ArtifactsTarget(this, definition);
+
+ if (log.isTraceEnabled())
+ log.trace("Created a new ArtifactsTarget: " + artifactsTarget.getName());
+
addTarget(artifactsTarget);
+
+
targetMap.put(definition.getTarget(), artifactsTarget);
}
}
@@ -820,4 +850,13 @@
// Inner classes -------------------------------------------------
+ /**
+ * Get the profiles.
+ *
+ * @return the profiles.
+ */
+ public Vector getProfiles()
+ {
+ return profiles;
+ }
}
\ No newline at end of file
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/build/Component.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/build/Component.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/build/Component.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -122,6 +122,8 @@
/** The relativePath **/
private String relativePath;
+ /** The executable */
+ private boolean executable;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
@@ -165,9 +167,6 @@
artifacts.add(artifact);
artifact.setComponent(this);
- if (log.isTraceEnabled())
- log.trace("Added artifact " + artifact.toShortString());
-
return artifact;
}
@@ -232,7 +231,14 @@
*/
public boolean getExists()
{
- return getDir().isDirectory();
+ boolean exists=false;
+
+ if (getDir().isDirectory()==false)
+ return exists;
+ else if (getDir().list().length <= 2)
+ return exists;
+ else
+ return true;
}
/**
@@ -535,7 +541,7 @@
*
* @return the location
*/
- public URL getLocationURL() throws MalformedURLException
+ public URL getLocation() throws MalformedURLException
{
URL locationURL = null;
if (location != null)
@@ -544,7 +550,7 @@
}
else
{
- locationURL = build.getLocationURL();
+ locationURL = build.getLocation();
}
URL componentLocation = FileUtil.resolve(locationURL, getId());
@@ -1067,4 +1073,22 @@
}
// Inner classes -------------------------------------------------
+ /**
+ * Get the executable.
+ *
+ * @return the executable.
+ */
+ public boolean isExecutable()
+ {
+ return executable;
+ }
+ /**
+ * Set the executable.
+ *
+ * @param executable The executable to set.
+ */
+ public void setExecutable(boolean executable)
+ {
+ this.executable = executable;
+ }
}
\ No newline at end of file
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ArtifactDefinition.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ArtifactDefinition.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ArtifactDefinition.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -11,6 +11,8 @@
import java.util.List;
import java.util.Vector;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.util.JavaEnvUtils;
import org.jboss.ant.targets.ArtifactDefinitionTarget;
import org.jboss.ant.types.DynamicType;
import org.jboss.ant.types.Include;
@@ -38,6 +40,18 @@
/** The artifact */
private String artifact;
+ /** The requiredJDK to build this artifact*/
+ private String requiredJDK="default";
+
+ /** If the artifact is buildable or not */
+ private boolean buildable;
+
+ /** The filename of the artifact if different from the id */
+ private String filename;
+
+ /** The name to rename the artifact to in cases where uniqueness is an issue */
+ private String toname;
+
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
@@ -59,7 +73,20 @@
*/
public Artifact getArtifact()
{
- return (Artifact) resolve("artifact", artifact, Artifact.class);
+ Component component = (Component) this.getProject().getReference(this.getComponentDefinition().getComponentName());
+
+ if (component==null)
+ throw new BuildException("Unable to resolve component with id: " + getComponentDefinition().getComponentName());
+
+ for (int i=0; i< component.getArtifacts().size(); i++)
+ {
+ Artifact currentArtifact = (Artifact) component.getArtifacts().elementAt(i);
+
+ if (currentArtifact.getId().equalsIgnoreCase(artifact))
+ return (currentArtifact);
+ }
+
+ return(null);
}
/**
@@ -72,6 +99,7 @@
return getArtifact().getComponent();
}
+
/**
* Set the artifact
*
@@ -134,6 +162,7 @@
{
getArtifact().validate();
componentDefinition.validate();
+ determineBuildable();
super.doValidate();
}
@@ -162,6 +191,80 @@
description = getArtifact().getId();
return description;
}
+
+ /**
+ * Get the requiredJDK.
+ *
+ * @return the requiredJDK.
+ */
+ public String getRequiredJDK()
+ {
+ return requiredJDK;
+ }
+ /**
+ * Set the requiredJDK.
+ *
+ * @param requiredJDK The requiredJDK to set.
+ */
+ public void setRequiredJDK(String requiredJDK)
+ {
+ this.requiredJDK = requiredJDK;
+ }
+ /**
+ * Get the buildable.
+ *
+ * @return the buildable.
+ */
+ public boolean isBuildable()
+ {
+ return buildable;
+ }
+ /**
+ * Set the buildable.
+ *
+ * @param buildable The buildable to set.
+ */
+ public void setBuildable(boolean buildable)
+ {
+ this.buildable = buildable;
+ }
+ /**
+ * Get the filename.
+ *
+ * @return the filename.
+ */
+ public String getFilename()
+ {
+ return filename;
+ }
+ /**
+ * Set the filename.
+ *
+ * @param filename The filename to set.
+ */
+ public void setFilename(String filename)
+ {
+ this.filename = filename;
+ }
+ /**
+ * Get the toname.
+ *
+ * @return the toname.
+ */
+ public String getToname()
+ {
+ return toname;
+ }
+ /**
+ * Set the toname.
+ *
+ * @param toname The toname to set.
+ */
+ public void setToname(String toname)
+ {
+ this.toname = toname;
+ }
+
// Package protected ---------------------------------------------
@@ -176,13 +279,23 @@
for (int i = 0; i < definitions.size(); ++i)
{
TargetDefinition definition = (TargetDefinition) definitions.get(i);
+
+ //get a list of dynamic types based on artifact type and artifactdef
List dynamicTypes = definition.getElement(getArtifact().getArtifactType().getType());
+ List artifactDefDynamicTypes=definition.getElement("artifactdef");
+
+ if ((dynamicTypes==null) && (artifactDefDynamicTypes != null))
+ dynamicTypes=artifactDefDynamicTypes;
+ else if ((dynamicTypes !=null) && (artifactDefDynamicTypes !=null))
+ dynamicTypes.addAll(artifactDefDynamicTypes);
+
if (dynamicTypes != null)
{
for (int j = 0; j < dynamicTypes.size(); ++ j)
{
ArtifactDefinitionTarget target = null;
DynamicType dynamicType = (DynamicType) dynamicTypes.get(j);
+
if (dynamicType.applies(this))
{
if (target == null)
@@ -208,7 +321,48 @@
this.componentDefinition = componentDefinition;
}
+ /**
+ * Determine whether this artifactdef
+ * is buildable or not based upon the compiler being used
+ * and what the user has defined as being required
+ */
+ protected void determineBuildable()
+ {
+ if (this.getRequiredJDK().equalsIgnoreCase("default"))
+ {
+ this.setBuildable(true);
+ }
+ else if (this.getRequiredJDK().equalsIgnoreCase("1.5"))
+ {
+ String version = JavaEnvUtils.getJavaVersion();
+ if (version.equalsIgnoreCase(this.getRequiredJDK()))
+ setBuildable(true);
+ else
+ setBuildable(false);
+ }
+ else if (this.getRequiredJDK().equalsIgnoreCase("1.4"))
+ {
+ this.setBuildable(true);
+ }
+ else
+ throw new BuildException("Invalid value set for attribute requiredJDK\n in source with id: " +
+ this.getId() + " in component definition with id: " + this.getComponent().getId() +
+ "\nAcceptable values are 1.3, 1.4 and 1.5");
+ }
+
+
// Private -------------------------------------------------------
// Inner classes -------------------------------------------------
+
+
+ /**
+ * Get the componentDefinition.
+ *
+ * @return the componentDefinition.
+ */
+ public ComponentDefinition getComponentDefinition()
+ {
+ return componentDefinition;
+ }
}
\ No newline at end of file
Added: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ClassPathDefinition.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ClassPathDefinition.java (rev 0)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ClassPathDefinition.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -0,0 +1,140 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ant.types.component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Vector;
+
+import org.jboss.ant.types.AbstractDataType;
+import org.jboss.ant.types.Include;
+
+/**
+ * A definition of a classpath which the user can define and add
+ * to the project
+ *
+ * @author <a href="ruel.loehr at jboss.com">Ruel Loehr</a>
+ * @version $Revision$
+ */
+public class ClassPathDefinition extends AbstractDataType
+{
+
+ /** The component definition */
+ private ComponentDefinition componentDefinition;
+
+ /** The includes of the classpath definition */
+ private Vector includes=new Vector();
+
+ /**
+ * Create a new ClassPathDefinition.
+ *
+ *
+ */
+ public ClassPathDefinition()
+ {
+
+ }
+
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ /**
+ * Create an include
+ *
+ * @return the include
+ */
+ public Include createInclude()
+ {
+ Include include = new Include();
+ includes.add(include);
+
+ if (log.isTraceEnabled())
+ log.trace("Added include " + include + toShortString() + " to classpath definition " + this.getId());
+
+ return include;
+ }
+
+ /**
+ * Get the includes size
+ *
+ * @return the include size
+ */
+ public int getSize()
+ {
+ return includes.size();
+ }
+
+ /**
+ * Get an include
+ *
+ * @param index the index of the include
+ * @return the include
+ */
+ public Include getInclude(int index)
+ {
+ return (Include) includes.get(index);
+ }
+
+ /**
+ * Get the classpath in the form a list of necessary files
+ *
+ * @return a space separate list of included jar artifacts
+ */
+ public List getClasspath()
+ {
+ ArrayList allFiles = new ArrayList();
+
+ //for each include defined in the the classpathdef
+ for (int i = 0; i < getSize(); ++i)
+ {
+ Include include = getInclude(i);
+ allFiles.addAll(include.getFiles());
+ }
+
+ return allFiles;
+ }
+
+
+ // AbstractDataType overrides ------------------------------------
+
+ protected void doValidate()
+ {
+ componentDefinition.validate();
+ }
+
+ protected void toString(StringBuffer buffer)
+ {
+ super.toString(buffer);
+ buffer.append(" classpathdefintion=").append(this.toShortString());
+ }
+
+ /**
+ * Set the component definition
+ *
+ * @param componentDefinition the component definition
+ */
+ protected void setComponentDefinition(ComponentDefinition componentDefinition)
+ {
+ this.componentDefinition = componentDefinition;
+ }
+
+
+ /**
+ * Get the componentDefinition.
+ *
+ * @return the componentDefinition.
+ */
+ public ComponentDefinition getComponentDefinition()
+ {
+ return componentDefinition;
+ }
+
+}
Property changes on: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ClassPathDefinition.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ComponentDefinition.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ComponentDefinition.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/ComponentDefinition.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -7,11 +7,13 @@
package org.jboss.ant.types.component;
import java.io.File;
+import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Vector;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.Path;
import org.jboss.ant.targets.AbstractTargetDefinitionTarget;
import org.jboss.ant.targets.ComponentDefinitionTarget;
import org.jboss.ant.targets.ShowTarget;
@@ -19,6 +21,7 @@
import org.jboss.ant.types.Source;
import org.jboss.ant.types.build.Component;
import org.jboss.ant.types.target.TargetDefinition;
+import org.jboss.ant.types.target.TargetInsertionDefinition;
import org.jboss.ant.util.FileUtil;
/**
@@ -47,10 +50,19 @@
/** The generated source definitions */
private Vector generatedSourceDefinitions = new Vector();
+
+ /** The targetDescriptor definitions */
+ private Vector targetInsertionDefinitions = new Vector();
+
+ /** The classpathDef definitions */
+ private Vector classPathDefinitions = new Vector();
/** The target definition components target */
private Hashtable targetMap = new Hashtable();
+ /** The version of the jdk required to build this componentdef */
+ private String required_jdk;
+
// Static --------------------------------------------------------
/** The component definition instance */
@@ -90,6 +102,11 @@
return (Component) resolve("component", component, Component.class);
}
+ public String getComponentName()
+ {
+ return component;
+ }
+
/**
* Set the component
*
@@ -103,6 +120,7 @@
getComponent().setComponentDefinition(this);
}
+
/**
* Get the sources
*
@@ -128,6 +146,21 @@
}
/**
+ * Add a a classpathDef
+ *
+ * @param classpathDefinition the classpath definition
+ */
+ public void addClassPathDefinition(ClassPathDefinition classPathDefinition)
+ {
+ classPathDefinitions.add(classPathDefinition);
+ classPathDefinition.setComponentDefinition(this);
+
+ if (log.isTraceEnabled())
+ log.trace("Added classPathDefinition " + classPathDefinition.toShortString());
+ }
+
+
+ /**
* Get the resources
*
* @return the resources
@@ -150,8 +183,33 @@
if (log.isTraceEnabled())
log.trace("Added resource " + resourceDefinition.toShortString());
}
+
+ /**
+ * Add a targetInsertionDefintion
+ *
+ * @param targetInsertionDefinition the targetInsertionDefinition definition
+ */
+ public void addTargetInsertionDefinition(TargetInsertionDefinition targetInsertionDefinition)
+ {
+ targetInsertionDefinition.setComponentDefinition(this);
+ targetInsertionDefinitions.add(targetInsertionDefinition);
+
+ if (log.isTraceEnabled())
+ log.trace("Added targetInsertionDefintion " + targetInsertionDefinition.toShortString());
+ }
/**
+ * Get the targetInsertionDefinitions
+ *
+ * @return the targetInsertionDefinitions
+ */
+ public Vector getTargetInsertionDefinitions()
+ {
+ return targetInsertionDefinitions;
+ }
+
+
+ /**
* Get the generated sources
*
* @return the generated sources
@@ -194,9 +252,21 @@
{
artifactDefinitions.add(artifactDefinition);
artifactDefinition.setComponentDefinition(this);
+
+ }
+
+ /**
+ * Add a classpathdefintion
+ *
+ * @param classpathDefinition the classpath definition
+ */
+ public void addClassPathDef(ClassPathDefinition classPathDefinition)
+ {
+ classPathDefinitions.add(classPathDefinition);
+ classPathDefinition.setComponentDefinition(this);
if (log.isTraceEnabled())
- log.trace("Added artifact " + artifactDefinition.toShortString());
+ log.trace("Added classpathdefinition " + classPathDefinition.toShortString());
}
// Source overrides ----------------------------------------------
@@ -224,6 +294,8 @@
generateGeneratedSourceTargets();
generateSourceTargets();
generateArtifactTargets();
+ generateTargetInsertions();
+ generateClassPaths();
addTarget(new ShowTarget(this));
}
@@ -236,6 +308,8 @@
validate(artifactDefinitions);
validate(resourceDefinitions);
validate(generatedSourceDefinitions);
+ validate(targetInsertionDefinitions);
+ validate(classPathDefinitions);
}
protected void appendIdentity(StringBuffer buffer)
@@ -302,6 +376,51 @@
}
}
+ /**
+ * Generate the target insertion dependencies
+ *
+ */
+ protected void generateTargetInsertions()
+ {
+ Vector targetInsertions = getTargetInsertionDefinitions();
+ for (int i = 0; i < targetInsertions.size(); ++i)
+ {
+ TargetInsertionDefinition targetInsertion = (TargetInsertionDefinition) targetInsertions.get(i);
+ ComponentDefinitionTarget target=(ComponentDefinitionTarget) this.getProject().getTargets().get(targetInsertion.getTarget());
+
+ if (target==null)
+ throw (new BuildException("Unable to find a target with name " + targetInsertion.getTarget() +
+ "for componentdef " + getComponent().getId()));
+
+ target.addDependency(targetInsertion.getDepends());
+
+ }
+ }
+
+ /**
+ * Generate the classpath definitions
+ *
+ */
+ protected void generateClassPaths()
+ {
+ Vector classPaths = getClassPathDefinitions();
+ for (int i = 0; i < classPaths.size(); ++i)
+ {
+ ClassPathDefinition classPathDefinition =(ClassPathDefinition)classPaths.get(i);
+ Path path = new Path(this.getProject());
+
+ ArrayList classpathList = (ArrayList) classPathDefinition.getClasspath();
+ for (int j=0; j < classpathList.size(); j++)
+ {
+ File currentFile=(File) classPathDefinition.getClasspath().get(j);
+ path.setLocation(currentFile);
+ }
+
+ //add the new path to the project hashtable with the defined id
+ this.getProject().getReferences().put(classPathDefinition.getId(), path);
+ }
+ }
+
/**
* Generate the source targets
*/
@@ -449,4 +568,14 @@
// Private -------------------------------------------------------
// Inner classes -------------------------------------------------
+
+ /**
+ * Get the classPathDefinitions.
+ *
+ * @return the classPathDefinitions.
+ */
+ public Vector getClassPathDefinitions()
+ {
+ return classPathDefinitions;
+ }
}
\ No newline at end of file
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/SourceDefinition.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/SourceDefinition.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/component/SourceDefinition.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -12,6 +12,7 @@
import java.util.Vector;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.util.JavaEnvUtils;
import org.jboss.ant.targets.SourceDefinitionTarget;
import org.jboss.ant.types.DynamicType;
import org.jboss.ant.types.Include;
@@ -39,6 +40,31 @@
/** The test pattern */
private String test;
+
+ /** The requiredJDK */
+ private String requiredJDK="default";
+
+ /** If the source is compileable or not */
+ private boolean compileable;
+
+ /** List of exclude classes for 1.5 compilation */
+ private String excludes15;
+
+ /** The excludes */
+ private String excludes;
+
+ /** The jvmSource */
+ private String jvmSource="1.4";
+
+ /** The jvmTarget */
+ private String jvmTarget="1.4";
+
+ /** The sourcedir if different from id */
+ private String sourcedir;
+
+ /** The outputdir if different from id */
+ private String outputdir;
+
// Static --------------------------------------------------------
@@ -49,6 +75,7 @@
*/
public SourceDefinition()
{
+
}
// Public --------------------------------------------------------
@@ -80,7 +107,10 @@
*/
public String getSourcePath()
{
- return componentDefinition.getSourcePath(getName());
+ if (getSourcedir()!=null)
+ return componentDefinition.getSourcePath(getSourcedir());
+ else
+ return componentDefinition.getSourcePath(getName());
}
/**
@@ -139,7 +169,13 @@
{
File result = super.getOutput();
if (result == null)
- result = componentDefinition.getClassOutput(getName());
+ {
+ if (getOutputdir()!=null)
+ result = componentDefinition.getClassOutput(getOutputdir());
+ else
+ result = componentDefinition.getClassOutput(getName());
+
+ }
return result;
}
@@ -148,17 +184,229 @@
protected void doValidate()
{
componentDefinition.validate();
+
if (getId() == null)
throw new BuildException("Source has no id/name");
+
+ determineCompilable();
+ determineExcludes();
+
super.doValidate();
}
+
+
+ /** Determine whether this source definition
+ * is compileable or not based upon user defintion
+ * and current compiler being used
+ */
+
+ protected void determineCompilable()
+ {
+ if (this.getRequiredJDK().equalsIgnoreCase("default"))
+ {
+ this.setCompileable(true);
+ }
+ else if (this.getRequiredJDK().equalsIgnoreCase("1.5"))
+ {
+ String version = JavaEnvUtils.getJavaVersion();
+ if (version.equalsIgnoreCase(this.getRequiredJDK()))
+ {
+ setCompileable(true);
+ }
+ else
+ setCompileable(false);
+ }
+ else if (this.getRequiredJDK().equalsIgnoreCase("1.4"))
+ {
+ String version = JavaEnvUtils.getJavaVersion();
+ if (version.equalsIgnoreCase(this.getRequiredJDK()))
+ {
+ setCompileable(true);
+ }
+ else
+ setCompileable(false);
+ }
+ else
+ throw new BuildException("Invalid value set for attribute requiredJDK\n in source with id: " +
+ this.getId() + " in component definition with id: " + this.getComponent().getId() +
+ "\nAcceptable values are 1.3, 1.4, 1.5, or default. Default will set the target and source to be the version as the jdk being used");
+ }
+
+
+ /** Determine this correct excludes to use
+ * this is needed due to the fact some
+ * projects specify different classes to exclude
+ * based upon whether a 1.4 or 1.5 compiler is used
+ */
+ protected void determineExcludes()
+ {
+ if (this.getExcludes()==null)
+ setExcludes("");
+
+ String version = JavaEnvUtils.getJavaVersion();
+ if (version.equalsIgnoreCase("1.5"))
+ {
+ if (this.getExcludes()==null)
+ this.setExcludes(this.getExcludes15());
+ else
+ this.setExcludes(this.getExcludes()+ ", " + this.getExcludes15());
+ }
+ }
+
+
protected void toString(StringBuffer buffer)
{
super.toString(buffer);
if (test != null)
buffer.append(" test=").append(test);
}
+
+ /**
+ * Get the compileable.
+ *
+ * @return the compileable.
+ */
+ public boolean isCompileable()
+ {
+ return compileable;
+ }
+ /**
+ * Set the compileable.
+ *
+ * @param compileable The compileable to set.
+ */
+ public void setCompileable(boolean compileable)
+ {
+ this.compileable = compileable;
+ }
+ /**
+ * Get the requiredJDK.
+ *
+ * @return the requiredJDK.
+ */
+ public String getRequiredJDK()
+ {
+ return requiredJDK;
+ }
+ /**
+ * Set the requiredJDK.
+ *
+ * @param requiredJDK The requiredJDK to set.
+ */
+ public void setRequiredJDK(String requiredJDK)
+ {
+ this.requiredJDK = requiredJDK;
+ }
+ /**
+ * Get the excludes15.
+ *
+ * @return the excludes15.
+ */
+ public String getExcludes15()
+ {
+ return excludes15;
+ }
+ /**
+ * Set the excludes15.
+ *
+ * @param excludes15 The excludes15 to set.
+ */
+ public void setExcludes15(String excludes15)
+ {
+ this.excludes15 = excludes15;
+ }
+ /**
+ * Get the excludes.
+ *
+ * @return the excludes.
+ */
+ public String getExcludes()
+ {
+ return excludes;
+ }
+ /**
+ * Set the excludes.
+ *
+ * @param excludes The excludes to set.
+ */
+ public void setExcludes(String excludes)
+ {
+ this.excludes = excludes;
+ }
+ /**
+ * Get the jvmSource.
+ *
+ * @return the jvmSource.
+ */
+ public String getJvmSource()
+ {
+ return jvmSource;
+ }
+ /**
+ * Set the jvmSource.
+ *
+ * @param jvmSource The jvmSource to set.
+ */
+ public void setJvmSource(String jvmSource)
+ {
+ this.jvmSource = jvmSource;
+ }
+ /**
+ * Get the jvmTarget.
+ *
+ * @return the jvmTarget.
+ */
+ public String getJvmTarget()
+ {
+ return jvmTarget;
+ }
+ /**
+ * Set the jvmTarget.
+ *
+ * @param jvmTarget The jvmTarget to set.
+ */
+ public void setJvmTarget(String jvmTarget)
+ {
+ this.jvmTarget = jvmTarget;
+ }
+ /**
+ * Get the sourcedir.
+ *
+ * @return the sourcedir.
+ */
+ public String getSourcedir()
+ {
+ return sourcedir;
+ }
+ /**
+ * Set the sourcedir.
+ *
+ * @param sourcedir The sourcedir to set.
+ */
+ public void setSourcedir(String sourcedir)
+ {
+ this.sourcedir = sourcedir;
+ }
+ /**
+ * Get the outputdir.
+ *
+ * @return the outputdir.
+ */
+ public String getOutputdir()
+ {
+ return outputdir;
+ }
+ /**
+ * Set the outputdir.
+ *
+ * @param outputdir The outputdir to set.
+ */
+ public void setOutputdir(String outputdir)
+ {
+ this.outputdir = outputdir;
+ }
+
// DataType overrides --------------------------------------------
Added: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/Deployment.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/Deployment.java (rev 0)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/Deployment.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -0,0 +1,227 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ant.types.deployment;
+
+import org.apache.tools.ant.BuildException;
+import org.jboss.ant.types.AbstractDataType;
+import org.jboss.ant.types.build.Artifact;
+import org.jboss.ant.types.build.Build;
+import org.jboss.ant.types.build.Component;
+
+/**
+ * A Deployment.
+ *
+ * @author <a href="ruel.loehr at jboss.com">Ruel Loehr</a>
+ * @version $Revision$
+ */
+public class Deployment extends AbstractDataType
+{
+ private Build build;
+
+ /** The artifact */
+ private String artifact;
+
+ /** The outputPath */
+ private String outputPath;
+
+ /** The requiredJDK */
+ private String requiredJDK = "default";
+
+ /** The exploded */
+ private String exploded = "false";
+
+ /** The overwrite */
+ private String overwrite;
+
+ /** The toName */
+ private String toName;
+
+ /** The component */
+ private String component;
+
+ /**
+ * Create a new Deployment.
+ *
+ *
+ */
+ public Deployment()
+ {
+ super();
+ }
+
+ /**
+ *
+ */
+
+ protected void doValidate()
+ {
+ if (artifact == null)
+ throw new BuildException("An artifact must be defined for each deployment");
+
+ if (component == null)
+ throw new BuildException("A component must be defined for deployment with artifact: " + artifact);
+ }
+
+ /**
+ * Set the artifact.
+ *
+ * @param artifact The artifact to set.
+ */
+ public void setArtifact(String artifact)
+ {
+ this.artifact = artifact;
+ }
+
+ /**
+ * Get the outputPath.
+ *
+ * @return the outputPath.
+ */
+ public String getOutputPath()
+ {
+ return outputPath;
+ }
+
+ /**
+ * Set the outputPath.
+ *
+ * @param outputPath The outputPath to set.
+ */
+ public void setOutputPath(String outputPath)
+ {
+ this.outputPath = outputPath;
+ }
+
+ public String getArtifactId()
+ {
+ return artifact;
+ }
+
+ public Artifact getArtifact()
+ {
+ for (int i = 0; i < Build.getBuild().getComponents().size(); i++)
+ {
+ Component currentComponent = (Component) Build.getBuild().getComponents()
+ .elementAt(i);
+
+ if (currentComponent.getId().equalsIgnoreCase(this.component))
+ {
+ for (int j = 0; j < currentComponent.getArtifacts().size(); j++)
+ {
+ Artifact currentArtifact = (Artifact) currentComponent.getArtifacts().elementAt(j);
+
+ if (currentArtifact.getId().equalsIgnoreCase(artifact))
+ return (currentArtifact);
+ }
+ }
+
+ }
+ throw new BuildException("Unable to locate artifact with id: " + artifact + " belonging to component: "
+ + component);
+ }
+
+ /**
+ * Get the requiredJDK.
+ *
+ * @return the requiredJDK.
+ */
+ public String getRequiredJDK()
+ {
+ return requiredJDK;
+ }
+
+ /**
+ * Set the requiredJDK.
+ *
+ * @param requiredJDK The requiredJDK to set.
+ */
+ public void setRequiredJDK(String requiredJDK)
+ {
+ this.requiredJDK = requiredJDK;
+ }
+
+ /**
+ * Get the exploded.
+ *
+ * @return the exploded.
+ */
+ public String getExploded()
+ {
+ return exploded;
+ }
+
+ /**
+ * Set the exploded.
+ *
+ * @param exploded The exploded to set.
+ */
+ public void setExploded(String exploded)
+ {
+ this.exploded = exploded;
+ }
+
+ /**
+ * Get the toName.
+ *
+ * @return the toName.
+ */
+ public String getToName()
+ {
+ return toName;
+ }
+
+ /**
+ * Set the toName.
+ *
+ * @param toName The toName to set.
+ */
+ public void setToName(String toName)
+ {
+ this.toName = toName;
+ }
+
+ /**
+ * Get the overwrite.
+ *
+ * @return the overwrite.
+ */
+ public String getOverwrite()
+ {
+ return overwrite;
+ }
+
+ /**
+ * Set the overwrite.
+ *
+ * @param overwrite The overwrite to set.
+ */
+ public void setOverwrite(String overwrite)
+ {
+ this.overwrite = overwrite;
+ }
+
+ /**
+ * Get the component.
+ *
+ * @return the component.
+ */
+ public String getComponent()
+ {
+ return component;
+ }
+
+ /**
+ * Set the component.
+ *
+ * @param component The component to set.
+ */
+ public void setComponent(String component)
+ {
+ this.component = component;
+ }
+
+}
Property changes on: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/Deployment.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/DeploymentType.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/DeploymentType.java (rev 0)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/DeploymentType.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ant.types.deployment;
+
+import java.util.Vector;
+
+import org.apache.tools.ant.BuildException;
+import org.jboss.ant.types.AbstractDataType;
+
+/**
+ * A DeploymentType.
+ *
+ * @author <a href="ruel.loehr at jboss.com">Ruel Loehr</a>
+ * @version $Revision$
+ */
+public class DeploymentType extends AbstractDataType
+{
+ private String type;
+
+ private Vector deployments=new Vector();
+
+ private Vector deploymentTypes=new Vector();
+
+ private String requiredJDK="default";
+
+
+ /**
+ * Create a new DeploymentType.
+ *
+ *
+ */
+ public DeploymentType()
+ {
+ // FIXME DeploymentType constructor
+ super();
+ }
+
+ /**
+ *
+ */
+
+ protected void doValidate()
+ {
+
+ for (int i=0; i<getDeploymentTypes().size(); i++)
+ {
+ DeploymentType dt=(DeploymentType) getDeploymentTypes().elementAt(i);
+ dt.doValidate();
+ }
+
+ for (int i=0; i<getDeployments().size(); i++)
+ {
+ Deployment d=(Deployment) getDeployments().elementAt(i);
+ d.doValidate();
+ }
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public String getType()
+ {
+ return type;
+ }
+ /**
+ * Set the type.
+ *
+ * @param type The type to set.
+ */
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+ /**
+ * Get the deployments.
+ *
+ * @return the deployments.
+ */
+ public Vector getDeployments()
+ {
+ return deployments;
+ }
+
+ public void addDeployment(Deployment deployment)
+ {
+
+ this.deployments.add(deployment);
+ // deployment.setDeploymentType(this);
+ }
+
+ public void addDeploymentType(DeploymentType deploymentType)
+ {
+ this.deploymentTypes.add(deploymentType);
+ }
+
+ public Vector getDeploymentTypes()
+ {
+ return this.deploymentTypes;
+ }
+ /**
+ * Set the deployments.
+ *
+ * @param deployments The deployments to set.
+ */
+ public void setDeployments(Vector deployments)
+ {
+ this.deployments = deployments;
+ }
+ /**
+ * Get the requiredJDK.
+ *
+ * @return the requiredJDK.
+ */
+ public String getRequiredJDK()
+ {
+ return requiredJDK;
+ }
+ /**
+ * Set the requiredJDK.
+ *
+ * @param requiredJDK The requiredJDK to set.
+ */
+ public void setRequiredJDK(String requiredJDK)
+ {
+ this.requiredJDK = requiredJDK;
+ }
+
+}
Property changes on: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/DeploymentType.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/Profile.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/Profile.java (rev 0)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/Profile.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ant.types.deployment;
+
+import java.util.Vector;
+
+import org.apache.tools.ant.BuildException;
+import org.jboss.ant.types.AbstractDataType;
+import org.jboss.ant.types.build.Build;
+
+
+/**
+ * A Profile.
+ *
+ * @author <a href="ruel.loehr at jboss.com">Ruel Loehr</a>
+ * @version $Revision$
+ */
+public class Profile extends AbstractDataType
+{
+ /** The profile */
+ private String profile;
+
+ /** The name */
+ private String name;
+
+ /** The deployments */
+ Vector deployments=new Vector();
+
+ /** The deploymentTypes */
+ private Vector deploymentTypes=new Vector();
+
+ /** The outputPath */
+ private String outputPath;
+
+
+ /**
+ * Create a new Profile.
+ *
+ *
+ */
+ public Profile()
+ {
+ super();
+ }
+
+ /**
+ * Add a deploymentProfile
+ *
+ * @param deploymentProfile the deploymentProfile to add
+ */
+ public void addDeployment(Deployment deployment)
+ {
+ deployments.add(deployment);
+ }
+
+ /**
+ * Add a deploymentProfile
+ *
+ * @param deploymentProfile the deploymentProfile to add
+ */
+ public void addDeploymentType(DeploymentType deploymentType)
+ {
+ // deploymentType.setProfile(this);
+ deploymentTypes.add(deploymentType);
+ }
+
+ /**
+ * Get the profile.
+ *
+ * @return the profile.
+ */
+ public String getProfile()
+ {
+ return profile;
+ }
+ /**
+ * Set the profile.
+ *
+ * @param profile The profile to set.
+ */
+ public void setProfile(String profile)
+ {
+ this.profile = profile;
+ }
+
+
+
+ /**
+ * Get the deployments.
+ *
+ * @return the deployments.
+ */
+ public Vector getDeployments()
+ {
+ return deployments;
+ }
+
+ public void doValidate()
+ {
+ if (this.getId() == null)
+ throw new BuildException("An id must be set for each profile");
+
+ for (int i=0; i<getDeploymentTypes().size(); i++)
+ {
+ DeploymentType dt=(DeploymentType) getDeploymentTypes().elementAt(i);
+ dt.doValidate();
+ }
+
+ for (int i=0; i<getDeployments().size(); i++)
+ {
+ Deployment d=(Deployment) getDeployments().elementAt(i);
+ d.doValidate();
+ }
+ }
+ /**
+ * Get the deploymentTypes.
+ *
+ * @return the deploymentTypes.
+ */
+ public Vector getDeploymentTypes()
+ {
+ return deploymentTypes;
+ }
+ /**
+ * Set the deploymentTypes.
+ *
+ * @param deploymentTypes The deploymentTypes to set.
+ */
+ public void setDeploymentTypes(Vector deploymentTypes)
+ {
+ this.deploymentTypes = deploymentTypes;
+ }
+ /**
+ * Get the outputPath.
+ *
+ * @return the outputPath.
+ */
+ public String getOutputPath()
+ {
+ return outputPath;
+ }
+ /**
+ * Set the outputPath.
+ *
+ * @param outputPath The outputPath to set.
+ */
+ public void setOutputPath(String outputPath)
+ {
+ this.outputPath = outputPath;
+ }
+
+ }
Property changes on: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/deployment/Profile.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/target/TargetInsertionDefinition.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/target/TargetInsertionDefinition.java (rev 0)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/target/TargetInsertionDefinition.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ant.types.target;
+
+import org.apache.tools.ant.BuildException;
+import org.jboss.ant.types.AbstractDataType;
+import org.jboss.ant.types.component.ComponentDefinition;
+
+/**
+ * The TargetInsertionDefiniton contains information
+ * necessary to allow the user to declare the insertion
+ * of an additional target into the build procedure. This is
+ * accomplished by specifying the name of the target to insert
+ * and the name of the exisiting target to add a dependency to.
+ *
+ * @author <a href="ruel.loehr at jboss.com">Ruel Loehr</a>
+ * @version $Revision$
+ */
+public class TargetInsertionDefinition extends AbstractDataType
+{
+
+ /** The existing target to add a dependecy too */
+ private String target;
+
+ /** The name of the target to add in to the build*/
+ private String depends;
+
+ /** The component definition */
+ private ComponentDefinition componentDefinition;
+
+ /** Create a TargetInsertinDefinition
+ */
+ public TargetInsertionDefinition()
+ {
+
+ }
+
+ /**
+ * Get the depends.
+ *
+ * @return the depends.
+ */
+ public String getDepends()
+ {
+ return depends;
+ }
+
+ /**
+ * Set the depends.
+ *
+ * @param depends The depends to set.
+ */
+ public void setDepends(String depends)
+ {
+ this.depends = depends;
+ }
+
+ /**
+ * Get the target.
+ *
+ * @return the target.
+ */
+ public String getTarget()
+ {
+ return target;
+ }
+
+ /**
+ * Set the target.
+ *
+ * @param target The target to set.
+ */
+ public void setTarget(String target)
+ {
+ this.target = target;
+ }
+
+ protected void doValidate()
+ {
+ if (depends == null)
+ throw (new BuildException("TargetInsertionDefinition for componentDef: "
+ + this.getComponentDefinition().getComponent().getId() + " must define attribute 'depends'"));
+
+ if (target == null)
+ throw (new BuildException("TargetInsertionDefinition for componentDef: + "
+ + this.getComponentDefinition().getComponent().getId() + " must define attribute 'target'"));
+
+ }
+
+ /**
+ * Get the componentDefinition.
+ *
+ * @return the componentDefinition.
+ */
+ public ComponentDefinition getComponentDefinition()
+ {
+ return componentDefinition;
+ }
+
+ /**
+ * Set the componentDefinition.
+ *
+ * @param componentDefinition The componentDefinition to set.
+ */
+ public void setComponentDefinition(ComponentDefinition componentDefinition)
+ {
+ this.componentDefinition = componentDefinition;
+ }
+
+
+}
Property changes on: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/types/target/TargetInsertionDefinition.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/DownloadUtil.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/DownloadUtil.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/DownloadUtil.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -44,6 +44,7 @@
getTask.setSrc(url);
getTask.setDest(file);
getTask.setVerbose(true);
+ getTask.setUseTimestamp(true);
try
{
@@ -51,7 +52,8 @@
}
catch (Exception e)
{
- throw (new BuildException("Unable to get remote file=" + file + " url=" + url));
+ BuildException be = new BuildException("Unable to get remote file=" + file + " url=" + url, e);
+ throw be;
}
return (file);
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/FileUtil.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/FileUtil.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/FileUtil.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -7,9 +7,15 @@
package org.jboss.ant.util;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
+import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Mkdir;
import org.apache.tools.ant.util.FileUtils;
@@ -51,7 +57,12 @@
*/
public static File getRoot(Project project)
{
- return project.getBaseDir().getParentFile();
+ if (project.getBaseDir().getParentFile().getName().equalsIgnoreCase("jbossas"))
+ return project.getBaseDir().getParentFile().getParentFile();
+ else if (project.getProperty("external.project")!=null)
+ return project.getBaseDir();
+ else
+ return project.getBaseDir().getParentFile();
}
/**
@@ -83,7 +94,45 @@
return;
}
+
+ public static void copy(File src, File dst) throws IOException
+ {
+ InputStream in = new FileInputStream(src);
+ OutputStream out = new FileOutputStream(dst);
+ // Transfer bytes from in to out
+ byte[] buf = new byte[1024];
+ int len;
+ while ((len = in.read(buf)) > 0)
+ {
+ out.write(buf, 0, len);
+ }
+ in.close();
+ out.close();
+ }
+
+ public static String readFile(File file)
+ {
+ try
+ {
+ FileInputStream fis = new FileInputStream(file);
+ int x= fis.available();
+
+ byte b[]= new byte[x];
+
+ fis.read(b);
+
+ String content = new String(b);
+
+ return content;
+ }
+ catch (IOException e)
+ {
+ throw new BuildException("Error reading contents of file: " + file.getAbsolutePath());
+ }
+
+ }
+
// Constructors --------------------------------------------------
/**
Deleted: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/ValidateLicenseHeaders.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/ValidateLicenseHeaders.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/ValidateLicenseHeaders.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -1,377 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-
-package org.jboss.ant.util;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.FileWriter;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Iterator;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.nio.channels.FileChannel;
-import java.nio.ByteBuffer;
-import java.net.URL;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Node;
-
-/**
- * This is a copy of the jbossas varia org.jboss.tools.license.ValidateLicenseHeaders
- * that needs to be updated to work with any project and provide better pass/fail
- * feedback when there are invalid headers.
- *
- * A utility which scans all java source files in the cvs tree and validates
- * the license header prior to the package statement for headers that match
- * those declared in thirdparty/licenses/license-info.xml
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class ValidateLicenseHeaders
-{
- static final String DEFAULT_HEADER = "/*\n" +
- "* JBoss, Home of Professional Open Source\n" +
- "*\n" +
- "* Distributable under LGPL license.\n" +
- "* See terms of license at gnu.org.\n" +
- "*/\n";
- static Logger log = Logger.getLogger("ValidateCopyrightHeaders");
- static boolean addDefaultHeader = false;
- static FileFilter dotJavaFilter = new DotJavaFilter();
- /**
- * The term-headers from the thirdparty/license/license-info.xml
- */
- static HashMap licenseHeaders = new HashMap();
- /**
- * Java source files with no license header
- */
- static ArrayList noheaders = new ArrayList();
- /**
- * Java source files with a header that does not match one from licenseHeaders
- */
- static ArrayList invalidheaders = new ArrayList();
- static int totalCount;
-
- /**
- * ValidateLicenseHeaders jboss-src-root
- * @param args
- */
- public static void main(String[] args)
- throws Exception
- {
- if( args.length == 0 || args[0].startsWith("-h") )
- {
- log.info("Usage: ValidateLicenseHeaders [-addheader] jboss-src-root");
- System.exit(1);
- }
- int rootArg = 0;
- if( args.length == 2 )
- {
- if( args[0].startsWith("-add") )
- addDefaultHeader = true;
- else
- {
- log.severe("Uknown argument: "+args[0]);
- log.info("Usage: ValidateLicenseHeaders [-addheader] jboss-src-root");
- System.exit(1);
-
- }
- rootArg = 1;
- }
-
- File jbossSrcRoot = new File(args[rootArg]);
- if( jbossSrcRoot.exists() == false )
- {
- log.info("Src root does not exist, check "+jbossSrcRoot.getAbsolutePath());
- System.exit(1);
- }
-
- URL u = Thread.currentThread().getContextClassLoader().getResource("META-INF/services/javax.xml.parsers.DocumentBuilderFactory");
- System.err.println(u);
-
- // Load the valid copyright statements for the licenses
- File licenseInfo = new File(jbossSrcRoot, "thirdparty/licenses/license-info.xml");
- if( licenseInfo.exists() == false )
- {
- log.severe("Failed to find the thirdparty/licenses/license-info.xml under the src root");
- System.exit(1);
- }
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder db = factory.newDocumentBuilder();
- Document doc = db.parse(licenseInfo);
- NodeList licenses = doc.getElementsByTagName("license");
- for(int i = 0; i < licenses.getLength(); i ++)
- {
- Element license = (Element) licenses.item(i);
- String key = license.getAttribute("id");
- ArrayList headers = new ArrayList();
- licenseHeaders.put(key, headers);
- NodeList copyrights = license.getElementsByTagName("terms-header");
- for(int j = 0; j < copyrights.getLength(); j ++)
- {
- Element copyright = (Element) copyrights.item(j);
- copyright.normalize();
- String id = copyright.getAttribute("id");
- String text = getElementContent(copyright);
- if( text == null )
- continue;
- // Replace all duplicate whitespace with a single space
- text = text.replaceAll("[\\s*]+", " ");
- if( text.length() == 1)
- continue;
-
- text = text.toLowerCase();
- LicenseHeader lh = new LicenseHeader(id, text);
- headers.add(lh);
- }
- }
- log.fine(licenseHeaders.toString());
-
- File[] files = jbossSrcRoot.listFiles(dotJavaFilter);
- log.info("Root files count: "+files.length);
- processSourceFiles(files, 0);
-
- log.info("Processed "+totalCount);
- log.info("Files with no headers: "+noheaders.size());
- FileWriter fw = new FileWriter("NoHeaders.txt");
- for(Iterator iter = noheaders.iterator(); iter.hasNext();)
- {
- File f = (File) iter.next();
- fw.write(f.getAbsolutePath());
- fw.write('\n');
- }
- fw.close();
- log.info("Files with invalid headers: "+invalidheaders.size());
- fw = new FileWriter("InvalidHeaders.txt");
- for(Iterator iter = invalidheaders.iterator(); iter.hasNext();)
- {
- File f = (File) iter.next();
- fw.write(f.getAbsolutePath());
- fw.write('\n');
- }
- fw.close();
- }
-
- /**
- * Get all non-comment content from the element.
- * @param element
- * @return the concatenated text/cdata content
- */
- public static String getElementContent(Element element)
- {
- if (element == null)
- return null;
-
- NodeList children = element.getChildNodes();
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < children.getLength(); i++)
- {
- Node child = children.item(i);
- if (child.getNodeType() == Node.TEXT_NODE ||
- child.getNodeType() == Node.CDATA_SECTION_NODE)
- {
- result.append(child.getNodeValue());
- }
- else if( child.getNodeType() == Node.COMMENT_NODE )
- {
- // Ignore comment nodes
- }
- else
- {
- result.append(child.getFirstChild());
- }
- }
- return result.toString().trim();
- }
-
- /**
- * Validate the headers of all java source files
- *
- * @param files
- * @param level
- * @throws IOException
- */
- static void processSourceFiles(File[] files, int level)
- throws IOException
- {
- for(int i = 0; i < files.length; i ++)
- {
- File f = files[i];
- if( level == 0 )
- log.info("processing "+f);
- if( f.isDirectory() )
- {
- File[] children = f.listFiles(dotJavaFilter);
- processSourceFiles(children, level+1);
- }
- else
- {
- parseHeader(f);
- }
- }
- }
-
- /**
- * Read the first comment upto the package ...; statement
- * @param javaFile
- */
- static void parseHeader(File javaFile)
- throws IOException
- {
- totalCount ++;
- FileReader fr = new FileReader(javaFile);
- BufferedReader br = new BufferedReader(fr);
- String line = br.readLine();
- StringBuffer tmp = new StringBuffer();
- while( line != null )
- {
- line = line.trim();
- if( line.startsWith("package") || line.startsWith("import") )
- break;
-
- // Ignore any single line comments
- if( line.startsWith("//") )
- {
- line = br.readLine();
- continue;
- }
-
- if( line.startsWith("/**") )
- tmp.append(line.substring(3));
- else if( line.startsWith("/*") )
- tmp.append(line.substring(2));
- else if( line.startsWith("*") )
- tmp.append(line.substring(1));
- else
- tmp.append(line);
- tmp.append(' ');
- line = br.readLine();
- }
- br.close();
- fr.close();
-
- if( tmp.length() == 0 )
- {
- addDefaultHeader(javaFile);
- return;
- }
-
- String text = tmp.toString();
- // Replace all duplicate whitespace with a single space
- text = text.replaceAll("[\\s*]+", " ");
- if( tmp.length() == 1 )
- {
- addDefaultHeader(javaFile);
- return;
- }
- text = text.toLowerCase();
- // Search for a matching header
- boolean matches = false;
- Iterator iter = licenseHeaders.values().iterator();
- escape:
- while( iter.hasNext() )
- {
- List list = (List) iter.next();
- Iterator jiter = list.iterator();
- while( jiter.hasNext() )
- {
- LicenseHeader lh = (LicenseHeader) jiter.next();
- if( text.startsWith(lh.text) )
- {
- matches = true;
- if( log.isLoggable(Level.FINE) )
- log.fine(javaFile+" matches copyright "+lh.id);
- break escape;
- }
- else if( javaFile.getName().equals("CompressionConstants.java") )
- {
- log.fine("Does not match: "+lh.id);
- }
- }
- }
- text = null;
- tmp.setLength(0);
- if( matches == false )
- invalidheaders.add(javaFile);
- }
-
- /**
- * Add the default jboss lgpl header
- */
- static void addDefaultHeader(File javaFile)
- throws IOException
- {
- if( addDefaultHeader )
- {
- FileInputStream fis = new FileInputStream(javaFile);
- FileChannel fc = fis.getChannel();
- int size = (int) fc.size();
- ByteBuffer contents = ByteBuffer.allocate(size);
- fc.read(contents);
- fis.close();
-
- ByteBuffer hdr = ByteBuffer.wrap(DEFAULT_HEADER.getBytes());
- FileOutputStream fos = new FileOutputStream(javaFile);
- fos.write(hdr.array());
- fos.write(contents.array());
- fos.close();
- }
-
- noheaders.add(javaFile);
- }
-
- /**
- * A class that encapsulates the license id and valid terms header
- */
- static class LicenseHeader
- {
- String id;
- String text;
- LicenseHeader(String id, String text)
- {
- this.id = id;
- this.text = text;
- }
- }
- /**
- * A filter which accepts files ending in .java (but not _Stub.java), or
- * directories other than gen-src and gen-parsers
- */
- static class DotJavaFilter implements FileFilter
- {
- public boolean accept(File pathname)
- {
- boolean accept = false;
- String name = pathname.getName();
- if( pathname.isDirectory() )
- {
- // Ignore the gen-src directories for generated output
- accept = name.equals("gen-src") == false
- && name.equals("gen-parsers") == false;
- }
- else
- {
- accept = name.endsWith("_Stub.java") == false && name.endsWith(".java");
- }
-
- return accept;
- }
- }
-}
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphClasspathVisitor.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphClasspathVisitor.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphClasspathVisitor.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -75,10 +75,13 @@
//perform replacement operation on the pathname to try and match
//the existing libraries.ent as closely as possible
- if (pathName.indexOf('-') != -1)
- pathName = pathName.replace('-', '.');
- else if (pathName.indexOf('/') != -1)
- pathName = pathName.replace('/', '.');
+ if ((pathName.indexOf('-') != -1) || (pathName.indexOf('/') != -1))
+ {
+ if (pathName.indexOf('-') != -1)
+ pathName = pathName.replace('-', '.');
+ if (pathName.indexOf('/') != -1)
+ pathName = pathName.replace('/', '.');
+ }
else
pathName = pathName + '.' + pathName;
Added: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphComponentInfoResolverVisitor.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphComponentInfoResolverVisitor.java (rev 0)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphComponentInfoResolverVisitor.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ant.util.graph;
+
+import java.io.File;
+import java.util.Vector;
+
+import org.jboss.ant.util.FileUtil;
+import org.jboss.ant.types.ComponentRef;
+
+/**
+ * Examines a component reference graph vertex and determines
+ * if a component-info.xml file has been resolved for the reference.
+ *
+ * @author <a href="ruel.loehr at jboss.com">Ruel Loehr</a>
+ * @version $Revision$
+ */
+public class ComponentRefGraphComponentInfoResolverVisitor implements Visitor
+{
+
+ /**a list of components for which we cannot resolve their dependencies*/
+ private Vector unresolvedComponents;
+
+ /**
+ * Create a new ComponentRefGraphFileResolverVisitor.
+ */
+ public ComponentRefGraphComponentInfoResolverVisitor()
+ {
+ super();
+ unresolvedComponents = new Vector();
+ }
+
+ /**
+ *Examines the component contained in a vertex and resolves it's
+ *depedency file or add's it to a list of unresolved dependencies
+ */
+ public void visit(Graph g, Vertex v)
+ {
+
+ if (v instanceof ComponentRefVertex)
+ {
+ ComponentRefVertex currentVertex = (ComponentRefVertex) v;
+ ComponentRef ref = currentVertex.getComponentRef();
+
+ File filename;
+ //get a reference to the component-info.xml file
+ if (ref.getModule() != null)
+ filename = FileUtil.resolve(ref.getDir(), ref.getFilename());
+ else
+ filename = FileUtil.resolve(ref.getThirdpartyDir(), ref.getFilename());
+
+ if ((!filename.exists()) || (ref.isFileResolved()==false))
+ {
+ unresolvedComponents.add(currentVertex);
+ }
+ }
+ return;
+
+ }
+
+ /**
+ *Not implemented
+ */
+ public void visit(Graph g, Vertex v, Edge e)
+ {
+ //not implemented
+ }
+
+ /**
+ * Get the unresolvedComponents.
+ *
+ * @return the unresolvedComponents.
+ */
+ public Vector getUnresolvedComponents()
+ {
+ return unresolvedComponents;
+ }
+
+ /**
+ * Set the unresolvedComponents.
+ *
+ * @param unresolvedComponents The unresolvedComponents to set.
+ */
+ public void setUnresolvedComponents(Vector unresolvedComponents)
+ {
+ this.unresolvedComponents = unresolvedComponents;
+ }
+
+}
Property changes on: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphComponentInfoResolverVisitor.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphLicenseVisitor.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphLicenseVisitor.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/ant/util/graph/ComponentRefGraphLicenseVisitor.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -57,7 +57,13 @@
{
project.log("afterVisit", Project.MSG_VERBOSE);
String baseDir = project.getProperty("basedir");
- File licensesDir = new File(baseDir, "../thirdparty/licenses");
+ File licensesDir;
+
+ if (project.getProperty("external.project")!=null)
+ licensesDir = new File(baseDir, "thirdparty/licenses");
+ else
+ licensesDir = new File(baseDir, "../thirdparty/licenses");
+
licensesDir.mkdirs();
project.log("Writing license info to dir: "+licensesDir);
File licenseInfo = new File(licensesDir, "thirdparty-licenses.xml");
@@ -118,7 +124,7 @@
get.setSrc(licenseSrc);
get.setDest(licenseFile);
get.setUseTimestamp(true);
- get.setIgnoreErrors(true);
+ get.setIgnoreErrors(false);
get.setVerbose(true);
get.setProject(project);
target.addTask(get);
Modified: labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/test/VersionTest.java
===================================================================
--- labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/test/VersionTest.java 2008-07-17 20:07:35 UTC (rev 21090)
+++ labs/jbossbuild/jbossbuild/trunk/src/main/org/jboss/test/VersionTest.java 2008-07-17 20:29:05 UTC (rev 21091)
@@ -49,8 +49,119 @@
assertTrue(test8 == 0);
-
-
}
+ public void testComparisonRefactored()
+ {
+ assertLessThan("1","1.1");
+ assertLessThan("1","1.1.2");
+ assertLessThan("1.1","1.1.2");
+
+ assertLessThan("1","ruel");
+ assertLessThan("ruel","ruel.1");
+ assertLessThan("ruel.1","ruel.1jbossa");
+ assertLessThan("ruel.1jboss","ruel.1jbossa");
+
+ assertEqual("1.1.2","1.1.2");
+
+ }
+
+ public void testWordAgainstNumberBug()
+ {
+ assertLessThan("1.1.2","ruel");
+ }
+
+
+ public void testNewVersionPolicy()
+ {
+ assertLessThan("1.0RC2","1.0.0.CR3");
+ }
+
+ public void testNewVersionPolicyReversed()
+ {
+ assertGreaterThan("1.0.0.CR3","1.0RC2");
+ }
+
+ public void testSnapshot()
+ {
+ assertGreaterThan("snapshot","1.0.0.CR3");
+ }
+
+ public void testJBossPatchedVersion()
+ {
+ assertLessThan("1.0.4jboss","1.0.4.1jboss");
+ }
+
+ public void testSuccessionMatrix()
+ {
+ String [] matrix = new String [] {
+ "1.0.0.Alpha",
+ "1.0.0.Alpha1",
+ "1.0.0.Alpha2",
+ "1.0.0.Alpha3",
+ "1.0.0.Beta",
+ "1.0.0.Beta1",
+ "1.0.0.Beta2",
+ "1.0.0.Beta3",
+ "1.0.0.CR",
+ "1.0.0.CR1",
+ "1.0.0.CR2",
+ "1.0.0.CR3",
+ "1.0.0.GA",
+ "1.0.0.SP",
+ "1.0.0.SP1",
+ "1.0.0.SP2",
+ "snapshot"
+ };
+ assertMatrixOrder(matrix);
+
+ }
+
+ private void assertMatrixOrder(String[] matrix)
+ {
+ for (int i = 0; i < matrix.length; i++)
+ {
+ for (int j = 0; j < matrix.length; j++)
+ {
+ if (i < j)
+ {
+ // test each version on both sides of compareTo
+ assertLessThan(matrix[i], matrix[j]);
+ assertGreaterThan(matrix[j], matrix[i]);
+ }
+ else if (i > j)
+ {
+ assertLessThan(matrix[j], matrix[i]);
+ assertGreaterThan(matrix[i], matrix[j]);
+ }
+ else
+ {
+ assertEquals(matrix[j], matrix[i]);
+ assertEquals(matrix[i], matrix[j]);
+ }
+ }
+ }
+ }
+
+ private void assertLessThan(String version1, String version2)
+ {
+ Version versionOne = new Version(version1);
+ Version versionTwo = new Version(version2);
+ assertTrue (version1+ " should be less than "+version2,versionOne.compareTo(versionTwo) < 0);
+ }
+
+ private void assertGreaterThan(String version1, String version2)
+ {
+ Version versionOne = new Version(version1);
+ Version versionTwo = new Version(version2);
+ assertTrue (version1+ " should be greater than "+version2,versionOne.compareTo(versionTwo) > 0);
+ }
+
+ private void assertEqual(String version1, String version2)
+ {
+ Version versionOne = new Version(version1);
+ Version versionTwo = new Version(version2);
+ assertTrue (version1+ " should equal "+version2,versionOne.compareTo(versionTwo) == 0);
+ }
+
}
More information about the jboss-svn-commits
mailing list