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 2008/03/21 18:55:24 UTC
svn commit: r639737 - in /harmony/enhanced/buildtest/trunk/infra: build.xml
scripts/config.xml scripts/tmp-config.xml
Author: smishura
Date: Fri Mar 21 10:55:21 2008
New Revision: 639737
URL: http://svn.apache.org/viewvc?rev=639737&view=rev
Log:
Prototype for config module (currently it is disabled).
The intent is to separate and simplify work with suites' properties.
So during install all suites/framework properties are resolved
and an user has a chance to review/update them before running setup.
Note: there are properties cycle dependencies, workarounds are provided.
need to decided how to resolve them (or leave as it is)
Added:
harmony/enhanced/buildtest/trunk/infra/scripts/config.xml (with props)
harmony/enhanced/buildtest/trunk/infra/scripts/tmp-config.xml (with props)
Modified:
harmony/enhanced/buildtest/trunk/infra/build.xml
Modified: harmony/enhanced/buildtest/trunk/infra/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/trunk/infra/build.xml?rev=639737&r1=639736&r2=639737&view=diff
==============================================================================
--- harmony/enhanced/buildtest/trunk/infra/build.xml (original)
+++ harmony/enhanced/buildtest/trunk/infra/build.xml Fri Mar 21 10:55:21 2008
@@ -61,6 +61,8 @@
<propertyref name="ant.home" />
<propertyref name="adaptors.dir" />
<propertyref name="scripts.dir" />
+ <propertyref name="config.dir" />
+ <propertyref name="checkouts.dir" />
<propertyref name="framework.properties.file" />
<propertyref name="framework.implementation.file" />
<propertyref name="test.suites.names.list" />
@@ -71,7 +73,10 @@
================================================================== -->
<target name="install"
- depends="fetch-depends,checkout-projects,patch-ant" />
+ depends="fetch-depends,
+ checkout-projects,
+ patch-ant,
+ generate-config" />
<target name="-check-selected-names">
@@ -122,6 +127,8 @@
<mkdir dir="${results.dir}" />
<mkdir dir="${temp.files.dir}" />
<mkdir dir="${classes.dir}" />
+
+ <delete dir="${config.dir}" />
<mkdir dir="${config.dir}" />
<!-- init properties -->
@@ -204,6 +211,17 @@
</javac>
</target>
+ <target name="generate-config" depends="-check-selected-names">
+
+ <!-- TODO: properties generated here currently are unused
+ need to check/fix properties flow -->
+ <subant genericantfile="${scripts.dir}/config.xml"
+ target="generate-config"
+ inheritall="true"
+ inheritrefs="true"
+ buildpath="${scripts.dir}">
+ </subant>
+ </target>
<!-- ==================================================================
Framework Setup Functionality
================================================================== -->
Added: harmony/enhanced/buildtest/trunk/infra/scripts/config.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/trunk/infra/scripts/config.xml?rev=639737&view=auto
==============================================================================
--- harmony/enhanced/buildtest/trunk/infra/scripts/config.xml (added)
+++ harmony/enhanced/buildtest/trunk/infra/scripts/config.xml Fri Mar 21 10:55:21 2008
@@ -0,0 +1,103 @@
+<?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. -->
+
+<project name="config" default="generate-config" basedir=".">
+
+ <target name="generate-config">
+
+ <!-- first stage: generate initial props -->
+ <subant genericantfile="${scripts.dir}/config.xml"
+ target="generate"
+ inheritall="true"
+ inheritrefs="true">
+ <dirset dir="${adaptors.dir}" includes="${test.suites}" />
+ </subant>
+
+ <!-- second stage: re-generate properties
+ to expand required if there is a value set -->
+ <property name="all.props" location="${config.dir}/all.props" />
+ <concat destfile="${all.props}">
+ <fileset dir="${config.dir}" includes="*.properties" />
+ <filterchain>
+ <linecontainsregexp>
+ <!-- filter out undefined props -->
+ <regexp pattern="=[^$]" />
+ </linecontainsregexp>
+ </filterchain>
+ </concat>
+
+ <subant genericantfile="${scripts.dir}/config.xml"
+ target="re-generate"
+ inheritall="false">
+ <dirset dir="${adaptors.dir}" includes="${test.suites}" />
+ <propertyset>
+ <propertyref name="all.props" />
+ <propertyref name="framework.local.configuration.file" />
+ <propertyset refid="global.build.parameters.id" />
+ </propertyset>
+ </subant>
+
+ <!-- third stage: extract required properties
+ to a separate file - 'required-parameters.properties' -->
+ <!-- TODO -->
+ </target>
+
+ <!-- The target is workaround for properties cycle dependencies
+ parameters.xml -> adaptor.xml -> parameters.xml
+ TODO: need to resolve the cycle dependencies
+ -->
+ <target name="generate">
+
+ <basename file="${basedir}" property="suite.name" />
+
+ <subant genericantfile="${scripts.dir}/tmp-config.xml"
+ target="-generate-tmp-config"
+ inheritall="true"
+ inheritrefs="true"
+ buildpath="${scripts.dir}">
+ </subant>
+ </target>
+
+ <!-- The target is workaround for properties cycle dependencies
+ framework.local.properties
+ -> parameters.xml -> framework.local.properties
+ TODO: need to resolve the cycle dependencies
+ -->
+ <target name="re-generate">
+
+ <basename file="${basedir}" property="suite.name" />
+
+ <echo>Generate config for: ${suite.name}</echo>
+
+ <property file="${all.props}" />
+ <loadproperties srcfile="${framework.local.configuration.file}">
+ <filterchain>
+ <expandproperties />
+ </filterchain>
+ </loadproperties>
+
+ <echoproperties destfile="${config.dir}/${suite.name}.properties">
+ <propertyset>
+ <propertyref prefix="${suite.name}" />
+ <!--propertyset refid="global.build.parameters.id" /-->
+ </propertyset>
+ </echoproperties>
+ </target>
+
+
+</project>
+
Propchange: harmony/enhanced/buildtest/trunk/infra/scripts/config.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: harmony/enhanced/buildtest/trunk/infra/scripts/tmp-config.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/trunk/infra/scripts/tmp-config.xml?rev=639737&view=auto
==============================================================================
--- harmony/enhanced/buildtest/trunk/infra/scripts/tmp-config.xml (added)
+++ harmony/enhanced/buildtest/trunk/infra/scripts/tmp-config.xml Fri Mar 21 10:55:21 2008
@@ -0,0 +1,39 @@
+<?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. -->
+
+<project name="config" basedir=".">
+
+ <import file="${adaptors.dir}/${suite.name}/adaptor.xml" />
+
+ <target name="-generate-tmp-config">
+
+ <xmlproperty file="${adaptors.dir}/${suite.name}/parameters.xml"
+ collapseAttributes="true"
+ semanticAttributes="true"
+ prefix="${suite.name}" />
+
+ <echoproperties destfile="${config.dir}/${suite.name}.properties">
+ <propertyset>
+ <propertyref prefix="${suite.name}" />
+ <!--propertyset refid="global.build.parameters.id" /-->
+ </propertyset>
+ </echoproperties>
+
+ </target>
+
+</project>
+
Propchange: harmony/enhanced/buildtest/trunk/infra/scripts/tmp-config.xml
------------------------------------------------------------------------------
svn:eol-style = native