Brett Porter wrote:
Hi,

This is primarily for Steve and Nicola Ken as I'm not sure if/how
closely they follow the Maven lists.

Just wanted to let you know about the changes I dropped in for the
dependencies and related tasks. Hopefully it is inline with the
feedback you'd been providing.

- added the ability to exclude specific transitive dependencies from
being pulled in from a specific dependency

yes, cool.

- ability to use a POM to specify dependencies and repositories, in
addition to the ant types

ok

- full support for external configuration (proxies, authentication
info, repository mirrors, local repository location). The search order
is ~/.ant/settings.xml, then ~/.m2/settings.xml

Is settings.xml documented anywhere?

I just found last week where java1.5 puts its proxy settings, but a bit of it is "use the browser" which is inadequate. We really need a commons-proxy-setup library to do this for standalone apps in a consistent manner.

- ability to export properties or references from the pom:
  <artifact:setProperty property="parent.artifact.id"
expression="project.parent.artifactId" pomRefId="maven.project" />
  <artifact:setProperty ref="developers"
expression="project.developers" pomRefId="maven.project" /> (not sure
whether this is a useful thing or not - I just thought references made
sense for object types)

I see. yes, it makes sense.

Here in ant-land, we've done two things to make the stuff work better

1.


This is only in the SVN version at the moment - if you'd like a
development build published just let me know.

Are there other features you see being needed, or is the focus now on
the error handling, validation and testing? Here I only mean Ant
specific things, as other features added to Maven like the dependency
path reporting, version ranges and conflict resolution will work from
the tasks as is, I think.
The only thing I've got left on my list is to incoporate the Maven
profiles support, but we need to play with that more on our end first.


1. build file tests; check handling of missing required items, etc, etc. ant-testutils is the jar for this.

2. I'd like to be able to create a mini-pom on the fly. I do this with echo today, and will move to echoproperties before long

   <target name="m2-make-pom" depends="m2-init" unless="project.haspom">
   <echo message="Creating Pom ${target.pom}" level="verbose"/>
   <echo file="${target.pom}"><![CDATA[<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>${m2.groupID}</groupId>
  <artifactId>${artifact.name}</artifactId>
  <packaging>jar</packaging>
  <version>${Version}</version>
</project>
]]></echo>

(nb, if there is a pom, I copy it with property expansion from ant)

   <target name="m2-copy-pom" depends="m2-init" if="project.haspom">
     <copy file="${project.pom}" tofile="${target.pom}" >
      <!-- we expand ant properties here.  -->
       <filterchain>
        <expandproperties/>
       </filterchain>
     </copy>
   </target>

This is a zero-dependency Pom... It'd make sense to actually import the dependency info declared elsewhere, without duplicating its entry.

3. Absence of a .pom file should not constitute a failure, if the jar is there. When hand patching stuff into a local cache, I have to hand generate stub poms just to stop it breaking

4., if it doesnt already, localRepository should take a File type and make an absolute URL of it:

 <localRepository location="../files" />

5. something to map from (artifact,groupid,version) to the path to a jar, to a pom, or the base dir. Here is my macro to get the dest directory, used when copying in local stuff.

    <macrodef name="m2-makepath">
      <attribute name="property"/>
      <attribute name="groupIDpath"/>
      <attribute name="artifactID" default="@{groupIDpath}"/>
      <attribute name="version"/>
      <sequential>
        <property name="@{property}"

location="${m2.repository}/@{groupIDpath}/@{artifactID}/@{version}" />
      </sequential>
    </macrodef>

this should do proper . to / conversion, which this macro omits.

I've attached one of my build files that does some of this stuff; its from a BSD-licensed project, not LGPL. I dont know how (L)GPL applies to build files, especially in a world of antlib, scriptdef and imports.





<?xml version="1.0"?>
<project name="cddlm-specification" default="default"
  xmlns:artifact="antlib:org.apache.maven.artifact.ant">

  <description>
    Build file for the CDDLM deliverables 
    -deployment JAR file containing schemas
    Needs Artifact antlib from http://maven.apache.org
  </description>
  <!-- override point -->
  <property file="build.properties"/>

  <!-- we are now preparing for ggf14 -->
  <property name="project.version" value="ggf14-alpha" />
  <property name="Version" value="${project.version}" />

  
  <target name="init" >
      <!-- declare directories -->
    <property name="xml.dir"
      location="xml"/>
    <property name="cddlm.dir"
      location="${xml.dir}/api"/>
    <property name="cdl.dir"
      location="${xml.dir}/cdl"/>
    <property name="constants.xml.dir"
      location="${cddlm.dir}"/>
    <property name="wsrf.dir"
      location="${xml.dir}/wsrf"/>
    <property name="soap.dir"
      location="${xml.dir}/wsrf"/>
      
    <property name="src.dir"
      location="src"/>
    <property name="test.src.dir"
      location="src/test"/>
    <property name="valid.dir"
      location="test/cdl/valid"/>

    <property name="transforms.dir"
      location="src/transforms"/>
      
    <property name="doc.dir"
      location="doc"/>

    <property name="lib.dir"
      location="lib"/>
    
    <property name="api.doc" location="doc/api/ggf-cddlm-deploy-api.doc" />
    <property name="api.pdf" location="doc/api/ggf-cddlm-deploy-api.pdf" />
    <property name="component-model.doc"
      location="doc/component-model/draft-ggf-cddlm-component-model.doc" />
    <property name="component-model.pdf"
      location="doc/component-model/draft-ggf-cddlm-component-model.pdf" />
    <property name="cdl.doc"
      location="doc/cdl/draft-ggf-cddlm-xml-cdl-10.doc" />
    <property name="cdl.pdf"
      location="doc/cdl/draft-ggf-cddlm-xml-cdl-10.pdf" />
      
    
      <!--XML Schemas -->
    <property name="xml-cdl.xsd"
      location="${cddlm.dir}/xml-cdl.xsd"/>

    <property name="component-model.xsd"
      location="${cddlm.dir}/component-model.xsd"/>
    <property name="component-model-events.xml"
      location="${cddlm.dir}/component-model-events.xml"/>
      
    <property name="deployment-api.xsd"
      location="${cddlm.dir}/deployment-api.xsd"/>

    <!-- ws-topics -->      
    <property name="deployment-api-portal-events.xml"
      location="${cddlm.dir}/deployment-api-portal-events.xml"/>
    <property name="deployment-api-system-events.xml"
      location="${cddlm.dir}/deployment-api-system-events.xml"/>

      
      <!-- WSDL -->
    <property name="deployment-api.wsdl"
      location="${cddlm.dir}/deployment-api.wsdl"/>

      <!-- generic XML -->
    <property name="constants.xml" 
      location="${constants.xml.dir}/constants.xml"/>
    <property name="transform.xsl" 
      location="${transforms.dir}/createJavaConstants.xsl"/>      

      <!-- incoming specs -->
    <property name="soap12.xsd"
      location="${soap.dir}/soap12.xsd"/>      
    <property name="ws-addressing.xsd"
      location="${soap.dir}/ws-addressing.xsd"/>      
    <property name="wsrf-rp.xsd"
      location="${wsrf.dir}/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"/>      
    <property name="wsrf-rp.wsdl"
      location="${wsrf.dir}/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"/>      
    <property name="wsrf-rl.xsd"
      location="${wsrf.dir}/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"/> 
    <property name="wsrf-rl.wsdl"
      location="${wsrf.dir}/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl"/> 
      
    <property name="wsrf-n.xsd"
      location="${wsrf.dir}/wsn-WS-BaseNotification-1.2-draft-01.xsd"/>      
    <property name="wsrf-n.wsdl"
      location="${wsrf.dir}/wsn-WS-BaseNotification-1.2-draft-01.wsdl"/>      
    <property name="wsrf-bf.xsd"
      location="${wsrf.dir}/wsrf-WS-BaseFaults-1.2-draft-01.xsd"/>
    <property name="wstop.xsd"
      location="${wsrf.dir}/wsn-WS-Topics-1.2-draft-01.xsd"/>
      
    <property name="muws-p1.xsd"
      location="${wsrf.dir}/wsdm-muws-part1.xsd"/>
    <property name="muws-p2.xsd"
      location="${wsrf.dir}/wsdm-muws-part2.xsd"/>
    <property name="wsdm-mows.xsd"
      location="${wsrf.dir}/wsdm-mows.xsd"/>      
      <!-- output directories - declare and create -->
    <property name="build.dir" location="build"/>
    <property name="build.classes.dir" location="${build.dir}/classes"/>
    <property name="build.cs.dir" location="${build.dir}/csharp"/>
    <property name="build.axis.dir" location="${build.dir}/axis"/>
    <property name="build.jarsrc.dir" location="${build.dir}/jar/src"/>
    
    
    <property name="dist.dir" location="dist"/>
      
    <mkdir dir="${build.dir}"/>
    <mkdir dir="${build.classes.dir}"/>
    <mkdir dir="${build.cs.dir}"/>
    <mkdir dir="${build.axis.dir}"/>
    <mkdir dir="${build.jarsrc.dir}"/>
    <mkdir dir="${dist.dir}"/>

    <!-- handwritten code -->
    
    <property name="java.src.dir" location="src/java" />
    <property name="cs.src.dir" location="src/cs" />
    <property name="test.src.dir" location="src/test" />
    
    <!-- generated code -->
    <property name="cs.client.namespace" value="Cddlm" />
    
    <property name="deployment-api.cs" 
      location="${build.cs.dir}/deployment-api.cs"/>
    <property name="component-model-api.cs" 
      location="${build.cs.dir}/component-model.cs"/>
    
    <property name="component-model-api.cs" 
      location="${build.cs.dir}/component-model.cs"/>
          
    <!-- constants  processing -->
    
    <!-- currently the package is hard coded into the XSL file, BTW -->
    
    <property name="cddlm.package.path" value="org/ggf/cddlm/"/>
    <property name="constants.package" value="org.ggf.cddlm.generated.api"/>
    <property name="constants.package.path" value="org/ggf/cddlm/generated/api"/>
    
    <property name="constants.generated.dir" location="${build.jarsrc.dir}/${constants.package.path}"/>
    <property name="doc.generated.dir" location="${constants.generated.dir}"/>
    <mkdir dir="${constants.generated.dir}"/>
    <property name="generated.constants.java"
      location="${build.jarsrc.dir}/${constants.package.path}/CddlmConstants.java"/>

    <property name="soapapi.package.dir" location="${build.jarsrc.dir}/org/ggf/cddlm/xml/wsrf" />
    <mkdir dir="${soapapi.package.dir}" />
    <property name="xmlapi.package.dir" location="${build.jarsrc.dir}/org/ggf/cddlm/xml/api" />
    <mkdir dir="${xmlapi.package.dir}" />
    
    <!-- target name -->

    <property name="project.name" value="cddlm" />
    
    <property name="target.name" value="${project.name}-${project.version}.zip"/>
    
    <property name="jarfile.suffix" value=""/>
    <property name="jarfile.extension" value="jar"/>
    <property name="artifact.name" value="${project.name}" />
    <property name="jarfile.stub" value="${artifact.name}${jarfile.suffix}-${Version}" />
    <property name="jarfile.name" value="${jarfile.stub}.${jarfile.extension}"/>
    <property name="target.zip"
        location="${dist.dir}/${target.name}" />
    <property name="target.jar"
        location="${dist.dir}/${jarfile.name}" />
    <echo level="verbose">target zip=${target.zip}</echo>
    
    <!-- presets -->
    <presetdef name="validate-xsd">
      <schemavalidate >
        <schema namespace="http://www.w3.org/2001/XMLSchema";
          file="${soap.dir}/XMLSchema.xsd" />
        <schema namespace="http://www.w3.org/XML/1998/namespace";
          file="${soap.dir}/xml.xsd" />
        <dtd publicId="http://www.w3.org/2001/datatypes.dtd";
          location="${soap.dir}/datatypes.dtd" />
        </schemavalidate>
    </presetdef>
    
    <presetdef name="validate-soap">
      <validate-xsd >
        <schema namespace="http://www.w3.org/2003/05/soap-envelope";
          file="${soap12.xsd}" />
        <schema namespace="http://schemas.xmlsoap.org/wsdl/";
          file="${soap.dir}/wsdl.xsd" />
        <schema namespace="http://schemas.xmlsoap.org/wsdl/soap/";
         file="${soap.dir}/wsdlsoap.xsd" />
      </validate-xsd>
    </presetdef>
    
    <!-- WSRF declarations -->
    <presetdef name="validate-wsrf">
      <validate-soap >
       <schema namespace="http://schemas.xmlsoap.org/ws/2003/03/addressing";
          file="${ws-addressing.xsd}" />
        <schema
          namespace="http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceProperties";
          file="${wsrf-rp.xsd}" />
        <schema
          namespace="http://www.ibm.com/xmlns/stdwip/web-services/WS-ResourceLifetime";
          file="${wsrf-rl.xsd}" />
        <schema
          namespace="http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification";
          file="${wsrf-n.xsd}" />
        <schema
          namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd";
          file="${wsrf-bf.xsd}" />
        <schema
          namespace="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-Topics-1.2-draft-01.xsd";
          file="${wstop.xsd}" />
        </validate-soap>
    </presetdef>

    <presetdef name="validate-mows">
      <validate-wsrf >
      <!-- later version of WSA from the rest. -->
      <schema
          namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing";
          file="${wsrf}/addressing-2004-08.xsd" />
        <schema
          namespace="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd";
          file="${muws-p1.xsd}" />
        <schema 
          namespace="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd";
          file="${muws-p2.xsd}" />
      </validate-wsrf>
    </presetdef>
    
    
    <presetdef name="validate-cddlm">
      <validate-wsrf >
        <schema namespace="http://www.gridforum.org/namespaces/2005/02/cddlm/CDL-1.0";
          file="${xml-cdl.xsd}" />
        <schema namespace="http://www.gridforum.org/cddlm/deployapi/2005/02";
          file="${deployment-api.xsd}" />
        <schema namespace="http://www.gridforum.org/cddlm/components/2005/02";
          file="${component-model.xsd}" />
      </validate-wsrf>
    </presetdef>
    
    
  </target>
  
  
  
  <!-- ========================================================== -->
  <!-- cleanup target -->
  <!-- ========================================================== -->
  <target name="clean" description="clean up build and dist"
      depends="init">
    <delete dir="${build.dir}" />    
    <delete dir="${dist.dir}"  />    
  </target>  
  
  <!-- ========================================================== -->
  <!-- verify the constants file is valid -->
  <!-- ========================================================== -->
  <target name="validate-constants" 
    description="validate constants.xml against the DTD"
    depends="init">
    <xmlvalidate file="${constants.xml}">
    </xmlvalidate>
    <fail>No Transform ${transform.xsl}
    <condition>
      <not><available file="${transform.xsl}"/></not>
    </condition>
    </fail>
  </target>

  <!-- ========================================================== -->
  <!-- xsl the constants -->
  <!-- ========================================================== -->
  <target name="constants" depends="validate-constants,init"
    description="create java constants from XML">
    <!-- demand create the directories -->
    <mkdir dir="${constants.generated.dir}"/>
    <mkdir dir="${doc.generated.dir}"/>
    <!-- now transform xml to java -->
    <xslt in="${constants.xml}"
      out="${generated.constants.java}"
      style="${transform.xsl}">
      <param name="package" expression="${constants.package}"/>
    </xslt>
    <!-- transform xml to HTML, for documentation -->
    <xslt in="${constants.xml}"
      out="${doc.generated.dir}/constants.html"
      style="${transforms.dir}/createHtmlConstants.xsl">
    </xslt>
  </target>
  

  
  <!-- ========================================================== -->
  <!-- verify the constants file is valid -->
  <!-- ========================================================== -->
  <target name="xsd"
    description="validate the XSD files"
    depends="init">
    <validate-cddlm file="${xml.dir}/test.xsd"/>
    <validate-cddlm file="${component-model.xsd}"/>
    <validate-cddlm file="${deployment-api.xsd}"/>
    <validate-cddlm file="${xml-cdl.xsd}"/>
  </target>

  <target name="wsrf"
    description="validate the WSRF schemas themselves"
    depends="init">
    <validate-wsrf file="${soap12.xsd}"/>
    <validate-wsrf file="${ws-addressing.xsd}"/>
    <validate-wsrf file="${wsrf-rp.wsdl}"/>
    <validate-wsrf file="${wsrf-bf.xsd}"/>
    <validate-wsrf file="${wsrf-rl.wsdl}"/> 
    <validate-wsrf file="${wsrf-n.wsdl}"/>
    <validate-wsrf file="${muws-p1.xsd}"/>
    <validate-wsrf file="${muws-p2.xsd}"/>
    <validate-wsrf file="${wsdm-mows.xsd}"/> 
    
  </target>  
  
  <target name="wsdl"
    description="validate the wsdl"
    depends="xsd">
    <validate-cddlm file="${component-model.xsd}"/>
    <validate-cddlm file="${deployment-api.wsdl}"/>
    <validate-cddlm file="${deployment-api-portal-events.xml}"/>
    <validate-cddlm file="${deployment-api-system-events.xml}"/>
    <validate-cddlm file="${component-model-events.xml}"/>
  </target>

  <target name="test-documents"
    description="validate the CD: test documents"
    depends="init">

    <validate-cddlm file="${valid.dir}/minimal.cdl"/>
    <validate-cddlm file="${valid.dir}/extra-elements.cdl"/>
    <validate-cddlm file="${valid.dir}/webserver.cdl"/>
    <validate-cddlm file="${valid.dir}/webserver-no-namespace.cdl"/>
    <validate-cddlm file="${valid.dir}/webserver-default-namespace.cdl"/>
    <validate-cddlm file="${valid.dir}/documented.cdl"/>
    <validate-cddlm file="${valid.dir}/references-1.cdl"/>
    <validate-cddlm file="${valid.dir}/references-2.cdl"/>
    <validate-cddlm file="${valid.dir}/references-3.cdl"/>
    <validate-cddlm file="${valid.dir}/expression-1.cdl"/>
    <validate-cddlm file="${valid.dir}/type-1.cdl"/>
    <validate-cddlm file="${valid.dir}/lazy-1.cdl"/>
    <validate-cddlm file="${valid.dir}/lazy-2.cdl"/>
    <validate-cddlm file="${valid.dir}/parameterization-1.cdl"/>
    <validate-cddlm file="${valid.dir}/full-example-1.cdl"/>
    <validate-cddlm file="${valid.dir}/full-example-2.cdl"/>
    <validate-cddlm file="${valid.dir}/full-example-3.cdl"/>

<!--
  This doesnt work.
  http://issues.apache.org/bugzilla/show_bug.cgi?id=34843
  http://issues.apache.org/bugzilla/show_bug.cgi?id=32791

    <validate-cddlm>
      <fileset dir="${valid.dir}" includes="*.cdl"/>
    </validate-cddlm>
-->

  </target>

  <target name="xml" depends="xsd,wsrf,wsdl,test-documents"
    description="validate all the XML documents"/>

  
  <target name="zip" depends="init,xml"
    description="make a zip file">
    <zip destFile="${target.zip}">
      <zipfileset dir="xml/api" prefix="xml/cddlm" >
        <include name="*.wsdl" />
        <include name="*.xsd" />
        <include name="*.xml" />
      </zipfileset>
      <zipfileset dir="xml/wsrf" prefix="xml/wsrf" >
        <include name="*.wsdl" />
        <include name="*.xsd" />
        <include name="*.xml" />
      </zipfileset>
      <zipfileset prefix="doc" file="${api.doc}" />
      <zipfileset prefix="doc" file="${api.pdf}" />
      <zipfileset prefix="doc" file="${component-model.doc}" />
      <zipfileset prefix="doc" file="${component-model.pdf}" />
      <zipfileset prefix="doc" file="${cdl.doc}" />
      <zipfileset prefix="doc" file="${cdl.pdf}" />
    </zip>
  </target>

  <target name="unzip" depends="zip" >
    <property name="unzip.dir" value="${build.dir}/unzip" />
    <mkdir dir="${unzip.dir}" />
    <unzip src="${target.zip}" dest="${unzip.dir}" />
  </target>


  <target name="dotnet-xsd" depends="wsdl">
  <!-- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpconXMLSchemaDefinitionToolXsdexe.asp -->
  <!--  xsd.exe <schema>.xsd /classes|dataset [/e:] [/l:] [/n:] [/o:] [/s] [/uri:] -->
    <exec executable="xsd" failonerror="true">
      <arg value="${deployment-api.xsd}" />
      <arg value="/c" />
      <!-- <arg value="/out:${build.cs.dir}" /> -->
      
    </exec>
  </target>
      
  <target name="dotnet" depends="wsdl">
    <wsdltodotnet
      destfile="${deployment-api.cs}"
      srcfile="${deployment-api.wsdl}"
      namespace="${cs.client.namespace}"
      extraoptions ="/parsableerrors"
      />
  </target>
  
  <!-- this is there for anyone behind the firewall; set the proxy here
    by declaring the proxy.host in your custom build.properties file
    before running this-->
  
  <target name="probe-proxy" depends="init">
    <condition property="proxy.enabled">
      <and>
        <isset property="proxy.host"/>
        <isreachable host="${proxy.host}"/>
      </and>
    </condition>
  </target>
  
  <target name="proxy" depends="probe-proxy" if="proxy.enabled">
    <property name="proxy.port" value="80" />
    <property name="proxy.user" value="" />
    <property name="proxy.pass" value="" />
    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
            proxyuser="${proxy.user}" proxypassword="${proxy.pass}" />
  </target>
  
  
  <target name="declare-versions" depends="init">
    
    <property file="libraries.properties"/>
    <property name="maven.url"
      value="http://ibiblio.org/maven/"/>
    <property name="axis.version" value="1.2-RC3" />
    <property name="xerces.version" value="2.6.2" />
    <property name="log4j.version" value="1.2.8" />
    <property name="c-logging.version" value="1.0.4" />
    <property name="c-discovery.version" value="0.2" />
    <property name="c-httpclient.version" value="3.0-rc1" />
  </target>
  
  <!-- import libs. may need proxy setup -->
  <!-- note that this is a very unstable corner of Ant; needs
       CVS_HEAD releases and will definitely change before long -->
  <target name="m2" depends="init,proxy,declare-versions" >
  
    <artifact:dependencies pathID="axis.classpath">
    <!--  <localRepository location="${basedir}/target/local-repo" />  -->
      <dependency groupID="log4j"
        artifactID="log4j" 
        version="${log4j.version}"/>
      <dependency groupID="axis"
        artifactID="axis-ant" 
        version="${axis.version}"/>
      <dependency groupID="axis"
        artifactID="axis-jaxrpc" 
        version="${axis.version}"/>
      <dependency groupID="axis"
        artifactID="axis-saaj" 
        version="${axis.version}"/>
      <dependency groupID="axis"
        artifactID="axis-wsdl4j" 
        version="${axis.version}"/>
      <dependency groupID="axis"
        artifactID="axis" 
        version="${axis.version}"/>
      <dependency groupID="commons-discovery"
        artifactID="commons-discovery"
        version="${c-discovery.version}"/>
      <dependency groupID="commons-httpclient"
        artifactID="commons-httpclient"
        version="${c-httpclient.version}"/>
      <dependency groupID="commons-logging"
        artifactID="commons-logging"
        version="${c-logging.version}"/>
      <dependency groupID="xerces"
        artifactID="xercesImpl"
        version="${xerces.version}"/>        
      <dependency groupID="xerces"
        artifactID="xmlParserAPIs"
        version="${xerces.version}"/>        
    </artifact:dependencies>
  
  </target>
  
  <target name="axis" depends="wsdl,m2">
    <axis-wsdl2java
      all="true"
      failonnetworkerrors="true"
      printstacktraceonfailure ="true"
      serverside ="true"
      testcase ="true"
      verbose="true"
      debug="true"
      url ="${deployment-api.wsdl}"
      output = "${build.axis.dir}"
      typemappingversion ="1.2"
      >
    </axis-wsdl2java>
  </target>
  
  <target name="generate" depends="dotnet,axis"
      description="Generate Axis and .NET clients" >

   
  </target>

  <!-- copy stuff from our XML directories, 
       for inclusion in the source tree, 
       in the packages we want-->
  <target name="prepare-source" depends="constants" >
    <copy todir="${soapapi.package.dir}" >
      <fileset dir="${wsrf.dir}" includes="*.dtd,*.xsd,*.wsdl,*.xml" />
    </copy>
    <copy todir="${xmlapi.package.dir}" >
      <fileset dir="${cddlm.dir}" includes="*.dtd,*.xsd,*.wsdl,*.xml" />
    </copy>
  </target>
  
  <!-- compile all java source, including generated files -->
  <target name="javac" depends="constants" >
    <javac source="1.5" target="1.5"
      destdir="${build.classes.dir}"
      debug="true">
      <src path="${build.jarsrc.dir}" />
      <!-- omitted until we have source to compile-->
      <!--<src path="${java.src.dir}" />-->
    </javac>
  </target>

  
  <target name="jar" depends="javac,xml,prepare-source"
      description="Make a JAR from the compiled source and XSD files" >
    <jar destfile="${target.jar}" >
      <zipfileset dir="${build.classes.dir}" />
      <zipfileset dir="${build.jarsrc.dir}" />
      <zipfileset dir="test/cdl" includes="**/*.cdl,**/*.xsd" prefix="test/cdl" />
      <manifest >
        <attribute name="Built-By" value="${user.name}"/>
        <section name="CDDLM">
          <attribute name="Specification-Title" value="GGF CDDLM"/>
          <attribute name="Specification-Version"
            value="${project.version}"/>
          <attribute name="Specification-Vendor" value="GGF"/>
        </section>
      </manifest>
    </jar>
  </target>

  <target name="unjar" depends="jar"
      description="expand the JAR" >
    <property name="unjar.dir" location="${build.dir}/unjar" />
    <unjar src="${target.jar}" dest="${unjar.dir}" />
  </target>

  <target name="default" depends="jar" description="do everything"/>

  <target name="checksum-target-jar"
    description="checksum our target jar" depends="jar">
    <checksum file="${target.jar}" algorithm="md5"/>
    <checksum file="${target.jar}" algorithm="sha1"/>
  </target>

  
  <!-- ========================================================== -->
  <!-- init all the maven2 support   -->
  <!-- ========================================================== -->
     <target name="m2-init" depends="init,proxy">
    <property file="${smartfrog.components.dir}/libraries.properties" />

    <!-- Maven2 stuff
      All components build into the org.smartfrog group, unless otherwise stated, but
      are their own artifacts. 
      -->
    <property name="m2.dir" location="${user.home}/.m2/repository" />
    <property name="m2.groupID" value="org.ggf" />
    <property name="m2.groupID.path" value="org/ggf" />
    <property name="m2.subdir" 
      location="${m2.dir}/${m2.groupID.path}/${artifact.name}/${Version}" />
      <!-- pom setup -->
    <property name="target.pom" location="${jarfile.stub}.pom" />
    <property name="project.pom" location="project.pom" />
    <available property="project.haspom" file="${project.pom}" />
        
   </target>  

  <!-- ========================================================== -->
  <!-- POM creation/copy, depending on whether it exists or not   -->
  <!-- ========================================================== -->
  
   <target name="m2-copy-pom" depends="m2-init" if="project.haspom">
     <copy file="${project.pom}" to="${target.pom}" />
   </target>

   <!-- inline creation of a very minimal (zero dependency) pom -->
   <target name="m2-make-pom" depends="m2-init" unless="project.haspom">
   <echo message="Creating Pom ${target.pom}" level="verbose"/>
   <echo file="${target.pom}"><![CDATA[<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>${m2.groupID}</groupId>
  <artifactId>${artifact.name}</artifactId>
  <packaging>jar</packaging>
  <version>${Version}</version>
</project>
]]></echo>
   
   </target>

   
   <target name="m2-pom" depends="m2-copy-pom,m2-make-pom" />
  
  <!-- ========================================================== -->
  <!-- install the jar, to the local maven2 repository -->
  <!-- ========================================================== -->
  <target name="m2-install" depends="checksum-target-jar,m2-pom,m2-init"
      description="copy the JAR file local maven repository">
      
    <mkdir dir="${m2.subdir}"/>    
    <copy file="${target.jar}" todir="${m2.subdir}"/>
    <!-- copy a pom -->
    <copy file="${target.pom}" todir="${m2.subdir}" failonerror="false"/>
    <copy file="${target.jar}.md5" todir="${m2.subdir}" failonerror="false"/>

  </target>
  
  <!-- =================================================================== -->
  <!--   JavaDocs                                                             -->
  <!-- =================================================================== -->
  <target name="javadoc" depends="jar" description="Generates the API documentation">
    <property name="build.javadocs.dir" value="${build.dir}/javadocs/" />
    <mkdir dir="${build.javadocs.dir}"/>
    <javadoc packagenames="org.ggf.cddlm.*"
           sourcepath="${build.jarsrc.dir}"
           destdir="${build.javadocs.dir}"
           version="true"
           use="true"
           >
    </javadoc>

  </target>  
  
    <!-- patch the API XSD/WSDL by switching to the other layout
       
    -->
  <target name="patch-api" depends="init">

    
    <property name="patched.dir" location="${build.dir}/patched" />
    <mkdir dir="patched.dir" />
    <property name="patched-api.xsd" location="${build.dir}/patched/deployment-api.xsd"/>
    <copy todir="${patched.dir}">
      <fileset dir="${cddlm.dir}" includes="*.xml,*.wsdl" />
    </copy>
    <replace dir="${patched.dir}" includes="*.xml,*.wsdl" >
      <replacefilter
        token="!!DELETE--&gt;"
        value=""/>
      <replacefilter
        token="&lt;!--!!REPLACE!!"
        value="--&gt;"/>
    </replace>
  </target>   
    
</project>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to