You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by sm...@apache.org on 2007/04/24 07:30:56 UTC

svn commit: r531732 [1/2] - in /harmony/enhanced/buildtest/branches: ./ 2.0/ 2.0/adaptors/ 2.0/adaptors/classlib/ 2.0/adaptors/drlvm/ 2.0/scripts/ 2.0/scripts/templates/

Author: smishura
Date: Mon Apr 23 22:30:55 2007
New Revision: 531732

URL: http://svn.apache.org/viewvc?view=rev&rev=531732
Log:
Create buildtest branch 2.0 and add new infra from HARMONY-3501:
(BT Infra Improvment)

Added:
    harmony/enhanced/buildtest/branches/
    harmony/enhanced/buildtest/branches/2.0/
    harmony/enhanced/buildtest/branches/2.0/README.txt   (with props)
    harmony/enhanced/buildtest/branches/2.0/SPEC.txt   (with props)
    harmony/enhanced/buildtest/branches/2.0/adaptors/
    harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/
    harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/adaptor.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/parameters.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/
    harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/adaptor.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/parameters.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/build.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/buildtest.bat   (with props)
    harmony/enhanced/buildtest/branches/2.0/buildtest.dtd   (with props)
    harmony/enhanced/buildtest/branches/2.0/buildtest.sh   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/
    harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/download.txt   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/download.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/exec-adaptor.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/framework.properties   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/framework.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/local.properties.template   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/parameters.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/templates/
    harmony/enhanced/buildtest/branches/2.0/scripts/templates/cc-config-template.xml   (with props)
    harmony/enhanced/buildtest/branches/2.0/scripts/templates/cc-project-template.xml   (with props)

Added: harmony/enhanced/buildtest/branches/2.0/README.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/README.txt?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/README.txt (added)
+++ harmony/enhanced/buildtest/branches/2.0/README.txt Mon Apr 23 22:30:55 2007
@@ -0,0 +1,221 @@
+                           =========================
+                           Build Test Infrastructure
+                           =========================
+
+---------------
+Archive Content
+---------------
+
+This archive contains improved and restructured Build Test (BT) Infrastructure.
+New BT architecture brings the clear structure on the trunk as well as several
+useful means simplifying test suite execution and new test suite integration.
+
+  +/
+   |-+scripts/      - BT Framework Implementation
+   |
+   |-+adaptors/     - Adaptors connecting test suites to BT
+   |
+   |-+tests/        - Tests suites placed under BuildTest repository
+   |
+   |-build.xml      - Main Build File
+   |
+   |-buildtest.dtd  - DTD for Main Build File
+   |
+   |-README.txt     - Readme File
+   |
+   |-SPEC.txt       - BT Specification
+
+
+-------------------------
+Pre-requisites for BT Use
+-------------------------
+
+To use BT following tools are required to be preinstalled on your system:
+
+  1) JDK version 1.5.0
+     http://java.sun.com
+     http://www.jrockit.com/
+
+  2) Apache Ant, version 1.6 or higher 
+     http://ant.apache.org
+
+  3) C compiler, either gcc for Linux*, or one of the following for Windows*:
+         + Microsoft* 32-bit C/C++ Compiler v.7 or higher,
+         + Windows* platform SDK,
+         + Microsoft* Visual Studio .NET* 2003 or higher
+           http://www.microsoft.com/downloads/
+
+  4) Subversion tool (svn)
+     http://subversion.tigris.org/
+
+
+=======================
+Using BT Infrastructure
+=======================
+
+Assumed BT usage (not actual, but after integration into repository, see next
+section for current use) is as follows:
+
+  ---------------------------------------
+* Test Execution (post integration vision)
+  ----------------------------------------
+
+  To launch some of the integrated test suites user should perform following 
+steps:
+    
+  1. Getting BT Infra
+    
+      #> svn co -r HEAD -N http://svn.apache.org/repos/asf/harmony/enhanced/buildtest/trunk
+     
+     It will download ONLY Main Build file and README's from SVN repository
+     Such a trick is needed for traffic and checkout time economy.
+
+  2. Setting Up and getting needed Test Suites:
+  
+    #> buildtest -Dtest.suites="classlib,drlvm" setup
+
+    It will:
+      1. Download BT Framework implementation (./scripts dir from BT trunk) if
+         it has not been done yet.
+      2. Set Up the Framework
+      3. Download adaptors for classlib and drlvm test suites already 
+         integrated into BT (if it has not been done yet).
+      4. Launch Set Up for selected Test Suites. These Set Ups will download
+         (or update) needed test sources for selected Test Suites and prepare
+         them for execution.
+      5. Extract REQUIRED parameters needed to be specified by used and
+         request user to provide the values for them.
+
+  3. User provides REQUIRED values for the build configuration
+
+  4. Execution of selected test suites:
+
+    #> buildtest
+      or 
+    #> buildtest run
+
+  5. Execution under Cruise Control system:
+
+    #> buildtest cc-run
+
+
+  ------------------------------------
+* Test Execution (pre-integration use)
+  ------------------------------------
+
+As it is not under SVN yet, to run the suites user should perform the following
+actions:
+
+  1. Setting Up and getting needed Test Suites:
+  
+    #> buildtest.bat -Dtest.suites="classlib,drlvm" setup
+
+  2. User provides REQUIRED values for the build configuration
+
+  3. Run the suites:
+
+    #> buildtest.bat -Dtest.suites="classlib,drlvm" run
+ 
+     or under CC:
+
+    #> buildtest.bat -Dtest.suites="classlib,drlvm" run-cc
+
+
+==========================
+New Test Suite Integration
+==========================
+
+To Integrate your Test Suite (say, 'my-test-suite') into new BT Framework you
+should perform the following steps:
+
+   1. Implement Adaptor interface for your Test Suite:
+     : implement _setup_, _run_, _clean_ targets in 
+          ${root.dir}/my-test-suite/adaptor.xml
+     * More on _Adaptors_ see at "SPEC.txt/Test Suite Adaptors" section
+
+   2. Define the Parameters of the Test Suite in 
+          ${root.dir}/my-test-suite/parameters.xml 
+      file:
+       - <required> section - list all properties required to be set up by user
+       - <shared> section - list all the values to be shared by the test suite
+       - <external> section - list all external dependencies to be downloaded
+       - <optional> section - list optional parameters for low-level tuning (not
+         supported at this development stage)
+       - depends attribute - coma separated list of dependencies on other suites
+     * More on _Parameters_ see at "SPEC.txt/Test Suite Parameters" section
+
+   3. Place adaptor.xml and parameters.xml under adaptor/${suite.name}
+      directory
+
+   4. If there is a reason to place sources of new Test Suite under BT
+      SVN, place them under tests/${suite.name} directory of BT repository and
+      use this location as a pointer to the sources.
+      -----
+      Note: Assumed BT usage does not suppose that all of the BT trunk files
+      ----- will be checked out. So adaptor.xml should check out the sources
+            by itself.
+
+   5. To run your 'my-test-suite' suite alone:
+      1. Set up environment variables in buildtest.bat
+      2. If you're using proxy for internet connection, set it up at ANT_OPTS
+         variable.
+      3. Type:
+            #> buildtest.bat -Dtest.suites=my-test-suite setup
+         to setup BT Infra.
+      4. Specify all of the required parameters in generated
+            required-parameters.properties
+         file.
+      5. Type:
+            #> buildtest.bat -Dtest.suites=my-test-suite run
+         to execute your suite alone.
+      6. Type:
+            #> buildtest.bat -Dtest.suites=my-test-suite run-cc
+         to launch continuous execution of your test suite.
+
+   6. Do 5. without
+        -Dtest.suites=my-test-suite
+      parameter to setup and execute all of the installed test suites.
+
+
+--------------------------
+Active Workspace Structure
+--------------------------
+
+  +/
+   |-+build/
+   |  |
+   |  |-+cc/        - CC related stuff
+   |  |
+   |  |-+checkouts/ - externally checkouted test suites (not included in BUILDTEST)
+   |  |
+   |  |-+lib/       - external libraries needed for fwk and test suites
+   |  |
+   |  |-+tmp/       - temporary files
+   |
+   |
+   |-+scripts/      - Framework implementation
+   |
+   |-+adaptors/     - Test Suites adaptors implementations
+   |
+   |-+tests/        - Tests Suites placed under BUILDTEST and dowlnoaded on 'setup' stage
+   |
+   |-build.xml      - Main Build file
+   |
+   |-buildtest.dtd  - DTD for Main Build File
+   |
+   |-README.txt     - Readme file
+   |
+   |-SPEC.txt       - BT Specification
+
+
+
+
+
+
+
+
+
+
+
+
+

Propchange: harmony/enhanced/buildtest/branches/2.0/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/SPEC.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/SPEC.txt?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/SPEC.txt (added)
+++ harmony/enhanced/buildtest/branches/2.0/SPEC.txt Mon Apr 23 22:30:55 2007
@@ -0,0 +1,302 @@
+= Test Suite Adaptors
+
+   1. Test Suite Adaptor is an Ant script acting as a glue between BT framework
+      and Test Suite to be integrated.
+
+   2. The Adaptor implementatin should be placed in adaptor.xml file under
+        ${root.dir}/adaptors/${suite.name}
+      directory.
+
+   3. The adaptor.xml should implement 3 targets:
+      - setup - should implement the all the functionality needed to
+                prepare the test suite for actual run
+      - run   - should make the actual execution of the test suite
+      - clean - should clean all the artifacts produced by test suite.
+
+
+= Test Suite Parameters
+
+ o Common Notions and Use
+
+   1. All of the parameters needed to integrate, tune and launch the test suite
+      are specified in parameters.xml placed near the adaptor.xml in 
+          ${root.dir}/adaptors/${suite.name}/ 
+      directory.
+
+   2. The parameters.xml has <parameters> root element and several sections separating
+      the parameters by their semantics.
+
+   3. Currently BT Framework supports the following sections for parameters:
+      * <required> 
+          used to describe the parameters 'required' to launch 
+          the test suite (example: jvm.under.test).
+      * <external>  
+          used to describe the external libraries on which the test
+          suite depends.
+      * <shared>
+          used for sharing some values with other suites.
+      * <cc>
+          used to describe some parameters used for default
+          Cruise Control configuration (example: use SVN checks on the test
+          suite or not, use trigger file for rerun or not)
+
+   4. Sections under TODO list:
+      * <optional>
+          to describe some 'optional' configuration parameters for this test
+          suite.
+   
+ o Parameters Values resolution
+
+   1. The ways to resolve parameters specified in each section can differ and
+      are specified for each section separately.
+
+   2. One common way for all of the sections is use extended name for the
+      parameter which constructed according to Ant's <xmlproperty> task
+      specification. For example, for parameters.xml for test suite named
+      'my-test-suite' described in the following form:
+        ---------- adaptors/my-test-suite/parameters.xml -------
+        <parameters>
+            <required>
+                <req.param 
+                  description="Required For Something Important"
+                  value="Some Parameter Value"/>
+            </required>
+
+            <shared>
+                <sources.dir value="${sources.dir}"/>
+                <build.dir value="${sources.dir}/target"/>
+            </shared>
+
+            <external>
+                <junit-3.8.1
+                    url="http://some.host.org/junit-3.8.1.jar"
+                    md5="1f40fb782a4f2cf78f161d32670f7a3a"
+                />
+            </external>
+        </parameters>
+        --------------------------------------------------------
+      the following set of properties will be set:
+
+        my-test-suite.parameters.external.junit-3.8.1.md5=1f40fb782a4f2cf78f161d32670f7a3a
+        my-test-suite.parameters.shared.build.dir=${sources.dir}/target
+        my-test-suite.parameters.shared.sources.dir=${sources.dir}
+        my-test-suite.parameters.required.req.param.description=Required For Something Important
+        my-test-suite.parameters.external.junit-3.8.1.url=http://some.host.org/junit-3.8.1.jar
+        my-test-suite.parameters.required.req.param=Some Parameter Value
+
+      Such a keys are considered as in an extended form and can be used as a
+      common way for resolving of the parameter values.
+      
+
+ o Required Parameters
+ 
+  o Common Notions and Use
+ 
+   0. Required Parameters are those without which Test Suite won't run
+      (such as: path to tested classlib, jvm and so on)
+ 
+   1. In case of unspecified value for some of the 'required' parameters,
+      BT framework will report it and won't launch the selected test suites
+ 
+   2. All of the required parameters for selected test suites are collected in
+         ${root.dir}/required-parameters.properties
+      file. This file is generated by framework on 'setup' stage and 
+      should be used for specification of the values for
+      unset required parameters.
+      -----
+      Note: ${root.dir}/required-parameters.properties file should not be
+      ----- used for specification of the values for properties other
+            than 'required'. If you will add your property to this file,
+            BT framework will warn you about it and remove this property
+            from this file. Your property with its value will be saved into
+                 ${root.dir}/backup-parameters.properties 
+            file. You SHOULD use 
+                 ${root.dir}/framework.local.properties
+            file for setting up the properties other than required.
+ 
+   3. Any required parameters values specified for unselected test suites
+      will be saved in 
+         ${root.dir}/backup-parameters.properties 
+      file. If you want to reuse these values, do copy/paste from this file
+      to 
+         ${root.dir}/required-parameters.properties
+      file.
+ 
+  o Required Parameters Specification and Dereferencing
+ 
+   1. Required Parameters are specified by means of <required> section of
+      parameters.xml file as follows:
+       - Required Parameter named as 'req.param' for test suite 'my-test-suite'
+         should be added into the section <required> in the following form:
+         ---------- adaptors/my-test-suite/parameters.xml -------
+         ...
+         <required>
+             ...
+             <req.param description="Required For Something Important"/>
+             ...
+         </required>
+         ...
+         --------------------------------------------------------
+         -----
+         Note: Without description your parameter won't be considered as
+         ----- required.
+         
+   2. Inside the my-test-suite/adaptor.xml this parameter can be accessed by
+      the following ways:
+       - by using of its short name: 
+             ${req.param}
+       - by using of its short name with 'my-test-suite' prefix: 
+             ${my-test-suite.req.param}
+       - by using of extended parameter name:
+             ${my=test-suite.parameters.required.req.param}
+ 
+   3. Inside the 'Required Parameters Specification File':
+         ${root.dir}/required-parameters.properties
+      this parameter will be in short form prefixed with suite's name.
+ 
+  o Default Values for Required Parameters
+ 
+   1. It's possible to provide default values for required parameters 
+      based on the shared parameters of other test suites.
+ 
+   2. The parameter holding the value for the required parameter 
+      should be the 'shared' value of other suite in extended form:
+         ${some-other-test-suite.parameters.shared.param.key}
+   
+   3. The form of the required parameter with default value is as follows:
+         ---------- adaptors/my-test-suite/parameters.xml -------
+         ...
+         <required>
+             ...
+             <req.param 
+                 description="Required For Something Important"
+                 value="${some-other-test-suite.parameters.shared.param.key}"/>
+             ...
+         </required>
+         ...
+         --------------------------------------------------------
+ 
+   4. If the 'some-other-test-suite' was not selected for run, the value
+      for this parameter will be unspecified and demanded for specification
+      by framework either on 'run' or on 'setup' stage.
+ 
+ 
+ o Shared Parameters
+  
+   1. Shared parameters are used for sharing of some values between 
+      the test suites.
+ 
+   2. Shared parameters are described in <shared> section of parameters.xml file.
+ 
+   3. The value specifying and resolutions is made as for required
+      parameters. See [>o Required Parameters Specification and Dereferencing]
+      section for this.
+
+
+ o External Libraries Dependencies
+  
+    New BT Infratructure offers the common way to fetch, use and share external
+    libraries between the test suites. Ii is done by the following means:
+      - every external dependency for the test suite is described in defined
+        format in parameters.xml file
+      - BT on 'setup' stage fetches all the dependencies according to their
+        descriptions and sets up corresponding properties to access them.
+      - adaptors uses these properties to pass the information about fetched
+        libraries to the test suites.
+
+   1. The dependencies on external librarties are described at <external> 
+ 
+
+= Test Execution Modes
+
+ o Single Run Mode and Test Suite Dependencies
+
+   1. The base mode for test suite execution launched by 'run' target is a
+      single run of each of the selected test suites. 
+      
+   2. The order in which the test suites will be launched depends on the
+      dependencies between the suites. Such a dependencies are specified in
+      parameters.xml by 'depends' attribute of the root 'parameters' tag.
+      The value of this attribute should be a coma separated list of all the
+      suites on which this suite depends.
+
+   3. The test suite depending on other suites is launched for execution only if
+      all of its superior test suites passed (adaptors have not reported failure).
+
+ o Continuous Run Mode
+
+   1. BT framework supports continuous test execution.
+
+   2. This support is implemented on the base of the Cruise Control system:
+        http://sourceforge.net/cruisecontrol
+  
+  o Default CC Configuration
+
+    * By default CC run all af the selected test suites are executad as a
+      separate CC Project with the following configuration:
+
+       1. Launching of the suite for execution is made by means of 
+          adaptor's run target.
+
+       2. If the set of dependencies for this suite is not empty, this suite 
+          will  monitor the build status of these suites al will be launched 
+          for execution (by means of adaptor's run target) in case of succesfull
+          build of superior suites.
+
+       3. If there is a 'usesvn' attribute specified for <cc> element of
+          parameters.xml file, the path contained as a value of this attribute
+          will be monitored for changes as a SVN repository. And if there was
+          some update for this repository, this update will be autimatically
+          fetched and test suite will be launched for execution.
+
+       4. If there is a 'trigger' attribute specified for <cc> element of
+          parameters.xml file, the path to file contained as a value of this 
+          attribute will be monitored for the modifications. And if there was
+          a modification for this file, the test suite will be launched for 
+          execution.
+
+  o Custom CC Configuration
+    
+    * If there is a need to extend the functionality provided by default BT CC
+      configuration, there are a means to provide custom configurations for each
+      of selected test suites:
+
+        1. Custom CC configuration 'my-cc-config.xml' for suite 'my-test-suite'
+           can be pluged in for use by BT Framework by specifying the following 
+           property:
+                my-test-suite.parameters.cc.config=${path.to}/my-cc-config.xml
+           in 
+                ${root.dir}/framework.local.properties
+           configuration file.
+
+        2. There are some restrictions on content of the custom CC config file:
+
+           - The name of the project SHOULD be equal to the suite name for which
+             this config is used ('my-test-suite' in our case). To tell to BT
+             Framework to automatically insert this name, the tag @BT.PROJECT@
+             should be used.
+
+           - The section <schedule> of the custom CC-config file MUST contain
+             the following tag:
+                <!-- @BT.ADAPTORCALL@ -->
+             This tag will be resolved to the code performing the call to the
+             adaptor run target to launch suite for execution.
+
+           - Before using, this custom config file will be copied by BT to 
+             another place and to another name. So the paths to the external 
+             files in custom CC-config file SHOULD be absolute names, or use 
+             global framework's properties (such as ${root.dir}, 
+             or ${cc.log.dir}) specified in 
+                scripts/framework.properties
+             file.
+
+        3. There are several predefined tags substituted by BT framework.
+           You can see and read about them in 
+              ${root.dir}/scripts/templates/cc-project-template.xml
+           file. This file is used as a default CC-config template for test
+           suites. I.e. the default CC behaviour for 'my-test-suite' is 
+           equivalent to this template specified as a custom CC config:
+              my-test-suite.parameters.cc.config=${root.dir}/scripts/templates/cc-project-template.xml
+           You can use this template as a starting point for your CC-config
+           implementation.
+

Propchange: harmony/enhanced/buildtest/branches/2.0/SPEC.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/adaptor.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/adaptor.xml?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/adaptor.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/adaptor.xml Mon Apr 23 22:30:55 2007
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+     
+         http://www.apache.org/licenses/LICENSE-2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. -->
+
+<!-- ====================================================================== 
+                    BT Adaptor for Harmony Classlib Project
+     ====================================================================== -->
+<project name="classlib" default="run" basedir=".">
+
+    <!-- do setup of the classlib workspace -->
+    <target name="setup">
+        <description>
+            setup:
+                Do checkout of the classlib's trunk to the place pointed
+                    by 'checkouts.dir' property.
+                Do setup of the suite (tune parameters)
+        </description>
+
+        <!-- Note: Properties
+                ${trunk.dir} pointing to the classlib workspace
+             and
+                ${svn.url}" pointing to the svn url
+             are defined as 'shared' in parameters.xml
+        -->
+
+        <!-- mkdir for sources should be made by adaptor -->
+        <mkdir dir="${trunk.dir}"/>
+
+        <!-- do checkout of the workspace -->
+        <svn-co url="${svn.url}" trunk="${trunk.dir}"/>
+    </target>
+    
+    <target name="run" depends="-set-properties">
+        <ant target="fetch-depends" 
+             dir="${trunk.dir}" 
+             inheritAll="false">
+        </ant>
+
+        <exec executable="${sh}" dir="${trunk.dir}" failonerror="true">
+            <arg line="${cmd.prefix} ${cmd}"/>
+            <arg line="rebuild"/>
+        </exec>
+    </target>
+
+    <target name="-set-properties" depends="-set-properties-win, -set-properties-other"/>
+
+    <condition property="is.windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="-set-properties-win" if="is.windows">
+        <property name="sh" value="cmd"/>
+        <property name="cmd.prefix" value="/c"/>
+        <property name="cmd" value='"${ant.home}/bin/ant.bat"'/>
+    </target>
+
+    <target name="-set-properties-other" unless="is.windows">
+        <property name="sh" value="sh"/>
+        <property name="cmd.prefix" value=""/>
+        <property name="cmd" value='"${ant.home}/bin/ant"'/>
+    </target>
+
+    <target name="clean">
+        <description>
+            to do clean
+        </description>
+    </target>
+
+</project>
+

Propchange: harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/adaptor.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/parameters.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/parameters.xml?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/parameters.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/parameters.xml Mon Apr 23 22:30:55 2007
@@ -0,0 +1,17 @@
+<parameters>
+    <!-- shared values -->
+    <shared>
+        <!-- define the place where classlib workspace will be placed -->
+        <trunk.dir value="${checkouts.dir}/classlib" id="trunk.dir.id"/>
+        <!-- the trunk url for svn -->
+        <svn.url value="http://svn.apache.org/repos/asf/harmony/enhanced/classlib/trunk"/>
+    </shared>
+
+    <!-- CC specific configuration -->
+    <cc> 
+        <!-- reference to the value by parameter ID -->
+        <usesvn refid="trunk.dir.id"/>
+        <!-- reference to the value by property name -->
+        <trigger value="${classlib.parameters.shared.trunk.dir}/${suite.name}.trigger"/>
+    </cc>
+</parameters>

Propchange: harmony/enhanced/buildtest/branches/2.0/adaptors/classlib/parameters.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/adaptor.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/adaptor.xml?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/adaptor.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/adaptor.xml Mon Apr 23 22:30:55 2007
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+     
+         http://www.apache.org/licenses/LICENSE-2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. -->
+
+<!-- ====================================================================== 
+                    BT Adaptor for Harmony DRLVM Project
+     ====================================================================== -->
+<project name="drlvm" default="run" basedir=".">
+
+    <!-- do setup of the drlvm workspace -->
+    <target name="setup">
+        <description>
+            setup:
+                Do checkout of the drlvm's trunk to the place pointed
+                    by 'checkouts.dir' property.
+                Do setup of the suite (tune parameters)
+        </description>
+
+        <!-- Note: Properties 
+                ${trunk.dir} pointing to the drlvm workspace
+             and
+                ${svn.url}" pointing to the svn url
+             are defined as 'shared' in parameters.xml 
+        -->
+
+        <!-- mkdir for sources should be made by adaptor -->
+        <mkdir dir="${trunk.dir}"/>
+
+        <!-- do checkout of the DRLVM workspace -->
+        <svn-co url="${svn.url}" trunk="${trunk.dir}"/>
+    </target>
+
+    <target name="run" 
+            description="Checks DRLVM trunk can be build." 
+            depends="-set-properties">
+        <exec executable="${sh}" dir="${trunk.dir}/build" failonerror="true">
+            <arg line="${cmd.prefix} ${cmd}"/>
+            <arg line="-Dproxy.host.vm=${http.proxyHost} -Dproxy.port.vm=${http.proxyPort}"/>
+            <arg line="-Dexternal.dep.CLASSLIB.loc=${classlib.trunk}"/>
+            <arg line="clean update" />
+        </exec>
+        <!-- do build separated of update (because of the bug with c.compiler 
+             dereferencing at the first time after cpptasks.jar has been 
+             downloaded) -->
+        <exec executable="${sh}" dir="${trunk.dir}/build" failonerror="true">
+            <arg line="${cmd.prefix} ${cmd}"/>
+            <arg line="-Dproxy.host.vm=${http.proxyHost} -Dproxy.port.vm=${http.proxyPort}"/>
+            <arg line="-Ddeploy.canonical.flag=true"/>
+            <arg line="-Dbuild.cfg=release"/>
+            <arg line="-Dexternal.dep.CLASSLIB.loc=${classlib.trunk}"/>
+            <arg line="build" />
+        </exec>
+    </target>
+
+    <target name="clean">
+        <description>
+            to do clean
+        </description>
+    </target>
+
+    <!-- platform depending configuration properties -->
+    <condition property="is.windows">
+        <os family="windows" />
+    </condition>
+
+    <condition property="exe" value=".exe" else="">
+        <os family="windows" />
+    </condition>
+
+    <target name="-set-properties" depends="-set-properties-win, -set-properties-other"/>
+    
+    <target name="-set-properties-win" if="is.windows">
+        <property name="sh" value="cmd" />
+        <property name="cmd.prefix" value="/c" />
+        <property name="cmd" value="build.bat" />
+        <property name="cc" value="msvc" />
+    </target>
+
+    <target name="-set-properties-other" unless="is.windows">
+        <property name="sh" value="sh" />
+        <property name="cmd.prefix" value="" />
+        <property name="cmd" value="build.sh" />
+        <property name="cc" value="gcc" />
+    </target>
+
+</project>
+

Propchange: harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/adaptor.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/parameters.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/parameters.xml?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/parameters.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/parameters.xml Mon Apr 23 22:30:55 2007
@@ -0,0 +1,29 @@
+<parameters depends="classlib">
+    <!-- required -->
+    <required>
+        <!-- path to built classlib, use classlib's shared value -->
+        <classlib.trunk 
+            description="Path to Classlib Workspace" 
+            value="${classlib.parameters.shared.trunk.dir}"/>
+    </required>
+
+    <!-- shared values -->
+    <shared>
+        <!-- define the place where drlvm workspace will be placed -->
+        <trunk.dir value="${checkouts.dir}/${suite.name}" id="trunk.dir.id"/>
+        <!-- the trunk url for svn -->
+        <svn.url value="http://svn.apache.org/repos/asf/harmony/enhanced/drlvm/trunk"/>
+        <!-- the path to built DRLVM JRE -->
+        <jre.dir value="${drlvm.parameters.shared.trunk.dir}/build/deploy/jdk/jre"/>
+        <!-- the path to built DRLVM JVM -->
+        <jvm.location value="${drlvm.parameters.shared.trunk.dir}/build/deploy/jdk/jre/bin/java${exe}"/>
+    </shared>
+
+    <!-- CC specific configuration -->
+    <cc> 
+        <!-- reference to the value by parameter ID -->
+        <usesvn refid="trunk.dir.id"/>
+        <!-- reference to the value by property name -->
+        <trigger value="${drlvm.parameters.shared.trunk.dir}/${suite.name}.trigger"/>
+    </cc>
+</parameters>

Propchange: harmony/enhanced/buildtest/branches/2.0/adaptors/drlvm/parameters.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/build.xml?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/build.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/build.xml Mon Apr 23 22:30:55 2007
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+     
+         http://www.apache.org/licenses/LICENSE-2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. -->
+
+<!DOCTYPE buildtest SYSTEM "buildtest.dtd">
+
+<!-- ====================================================================== 
+                   Main Entry Point for BUILD TEST Framework
+     ====================================================================== -->
+<project name="build-test-infrastructure" default="run" basedir=".">
+
+    <!-- define only the properties used before installation 
+         other properties should be defined in ${framework.properties.file} -->
+    <property name="root.dir" location="${basedir}"/>
+    <property name="adaptors.dir" location="adaptors"/>
+    <property name="scripts.dir" location="scripts"/>
+
+    <property name="framework.properties.file" 
+              location="${scripts.dir}/framework.properties"/>
+    <property file="${framework.properties.file}"/>
+
+    <property file="${local.configuration.file}"/>
+
+    <property name="framework.implementation.file" 
+              location="${scripts.dir}/framework.xml"/>
+    <import file="${framework.implementation.file}" optional="true"/>
+    
+    <!-- Use this property to specify particular test suites to run -->
+    <!-- Use 
+            -Dtest.suites=classlib
+         or 
+            -Dtest.suites=classlib,drlvm
+         to specify particular suites to execute -->
+    <property name="test.suites" value="*"/>
+    <dirset id="test.suites.dirs.ref"
+            dir="${adaptors.dir}"
+            includes="${test.suites}"/>
+    <pathconvert pathsep=","
+                 property="test.suites.names.list"
+                 refid="test.suites.dirs.ref">
+        <flattenmapper/>
+    </pathconvert>
+
+    <!-- For correct framework operation, all global properties defined 
+         in this file SHOULD be added to this set -->
+    <propertyset id="global.build.parameters.id">
+        <propertyref name="root.dir"/>
+        <propertyref name="ant.home"/>
+        <propertyref name="adaptors.dir"/>
+        <propertyref name="scripts.dir"/>
+        <propertyref name="framework.properties.file"/>
+        <propertyref name="framework.implementation.file"/>
+        <propertyref name="test.suites.names.list"/>
+    </propertyset>
+
+
+    <!-- ================================================================== 
+                      Framework Installation Functionality
+         ================================================================== -->
+    <target name="install" description="install">
+        <description>&installDocumentation;</description>
+        <!-- checkout framework -->
+        <!-- TODO: check svn on path -->
+        <!-- TODO: uncomment when integrated 
+        <exec executable="svn" dir="${root.dir}" failonerror="true">
+            <arg line="update ${scripts.dir} ${adaptors.dir}"/>
+        </exec>
+        -->
+        <!-- create the file for local framework configuration -->
+        <copy file="${local.configuration.template.file}"
+              tofile="${local.configuration.file}"/>
+    </target>
+    
+    <target name="check-install">
+        <fail>
+            <condition>
+                <not>
+                    <and>
+                        <available file="${adaptors.dir}" type="dir"/>
+                        <available file="${scripts.dir}" type="dir"/>
+                        <available file="${framework.implementation.file}"/>
+                        <available file="${local.configuration.file}"/>
+                    </and>
+                </not>
+            </condition>
+            &installationFailureMessage;
+        </fail>
+    </target>
+
+    <!-- ================================================================== 
+                         Framework Setup Functionality
+         ================================================================== -->
+    <target name="setup" description="setup" 
+            depends="install, check-install, init-framework, setup-suites">
+        <description>&setupDocumentation;</description>
+    </target>
+
+    <!-- ================================================================== 
+                          Test Execution Functionality
+         ================================================================== -->
+    <target name="run" depends="init-framework, setup-suites, run-suites">
+        <description>&runDocumentation;</description>
+    </target>
+
+    <target name="create-cc-configuration_"/>
+
+    <target name="run-cc" description="run-cc"
+            depends="init-framework, init-suites, setup-suites, check-status,
+                        prepare-cc, create-cc-configuration">
+        <java jar="${ext.cc.location}/lib/cruisecontrol-launcher.jar" dir="${cc.work.dir}" fork="true">
+            <classpath>
+                <fileset dir="${ext.cc.location}/lib">
+                    <include name="*.jar"/>
+                </fileset>
+            </classpath>
+            <sysproperty key="javax.management.builder.initial" value="mx4j.server.MX4JMBeanServerBuilder"/>
+            <arg line="-configfile ${cc.config.file} -webapppath ${ext.cc.location}/webapps/cruisecontrol -jmxport ${framework.parameters.cc.jmxport} -webport ${framework.parameters.cc.webport}"/>
+        </java>
+    </target>
+
+    <target name="clean" description="clean" depends="init-framework">
+        <antfetch dir="scripts" target="distclean" antfile="../build.xml"/>
+    </target>
+
+    <target name="distclean" description="distclean">
+    </target>
+
+</project>

Propchange: harmony/enhanced/buildtest/branches/2.0/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/buildtest.bat
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/buildtest.bat?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/buildtest.bat (added)
+++ harmony/enhanced/buildtest/branches/2.0/buildtest.bat Mon Apr 23 22:30:55 2007
@@ -0,0 +1,12 @@
+@rem Tune environment:
+@set COMPILER_CFG_SCRIPT=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat
+@set JAVA_HOME=C:\ws\bin\jdk1.5.0_06
+@set ANT_HOME=C:\ws\bin\apache-ant-1.6.5
+@set SVN_HOME=C:\ws\bin\svn-win32-1.4.2
+@set ANT_OPTS=-XX:MaxPermSize=512m -Xmx1000M -Dhttp.proxyHost=my.proxy.com -Dhttp.proxyPort=1111
+
+@set PATH=%SVN_HOME%/bin;%PATH%;%ANT_HOME%/bin
+@set CLASSPATH=./build/classes
+
+@call "%COMPILER_CFG_SCRIPT%"
+call ant %* 2>&1

Propchange: harmony/enhanced/buildtest/branches/2.0/buildtest.bat
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: harmony/enhanced/buildtest/branches/2.0/buildtest.bat
------------------------------------------------------------------------------
    svn:executable = *

Added: harmony/enhanced/buildtest/branches/2.0/buildtest.dtd
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/buildtest.dtd?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/buildtest.dtd (added)
+++ harmony/enhanced/buildtest/branches/2.0/buildtest.dtd Mon Apr 23 22:30:55 2007
@@ -0,0 +1,71 @@
+<!-- framework implementation source -->
+<!-- ENTITY frameworkImplementation SYSTEM "scripts/framework.xml" -->
+
+<!-- Error Messages -->
+<!ENTITY nl "
+">
+<!ENTITY divisionLine "========================================">
+<!ENTITY messagePrefix "...&nl;&divisionLine;&nl;">
+<!ENTITY messageSuffix "&divisionLine;">
+<!ENTITY failurePrefix "&messagePrefix;FAILURE: ">
+<!ENTITY installationFailureMessage 
+"&failurePrefix;
+Could not found some of the framework components.
+Please, do
+
+    > ant install
+
+first.
+&messageSuffix;
+">
+<!ENTITY nullFilePointerMessage 
+"&failurePrefix;
+Property '@{property}' acting as a file pointer was not set.  
+Actualy such an error can appear only while framework development.
+Please, check your development fixes.
+&messageSuffix;
+">
+<!ENTITY unexistingFilePointerMessage 
+"&failurePrefix;
+Property '@{property}' is pointing to unexisting @{type}:
+    ${@{property}}
+Actualy such an error can appear only while framework development.
+Please, check your development fixes.
+&messageSuffix;
+">
+
+<!-- Documentation Strings -->
+<!ENTITY installDocumentation "
+install:
+    1. Download ./scripts and ./adaptors from SVN (do ant checkout)
+    2. Create build configuration file for local framework configuration
+    [>idx.1]
+">
+
+<!ENTITY setupDocumentation "
+setup:
+    1. Setup framework itself
+    2. Setup specified by _suites_ property test suites (or all the
+       available suites if property was not specified)
+    If test suites' configuration parameters was not fully provided,
+      framework will demand to repeat this step.
+    [>idx.2]
+">
+<!ENTITY runDocumentation "
+run:
+    foreach adaptor from @selected test suites:
+       #> ant adaptor.xml update
+         : updates the test suite (svn co, download from external
+         sources, unzipping and so on - everything connected with
+         external fetching)
+       #> ant adaptor.xml setup
+         : do setup work for selected test suites (all the needed
+         configuration properties were set up during step 4.)
+       #> ant adaptor.xml run
+         : run the test suite with specified configuration
+         properties.
+       #> ant adaptor.xml publish
+         : publich expected results (built product, test results)
+         to the specified place.
+    [>idx.3]
+">

Propchange: harmony/enhanced/buildtest/branches/2.0/buildtest.dtd
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/buildtest.sh
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/buildtest.sh?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/buildtest.sh (added)
+++ harmony/enhanced/buildtest/branches/2.0/buildtest.sh Mon Apr 23 22:30:55 2007
@@ -0,0 +1,13 @@
+# Tune environment:
+export COMPILER_CFG_SCRIPT=
+export JAVA_HOME=/usr/jdk1.5.0_06/jdk
+export ANT_HOME=/usr/lib/ant
+export SVN_HOME=/usr/local
+export ANT_OPTS="-XX:MaxPermSize=512m -Xmx700M -Dhttp.proxyHost=my.proxy.com -Dhttp.proxyPort=1111"
+
+export PATH=$SVN_HOME/bin:$PATH:$ANT_HOME/bin
+export CLASSPATH=./build/classes
+
+$COMPILER_CFG_SCRIPT
+
+ant $*

Propchange: harmony/enhanced/buildtest/branches/2.0/buildtest.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: harmony/enhanced/buildtest/branches/2.0/buildtest.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml Mon Apr 23 22:30:55 2007
@@ -0,0 +1,525 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+     
+         http://www.apache.org/licenses/LICENSE-2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. -->
+
+<!DOCTYPE buildtest SYSTEM "../buildtest.dtd">
+
+<!-- ====================================================================== 
+                   Ant's script supplementing CC functionality
+     ====================================================================== -->
+<project name="cc" default="fetch-depends" basedir=".">
+
+    <import file="framework.xml"/>
+
+    <!--
+                        CC-project Retated Functionality
+    -->
+
+    <!-- loads properties passed from CC-config -->
+    <target name="load-properties">
+        <property file="${parameters.dump.file}"/>
+        <property file="${framework.properties.file}"/>
+    </target>
+
+    <!-- is called from CC to launch the test suite named ${test.suite} -->
+    <target name="cc-run" depends="load-properties, define-ant-contrib">
+        <property name="suite.adaptor.dir" value="${root.dir}/adaptors/${suite.name}"/>
+        <log message="Test Suite '${suite.name}' execution. Repository updated: ${repository.updated}"/>
+        <ant dir="${root.dir}/adaptors/${suite.name}" 
+             antfile="adaptor.xml" 
+             target="run"
+             inheritAll="true"/>
+    </target>
+
+    <!-- is called from CC to launch the custom ant publisher for ${test.suite} -->
+    <target name="cc-publish" depends="load-properties, define-ant-contrib">
+        <dirname property="publisher.dir" file="${publisher.location}"/>
+        <log message="Calling Publisher ${publisher.location} at ${publisher.dir} for ${suite.name}"/>
+        <ant dir="${publisher.dir}" 
+             antfile="${publisher.location}" 
+             target="publish"
+             inheritAll="true"/>
+    </target>
+
+    <!--
+                        Framework Retated Functionality
+    -->
+
+    <target name="prepare-cc">
+        <sequential>
+        <if>
+            <istrue value="${framework.parameters.cc.doclean}"/>
+        <then>
+            <delete quiet="true" verbose="false">
+                <fileset dir="${build.dir}/cc" includes="**/*"/>
+            </delete>
+        </then>
+        </if>
+        <mkdir dir="${build.dir}/cc"/>
+        <mkdir dir="${cc.log.dir}"/>
+        </sequential>
+    </target>
+    
+    <target name="create-cc-configuration" depends="init-framework, init-suites">
+        <!-- Create Main CC Configuration File -->
+        <delete file="${cc.config.file}"/>
+        <copy file="${cc.config.template}" 
+              tofile="${cc.config.file}"/>
+
+        <!-- Create Project Files corresponding to selected Test Suites -->
+        <for list="${test.suites.names.list}" param="suite.name">
+            <sequential>
+                <log message="==> Process CC Configuration File for '@{suite.name}'"/>
+                <!-- print-parameters suite="@{suite.name}"/ -->
+
+                <mkdir dir="${cc.log.dir}/@{suite.name}"/>
+                <property name="@{suite.name}.parameters.cc.filename"
+                          value="cc-@{suite.name}-project.xml"/>
+                <property name="@{suite.name}.parameters.cc.file.location"
+                          location="${cc.work.dir}/${@{suite.name}.parameters.cc.filename}"/>
+                <delete file="${@{suite.name}.parameters.cc.file.location}"/>
+                
+                <if><!-- check for custom configuration file -->
+                    <isset property="@{suite.name}.parameters.cc.config"/>
+                <then>
+                    <!-- use custom -->
+                    <log message="Generating CC config on the base of custom CC config template: ${@{suite.name}.parameters.cc.config}"/>
+
+                    <copy file="${@{suite.name}.parameters.cc.config}" 
+                          tofile="${@{suite.name}.parameters.cc.file.location}"/>
+                </then>
+                <else>
+                    <!-- use custom -->
+                    <log message="Generating CC config on the base of default CC template: ${cc.project.template}"/>
+
+                    <!-- use dafault cc config template -->
+                    <copy file="${cc.project.template}" 
+                          tofile="${@{suite.name}.parameters.cc.file.location}"/>
+                </else>
+                </if>
+
+                <!-- Do Tag Substitutions -->
+                <!-- insert 'MUSTHAVE' project name and call to adaptor -->
+                <insert-adaptorcall
+                    suite="@{suite.name}"
+                    ccfile="${@{suite.name}.parameters.cc.file.location}"/>
+                <!-- insert svn using -->
+                <if>
+                    <isset property="@{suite.name}.parameters.cc.usesvn"/>
+                <then>
+                    <!-- use svn to check for changes -->
+                    <insert-svnuse
+                        localWorkingCopy="${@{suite.name}.parameters.cc.usesvn}"
+                        ccfile="${@{suite.name}.parameters.cc.file.location}"/>
+                </then>
+                </if>
+                <!-- insert trigger file -->
+                <if>
+                    <isset property="@{suite.name}.parameters.cc.trigger"/>
+                <then>
+                    <!-- use svn to check for changes -->
+                    <insert-trigger
+                        triggerfile="${@{suite.name}.parameters.cc.trigger}"
+                        ccfile="${@{suite.name}.parameters.cc.file.location}"/>
+                </then>
+                </if>
+                <!-- insert custom publisher -->
+                <if>
+                    <isset property="@{suite.name}.parameters.cc.publisher"/>
+                <then>
+                    <insert-publisher
+                        suite="@{suite.name}"
+                        publisher="${@{suite.name}.parameters.cc.publisher}"
+                        ccfile="${@{suite.name}.parameters.cc.file.location}"/>
+                </then>
+                </if>
+                <!-- insert the results directory publisher -->
+                <if>
+                    <isset property="@{suite.name}.parameters.cc.results"/>
+                <then>
+                    <insert-results
+                        dir="${@{suite.name}.parameters.cc.results}"
+                        ccfile="${@{suite.name}.parameters.cc.file.location}"/>
+                </then>
+                </if>
+                <!-- insert dependencies on other test suites -->
+                <!-- if>
+                    <isset property="@{suite.name}.parameters.depends"/>
+                <then -->
+                <insert-dependencies
+                    suite="@{suite.name}"
+                    ccfile="${@{suite.name}.parameters.cc.file.location}"/>
+                <!-- /then>
+                </if -->
+                <insert-finish
+                        ccfile="${@{suite.name}.parameters.cc.file.location}"/>
+
+                <!-- add import of the project -->
+                <replace file="${cc.config.file}">
+                    <replacefilter
+                        token="@PROJECT@"
+                        value="&lt;include.projects file='${@{suite.name}.parameters.cc.filename}'/&gt;@PROJECT@"/>
+                    <replacetoken>@PROJECT@</replacetoken>
+                    <replacevalue><![CDATA[
+    @PROJECT@]]></replacevalue>
+                </replace>
+
+            </sequential>
+        </for>
+
+        <!-- setup CC properties and clear last token in main config file -->
+        <replace file="${cc.config.file}">
+            <replacefilter 
+                token="@BT.ROOTDIR@" 
+                value="${root.dir}"/>
+            <replacefilter 
+                token="@BT.PROPERTIES@" 
+                value="${framework.properties.file}"/>
+
+            <replacetoken>@PROJECT@</replacetoken>
+            <replacevalue></replacevalue>
+        </replace>
+    </target>
+
+    <!-- Creates the CC properties file for specified by ${suite} project -->
+    <target name="make-parameter-files">
+        <propertyselector 
+            property="tmp.params.list"
+            delimiter=","
+            match="-TO-PASS-\.(.*)$"
+            select="\1"
+            override="true"
+        />
+        <sortlist 
+            property="tmp.sorted.list"
+            value="${tmp.params.list}"
+            delimiter=","
+            override="true"
+        />
+        <!-- make the file for using by ant (double \) -->
+        <echoproperties destfile="${ant-params-file}">
+            <propertyset>
+                <propertyref prefix="-TO-PASS-"/>
+                <globmapper from="-TO-PASS-.*" to="*"/>
+            </propertyset>
+        </echoproperties>
+        <!-- make the file for using by CC -->
+        <echo file="${cc-params-file}"/>
+        <for list="${tmp.sorted.list}" param="param">
+            <sequential>
+                <echo file="${cc-params-file}" 
+                      append="true">@{param}=${-TO-PASS-.@{param}}
+</echo>
+            </sequential>
+        </for>
+    </target>
+
+    <macrodef name="insert-adaptorcall">
+        <attribute name="suite"/>
+        <attribute name="ccfile"/>
+        <sequential>
+            <!-- Create the parameter files for inclusion into the 
+                 CC-config file for @{suite} project, and for passing
+                 them through the CC to adaptors -->
+            <var name="tmp.cc-params-file"
+                 value="${cc.work.dir}/cc-@{suite}.properties"/>
+            <var name="tmp.ant-params-file"
+                 value="${cc.work.dir}/@{suite}.properties"/>
+            <antcall target="make-parameter-files" inheritAll="true">
+                <param name="suite" value="@{suite}"/>
+                <param name="cc-params-file" value="${tmp.cc-params-file}"/>
+                <param name="ant-params-file" value="${tmp.ant-params-file}"/>
+                <propertyset>
+                    <propertyset refid="@{suite}.parameters.id"/>
+                    <!-- do map keys to separate the properties 
+                         need to be passed to the project -->
+                    <globmapper from="*" to="-TO-PASS-.*"/>
+                </propertyset>
+            </antcall>
+            <replace file="@{ccfile}">
+                <!-- Define the name of the project as name of a current 
+                     test suite -->
+                <replacefilter 
+                    token="@BT.PROJECT@@" 
+                    value="@{suite}"/>
+                <!-- Include the parameters known by test suite -->
+                <replacefilter 
+                    token="&lt;!-- @BT.PARAMETERS.INCLUDE@ --&gt;" 
+                    value="&lt;property file='${tmp.cc-params-file}'/&gt;"
+                />
+                <replacefilter 
+                    token="&lt;!-- @BT.LISTENER@ --&gt;" 
+                    value="&lt;currentbuildstatuslistener file='${cc.log.dir}/@{suite}/status.txt'/&gt;"
+                />
+                <replacefilter 
+                    token="&lt;!-- @BT.ADAPTORCALL@ --&gt;" 
+                    value="&lt;ant anthome='${ant.home}'@NL@
+                antWorkingDir='${root.dir}'@NL@
+                timeout='${cc.project.execution.timeout}'@NL@
+                buildfile='${root.dir}/scripts/cc-project.xml'@NL@
+                target='cc-run'&gt;@NL@
+               &lt;property name='suite.name' value='@{suite}'/&gt;@NL@
+               &lt;property name='parameters.dump.file'@NL@
+                         value='${tmp.ant-params-file}'/&gt;@NL@
+           &lt;/ant&gt;@NL@"/>
+            </replace>
+        </sequential>
+    </macrodef>
+
+    <macrodef name="insert-svnuse">
+        <attribute name="localWorkingCopy"/>
+        <attribute name="ccfile"/>
+        <sequential>
+            <replace file="@{ccfile}">
+                <replacefilter 
+                    token="&lt;!-- @BT.BOOTSTRAPPER@ --&gt;" 
+                    value="&lt;svnbootstrapper localWorkingCopy='@{localWorkingCopy}'/&gt;"
+                />
+                <replacefilter 
+                    token="&lt;!-- @BT.MODIFICATIONSET@ --&gt;" 
+                    value="&lt;svn localWorkingCopy='@{localWorkingCopy}' property='repository.updated'/&gt;@NL@
+           &lt;!-- @BT.MODIFICATIONSET@ --&gt;"
+                />
+            </replace>
+        </sequential>
+    </macrodef>
+
+    <macrodef name="insert-trigger">
+        <attribute name="triggerfile"/>
+        <attribute name="ccfile"/>
+        <sequential>
+            <if>
+                <not><available file="@{triggerfile}"/></not>
+            <then>
+                <touch file="@{triggerfile}"/>
+            </then>
+            </if>
+            <replace file="@{ccfile}">
+                <replacefilter 
+                    token="&lt;!-- @BT.MODIFICATIONSET@ --&gt;" 
+                    value="&lt;filesystem folder='@{triggerfile}'/&gt;@NL@
+           &lt;!-- @BT.MODIFICATIONSET@ --&gt;"
+                />
+            </replace>
+        </sequential>
+    </macrodef>
+
+    <!-- process dependencies and insert corresponding CC configuration -->
+    <macrodef name="insert-dependencies">
+        <attribute name="suite"/>
+        <attribute name="ccfile"/>
+        <sequential>
+            <do-insert-direct-dependencies
+                suite="@{suite}"
+                ccfile="${@{suite}.parameters.cc.file.location}"/>
+        </sequential>
+    </macrodef>
+
+    <!-- insert dependencies on succesfull status of superiour suites -->
+    <macrodef name="do-insert-direct-dependencies">
+        <attribute name="suite"/>
+        <attribute name="ccfile"/>
+        <sequential>
+            <if>
+                <isset property="@{suite}.parameters.depends"/>
+            <then>
+                <for list="${@{suite}.parameters.depends}" param="dependency">
+                <sequential>
+                    <if>
+                        <isset property="@{dependency}.parameters.cc.usesvn"/>
+                    <then>
+                        <!-- if dependency uses svn, insert its modification set 
+                             (for better reporting) -->
+                        <replace file="@{ccfile}">
+                            <replacefilter 
+                                token="&lt;!-- @BT.MODIFICATIONSET@ --&gt;"
+                                value="&lt;!-- @BT.SVN.MODIFICATIONSET@ --&gt;@NL@
+           &lt;!-- @BT.MODIFICATIONSET@ --&gt;"
+                            />
+                        </replace>
+                        <!-- to remember processed suites -->
+                        <var name="tmp.processed.suites" value=",@{suite},"/>
+                        <do-insert-svnmod-dependencies
+                            suite="@{dependency}"
+                            ccfile="${@{suite}.parameters.cc.file.location}"/>
+                        <var name="tmp.processed.suites" unset="true"/>
+                        <replace file="@{ccfile}">
+                            <replacefilter 
+                                token="&lt;!-- @BT.SVN.MODIFICATIONSET@ --&gt;"
+                                value="&lt;!-- end of svn modifications set possible in case of rebuilding of @{dependency} --&gt;"
+                            />
+                        </replace>
+                    </then>
+                    <else>
+                        <replace file="@{ccfile}">
+                            <replacefilter 
+                                token="&lt;!-- @BT.MODIFICATIONSET@ --&gt;"
+                                value="&lt;buildstatus logdir='${cc.log.dir}/@{dependency}'/&gt;@NL@
+           &lt;!-- @BT.MODIFICATIONSET@ --&gt;"
+                            />
+                        </replace>
+                    </else>
+                    </if>
+                </sequential>
+                </for>
+            </then>
+            </if>
+        </sequential>
+    </macrodef>
+
+    <!-- insert the modification sets of superiour suites using SVN -->
+    <macrodef name="do-insert-svnmod-dependencies">
+        <attribute name="suite"/>
+        <attribute name="ontop" default="true"/>
+        <attribute name="indent" default="           "/>
+        <attribute name="ccfile"/>
+        <sequential>
+            <!-- insert SVN modifications processing for @{suite}-->
+            <if>
+                <isset property="@{suite}.parameters.cc.usesvn"/>
+            <then>
+                <replace file="@{ccfile}">
+                    <replacefilter 
+                        token="&lt;!-- @BT.SVN.MODIFICATIONSET@ --&gt;"
+                        value="&lt;compound includeTriggerChanges='@{ontop}'&gt;@NL@
+@{indent}    &lt;triggers&gt;@NL@
+@{indent}        &lt;buildstatus logdir='${cc.log.dir}/@{suite}'/&gt;@NL@
+@{indent}    &lt;/triggers&gt;@NL@
+@{indent}    &lt;targets&gt;@NL@
+@{indent}        &lt;svn localWorkingCopy='${@{suite}.parameters.cc.usesvn}'/&gt;@NL@
+@{indent}        &lt;!-- @BT.SVN.MODIFICATIONSET@ --&gt;@NL@
+@{indent}    &lt;/targets&gt;@NL@
+@{indent}&lt;/compound&gt;"
+                    />
+                </replace>
+            </then>
+            </if>
+            <!-- remember processed suite -->
+            <var name="tmp.processed.suites" value="${tmp.processed.suites}@{suite},"/>
+
+            <!-- insert SVN modifications processing for 
+                 @{suite}'s superior suites -->
+            <if>
+                <isset property="@{suite}.parameters.depends"/>
+            <then>
+                <for list="${@{suite}.parameters.depends}" param="dependency">
+                <sequential>
+                    <if>
+                        <not><contains string="${tmp.processed.suites}" 
+                                       substring=",@{dependency},"/></not>
+                    <then>
+                        <!-- do recursion -->
+                        <do-insert-svnmod-dependencies
+                            suite="@{dependency}"
+                            ontop="false"
+                            indent="@{indent}        "
+                            ccfile="@{ccfile}"/>
+                    </then>
+                    </if>
+                </sequential>
+                </for>
+            </then>
+            </if>
+        </sequential>
+    </macrodef>
+
+    <macrodef name="insert-publisher">
+        <attribute name="suite"/>
+        <attribute name="publisher"/>
+        <attribute name="ccfile"/>
+        <sequential>
+            <!-- Create the parameter files for inclusion into the 
+                 CC-config file for @{suite} project, and for passing
+                 them through the CC to adaptors -->
+            <var name="tmp.cc-params-file"
+                 value="${cc.work.dir}/cc-@{suite}.properties"/>
+            <var name="tmp.ant-params-file"
+                 value="${cc.work.dir}/@{suite}.properties"/>
+            <antcall target="make-parameter-files" inheritAll="true">
+                <param name="suite" value="@{suite}"/>
+                <param name="cc-params-file" value="${tmp.cc-params-file}"/>
+                <param name="ant-params-file" value="${tmp.ant-params-file}"/>
+                <propertyset>
+                    <propertyset refid="@{suite}.parameters.id"/>
+                    <!-- do map keys to separate the properties 
+                         need to be passed to the project -->
+                    <globmapper from="*" to="-TO-PASS-.*"/>
+                </propertyset>
+            </antcall>
+            <replace file="@{ccfile}">
+                <!-- Define the name of the project as name of a current 
+                     test suite -->
+                <replacefilter 
+                    token="@BT.PROJECT@@" 
+                    value="@{suite}"/>
+                <!-- Include the parameters known by test suite -->
+                <replacefilter 
+                    token="&lt;!-- @BT.PARAMETERS.INCLUDE@ --&gt;" 
+                    value="&lt;property file='${tmp.cc-params-file}'/&gt;"
+                />
+                <replacefilter 
+                    token="&lt;!-- @BT.LISTENER@ --&gt;" 
+                    value="&lt;currentbuildstatuslistener file='${cc.log.dir}/@{suite}/status.txt'/&gt;"
+                />
+                <replacefilter 
+                    token="&lt;!-- @BT.PUBLISHER@ --&gt;" 
+                    value="&lt;antpublisher 
+                anthome='${ant.home}'@NL@
+                timeout='${cc.project.execution.timeout}'@NL@
+                antWorkingDir='${root.dir}'@NL@
+                buildfile='${root.dir}/scripts/cc-project.xml'@NL@
+                target='cc-publish'&gt;@NL@
+               &lt;property name='suite.name' value='@{suite}'/&gt;@NL@
+               &lt;property name='publisher.location' value='@{publisher}'/&gt;@NL@
+               &lt;property name='parameters.dump.file'@NL@
+                         value='${tmp.ant-params-file}'/&gt;@NL@
+           &lt;/antpublisher&gt;@NL@"/>
+            </replace>
+        </sequential>
+    </macrodef>
+
+    <macrodef name="insert-results">
+        <attribute name="dir"/>
+        <attribute name="ccfile"/>
+        <sequential>
+            <replace file="@{ccfile}">
+                <replacefilter 
+                    token="&lt;!-- @BT.TEST.RESULTS@ --&gt;" 
+                    value="&lt;merge dir='@{dir}'/&gt;"
+                />
+            </replace>
+        </sequential>
+    </macrodef>
+
+    <macrodef name="insert-finish">
+        <attribute name="ccfile"/>
+        <sequential>
+            <replace file="@{ccfile}">
+                <replacefilter 
+                    token="&lt;!-- @BT.MODIFICATIONSET@ --&gt;" 
+                    value="&lt;forceonly/&gt;"
+                />
+            </replace>
+            <replace file="@{ccfile}">
+                <replacetoken>@NL@</replacetoken>
+                <replacevalue><![CDATA[
+]]></replacevalue>
+            </replace>
+        </sequential>
+    </macrodef>
+
+</project>
+

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/download.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/download.txt?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/download.txt (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/download.txt Mon Apr 23 22:30:55 2007
@@ -0,0 +1,38 @@
+= External Dependencies Downloading Implementation Notes
+
+o Control Flow
+
+- can be implemented as component independent (no fwk.perameters)
+
+1. <fetch libname>
+  - macro
+  : extracts information regarding libname
+
+2. <ancall -fetch>
+  : is called with parameters from 1.
+  : do split of the control flow on the base of parameters (is.zip, is.jar, ...)
+
+  1. <target fetch-jar>
+    : downloads jar file
+    : checks for file presence
+
+    1. <antcall -do-download>
+      : executes if target lib file does not exist in lib dir
+
+    2. <do-download libname>
+      - macro
+      : downloads jar to temp dir, checksum, move to lib dir
+
+  2. <target fetch-zip>
+    : downloads zip file, extracts jar lib, places it to lib dir
+    : checks for file presence
+
+    1. <antcall -do-download>
+      : executes if target lib file does not exist in lib dir
+
+    2. <do-download libname>
+      - macro
+      : downloads zip to temp dir, checksum, unzip jar lib, move lib to lib dir
+
+--------------------
+ vim:ft=notes:fo=vtcql:tw=80:sts=2

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/download.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/buildtest/branches/2.0/scripts/download.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/download.xml?view=auto&rev=531732
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/download.xml (added)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/download.xml Mon Apr 23 22:30:55 2007
@@ -0,0 +1,317 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+     
+         http://www.apache.org/licenses/LICENSE-2.0
+     
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License. -->
+
+<!DOCTYPE buildtest SYSTEM "../buildtest.dtd">
+
+<!-- ====================================================================== 
+                   External Libraries Fetching Implementation
+     ====================================================================== -->
+<project name="external-libraries-fetching" default="fetch-depends" basedir=".">
+
+    <target name="-init" depends="-make-dep-dirs, load-framework-parameters, -setup-proxy"/>
+
+    <target name="fetch-ant-contrib" depends="-init">
+        <fetch libname="ant-contrib" subcomponent="framework"/>
+    </target>
+
+    <target name="fetch-depends"
+            depends="define-tasks, load-framework-parameters, load-suites-parameters, -make-dep-dirs, -setup-proxy">
+        <description>
+            Fetches all external dependencies needed by framework itself.
+            Network connection is required.
+            (You can set up proxy settings in local configuration file).
+        </description>
+
+        <propertyset id="external.propertyset.id">
+            <propertyref regex="[^\.]*\.parameters\.external\."/>
+        </propertyset>
+        
+        <!--  XXX debug print -->
+        <echoproperties>
+            <propertyset refid="external.propertyset.id"/>
+        </echoproperties>
+
+        <for list="framework,${test.suites.names.list}" param="subcomponent">
+            <sequential>
+            <!-- declare property containing the list of externals 
+                 to download -->
+            <property name="@{subcomponent}.external.names.list" value=""/>
+            <propertyselector 
+                    property="@{subcomponent}.external.names.list"
+                    delimiter=","
+                    match="^@{subcomponent}\.parameters\.external\.(.*)\.url"
+                    select="\1"
+                    distinct="true"
+                    override="true"/>
+            <for list="${@{subcomponent}.external.names.list}" param="dependency">
+            <sequential>
+                <fetch libname="@{dependency}" subcomponent="@{subcomponent}"/>
+            </sequential>
+            </for>
+            </sequential>
+        </for>
+        <echoproperties>
+            <propertyset>
+                <propertyref prefix="ext."/>
+            </propertyset>
+        </echoproperties>
+    </target>
+
+    <!-- expected parameters: 
+         ext.names.list - the list of externals
+         parameters.external.* - parameters for externals to fetch -->
+
+    <!-- Fetches the external resource described by 
+                parameters.external.@{libname}.*
+         properties. 
+         Now supported fetching of:
+            - jar files described by 'url' and 'md5' attributes, 
+            - zip files described by 'url, 'md5', 'jar' attributes 
+         Fetched library can be referenced by 
+            ext.@{libname}.location 
+         property. -->
+    <macrodef name="fetch">
+        <attribute name="libname"/>
+        <attribute name="subcomponent"/>
+        <sequential>
+            <echo message="Fetching '@{libname}' external dependency for '@{subcomponent}' subcomponent."/>
+
+            <!-- Determine the basename of the URL pointing to library file
+                 (further procedure of the library fetching depends on its 
+                 type)                                                      -->
+            <basename file="${@{subcomponent}.parameters.external.@{libname}.url}"
+                      property="@{subcomponent}.parameters.external.@{libname}.url.basename"/>
+
+            <!-- Determine the [base]name of the library file:              -->
+            <!-- firstly: check if it was expicitly specified 
+                          by 'jar' attribute: -->
+            <condition property="@{subcomponent}.parameters.external.@{libname}.basename"
+                       value="${@{subcomponent}.parameters.external.@{libname}.jar}">
+                <isset property="@{subcomponent}.parameters.external.@{libname}.jar"/>
+            </condition>
+            <!-- secondly: check if it was expicitly specified 
+                          by 'dir' attribute: -->
+            <condition property="@{subcomponent}.parameters.external.@{libname}.basename"
+                       value="${@{subcomponent}.parameters.external.@{libname}.dir}">
+                <isset property="@{subcomponent}.parameters.external.@{libname}.dir"/>
+            </condition>
+            <!-- at last: if the name was not explicitly specified,
+                 use URL's basename. -->
+            <property name="@{subcomponent}.parameters.external.@{libname}.basename"
+                      value="${@{subcomponent}.parameters.external.@{libname}.url.basename}"/>
+            
+            <!-- Set up the library accessing property: -->
+            <property 
+                name="ext.@{libname}.location" 
+                location="${external.libs.dir}/${@{subcomponent}.parameters.external.@{libname}.basename}"/>
+            
+            <!-- Check for lib file presence -->
+            <condition property="@{subcomponent}.parameters.external.@{libname}.exists">
+                <available file="${ext.@{libname}.location}"/>
+            </condition>
+
+            <echo message="===> Library Info: @{libname}"/>
+            <echo message="         Basename: ${@{subcomponent}.parameters.external.@{libname}.basename}"/>
+            <echo message="         Location: ${ext.@{libname}.location}"/>
+            <echo message="         Presence: ${@{subcomponent}.parameters.external.@{libname}.exists}"/>
+
+            <!-- Proceed fetching if the target file does not exist -->
+            <antcall target="-fetch-unless-exists">
+                <param name="lib.name" value="@{libname}"/>
+                <param name="url.file"
+                       value="${@{subcomponent}.parameters.external.@{libname}.url.basename}"/>
+                <param name="lib.file"
+                       value="${@{subcomponent}.parameters.external.@{libname}.basename}"/>
+                <propertyset>
+                    <propertyref regex="^@{subcomponent}.parameters\.external\..*"/>
+                    <!-- remove @{subcomponent} prefix -->
+                    <mapper type="regexp" from="^@{subcomponent}\.(.*)" to="\1"/>
+                </propertyset>
+            </antcall>
+        </sequential>
+    </macrodef>
+
+    <!-- Determines the type of the resource to be downloaded and sets up
+         corresponding properties. The further control flow depends on 
+         this target. -->
+    <target name="-fetch-unless-exists"
+            unless="parameters.external.${lib.name}.exists">
+        <determine-resource-type libname="${lib.name}"/>
+        <antcall target="-fetch"/>
+    </target>
+
+    <!-- Does determination of resource type -->
+    <macrodef name="determine-resource-type">
+        <attribute name="libname"/>
+        <sequential>
+            <!-- determine if it is an archive -->
+            <condition property="parameters.external.@{libname}.is.zip">
+                <contains string="${parameters.external.@{libname}.url.basename}?" 
+                          substring=".zip?"/>
+            </condition>
+            <!-- check availability of the archive -->
+            <condition property="parameters.external.${lib.name}.downloaded">
+                <and>
+                    <isset property="parameters.external.@{libname}.is.zip"/>
+                    <available file="${external.arch.dir}/${url.file}"/>
+                </and>
+            </condition>
+            <!-- determine if it is a jar library -->
+            <condition property="parameters.external.@{libname}.is.jar">
+                <contains string="${parameters.external.@{libname}.url.basename}?" 
+                          substring=".jar?"/>
+            </condition>
+            <!-- check jar for presence -->
+            <condition property="parameters.external.${lib.name}.downloaded">
+                <isset property="parameters.external.${lib.name}.exists"/>
+            </condition>
+        </sequential>
+    </macrodef>
+
+    <!-- Do download to the temporal directory 
+         and split control flow on the base of resource type -->
+    <target name="-fetch" depends="-download, -fetch-zip, -fetch-jar"/>
+
+    <!-- Do download external zip and extract it into external.libs.dir -->
+    <target name="-fetch-zip" 
+            if="parameters.external.${lib.name}.is.zip">
+        <echo>==> Fetch ZIP: ${url.file}</echo>
+        <!-- file was downloaded, place it to the destination -->
+        <move file="${temp.files.dir}/${url.file}"
+              tofile="${external.arch.dir}/${url.file}"
+              failonerror="false"/>
+        <!-- .. and unzip -->
+        <antcall target="-do-unzip"/>
+    </target>
+
+    <!-- Do unzip the archive on the base of its content -->
+    <target name="-do-unzip" depends="-do-unzip-jar, -do-unzip-dir"/>
+
+    <!-- Do unzip the specified jar library -->
+    <target name="-do-unzip-jar" if="parameters.external.${lib.name}.jar">
+        <unzip src="${external.arch.dir}/${url.file}"
+               dest="${temp.files.dir}">
+            <patternset>
+                <include name="**/${lib.file}"/>
+            </patternset>
+        </unzip>
+        <move todir="${external.libs.dir}" flatten="true">
+            <fileset dir="${temp.files.dir}">
+                <include name="**/${lib.file}"/>
+            </fileset>
+        </move>
+    </target>
+
+    <!-- Do unzip the archive into specified by 'dir' attribute directory -->
+    <target name="-do-unzip-dir" if="parameters.external.${lib.name}.dir">
+        <do-unzip-dir libname="${lib.name}"/>
+    </target>
+
+    <macrodef name="do-unzip-dir">
+        <attribute name="libname"/>
+        <sequential>
+            <!-- If 'inc' attribute specifying the extract includes was not
+                 specified, unzip all -->
+            <property name="parameters.external.@{libname}.inc" value="**/*"/>
+            <!-- Do all the work in the special directory -->
+            <tempfile 
+                destdir="${temp.files.dir}"
+                property="parameters.external.@{libname}.tempfile"/>
+            <mkdir dir="${parameters.external.@{libname}.tempfile}"/>
+            <unzip src="${external.arch.dir}/${url.file}"
+                   dest="${parameters.external.@{libname}.tempfile}">
+                <patternset includes="${parameters.external.@{libname}.inc}"/>
+            </unzip>
+            <!-- If archive's root dir name equals to target dir name
+                 (specified by 'dir' attribute) move it to libs dir, 
+                 otherwise - move all extracted files to target dir 
+                 (under libs dir) -->
+            <move todir="${external.libs.dir}/${parameters.external.@{libname}.dir}">
+                <fileset dir="${parameters.external.@{libname}.tempfile}">
+                    <include name="**/*"/>
+                </fileset>
+                <mapper type="glob" 
+                        from="${parameters.external.@{libname}.dir}${file.separator}"
+                        to="*"/>
+            </move>
+            <delete dir="${parameters.external.@{libname}.tempfile}"
+                    failonerror="false"/>
+        </sequential>
+    </macrodef>
+
+    <!-- Do download external jar into external.libs.dir -->
+    <target name="-fetch-jar" if="parameters.external.${lib.name}.is.jar">
+        <echo>==> Fetch JAR: ${url.file}</echo>
+        <!-- file was downloaded, place it to the destination -->
+        <move file="${temp.files.dir}/${url.file}"
+              tofile="${external.libs.dir}/${lib.file}"
+              failonerror="false"/>
+    </target>
+    
+    <target name="-download" unless="parameters.external.${lib.name}.downloaded">
+        <do-download libname="${lib.name}"/>
+    </target>
+
+    <!-- Downloads external dependency pointed by @{libname}'s URL
+         into ${temp.files.dir}/${url.file} and checks its checksum -->
+    <macrodef name="do-download">
+        <attribute name="libname"/>
+        <sequential>
+            <echo>==> Do Download from ${parameters.external.@{libname}.url}</echo>
+            <get src="${parameters.external.@{libname}.url}" 
+                 dest="${temp.files.dir}/${url.file}" 
+                 usetimestamp="true" 
+                 verbose="true"
+            />
+            <!-- compute the checksum and check the downloaded file -->
+            <checksum
+                file="${temp.files.dir}/${url.file}"
+                property="parameters.external.@{libname}.url.md5"/>
+            <fail>
+                <condition>
+                    <not><equals 
+                        arg1="${parameters.external.@{libname}.url.md5}" 
+                        arg2="${parameters.external.@{libname}.md5}"
+                    /></not>
+                </condition>
+...
+File
+    ${lib.file} 
+downloaded from:
+    ${parameters.external.@{libname}.url} 
+has incorrect MD5 checksum:
+    '${parameters.external.@{libname}.url.md5}'
+while expected is:
+    '${parameters.external.@{libname}.md5}'
+            </fail>
+        </sequential>
+    </macrodef>
+
+    <target name="-make-dep-dirs" unless="${depends.jars}.exists">
+        <!-- Make the directories to store external dependencies -->
+        <mkdir dir="${external.libs.dir}"/>
+        <mkdir dir="${external.arch.dir}"/>
+        <mkdir dir="${temp.files.dir}"/>
+    </target>
+
+    <target name="-setup-proxy" if="http.proxyHost">
+        <echo>==> Setting Up the proxy: ${http.proxyHost}:${http.proxyPort}</echo>
+        <setproxy proxyhost="${http.proxyHost}" proxyport="${http.proxyPort}"/>
+    </target>
+
+</project>
+

Propchange: harmony/enhanced/buildtest/branches/2.0/scripts/download.xml
------------------------------------------------------------------------------
    svn:eol-style = native