You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2007/01/27 23:58:28 UTC
svn commit: r500661 [1/3] - in /geronimo/sandbox/build-support/harness: ./
branches/ tags/ trunk/ trunk/bin/ trunk/lib/ trunk/lib/buildharness/
trunk/lib/buildharness/commands/ trunk/lib/buildharness/commands/tck/
trunk/lib/buildharness/util/ trunk/too...
Author: jdillon
Date: Sat Jan 27 14:58:22 2007
New Revision: 500661
URL: http://svn.apache.org/viewvc?view=rev&rev=500661
Log:
The build harness, not for release or distribution
Added:
geronimo/sandbox/build-support/harness/
geronimo/sandbox/build-support/harness/branches/
geronimo/sandbox/build-support/harness/tags/
geronimo/sandbox/build-support/harness/trunk/
geronimo/sandbox/build-support/harness/trunk/bin/
geronimo/sandbox/build-support/harness/trunk/bin/clean (with props)
geronimo/sandbox/build-support/harness/trunk/harness.xml (with props)
geronimo/sandbox/build-support/harness/trunk/lib/
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildContext.groovy (with props)
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildHarness.groovy (with props)
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ExitNotification.groovy (with props)
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ForwardNotification.groovy (with props)
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/CommandSupport.groovy (with props)
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/exec.groovy (with props)
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/iteration.groovy (with props)
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/maven.groovy (with props)
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/postprocess.groovy (with props)
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/report.groovy (with props)
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/util/
geronimo/sandbox/build-support/harness/trunk/lib/buildharness/util/Line.groovy (with props)
geronimo/sandbox/build-support/harness/trunk/lib/groovy-all-1.0.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/
geronimo/sandbox/build-support/harness/trunk/tools/ant/
geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/
geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/ant (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/antRun (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/antRun.pl (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/complete-ant-cmd.pl (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/runant.pl (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/runant.py (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-antlr-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-antlr-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-antlr-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-antlr.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-bcel-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-bcel-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-bcel-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-bcel.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-bsf-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-bsf-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-bsf-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-bsf.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-log4j-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-log4j-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-log4j-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-log4j.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-oro-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-oro-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-oro-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-oro.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-regexp-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-regexp-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-regexp-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-regexp.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-resolver-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-resolver-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-resolver-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-apache-resolver.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-commons-logging-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-commons-logging-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-commons-logging-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-commons-logging.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-commons-net-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-commons-net-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-commons-net-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-commons-net.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jai-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jai-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jai-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jai.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-javamail-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-javamail-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-javamail-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-javamail.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jdepend-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jdepend-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jdepend-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jdepend.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jmf-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jmf-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jmf-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jmf.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jsch-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jsch-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jsch-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-jsch.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-junit-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-junit-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-junit-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-junit.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-launcher-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-launcher-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-launcher-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-launcher.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-netrexx-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-netrexx-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-netrexx-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-netrexx.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-nodeps-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-nodeps-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-nodeps-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-nodeps.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-parent-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-parent-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-parent-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-starteam-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-starteam-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-starteam-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-starteam.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-stylebook-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-stylebook-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-stylebook-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-stylebook.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-swing-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-swing-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-swing-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-swing.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-testutil-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-testutil-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-testutil-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-testutil.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-trax-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-trax-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-trax-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-trax.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-weblogic-1.7.0.pom
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-weblogic-1.7.0.pom.md5
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-weblogic-1.7.0.pom.sha1
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant-weblogic.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/ant.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/antlr-2.7.2.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/bcel-5.1.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/bsf-2.4.0.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/bsh-2.0b4.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/bsh-core-2.0b4.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/commons-logging-1.0.4.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/commons-logging-api-1.0.4.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/commons-net-1.4.0.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/jdepend-2.7.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/jruby-0.8.3.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/js-1.6R3.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/jsch-0.1.29.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/junit-3.8.2.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/jython-2.1.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/libraries.properties (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/log4j-1.2.13.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/maven-artifact-ant-2.0.4-dep.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/oro-2.0.8.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/regexp-1.3.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/which-1.0.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/xalan-2.7.0.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/xercesImpl.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/xml-apis-1.0.b2.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/xml-apis.jar (with props)
geronimo/sandbox/build-support/harness/trunk/tools/ant/lib/xml-resolver-1.1.jar (with props)
Added: geronimo/sandbox/build-support/harness/trunk/bin/clean
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/bin/clean?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/bin/clean (added)
+++ geronimo/sandbox/build-support/harness/trunk/bin/clean Sat Jan 27 14:58:22 2007
@@ -0,0 +1,38 @@
+#!/bin/sh
+##
+## 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.
+##
+
+##
+## $Id$
+##
+
+DIRNAME=`dirname $0`
+PROGNAME=`basename $0`
+
+if [ "x$1" = "x" ]; then
+ dir=`pwd`
+else
+ dir=`cd "$1" && pwd`
+fi
+echo "Cleaning $dir..."
+
+find "$dir" -name target | xargs rm -rfv | egrep "^removed directory:"
+
+# egrep will return non-zero if no match
+exit 0
Propchange: geronimo/sandbox/build-support/harness/trunk/bin/clean
------------------------------------------------------------------------------
svn:executable = *
Added: geronimo/sandbox/build-support/harness/trunk/harness.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/harness.xml?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/harness.xml (added)
+++ geronimo/sandbox/build-support/harness/trunk/harness.xml Sat Jan 27 14:58:22 2007
@@ -0,0 +1,58 @@
+<?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.
+-->
+
+<!-- $Id$ -->
+
+<project default="bootstrap" basedir=".">
+
+ <target name="setup">
+ <chmod perm="u+x">
+ <fileset dir="bin">
+ <include name="*"/>
+ </fileset>
+ <fileset dir="tools">
+ <include name="*/bin/*"/>
+ </fileset>
+ </chmod>
+ </target>
+
+ <target name="init">
+ <record name="harness.log" action="start" emacsmode="true" loglevel="info" append="false"/>
+
+ <path id="groovy.classpath">
+ <fileset dir="${basedir}/lib">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="groovy.classpath"/>
+ </target>
+
+ <target name="bootstrap" depends="init">
+ <groovy>
+ <classpath>
+ <pathelement location="${basedir}/lib"/>
+ </classpath>
+
+ buildharness.BuildHarness.bootstrap(this)
+ </groovy>
+ </target>
+
+</project>
Propchange: geronimo/sandbox/build-support/harness/trunk/harness.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/harness/trunk/harness.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/harness/trunk/harness.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildContext.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildContext.groovy?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildContext.groovy (added)
+++ geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildContext.groovy Sat Jan 27 14:58:22 2007
@@ -0,0 +1,140 @@
+/*
+ * 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.
+ */
+
+//
+// $Id$
+//
+
+package buildharness
+
+class BuildContext
+{
+ /** The invoking script reference */
+ def script
+
+ /** Internal ant environment */
+ def ant = new AntBuilder()
+
+ /** Overridded properties. */
+ def overrides = [:]
+
+ public BuildContext(script) {
+ assert script != null
+
+ this.script = script
+
+ // Replace the default listener with the enclosing listener from ant via the script reference
+ // This is to prevent duplicate processing, which results in extra new lines :-(
+ def p = ant.antProject
+ p.removeBuildListener(p.buildListeners[0])
+ p.addBuildListener(script.ant.antProject.buildListeners[0])
+ }
+
+ def resolveFile(path) {
+ def file = new File(path)
+
+ // TODO: Maybe need to resolve this puppy relative to ${basedir}
+
+ return file.canonicalFile
+ }
+
+ def fail(msg, cause=null) {
+ throw new ExitNotification(message: msg, cause: cause)
+ }
+
+ def forward(name) {
+ throw new ForwardNotification(name: name)
+ }
+
+ def dumpProperties() {
+ println 'Properties:'
+
+ def props = [:]
+ props.putAll(script.properties)
+ props.putAll(overrides)
+
+ props.keySet().sort().each {
+ println " ${it}=" + props[it]
+ }
+ }
+
+ def set(name, value) {
+ assert name != null
+
+ overrides[name] = value
+ }
+
+ def getInternal(name) {
+ if (overrides.containsKey(name)) {
+ return overrides[name]
+ }
+ else {
+ return script.properties[name]
+ }
+ }
+
+ def get(name, defaultValue=null) {
+ assert name != null
+
+ def value = getInternal(name)
+
+ if (value == null) {
+ return defaultValue
+ }
+ else {
+ return value
+ }
+ }
+
+ def getAsInt(name, defaultValue=-1) {
+ def value = get(name)
+
+ if (value == null) {
+ return defaultValue
+ }
+ else {
+ return Integer.parseInt(value)
+ }
+ }
+
+ def getAsFile(name) {
+ def value = get(name)
+
+ return resolveFile(value)
+ }
+
+ def getRequired(name) {
+ def value = get(name)
+
+ assert value != null : "Missing required property: ${name}"
+
+ return value
+ }
+
+ def getRequiredAsInt(name) {
+ def value = getRequired(name)
+ return Integer.parseInt(value)
+ }
+
+ def getRequiredAsFile(name) {
+ def value = getRequired(name)
+
+ return resolveFile(value)
+ }
+}
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildContext.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildContext.groovy
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildContext.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildHarness.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildHarness.groovy?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildHarness.groovy (added)
+++ geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildHarness.groovy Sat Jan 27 14:58:22 2007
@@ -0,0 +1,101 @@
+/*
+ * 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.
+ */
+
+//
+// $Id$
+//
+
+package buildharness
+
+import buildharness.util.*
+
+class BuildHarness
+{
+ /** The package where command classes live */
+ static final def COMMANDS_PACKAGE = "buildharness.commands"
+
+ /** Nested Groovy shell for evaluate expressions */
+ def shell = new GroovyShell(this.class.classLoader)
+
+ /** Build context */
+ def context
+
+ public BuildHarness(script) {
+ this.context = new BuildContext(script)
+ }
+
+ def run() {
+ def name = context.getRequired('command')
+
+ while (true) {
+ try {
+ execute(name)
+
+ // If we get this far, we did not forward, so exit the loop
+ break
+ }
+ catch (ForwardNotification n) {
+ name = n.name
+ println "Forwarding to: ${name}"
+ }
+ }
+ }
+
+ def execute(name) {
+ Line.display()
+
+ println "Command: ${name}"
+
+ def command = shell.evaluate("new ${COMMANDS_PACKAGE}.${name}()")
+ println "Command instance: ${command}"
+
+ // Dump the environemnt
+ context.dumpProperties()
+
+ Line.display()
+
+ command.init(context)
+ command.execute()
+ }
+
+ static def bootstrap(script) {
+ def exitn
+
+ try {
+ new BuildHarness(script).run()
+ }
+ catch (ExitNotification n) {
+ exitn = n
+ }
+ catch (Throwable t) {
+ Line.display()
+
+ // Dump for debugging purposes
+ t.printStackTrace()
+
+ exitn = new ExitNotification(cause: t)
+ }
+
+ Line.display(false)
+
+ if (exitn != null) {
+ script.ant.fail(message: exitn as String)
+ }
+ }
+}
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildHarness.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildHarness.groovy
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/BuildHarness.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ExitNotification.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ExitNotification.groovy?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ExitNotification.groovy (added)
+++ geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ExitNotification.groovy Sat Jan 27 14:58:22 2007
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+//
+// $Id$
+//
+
+package buildharness
+
+class ExitNotification
+ extends Error
+{
+ def message
+
+ def cause
+
+ public String toString() {
+ def text = ''
+
+ if (message != null) {
+ text += message
+ }
+
+ if (message != null && cause != null) {
+ text += ': '
+ }
+
+ if (cause != null) {
+ text += cause
+ }
+
+ return text
+ }
+}
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ExitNotification.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ExitNotification.groovy
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ExitNotification.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ForwardNotification.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ForwardNotification.groovy?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ForwardNotification.groovy (added)
+++ geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ForwardNotification.groovy Sat Jan 27 14:58:22 2007
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+//
+// $Id$
+//
+
+package buildharness
+
+class ForwardNotification
+ extends Error
+{
+ /** The name of the command to forward to. */
+ def name
+}
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ForwardNotification.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ForwardNotification.groovy
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/ForwardNotification.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/CommandSupport.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/CommandSupport.groovy?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/CommandSupport.groovy (added)
+++ geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/CommandSupport.groovy Sat Jan 27 14:58:22 2007
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+//
+// $Id$
+//
+
+package buildharness.commands
+
+abstract class CommandSupport
+{
+ def context
+
+ def ant
+
+ def init(context) {
+ assert context != null
+
+ this.context = context
+ this.ant = context.ant
+ }
+}
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/CommandSupport.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/CommandSupport.groovy
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/CommandSupport.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/exec.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/exec.groovy?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/exec.groovy (added)
+++ geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/exec.groovy Sat Jan 27 14:58:22 2007
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+
+//
+// $Id$
+//
+
+package buildharness.commands
+
+import buildharness.util.*
+
+class exec
+ extends CommandSupport
+{
+ def execute() {
+ // Setup the executable
+ def executable = context.getRequiredAsFile('executable')
+ println "Using executable: ${executable}"
+
+ // Optional timeout
+ def timeout = context.getAsInt('timeout', -1)
+ println "Using timeout: ${timeout}"
+
+ // Optional args
+ def args = context.get('args')
+ println "Using args: ${args}"
+
+ Line.display()
+
+ //
+ // TODO: May need to expose setting of JAVA_HOME here...
+ //
+
+ // Chmod +x the file just as a sanity check
+ if (executable.exists()) {
+ ant.chmod(perm: 'u+x', file: executable)
+ }
+
+ try {
+ ant.exec(executable: executable, failonerror: true) {
+ // Get a reference to the current node so we can conditionally set attributes
+ def node = current.wrapper
+
+ // Maybe set timeout
+ if (timeout > 0) {
+ println "Timeout after: ${timeout} seconds"
+ def millis = timeout * 1000
+ node.setAttribute('timeout', "${millis}")
+ }
+
+ // Attach any optional args passed in
+ if (args != null) {
+ arg(line: args)
+ }
+ }
+ }
+ catch (Exception e) {
+ context.fail('Command execution failed', e)
+ }
+ }
+}
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/exec.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/exec.groovy
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/exec.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/iteration.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/iteration.groovy?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/iteration.groovy (added)
+++ geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/iteration.groovy Sat Jan 27 14:58:22 2007
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+
+//
+// $Rev$ $Date$
+//
+
+package buildharness.commands
+
+class iteration
+ extends CommandSupport
+{
+ /** The iteration index. */
+ int iteration
+
+ /** The mapping of iteration index to replacement values. */
+ Map mapping
+
+ def loadMapping(file) {
+ assert file != null
+
+ def props = new Properties()
+ props.load(file.newInputStream())
+
+ return props
+ }
+
+ def applyMapping(name) {
+ assert name != null
+
+ //
+ // TODO: Maybe apply the mapping to more than one property?
+ //
+
+ def value = context.getRequired(name)
+ def parts = value.tokenize(' ')
+ def list = []
+
+ def mappedValue = mapping[this.iteration as String]
+
+ println "Applying mapping to ${name}=${parts}"
+
+ parts.each { part ->
+ part = part.replaceAll('%', { mappedValue })
+ list.add(part)
+ }
+
+ value = list.join(' ')
+ println "Mapped ${name} to ${value}"
+ context.set(name, value)
+ }
+
+ def execute() {
+ this.iteration = context.getRequiredAsInt('iteration')
+ assert this.iteration >= 1 : 'Iteration must be greater than 1'
+ println "Iteration: ${this.iteration}"
+
+ // The command we will execute to perform the iteration task
+ def command = context.getRequired('iteration_command')
+ println "Iteration Command: ${command}"
+
+ //
+ // TODO: Allow for groovy-based mapping support?
+ //
+
+ // Load mapping
+ def mappingFile = context.getRequiredAsFile('mapping')
+ assert mappingFile.exists() : "Missing iteration mapping file: ${mappingFile}"
+ println "Using iteration mapping file: ${mappingFile}"
+
+ this.mapping = loadMapping(mappingFile)
+ println 'Iteration Map:'
+ mapping.keySet().sort().each {
+ println " ${it}=" + mapping[it]
+ }
+
+ // Make sure its a valid key in the map
+ assert mapping.containsKey((String)this.iteration) : 'Invalid iteration value; not mapped: ' + this.iteration
+
+ // Process arguments
+ def apply_to = context.get('apply_to', 'args')
+ println "Applying iteration mapping to: ${apply_to}"
+ applyMapping(apply_to)
+
+ // Forward to the handling command
+ context.forward(command)
+ }
+}
+
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/iteration.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/iteration.groovy
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/iteration.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/maven.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/maven.groovy?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/maven.groovy (added)
+++ geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/maven.groovy Sat Jan 27 14:58:22 2007
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+
+//
+// $Id$
+//
+
+package buildharness.commands
+
+import buildharness.util.*
+
+class maven
+ extends CommandSupport
+{
+ /** The path for JAVA_HOME. */
+ def javaHome = System.getenv("JAVA_HOME")
+
+ def setJavaVersion(ver) {
+ assert ver != null
+
+ def tmp = String.valueOf(ver).replace('.', '_')
+ def dir = System.getenv("JAVA_HOME_${tmp}")
+ if (dir == null) {
+ throw new Exception("Unable to use Java ${ver}; missing JAVA_HOME_${tmp}")
+ }
+
+ this.javaHome = dir
+ }
+
+ def execute() {
+ // Java version
+ def tmp = context.get('java_version')
+ if (tmp != null) {
+ javaVersion = tmp
+ }
+ println "Using JAVA_HOME: ${javaHome}"
+
+ // MAVEN_OPTS
+ def mavenOpts = context.get('maven_opts')
+ println "Using MAVEN_OPTS: ${mavenOpts}"
+
+ // Setup the POM
+ def pom = context.getRequiredAsFile('pom')
+ assert pom.exists() : "Missing POM file: ${pom}"
+ println "Using POM: ${pom}"
+
+ // Setup the repository
+ def repodir = context.resolveFile('repository')
+ ant.mkdir(dir: repodir)
+ println "Using repository: ${repodir}"
+
+ // Optional timeout
+ def timeout = context.getAsInt('timeout', -1)
+ println "Using timeout: ${timeout}"
+
+ // Optional args
+ def args = context.get('args')
+ println "Using args: ${args}"
+
+ // Execute Maven
+ Line.display()
+
+ try {
+ //
+ // TODO: May eventually want to control which 'mvn' to execute,
+ // perhaps using tools/maven/bin/mvn or something
+ //
+
+ ant.exec(executable: 'mvn', failonerror: true) {
+ // Get a reference to the current node so we can conditionally set attributes
+ def node = current.wrapper
+
+ // Maybe set timeout
+ if (timeout > 0) {
+ println "Timeout after: ${timeout} seconds"
+ def millis = timeout * 1000
+ node.setAttribute('timeout', "${millis}")
+ }
+
+ if (javaHome != null) {
+ env(key: 'JAVA_HOME', file: javaHome)
+ }
+
+ if (mavenOpts != null) {
+ env(key: 'MAVEN_OPTS', value: mavenOpts)
+ }
+
+ arg(value: '--batch-mode')
+ arg(value: '--errors')
+ arg(value: '--file')
+ arg(file: pom)
+
+ arg(value: "-Dmaven.repo.local=${repodir}")
+
+ // Attach any optional args passed in
+ if (args != null) {
+ arg(line: args)
+ }
+ }
+ }
+ catch (Exception e) {
+ context.fail('Maven execution failed', e)
+ }
+ }
+}
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/maven.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/maven.groovy
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/maven.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/postprocess.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/postprocess.groovy?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/postprocess.groovy (added)
+++ geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/postprocess.groovy Sat Jan 27 14:58:22 2007
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+//
+// $Id$
+//
+
+package buildharness.commands.tck
+
+import buildharness.commands.CommandSupport
+
+class postprocess
+ extends CommandSupport
+{
+ /** The iteration index. */
+ int iteration
+
+ /** The ID of the workflow being executed for uniqness in the buildlife. */
+ int workflowId
+
+ /** The source directory were test output lives. */
+ def sourceDir
+
+ /** Where to put the test output for capture. */
+ def targetDir
+
+ def execute() {
+ iteration = context.getRequiredAsInt('iteration')
+ println "Iteration: ${iteration}"
+
+ workflowId = context.getRequiredAsInt('workflow_id')
+ println "Using workflow ID: ${workflowId}"
+
+ sourceDir = context.getRequiredAsFile('source_dir')
+ println "Using source dir: ${sourceDir}"
+ assert sourceDir.exists() : "Missing source dir: ${sourceDir}"
+
+ targetDir = context.resolveFile("reports/tck/${workflowId}/${iteration}")
+ println "Using target dir: ${targetDir}"
+ ant.mkdir(dir: targetDir)
+
+ // Copy test output to be saved/remoted
+ ant.copy(todir: targetDir) {
+ fileset(dir: sourceDir) {
+ include(name: 'logs/**')
+ include(name: 'summary.properties')
+
+ //
+ // TODO: Shall we also include the javatest output too?
+ //
+ }
+ }
+ }
+}
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/postprocess.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/postprocess.groovy
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/postprocess.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/report.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/report.groovy?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/report.groovy (added)
+++ geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/report.groovy Sat Jan 27 14:58:22 2007
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ */
+
+//
+// $Id$
+//
+
+package buildharness.commands.tck
+
+import buildharness.commands.CommandSupport
+
+import java.util.UUID
+
+class report
+ extends CommandSupport
+{
+ /** The ID of the workflow being executed for uniqness in the buildlife. */
+ int workflowId
+
+ /** The file where sections are loaded from. */
+ def sections
+
+ /** The directory where test inputs for the report live. */
+ def inputDir
+
+ /** The directory where the report will be written. */
+ def reportDir
+
+ def execute() {
+ workflowId = context.getRequiredAsInt('workflow_id')
+ println "Using workflow ID: ${workflowId}"
+
+ sections = context.getRequiredAsFile('sections')
+ println "Using sections file: ${sections}"
+ assert sections.exists() : "Missing sections file: ${sections}"
+
+ inputDir = context.resolveFile("reports/tck/${workflowId}")
+ println "Using input dir: ${inputDir}"
+ assert inputDir.exists() : "Missing report input dir: ${inputDir}"
+
+ reportDir = context.resolveFile('reports/tck/html')
+ println "Generating reports in dir: ${reportDir}"
+ ant.mkdir(dir: reportDir)
+
+ // Setup the repository
+ def repoDir = context.resolveFile('repository')
+ println "Using repository: ${repoDir}"
+
+ // Copy all summary properties to a tempdir for soaking up
+ def summariesDir = context.resolveFile('temp/summaries')
+ ant.mkdir(dir: summariesDir)
+
+ def scanner = ant.fileScanner {
+ fileset(dir: inputDir) {
+ include(name: '*/summary.properties')
+ }
+ }
+ for (file in scanner) {
+ def uuid = UUID.randomUUID()
+ ant.copy(file: file, tofile: "${summariesDir}/${uuid}.properties")
+ }
+
+ // Generate a report from captured TCK output
+ def runDir = sections.getParentFile() // must run from the dir where sections props lives
+ ant.exec(executable: 'mvn', dir: runDir, failonerror: true) {
+ // Assume that our repo is filled with the right bits
+ arg(value: '--offline')
+
+ arg(value: '--batch-mode')
+ arg(value: '--errors')
+ arg(value: "-Dmaven.repo.local=${repoDir}")
+
+ arg(value: 'j2eetck:generate-report')
+
+ arg(value: "-DsectionsFile=${sections}")
+ arg(value: "-DsummariesDirectory=${summariesDir}")
+ arg(value: "-DreportsDirectory=ignored")
+ arg(value: "-DoutputDirectory=${reportDir}")
+ }
+ }
+}
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/report.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/report.groovy
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/commands/tck/report.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/util/Line.groovy
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/lib/buildharness/util/Line.groovy?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/lib/buildharness/util/Line.groovy (added)
+++ geronimo/sandbox/build-support/harness/trunk/lib/buildharness/util/Line.groovy Sat Jan 27 14:58:22 2007
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+//
+// $Id$
+//
+
+package buildharness.util
+
+class Line
+{
+ static def display(endingNL=true) {
+ println ''
+ println '* ' * 40
+
+ if (endingNL) {
+ println ''
+ }
+ }
+}
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/util/Line.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/util/Line.groovy
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/buildharness/util/Line.groovy
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/build-support/harness/trunk/lib/groovy-all-1.0.jar
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/lib/groovy-all-1.0.jar?view=auto&rev=500661
==============================================================================
Binary file - no diff available.
Propchange: geronimo/sandbox/build-support/harness/trunk/lib/groovy-all-1.0.jar
------------------------------------------------------------------------------
svn:mime-type = application/java-archive
Added: geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/ant
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/ant?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/ant (added)
+++ geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/ant Sat Jan 27 14:58:22 2007
@@ -0,0 +1,326 @@
+#! /bin/sh
+
+# 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.
+
+# Extract launch and ant arguments, (see details below).
+ant_exec_args=
+no_config=false
+use_jikes_default=false
+ant_exec_debug=false
+show_help=false
+for arg in "$@" ; do
+ if [ "$arg" = "--noconfig" ] ; then
+ no_config=true
+ elif [ "$arg" = "--usejikes" ] ; then
+ use_jikes_default=true
+ elif [ "$arg" = "--execdebug" ] ; then
+ ant_exec_debug=true
+ elif [ my"$arg" = my"--h" -o my"$arg" = my"--help" ] ; then
+ show_help=true
+ ant_exec_args="$ant_exec_args -h"
+ else
+ if [ my"$arg" = my"-h" -o my"$arg" = my"-help" ] ; then
+ show_help=true
+ fi
+ ant_exec_args="$ant_exec_args \"$arg\""
+ fi
+done
+
+# Source/default ant configuration
+if $no_config ; then
+ rpm_mode=false
+ usejikes=$use_jikes_default
+else
+ # load system-wide ant configuration (ONLY if ANT_HOME has NOT been set)
+ if [ -z "$ANT_HOME" -o "$ANT_HOME" = "/usr/share/ant" ]; then
+ if [ -f "/etc/ant.conf" ] ; then
+ . /etc/ant.conf
+ fi
+ fi
+
+ # load user ant configuration
+ if [ -f "$HOME/.ant/ant.conf" ] ; then
+ . $HOME/.ant/ant.conf
+ fi
+ if [ -f "$HOME/.antrc" ] ; then
+ . "$HOME/.antrc"
+ fi
+
+ # provide default configuration values
+ if [ -z "$rpm_mode" ] ; then
+ rpm_mode=false
+ fi
+ if [ -z "$usejikes" ] ; then
+ usejikes=$use_jikes_default
+ fi
+fi
+
+# Setup Java environment in rpm mode
+if $rpm_mode ; then
+ if [ -f /usr/share/java-utils/java-functions ] ; then
+ . /usr/share/java-utils/java-functions
+ set_jvm
+ set_javacmd
+ fi
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ Darwin*) darwin=true
+ if [ -z "$JAVA_HOME" ] ; then
+ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
+ fi
+ ;;
+esac
+
+if [ -z "$ANT_HOME" -o ! -d "$ANT_HOME" ] ; then
+ ## resolve links - $0 may be a link to ant's home
+ PRG="$0"
+ progname=`basename "$0"`
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+ done
+
+ ANT_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ ANT_HOME=`cd "$ANT_HOME" && pwd`
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$ANT_HOME" ] &&
+ ANT_HOME=`cygpath --unix "$ANT_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# set ANT_LIB location
+ANT_LIB="${ANT_HOME}/lib"
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ elif [ -x "$JAVA_HOME/jre/bin/java" ] ; then
+ JAVACMD="$JAVA_HOME/jre/bin/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD=`which java 2> /dev/null `
+ if [ -z "$JAVACMD" ] ; then
+ JAVACMD=java
+ fi
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly."
+ echo " We cannot execute $JAVACMD"
+ exit 1
+fi
+
+# Build local classpath using just the launcher in non-rpm mode or
+# use the Jpackage helper in rpm mode with basic and default jars
+# specified in the ant.conf configuration. Because the launcher is
+# used, libraries linked in ANT_HOME/lib will also be included, but this
+# is discouraged as it is not java-version safe. A user should
+# request optional jars and their dependencies via the OPT_JAR_LIST
+# variable
+if $rpm_mode && [ -x /usr/bin/build-classpath ] ; then
+ LOCALCLASSPATH="$(/usr/bin/build-classpath ant ant-launcher jaxp_parser_impl xml-commons-apis)"
+
+ # If no optional jars have been specified then build the default list
+ if [ -z "$OPT_JAR_LIST" ] ; then
+ for file in /etc/ant.d/*; do
+ if [ -f "$file" ]; then
+ case "$file" in
+ *~) ;;
+ *#*) ;;
+ *.rpmsave) ;;
+ *.rpmnew) ;;
+ *)
+ for dep in `cat "$file"`; do
+ case "$OPT_JAR_LIST" in
+ *"$dep"*) ;;
+ *) OPT_JAR_LIST="$OPT_JAR_LIST${OPT_JAR_LIST:+ }$dep"
+ esac
+ done
+ esac
+ fi
+ done
+ fi
+
+ # If the user requested to try to add some other jars to the classpath
+ if [ -n "$OPT_JAR_LIST" ] ; then
+ _OPTCLASSPATH="$(/usr/bin/build-classpath $OPT_JAR_LIST 2> /dev/null)"
+ if [ -n "$_OPTCLASSPATH" ] ; then
+ LOCALCLASSPATH="$LOCALCLASSPATH:$_OPTCLASSPATH"
+ fi
+ fi
+
+ # Explicitly add javac path to classpath, assume JAVA_HOME set
+ # properly in rpm mode
+ if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
+ LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar"
+ fi
+ if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
+ LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip"
+ fi
+
+ # if CLASSPATH_OVERRIDE env var is set, LOCALCLASSPATH will be
+ # user CLASSPATH first and ant-found jars after.
+ # In that case, the user CLASSPATH will override ant-found jars
+ #
+ # if CLASSPATH_OVERRIDE is not set, we'll have the normal behaviour
+ # with ant-found jars first and user CLASSPATH after
+ if [ -n "$CLASSPATH" ] ; then
+ # merge local and specified classpath
+ if [ -z "$LOCALCLASSPATH" ] ; then
+ LOCALCLASSPATH="$CLASSPATH"
+ elif [ -n "$CLASSPATH_OVERRIDE" ] ; then
+ LOCALCLASSPATH="$CLASSPATH:$LOCALCLASSPATH"
+ else
+ LOCALCLASSPATH="$LOCALCLASSPATH:$CLASSPATH"
+ fi
+
+ # remove class path from launcher -cp option
+ CLASSPATH=""
+ fi
+else
+ # not using rpm_mode; use launcher to determine classpaths
+ if [ -z "$LOCALCLASSPATH" ] ; then
+ LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar
+ else
+ LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH
+ fi
+fi
+
+if [ -n "$JAVA_HOME" ] ; then
+ # OSX hack to make Ant work with jikes
+ if $darwin ; then
+ OSXHACK="${JAVA_HOME}/../Classes"
+ if [ -d "${OSXHACK}" ] ; then
+ for i in "${OSXHACK}"/*.jar
+ do
+ JIKESPATH="$JIKESPATH:$i"
+ done
+ fi
+ fi
+fi
+
+# Allow Jikes support (off by default)
+if $usejikes; then
+ ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes"
+fi
+
+# For Cygwin, switch paths to appropriate format before running java
+# For PATHs convert to unix format first, then to windows format to ensure
+# both formats are supported. Probably this will fail on directories with ;
+# in the name in the path. Let's assume that paths containing ; are more
+# rare than windows style paths on cygwin.
+if $cygwin; then
+ if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
+ format=mixed
+ else
+ format=windows
+ fi
+ ANT_HOME=`cygpath --$format "$ANT_HOME"`
+ ANT_LIB=`cygpath --$format "$ANT_LIB"`
+ JAVA_HOME=`cygpath --$format "$JAVA_HOME"`
+ LCP_TEMP=`cygpath --path --unix "$LOCALCLASSPATH"`
+ LOCALCLASSPATH=`cygpath --path --$format "$LCP_TEMP"`
+ if [ -n "$CLASSPATH" ] ; then
+ CP_TEMP=`cygpath --path --unix "$CLASSPATH"`
+ CLASSPATH=`cygpath --path --$format "$CP_TEMP"`
+ fi
+ CYGHOME=`cygpath --$format "$HOME"`
+fi
+
+# Show script help if requested
+if $show_help ; then
+ echo $0 '[script options] [options] [target [target2 [target3] ..]]'
+ echo 'Script Options:'
+ echo ' --help, --h print this message and ant help'
+ echo ' --noconfig suppress sourcing of /etc/ant.conf,'
+ echo ' $HOME/.ant/ant.conf, and $HOME/.antrc'
+ echo ' configuration files'
+ echo ' --usejikes enable use of jikes by default, unless'
+ echo ' set explicitly in configuration files'
+ echo ' --execdebug print ant exec line generated by this'
+ echo ' launch script'
+ echo ' '
+fi
+# add a second backslash to variables terminated by a backslash under cygwin
+if $cygwin; then
+ case "$ANT_HOME" in
+ *\\ )
+ ANT_HOME="$ANT_HOME\\"
+ ;;
+ esac
+ case "$CYGHOME" in
+ *\\ )
+ CYGHOME="$CYGHOME\\"
+ ;;
+ esac
+ case "$JIKESPATH" in
+ *\\ )
+ JIKESPATH="$JIKESPATH\\"
+ ;;
+ esac
+ case "$LOCALCLASSPATH" in
+ *\\ )
+ LOCALCLASSPATH="$LOCALCLASSPATH\\"
+ ;;
+ esac
+ case "$CLASSPATH" in
+ *\\ )
+ CLASSPATH="$CLASSPATH\\"
+ ;;
+ esac
+fi
+# Execute ant using eval/exec to preserve spaces in paths,
+# java options, and ant args
+ant_sys_opts=
+if [ -n "$CYGHOME" ]; then
+ if [ -n "$JIKESPATH" ]; then
+ ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\" -Dcygwin.user.home=\"$CYGHOME\""
+ else
+ ant_sys_opts="-Dcygwin.user.home=\"$CYGHOME\""
+ fi
+else
+ if [ -n "$JIKESPATH" ]; then
+ ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\""
+ fi
+fi
+ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath \"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"$CLASSPATH\" $ant_exec_args"
+if $ant_exec_debug ; then
+ echo $ant_exec_command
+fi
+eval $ant_exec_command
Propchange: geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/ant
------------------------------------------------------------------------------
svn:executable = *
Added: geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/antRun
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/antRun?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/antRun (added)
+++ geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/antRun Sat Jan 27 14:58:22 2007
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+# 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.
+
+# Args: DIR command
+cd "$1"
+CMD="$2"
+shift
+shift
+
+exec "$CMD" "$@"
Propchange: geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/antRun
------------------------------------------------------------------------------
svn:executable = *
Added: geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/antRun.pl
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/antRun.pl?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/antRun.pl (added)
+++ geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/antRun.pl Sat Jan 27 14:58:22 2007
@@ -0,0 +1,66 @@
+#!/usr/bin/perl
+#
+# 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.
+#
+#######################################################################
+#
+# antRun.pl
+#
+# wrapper script for invoking commands on a platform with Perl installed
+# this is akin to antRun.bat, and antRun the SH script
+#
+# created: 2001-10-18
+# author: Jeff Tulley jtulley@novell.com
+#######################################################################
+#be fussy about variables
+use strict;
+
+#turn warnings on during dev; generates a few spurious uninitialised var access warnings
+#use warnings;
+
+#and set $debug to 1 to turn on trace info (currently unused)
+my $debug=1;
+
+#######################################################################
+# change drive and directory to "%1"
+my $ANT_RUN_CMD = @ARGV[0];
+
+# assign current run command to "%2"
+chdir (@ARGV[0]) || die "Can't cd to $ARGV[0]: $!\n";
+if ($^O eq "NetWare") {
+ # There is a bug in Perl 5 on NetWare, where chdir does not
+ # do anything. On NetWare, the following path-prefixed form should
+ # always work. (afaict)
+ $ANT_RUN_CMD .= "/".@ARGV[1];
+}
+else {
+ $ANT_RUN_CMD = @ARGV[1];
+}
+
+# dispose of the first two arguments, leaving only the command's args.
+shift;
+shift;
+
+# run the command
+my $returnValue = system $ANT_RUN_CMD, @ARGV;
+if ($returnValue eq 0) {
+ exit 0;
+}
+else {
+ # only 0 and 1 are widely recognized as exit values
+ # so change the exit value to 1
+ exit 1;
+}
Propchange: geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/antRun.pl
------------------------------------------------------------------------------
svn:executable = *
Added: geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/complete-ant-cmd.pl
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/complete-ant-cmd.pl?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/complete-ant-cmd.pl (added)
+++ geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/complete-ant-cmd.pl Sat Jan 27 14:58:22 2007
@@ -0,0 +1,114 @@
+#!/usr/bin/perl
+#
+# 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.
+#
+# A script to allow Bash or Z-Shell to complete an Ant command-line.
+#
+# To install for Bash 2.0 or better, add the following to ~/.bashrc:
+#
+# $ complete -C complete-ant-cmd ant build.sh
+#
+# To install for Z-Shell 2.5 or better, add the following to ~/.zshrc:
+#
+# function ant_complete () {
+# local args_line args
+# read -l args_line
+# set -A args $args_line
+# set -A reply $(COMP_LINE=$args_line complete-ant-cmd ${args[1]} $1)
+# }
+# compctl -K ant_complete ant build.sh
+#
+# @author Mike Williams <mi...@cortexebusiness.com.au>
+
+my $cmdLine = $ENV{'COMP_LINE'};
+my $antCmd = $ARGV[0];
+my $word = $ARGV[1];
+
+my @completions;
+if ($word =~ /^-/) {
+ list( restrict( $word, getArguments() ));
+} elsif ($cmdLine =~ /-(f|buildfile)\s+\S*$/) {
+ list( getBuildFiles($word) );
+} else {
+ list( restrict( $word, getTargets() ));
+}
+
+exit(0);
+
+sub list {
+ for (@_) {
+ print "$_\n";
+ }
+}
+
+sub restrict {
+ my ($word, @completions) = @_;
+ grep( /^\Q$word\E/, @completions );
+}
+
+sub getArguments {
+ qw(-buildfile -debug -emacs -f -find -help -listener -logfile
+ -logger -projecthelp -quiet -verbose -version);
+}
+
+
+sub getBuildFiles {
+ my ($word) = @_;
+ grep( /\.xml$/, glob( "$word*" ));
+}
+
+sub getTargets {
+
+ # Look for build-file
+ my $buildFile = 'build.xml';
+ if ($cmdLine =~ /-(f|buildfile)\s+(\S+)/) {
+ $buildFile = $2;
+ }
+ return () unless (-f $buildFile);
+
+ # Run "ant -projecthelp" to list targets. Keep a cache of results in a
+ # cache-file.
+ my $cacheFile = $buildFile;
+ $cacheFile =~ s|(.*/)?(.*)|${1}.ant-targets-${2}|;
+ if ((!-e $cacheFile) || (-M $buildFile) < (-M $cacheFile)) {
+ open( CACHE, '>'.$cacheFile ) || die "can\'t write $cacheFile: $!\n";
+ open( HELP, "$antCmd -projecthelp -f '$buildFile'|" ) || return();
+ my %targets;
+ while( <HELP> ) {
+ if (/^\s+(\S+)/) {
+ $targets{$1}++;
+ }
+ }
+ my @targets = sort keys %targets;
+ for (@targets) { print CACHE "$_\n"; }
+ return @targets;
+ }
+
+ # Read the target-cache
+ open( CACHE, $cacheFile ) || die "can\'t read $cacheFile: $!\n";
+ my @targets;
+ while (<CACHE>) {
+ chop;
+ s/\r$//; # for Cygwin
+ push( @targets, $_ );
+ }
+ close( CACHE );
+ @targets;
+
+}
+
+
+
Propchange: geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/complete-ant-cmd.pl
------------------------------------------------------------------------------
svn:executable = *
Added: geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/runant.pl
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/runant.pl?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/runant.pl (added)
+++ geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/runant.pl Sat Jan 27 14:58:22 2007
@@ -0,0 +1,153 @@
+#!/usr/bin/perl
+#
+# 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.
+#
+#######################################################################
+#
+# runant.pl
+#
+# wrapper script for invoking ant in a platform with Perl installed
+# this may include cgi-bin invocation, which is considered somewhat daft.
+# (slo: that should be a separate file which can be derived from this
+# and returns the XML formatted output)
+#
+# the code is not totally portable due to classpath and directory splitting
+# issues. oops. (NB, use File::Spec::Functions will help and the code is
+# structured for the catfile() call, but because of perl version funnies
+# the code is not included.
+#
+# created: 2000-8-24
+# author: Steve Loughran steve_l@sourceforge.net
+#######################################################################
+#
+# Assumptions:
+#
+# - the "java" executable/script is on the command path
+# - ANT_HOME has been set
+# - target platform uses ":" as classpath separator or perl indicates it is dos/win32
+# - target platform uses "/" as directory separator.
+
+#be fussy about variables
+use strict;
+
+#platform specifics (disabled)
+#use File::Spec::Functions;
+
+#turn warnings on during dev; generates a few spurious uninitialised var access warnings
+#use warnings;
+
+#and set $debug to 1 to turn on trace info
+my $debug=1;
+
+#######################################################################
+#
+# check to make sure environment is setup
+#
+
+my $HOME = $ENV{ANT_HOME};
+if ($HOME eq "")
+ {
+ die "\n\nANT_HOME *MUST* be set!\n\n";
+ }
+
+my $JAVACMD = $ENV{JAVACMD};
+$JAVACMD = "java" if $JAVACMD eq "";
+
+my $onnetware = 0;
+if ($^O eq "NetWare")
+{
+ $onnetware = 1;
+}
+
+my $oncygwin = ($^O eq "cygwin");
+
+#ISSUE: what java wants to split up classpath varies from platform to platform
+#and perl is not too hot at hinting which box it is on.
+#here I assume ":" 'cept on win32, dos, and netware. Add extra tests here as needed.
+my $s=":";
+if(($^O eq "MSWin32") || ($^O eq "dos") || ($^O eq "cygwin") ||
+ ($onnetware == 1))
+ {
+ $s=";";
+ }
+
+#build up standard classpath
+my $localpath = "$HOME/lib/ant-launcher.jar";
+#set JVM options and Ant arguments, if any
+my @ANT_OPTS=split(" ", $ENV{ANT_OPTS});
+my @ANT_ARGS=split(" ", $ENV{ANT_ARGS});
+
+#jikes
+if($ENV{JIKESPATH} ne "")
+ {
+ push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}";
+ }
+
+#construct arguments to java
+my @ARGS;
+push @ARGS, @ANT_OPTS;
+
+my $CYGHOME = "";
+
+my $classpath=$ENV{CLASSPATH};
+if ($oncygwin == 1) {
+ $localpath = `cygpath --path --windows $localpath`;
+ chomp ($localpath);
+ if (! $classpath eq "")
+ {
+ $classpath = `cygpath --path --windows "$classpath"`;
+ chomp ($classpath);
+ }
+ $HOME = `cygpath --path --windows $HOME`;
+ chomp ($HOME);
+ $CYGHOME = `cygpath --path --windows $ENV{HOME}`;
+ chomp ($CYGHOME);
+}
+push @ARGS, "-classpath", "$localpath";
+push @ARGS, "-Dant.home=$HOME";
+if ( ! $CYGHOME eq "" )
+{
+ push @ARGS, "-Dcygwin.user.home=\"$CYGHOME\""
+}
+push @ARGS, "org.apache.tools.ant.launch.Launcher", @ANT_ARGS;
+push @ARGS, @ARGV;
+if (! $classpath eq "")
+{
+ if ($onnetware == 1)
+ {
+ # make classpath literally $CLASSPATH
+ # this is to avoid pushing us over the 512 character limit
+ # even skip the ; - that is already in $localpath
+ push @ARGS, "-lib", "\$CLASSPATH";
+ }
+ else
+ {
+ push @ARGS, "-lib", "$classpath";
+ }
+}
+print "\n $JAVACMD @ARGS\n\n" if ($debug);
+
+my $returnValue = system $JAVACMD, @ARGS;
+if ($returnValue eq 0)
+ {
+ exit 0;
+ }
+else
+ {
+ # only 0 and 1 are widely recognized as exit values
+ # so change the exit value to 1
+ exit 1;
+ }
Propchange: geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/runant.pl
------------------------------------------------------------------------------
svn:executable = *
Added: geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/runant.py
URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/runant.py?view=auto&rev=500661
==============================================================================
--- geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/runant.py (added)
+++ geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/runant.py Sat Jan 27 14:58:22 2007
@@ -0,0 +1,102 @@
+#!/usr/bin/python
+# 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.
+#
+
+"""
+
+ runant.py
+
+ This script is a translation of the runant.pl written by Steve Loughran.
+ It runs ant with/out arguments, it should be quite portable (thanks to
+ the python os library)
+ This script has been tested with Python2.0/Win2K
+
+ created: 2001-04-11
+ author: Pierre Dittgen pierre.dittgen@criltelecom.com
+
+ Assumptions:
+
+ - the "java" executable/script is on the command path
+"""
+import os, os.path, string, sys
+
+# Change it to 1 to get extra debug information
+debug = 0
+
+#######################################################################
+
+# If ANT_HOME is not set default to script's parent directory
+if os.environ.has_key('ANT_HOME'):
+ ANT_HOME = os.environ['ANT_HOME']
+else:
+ ANT_HOME = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
+
+# set ANT_LIB location
+ANT_LIB = os.path.join(ANT_HOME, 'lib')
+
+# set JAVACMD (check variables JAVACMD and JAVA_HOME)
+JAVACMD = None
+if not os.environ.has_key('JAVACMD'):
+ if os.environ.has_key('JAVA_HOME'):
+ if not os.path.exists(os.environ['JAVA_HOME']):
+ print "Warning: JAVA_HOME is not defined correctly."
+ else:
+ JAVACMD = os.path.join(os.environ['JAVA_HOME'], 'bin', 'java')
+ else:
+ print "Warning: JAVA_HOME not set."
+else:
+ JAVACMD = os.environ['JAVACMD']
+if not JAVACMD:
+ JAVACMD = 'java'
+
+launcher_jar = os.path.join(ANT_LIB, 'ant-launcher.jar')
+if not os.path.exists(launcher_jar):
+ print 'Unable to locate ant-launcher.jar. Expected to find it in %s' % \
+ ANT_LIB
+
+# Build up standard classpath (LOCALCLASSPATH)
+LOCALCLASSPATH = launcher_jar
+if os.environ.has_key('LOCALCLASSPATH'):
+ LOCALCLASSPATH += os.pathsep + os.environ['LOCALCLASSPATH']
+
+ANT_OPTS = ""
+if os.environ.has_key('ANT_OPTS'):
+ ANT_OPTS = os.environ['ANT_OPTS']
+
+OPTS = ""
+if os.environ.has_key('JIKESPATH'):
+ OPTS = '-Djikes.class.path=\"%s\"' % os.environ['JIKESPATH']
+
+ANT_ARGS = ""
+if os.environ.has_key('ANT_ARGS'):
+ ANT_ARGS = os.environ['ANT_ARGS']
+
+CLASSPATH = ""
+if os.environ.has_key('CLASSPATH'):
+ CLASSPATH = os.environ['CLASSPATH']
+
+# Builds the commandline
+cmdline = ('%s %s -classpath %s -Dant.home=%s %s ' + \
+ 'org.apache.tools.ant.launch.Launcher %s -lib %s %s') \
+ % (JAVACMD, ANT_OPTS, LOCALCLASSPATH, ANT_HOME, OPTS, ANT_ARGS, \
+ CLASSPATH, string.join(sys.argv[1:], ' '))
+
+if debug:
+ print '\n%s\n\n' % (cmdline)
+sys.stdout.flush()
+
+# Run the biniou!
+os.system(cmdline)
Propchange: geronimo/sandbox/build-support/harness/trunk/tools/ant/bin/runant.py
------------------------------------------------------------------------------
svn:executable = *