On 8/21/01 3:30 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

> jon         01/08/21 12:30:34
> 
> Modified:    jpath    build.properties.sample build.xml
> Log:
> clean up the build system so that all one needs to do is:
> 
> #1. define a ${lib.repo} and put the various .jar files into a single location
>     this will also help make JJAR integration easier
> #2. cp build.properties.sample build.properties
> #3. ant
> 
> No need to edit files in order to define things and if a .jar file is
> missing, the build system will report the error! On top of it, the list of
> dependencies is clearly stated in the build.properties file.
> 
> Can people *please* start using this?

Actually, this method will probably go away when JJAR works as you won't
need to specify any jar files. JJAR will know what to download, modify the
classpath accordingly and report any errors. The build files that we are
currently using for turbine projects will become a lot less complex.

I think the ${lib.repo}/a-1.0.jar is a good temporary solution, but not a
long term maintainable solution. It is working well for the turbine projects
but all the check.X and <available> tasks can disappear making the build
file very clean.
 
> -jon
> 
> Revision  Changes    Path
> 1.2       +4 -3      jakarta-commons-sandbox/jpath/build.properties.sample
> 
> Index: build.properties.sample
> ===================================================================
> RCS file: /home/cvs/jakarta-commons-sandbox/jpath/build.properties.sample,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -r1.1 -r1.2
> --- build.properties.sample    2001/06/03 21:19:58    1.1
> +++ build.properties.sample    2001/08/21 19:30:34    1.2
> @@ -6,7 +6,7 @@
>  # Make any changes you need, and rename this file to
>  # "build.properties"
>  #
> -# $Id: build.properties.sample,v 1.1 2001/06/03 21:19:58 dmitri Exp $
> +# $Id: build.properties.sample,v 1.2 2001/08/21 19:30:34 jon Exp $
>  # -------------------------------------------------------------------
>  
>  
> @@ -14,6 +14,7 @@
>  # EXTERNAL DEPENDENCIES
>  # -------------------------------------------------------------------
>  
> -junit.home=c:/junit3.6
> +junit.jar=${lib.repo}/junit-3.7.jar
>  
> -jaxp.home=c:/jaxp-1.1
> +jaxp.jaxp.jar=${lib.repo}/jaxp-1.1.jar
> +jaxp.xslt.jar=${lib.repo}/xalan-2.1.0.jar
> 
> 
> 
> 1.2       +68 -24    jakarta-commons-sandbox/jpath/build.xml
> 
> Index: build.xml
> ===================================================================
> RCS file: /home/cvs/jakarta-commons-sandbox/jpath/build.xml,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -r1.1 -r1.2
> --- build.xml    2001/06/03 21:19:58    1.1
> +++ build.xml    2001/08/21 19:30:34    1.2
> @@ -3,37 +3,18 @@
>  
>  <!--
>          "JPath" component of the Jakarta Commons Subproject
> -        $Id: build.xml,v 1.1 2001/06/03 21:19:58 dmitri Exp $
> +        $Id: build.xml,v 1.2 2001/08/21 19:30:34 jon Exp $
>  -->
>  
>  
>  <!-- ========== Initialize Properties =====================================
> -->
>  
> -
> +  <property file="${user.home}/build.properties"/>   <!-- User local
> -->
>    <property file="build.properties"/>                <!-- Component local
> -->
>    <property file="../build.properties"/>             <!-- Commons local
> -->
> -  <property file="${user.home}/build.properties"/>   <!-- User local
> -->
> -
> -<!-- ========== External Dependencies =====================================
> -->
> -
> -
> -  <!-- The directory containing your binary distribution of JUnit,
> -       version 3.2 or later -->
> -  <property name="junit.home"              value="/usr/local/junit3.5"/>
> -  <property name="jaxp.home"               value="/usr/local/jaxp1.1"/>
>  
> -
> -<!-- ========== Derived Values ============================================
> -->
> -
> -
> -  <!-- The pathname of the "junit.jar" JAR file -->
> -  <property name="junit.jar"               value="${junit.home}/junit.jar"/>
> -  <property name="jaxp.jaxp.jar"           value="${jaxp.home}/jaxp.jar"/>
> -  <property name="jaxp.xslt.jar"           value="${jaxp.home}/xalan.jar"/>
> -
>  <!-- ========== Component Declarations ====================================
> -->
>  
> -
>    <!-- The name of this component -->
>    <property name="component.name"          value="jpath"/>
>  
> @@ -76,6 +57,7 @@
>      <pathelement location="${build.home}/classes"/>
>      <pathelement location="${jaxp.jaxp.jar}"/>
>      <pathelement location="${jaxp.xslt.jar}"/>
> +    <pathelement location="${junit.jar}"/>
>    </path>
>  
>  
> @@ -100,23 +82,85 @@
>  
>  <!-- ========== Executable Targets ========================================
> -->
>  
> +  <target name="check_available">
> +    <available 
> +      classname="junit.framework.Test"
> +      property="junit.present"
> +      classpathref="compile.classpath"
> +    />
> +
> +    <available 
> +      classname="org.xml.sax.SAXException"
> +      property="jaxp.jaxp.present"
> +      classpathref="compile.classpath"
> +    />
> +
> +    <available 
> +      classname="javax.xml.transform.Transformer"
> +      property="jaxp.xslt.present"
> +      classpathref="compile.classpath"
> +    />
> +  </target>
>  
>    <target name="init"
> -   description="Initialize and evaluate conditionals">
> +    description="Initialize and evaluate conditionals"
> +    depends="check_available">
>      <echo message="-------- ${component.name} ${component.version}
> --------"/>
>      <filter  token="name"                  value="${component.name}"/>
>      <filter  token="version"               value="${component.version}"/>
> +
> +    <echo message="junit.jar = ${junit.jar}"/>
> +    <echo message="jaxp.jaxp.jar = ${jaxp.jaxp.jar}"/>
> +    <echo message="jaxp.xslt.jar = ${jaxp.xslt.jar}"/>
>    </target>
>  
> +  <target name="check.junit" unless="junit.present">
> +    <antcall target="property-warning">
> +      <param name="name" value="junit.jar"/>
> +      <param name="value" value="${junit.jar}"/>
> +    </antcall>
> +  </target>
> +
> +  <target name="check.jaxp.jaxp" unless="jaxp.jaxp.present">
> +    <antcall target="property-warning">
> +      <param name="name" value="jaxp.jaxp.jar"/>
> +      <param name="value" value="${jaxp.jaxp.jar}"/>
> +    </antcall>
> +  </target>
>  
> -  <target name="prepare" depends="init"
> +  <target name="check.jaxp.xslt" unless="jaxp.xslt.present">
> +    <antcall target="property-warning">
> +      <param name="name" value="jaxp.xslt.jar"/>
> +      <param name="value" value="${jaxp.xslt.jar}"/>
> +    </antcall>
> +  </target>
> +
> +  <target name="property-warning">
> +    <echo>
> +      +----------------------------------------------------------------+
> +      + F A I L E D  R E Q U I R E M E N T                             |
> +      +----------------------------------------------------------------+
> +      | You must define the following property in order                |
> +      | to build ${component.name}:
> +      |                                                                |
> +      | ${name} = ${value}
> +      |                                                                |
> +      | You can set this property in the provided build.properties     |
> +      | file, or you may set this property in your                     |
> +      | ${user.home}/build.properties file.
> +      +----------------------------------------------------------------+
> +    </echo>
> +    <fail message="Failed Requirement"/>
> +  </target>
> +
> +  <target name="prepare" depends="init,
> +                         check.junit,check.jaxp.jaxp,check.jaxp.xslt"
>     description="Prepare build directory">
>      <mkdir dir="${build.home}"/>
>      <mkdir dir="${build.home}/classes"/>
>      <mkdir dir="${build.home}/conf"/>
>      <mkdir dir="${build.home}/tests"/>
>    </target>
> -
>  
>    <target name="static" depends="prepare"
>     description="Copy static files to build directory">
> 
> 
> 

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons


Reply via email to