Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 21639 invoked from network); 19 Nov 2007 01:46:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Nov 2007 01:46:48 -0000 Received: (qmail 36817 invoked by uid 500); 19 Nov 2007 01:46:32 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 36778 invoked by uid 500); 19 Nov 2007 01:46:32 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 36754 invoked by uid 99); 19 Nov 2007 01:46:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Nov 2007 17:46:32 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of majorshao@gmail.com designates 72.14.202.180 as permitted sender) Received: from [72.14.202.180] (HELO ro-out-1112.google.com) (72.14.202.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Nov 2007 01:46:20 +0000 Received: by ro-out-1112.google.com with SMTP id p4so1647970roc for ; Sun, 18 Nov 2007 17:46:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; bh=KU2qJ3gTowFsQW9UybpHfXuEBkmHHcC8X53LHJJ15io=; b=KcNq6IVzdeqJ9jl2Aza9jVQ0LhbvrsF4ApbX08bv5Djmf2Fi3iAXo+4SfHT1AYOeKhwUi9+kI6R+0O6bL1rB6eA00uxYQdh0DEPAv8xhUKSn24cddmUmYZABEaTusMndaDIdB+4R3tHhdf37EHBxPNO4cSzSzlmKucrTe+gBwNU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=mMR+xVXU915ypkR+qy/AHqH1YhPWDYGqV9qaqM/YFAw9PPbxuio+tlBRMjwL7m2h0npK49WHoXLBTpbj03+VYrjlZkQVwUSNf+xlUCqhQEv20vsU12D3hpt+1wSn1W2oIp0fWnC3Iot6lRC7/noFKhSQ1PxysHHj7sfiKQuZFzc= Received: by 10.140.199.19 with SMTP id w19mr1417809rvf.1195436772911; Sun, 18 Nov 2007 17:46:12 -0800 (PST) Received: by 10.140.194.18 with HTTP; Sun, 18 Nov 2007 17:46:12 -0800 (PST) Message-ID: Date: Sun, 18 Nov 2007 17:46:12 -0800 From: "Major shao" To: user@ant.apache.org Subject: Stefan Bodewig or Magesh Umasankar, please kindly help: Ant 1.5 to 1.7 problem. Cc: dev@ant.apache.org, stefan.bodewig@epost.de, umagesh@apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Hello, experts This came from ant user list. It will be good if i can have the confirmation for what's in the following. Hopefully Stefan Bodewig or Magesh Umasankar would have time to give expert advise. Really appreciate it. I am in the process to upgrade a project building using ant1.5.1 to ant1.7 directly. There is a ant151patch.jar file used in this project since a while back. I have to comment out this jar file otherwise i would get all sorts of error like java.lang.ExceptionInInitializerError; i am wondering whatever this jar took care of for ant151 is already included in ant1.7 (without the need of that kind of patch), is that accurate? Looks like it is used for some os system properties? Together with the "wondering" i mentioned on the above, i am confused by the " @since 1.7" comments in the Os.java and some explanation on that would be highly appreciated. I guess the key thing for me is to confirm it is totally safe to use ant1.7 and get rid of that 151patch.jar; the build is running on windows xp and most customers of the product are windows based. In this ant151patch.jar, there is only 1 class Os.class (and Os.java). (The first section is the MANIFEST.MF) Manifest-Version: 1.0 Created-By: Apache Ant 1.5.1 Name: org/apache/tools/ant/ Extension-name: Ant 1.5.1 patch Specification-Title: Apache Ant 1.5.1 patch Specification-Version: 1.5.1 Specification-Vendor: Apache Software Foundation Implementation-Title: Ant 1.5.1 patch Implementation-Version: 1.5.1 /* * The Apache Software License, Version 1.1 * * Copyright (c) 2001-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Ant", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ package org.apache.tools.ant.taskdefs.condition; import org.apache.tools.ant.BuildException; import java.util.Locale; /** * Condition that tests the OS type. * * @author Stefan Bodewig * @author Magesh Umasankar * @since Ant 1.4 * @version $Revision: 1.15.2.1 $ */ public class Os implements Condition { private static final String osName = System.getProperty("os.name").toLowerCase(Locale.US); private static final String osArch = System.getProperty("os.arch").toLowerCase(Locale.US); private static final String osVersion = System.getProperty("os.version").toLowerCase(Locale.US); private static final String pathSep = System.getProperty("path.separator"); private String family; private String name; private String version; private String arch; public Os() {} public Os(String family) { setFamily(family); } /** * Sets the desired OS family type * * @param f The OS family type desired
* Possible values:
*
    *
  • dos
  • *
  • mac
  • *
  • netware
  • *
  • os/2
  • *
  • unix
  • *
  • windows
  • *
  • win9x
  • *
  • z/os
  • *
*/ public void setFamily(String f) {family = f.toLowerCase(Locale.US);} /** * Sets the desired OS name * * @param name The OS name */ public void setName(String name) { this.name = name.toLowerCase(Locale.US); } /** * Sets the desired OS architecture * * @param arch The OS architecture */ public void setArch(String arch) { this.arch = arch.toLowerCase(Locale.US); } /** * Sets the desired OS version * * @param version The OS version */ public void setVersion(String version) { this.version = version.toLowerCase(Locale.US); } /** * Determines if the OS on which Ant is executing matches the type of * that set in setFamily. * @see Os#setFamily(String) */ public boolean eval() throws BuildException { return isOs(family, name, arch, version); } /** * Determines if the OS on which Ant is executing matches the * given OS family. * * @since 1.5 */ public static boolean isFamily(String family) { return isOs(family, null, null, null); } /** * Determines if the OS on which Ant is executing matches the * given OS name. * * @since 1.7 */ public static boolean isName(String name) { return isOs(null, name, null, null); } /** * Determines if the OS on which Ant is executing matches the * given OS architecture. * * @since 1.7 */ public static boolean isArch(String arch) { return isOs(null, null, arch, null); } /** * Determines if the OS on which Ant is executing matches the * given OS version. * * @since 1.7 */ public static boolean isVersion(String version) { return isOs(null, null, null, version); } /** * Determines if the OS on which Ant is executing matches the * given OS family, name, architecture and version * * @param family The OS family * @param name The OS name * @param arch The OS architecture * @param version The OS version * * @since 1.7 */ public static boolean isOs(String family, String name, String arch, String version) { boolean retValue = false; if (family != null || name != null || arch != null || version != null) { boolean isFamily = true; boolean isName = true; boolean isArch = true; boolean isVersion = true; if (family != null) { if (family.equals("windows")) { isFamily = osName.indexOf("windows") > -1; } else if (family.equals("os/2")) { isFamily = osName.indexOf("os/2") > -1; } else if (family.equals("netware")) { isFamily = osName.indexOf("netware") > -1; } else if (family.equals("dos")) { isFamily = pathSep.equals(";") && !isFamily("netware"); } else if (family.equals("mac")) { isFamily = osName.indexOf("mac") > -1; } else if (family.equals("unix")) { isFamily = pathSep.equals(":") && (!isFamily("mac") || osName.endsWith("x")); } else if (family.equals("win9x")) { isFamily = isFamily("windows") && !(osName.indexOf("nt") >= 0 || osName.indexOf("2000") >= 0 || osName.indexOf("2003") >= 0 || osName.indexOf("xp") >= 0); } else if (family.equals("z/os")) { isFamily = osName.indexOf("z/os") > -1 || osName.indexOf("os/390") > -1; } else { throw new BuildException( "Don\'t know how to detect os family \"" + family + "\""); } } if (name != null) { isName = name.equals(osName); } if (arch != null) { isArch = arch.equals(osArch); } if (version != null) { isVersion = version.equals(osVersion); } retValue = isFamily && isName && isArch && isVersion; } return retValue; } } On Nov 15, 2007 4:01 PM, richardmonk wrote: > > This patch jar has only 1 class inside. After i commented out this jar, the > compile went well so far so good. > I am going to exclude this jar. Before that, just paste the only class/java > here. If you have any infor on this (and/or related to ant 1.7), please let > me know. Thanks. I guess this is a patch needed for ant 1.5.1, but ant1.7 > already takes care of it on its own? > > /* > * The Apache Software License, Version 1.1 > * > * Copyright (c) 2001-2002 The Apache Software Foundation. All rights > * reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * > * 1. Redistributions of source code must retain the above copyright > * notice, this list of conditions and the following disclaimer. > * > * 2. Redistributions in binary form must reproduce the above copyright > * notice, this list of conditions and the following disclaimer in > * the documentation and/or other materials provided with the > * distribution. > * > * 3. The end-user documentation included with the redistribution, if > * any, must include the following acknowlegement: > * "This product includes software developed by the > * Apache Software Foundation (http://www.apache.org/)." > * Alternately, this acknowlegement may appear in the software itself, > * if and wherever such third-party acknowlegements normally appear. > * > * 4. The names "The Jakarta Project", "Ant", and "Apache Software > * Foundation" must not be used to endorse or promote products derived > * from this software without prior written permission. For written > * permission, please contact apache@apache.org. > * > * 5. Products derived from this software may not be called "Apache" > * nor may "Apache" appear in their names without prior written > * permission of the Apache Group. > * > * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED > * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR > * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, > * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF > * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND > * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, > * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT > * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > * SUCH DAMAGE. > * ==================================================================== > * > * This software consists of voluntary contributions made by many > * individuals on behalf of the Apache Software Foundation. For more > * information on the Apache Software Foundation, please see > * . > */ > > package org.apache.tools.ant.taskdefs.condition; > > import org.apache.tools.ant.BuildException; > > import java.util.Locale; > > /** > * Condition that tests the OS type. > * > * @author mailto:stefan.bodewig@epost.de Stefan Bodewig > * @author mailto:umagesh@apache.org Magesh Umasankar > * @since Ant 1.4 > * @version $Revision: 1.15.2.1 $ > */ > public class Os implements Condition { > private static final String osName = > System.getProperty("os.name").toLowerCase(Locale.US); > private static final String osArch = > System.getProperty("os.arch").toLowerCase(Locale.US); > private static final String osVersion = > System.getProperty("os.version").toLowerCase(Locale.US); > private static final String pathSep = > System.getProperty("path.separator"); > > private String family; > private String name; > private String version; > private String arch; > > public Os() {} > > public Os(String family) { > setFamily(family); > } > > /** > * Sets the desired OS family type > * > * @param f The OS family type desired
> * Possible values:
> *
    > *
  • dos
  • > *
  • mac
  • > *
  • netware
  • > *
  • os/2
  • > *
  • unix
  • > *
  • windows
  • > *
  • win9x
  • > *
  • z/os
  • > *
> */ > public void setFamily(String f) {family = f.toLowerCase(Locale.US);} > > /** > * Sets the desired OS name > * > * @param name The OS name > */ > public void setName(String name) { > this.name = name.toLowerCase(Locale.US); > } > > /** > * Sets the desired OS architecture > * > * @param arch The OS architecture > */ > public void setArch(String arch) { > this.arch = arch.toLowerCase(Locale.US); > } > > /** > * Sets the desired OS version > * > * @param version The OS version > */ > public void setVersion(String version) { > this.version = version.toLowerCase(Locale.US); > } > > /** > * Determines if the OS on which Ant is executing matches the type of > * that set in setFamily. > * @see Os#setFamily(String) > */ > public boolean eval() throws BuildException { > return isOs(family, name, arch, version); > } > > /** > * Determines if the OS on which Ant is executing matches the > * given OS family. > * > * @since 1.5 > */ > public static boolean isFamily(String family) { > return isOs(family, null, null, null); > } > > /** > * Determines if the OS on which Ant is executing matches the > * given OS name. > * > * @since 1.7 > */ > public static boolean isName(String name) { > return isOs(null, name, null, null); > } > > /** > * Determines if the OS on which Ant is executing matches the > * given OS architecture. > * > * @since 1.7 > */ > public static boolean isArch(String arch) { > return isOs(null, null, arch, null); > } > > /** > * Determines if the OS on which Ant is executing matches the > * given OS version. > * > * @since 1.7 > */ > public static boolean isVersion(String version) { > return isOs(null, null, null, version); > } > > /** > * Determines if the OS on which Ant is executing matches the > * given OS family, name, architecture and version > * > * @param family The OS family > * @param name The OS name > * @param arch The OS architecture > * @param version The OS version > * > * @since 1.7 > */ > public static boolean isOs(String family, String name, String arch, > String version) { > boolean retValue = false; > > if (family != null || name != null || arch != null > || version != null) { > > boolean isFamily = true; > boolean isName = true; > boolean isArch = true; > boolean isVersion = true; > > if (family != null) { > if (family.equals("windows")) { > isFamily = osName.indexOf("windows") > -1; > } else if (family.equals("os/2")) { > isFamily = osName.indexOf("os/2") > -1; > } else if (family.equals("netware")) { > isFamily = osName.indexOf("netware") > -1; > } else if (family.equals("dos")) { > isFamily = pathSep.equals(";") && !isFamily("netware"); > } else if (family.equals("mac")) { > isFamily = osName.indexOf("mac") > -1; > } else if (family.equals("unix")) { > isFamily = pathSep.equals(":") > && (!isFamily("mac") || osName.endsWith("x")); > } else if (family.equals("win9x")) { > isFamily = isFamily("windows") && > !(osName.indexOf("nt") >= 0 || > osName.indexOf("2000") >= 0 || > osName.indexOf("2003") >= 0 || > osName.indexOf("xp") >= 0); > } else if (family.equals("z/os")) { > isFamily = osName.indexOf("z/os") > -1 > || osName.indexOf("os/390") > -1; > } else { > throw new BuildException( > "Don\'t know how to detect os family \"" > + family + "\""); > } > } > if (name != null) { > isName = name.equals(osName); > } > if (arch != null) { > isArch = arch.equals(osArch); > } > if (version != null) { > isVersion = version.equals(osVersion); > } > retValue = isFamily && isName && isArch && isVersion; > } > return retValue; > > } > } > > > richardmonk wrote: > > > > looks like it is caused by this ant151patch.jar; i am looking into it. > > Thanks > > > > > > > > David Weintraub wrote: > >> > >> What's this line?: > >> > >>> Using Ant151patch.jar > >> > >> That looks like the wrong jar file. That's probably for Ant 1.51. What > >> is this jarfile anyway? I can't find it on Google. > >> > >> It is interesting that the build failed on the second run. In the > >> first run, the property isn't set (because everything isn't > >> up to date). However, I touch the target file making it more recent > >> than the two source files. > >> > >> That means in the second run, the target is up to date, and the > >> property has to be set. What happens if you touch the > >> source files, so that the target is out of date, and the > >> property isn't set? > >> > >> I bet your Python script is causing the problems. What if you used the > >> standard "ant" shell script without the Python front end? > >> > >> On Nov 12, 2007 3:01 PM, richardmonk wrote: > >>> > >>> David > >>> > >>> Thanks a lot for this. > >>> I tried it. It was good first time. When i ran it again, it gave the > >>> same > >>> error. > >>> (i changed a little on the echo msg) > >>> > >>> Sorry if it is late to mention here, we use a customized runant.py to > >>> run > >>> the build.xml; it does have some cutomized things inside to load > >>> different > >>> properties we need for different modules in the whole build. > >>> > >>> Here is the output of the 1st run (added the -debug option) > >>> Using Ant patch ant151patch.jar > >>> -Djvm=jrockit1.4.2_05 > >>> -Dant.home.dir=T:/Eng/win32bin/apache-ant-1.7.0 > >>> java version "1.4.2_05" > >>> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04) > >>> BEA WebLogic JRockit(TM) 1.4.2_05 JVM R24.4.0-1 (build > >>> ari-38120-20041118-1131-win-ia32, Native Threads, GC strategy: pa > >>> rallel) > >>> > >>> Apache Ant version 1.7.0 compiled on December 13 2006 > >>> Buildfile: build.xml > >>> Adding reference: ant.PropertyHelper > >>> Detected Java version: 1.4 in: > >>> T:\eng\win32bin\weblogic8.1.4\jrockit81sp4_142_05\jre > >>> Detected OS: Windows XP > >>> Adding reference: ant.ComponentHelper > >>> Setting ro project property: ant.file -> T:\eng\ccroot\build.xml > >>> Adding reference: ant.projectHelper > >>> Adding reference: ant.parsing.context > >>> Adding reference: ant.targets > >>> parsing buildfile T:\eng\ccroot\build.xml with URI = > >>> file:/T:/eng/ccroot/build.xml > >>> Setting ro project property: ant.project.name -> test > >>> Adding reference: test > >>> Setting ro project property: ant.file.test -> T:\eng\ccroot\build.xml > >>> Project base dir set to: T:\eng\ccroot > >>> +Target: > >>> +Target: check.db.schema.up.to.date > >>> +Target: test1 > >>> +Target: test2 > >>> +Target: test > >>> [antlib:org.apache.tools.ant] Could not load definitions from resource > >>> org/apache/tools/ant/antlib.xml. It could not be > >>> found. > >>> Setting project property: get.dbversion.build.dir -> build > >>> Setting project property: db.root.dir -> src > >>> [mkdir] Created dir: T:\eng\ccroot\build\src > >>> [mkdir] Created dir: T:\eng\ccroot\src > >>> Attempting to create object of type > >>> org.apache.tools.ant.helper.DefaultExecutor > >>> Adding reference: ant.executor > >>> Build sequence for target(s) `test' is [check.db.schema.up.to.date, > >>> test1, > >>> test2, test] > >>> Complete build sequence is [check.db.schema.up.to.date, test1, test2, > >>> test, > >>> ] > >>> > >>> check.db.schema.up.to.date: > >>> [uptodate] The targetfile "T:\eng\ccroot\build\src\dbinfo.properties" > >>> does > >>> not exist. > >>> > >>> test1: > >>> Skipped because property 'db.schema.up.to.date' not set. > >>> > >>> test2: > >>> Property "db.schema.up.to.date" has not been set > >>> [echo] check this out::${db.schema.up.to.date} > >>> [echo] Need to rebuild > >>> [touch] Creating T:\eng\ccroot\build\src\dbinfo.properties > >>> > >>> test: > >>> > >>> BUILD SUCCESSFUL > >>> Total time: 0 seconds > >>> > >>> [wfm]T:\eng\ccroot> > >>> > >>> > >>> Here is the output of 2nd run (i added the -debug option) > >>> Using Ant patch ant151patch.jar > >>> -Djvm=jrockit1.4.2_05 > >>> -Dant.home.dir=T:/Eng/win32bin/apache-ant-1.7.0 > >>> java version "1.4.2_05" > >>> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04) > >>> BEA WebLogic JRockit(TM) 1.4.2_05 JVM R24.4.0-1 (build > >>> ari-38120-20041118-1131-win-ia32, Native Threads, GC strategy: pa > >>> rallel) > >>> > >>> Apache Ant version 1.7.0 compiled on December 13 2006 > >>> Buildfile: build.xml > >>> Adding reference: ant.PropertyHelper > >>> Detected Java version: 1.4 in: > >>> T:\eng\win32bin\weblogic8.1.4\jrockit81sp4_142_05\jre > >>> Detected OS: Windows XP > >>> Adding reference: ant.ComponentHelper > >>> Setting ro project property: ant.file -> T:\eng\ccroot\build.xml > >>> Adding reference: ant.projectHelper > >>> Adding reference: ant.parsing.context > >>> Adding reference: ant.targets > >>> parsing buildfile T:\eng\ccroot\build.xml with URI = > >>> file:/T:/eng/ccroot/build.xml > >>> Setting ro project property: ant.project.name -> test > >>> Adding reference: test > >>> Setting ro project property: ant.file.test -> T:\eng\ccroot\build.xml > >>> Project base dir set to: T:\eng\ccroot > >>> +Target: > >>> +Target: check.db.schema.up.to.date > >>> +Target: test1 > >>> +Target: test2 > >>> +Target: test > >>> [antlib:org.apache.tools.ant] Could not load definitions from resource > >>> org/apache/tools/ant/antlib.xml. It could not be > >>> found. > >>> Setting project property: get.dbversion.build.dir -> build > >>> Setting project property: db.root.dir -> src > >>> [mkdir] Skipping T:\eng\ccroot\build\src because it already exists. > >>> [mkdir] Skipping T:\eng\ccroot\src because it already exists. > >>> Attempting to create object of type > >>> org.apache.tools.ant.helper.DefaultExecutor > >>> Adding reference: ant.executor > >>> Build sequence for target(s) `test' is [check.db.schema.up.to.date, > >>> test1, > >>> test2, test] > >>> Complete build sequence is [check.db.schema.up.to.date, test1, test2, > >>> test, > >>> ] > >>> > >>> check.db.schema.up.to.date: > >>> > >>> BUILD FAILED > >>> T:\eng\ccroot\build.xml:11: java.lang.ExceptionInInitializerError > >>> at > >>> org.apache.tools.ant.dispatch.DispatchUtils.execute(Ljava.lang.Object;)V(DispatchUtils.java:115) > >>> at org.apache.tools.ant.Task.perform()V(Task.java:348) > >>> at org.apache.tools.ant.Target.execute()V(Target.java:357) > >>> at org.apache.tools.ant.Target.performTasks()V(Target.java:385) > >>> at > >>> org.apache.tools.ant.Project.executeSortedTargets(Ljava.util.Vector;)V(Project.java:1329) > >>> at > >>> org.apache.tools.ant.Project.executeTarget(Ljava.lang.String;)V(Project.java:1298) > >>> at > >>> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(Lorg.apache.tools.ant.Project;[Ljava.lang.String;) > >>> V(DefaultExecutor.java:41) > >>> at > >>> org.apache.tools.ant.Project.executeTargets(Ljava.util.Vector;)V(Project.java:1181) > >>> at > >>> org.apache.tools.ant.Main.runBuild(Ljava.lang.ClassLoader;)V(Main.java:698) > >>> at > >>> org.apache.tools.ant.Main.startAnt([Ljava.lang.String;Ljava.util.Properties;Ljava.lang.ClassLoader;)V(Main.ja > >>> va:199) > >>> at > >>> org.apache.tools.ant.Main.start([Ljava.lang.String;Ljava.util.Properties;Ljava.lang.ClassLoader;)V(Main.java: > >>> 161) > >>> at > >>> org.apache.tools.ant.Main.main([Ljava.lang.String;)V(Main.java:250) > >>> Caused by: java.lang.ExceptionInInitializerError > >>> at > >>> org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(Lorg.apache.tools.ant.Project;)Lorg.apache.too > >>> ls.ant.DirectoryScanner;(AbstractFileSet.java:429) > >>> at > >>> org.apache.tools.ant.taskdefs.UpToDate.eval()Z(UpToDate.java:206) > >>> at > >>> org.apache.tools.ant.taskdefs.UpToDate.execute()V(UpToDate.java:232) > >>> at > >>> org.apache.tools.ant.UnknownElement.execute()V(UnknownElement.java:288) > >>> at > >>> jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.lang.Object;[Ljava.lang.Object;)Ljava.la > >>> ng.Object;(Unknown Source) > >>> at > >>> jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown > >>> S > >>> ource) > >>> at > >>> jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Un > >>> known Source) > >>> at > >>> java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown > >>> Source) > >>> at > >>> org.apache.tools.ant.dispatch.DispatchUtils.execute(Ljava.lang.Object;)V(DispatchUtils.java:105) > >>> ... 11 more > >>> Caused by: Don't know how to detect os family "openvms" > >>> at > >>> org.apache.tools.ant.taskdefs.condition.Os.isOs(Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;Ljava.l > >>> ang.String;)Z(Os.java:230) > >>> at > >>> org.apache.tools.ant.taskdefs.condition.Os.isFamily(Ljava.lang.String;)Z(Os.java:150) > >>> at > >>> org.apache.tools.ant.DirectoryScanner.()V(DirectoryScanner.java:128) > >>> at jrockit.vm.RNI.initializeClassFromJava(II)V(Unknown Source) > >>> at jrockit.vm.RNI.clinitTrampoline()V(Unknown Source) > >>> ... 20 more > >>> --- Nested Exception --- > >>> java.lang.ExceptionInInitializerError > >>> at > >>> org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(Lorg.apache.tools.ant.Project;)Lorg.apache.too > >>> ls.ant.DirectoryScanner;(AbstractFileSet.java:429) > >>> at > >>> org.apache.tools.ant.taskdefs.UpToDate.eval()Z(UpToDate.java:206) > >>> at > >>> org.apache.tools.ant.taskdefs.UpToDate.execute()V(UpToDate.java:232) > >>> at > >>> org.apache.tools.ant.UnknownElement.execute()V(UnknownElement.java:288) > >>> at > >>> jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.lang.Object;[Ljava.lang.Object;)Ljava.la > >>> ng.Object;(Unknown Source) > >>> at > >>> jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown > >>> S > >>> ource) > >>> at > >>> jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Un > >>> known Source) > >>> at > >>> java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown > >>> Source) > >>> at > >>> org.apache.tools.ant.dispatch.DispatchUtils.execute(Ljava.lang.Object;)V(DispatchUtils.java:105) > >>> at org.apache.tools.ant.Task.perform()V(Task.java:348) > >>> at org.apache.tools.ant.Target.execute()V(Target.java:357) > >>> at org.apache.tools.ant.Target.performTasks()V(Target.java:385) > >>> at > >>> org.apache.tools.ant.Project.executeSortedTargets(Ljava.util.Vector;)V(Project.java:1329) > >>> at > >>> org.apache.tools.ant.Project.executeTarget(Ljava.lang.String;)V(Project.java:1298) > >>> at > >>> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(Lorg.apache.tools.ant.Project;[Ljava.lang.String;) > >>> V(DefaultExecutor.java:41) > >>> at > >>> org.apache.tools.ant.Project.executeTargets(Ljava.util.Vector;)V(Project.java:1181) > >>> at > >>> org.apache.tools.ant.Main.runBuild(Ljava.lang.ClassLoader;)V(Main.java:698) > >>> at > >>> org.apache.tools.ant.Main.startAnt([Ljava.lang.String;Ljava.util.Properties;Ljava.lang.ClassLoader;)V(Main.ja > >>> va:199) > >>> at > >>> org.apache.tools.ant.Main.start([Ljava.lang.String;Ljava.util.Properties;Ljava.lang.ClassLoader;)V(Main.java: > >>> 161) > >>> at > >>> org.apache.tools.ant.Main.main([Ljava.lang.String;)V(Main.java:250) > >>> Caused by: Don't know how to detect os family "openvms" > >>> at > >>> org.apache.tools.ant.taskdefs.condition.Os.isOs(Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;Ljava.l > >>> ang.String;)Z(Os.java:230) > >>> at > >>> org.apache.tools.ant.taskdefs.condition.Os.isFamily(Ljava.lang.String;)Z(Os.java:150) > >>> at > >>> org.apache.tools.ant.DirectoryScanner.()V(DirectoryScanner.java:128) > >>> at jrockit.vm.RNI.initializeClassFromJava(II)V(Unknown Source) > >>> at jrockit.vm.RNI.clinitTrampoline()V(Unknown Source) > >>> ... 20 more > >>> > >>> Total time: 0 seconds > >>> > >>> > >>> > >>> > >>> > >>> David Weintraub wrote: > >>> > > >>> > I just wrote the following test build.xml: > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > >>> > > >>> targetfile="${get.dbversion.build.dir}/src/dbinfo.properties" > >>> > > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > >>> > depends="check.db.schema.up.to.date" > >>> > if="db.schema.up.to.date"> > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > >>> > depends="check.db.schema.up.to.date" > >>> > unless="db.schema.up.to.date"> > >>> > > >>> > > >>> > > >>> > >>> file="${get.dbversion.build.dir}/src/dbinfo.properties"/> > >>> > > >>> > > >>> > >>> > depends="test1,test2"/> > >>> > > >>> > > >>> > As you can see, my "check.db.schema.up.to.date" target is the same > >>> > code that you gave in your example, and I had no problems with this > >>> > particular build file with the outofdate task. > >>> > > >>> > Why not test this build.xml file and see if it works for you? All you > >>> > have to do is put it into a test directory, and run "ant" on it. It > >>> > will automatically create the needed files and directories. Each time > >>> > you run this build.xml, it will alternate between saying that the > >>> > project is out of date and isn't out of date. > >>> > > >>> > If this build.xml file doesn't work for you, then is probably an issue > >>> > with your installation of either Java or Ant. > >>> > > >>> > On Nov 9, 2007 4:12 PM, Major shao wrote: > >>> >> java version "1.4.2_05" > >>> >> > >>> >> Thanks for reply, I really need help on this! > >>> >> > >>> >> I suspect it's caused by the ant 1.7 does not take the dir path > >>> property > >>> >> ${ > >>> >> get.dbversion.build.dir} in the uptodate task. But it still failed if > >>> i > >>> >> replace it with absolute path. > >>> >> I do not understand. The forward slash or backward slash should not > >>> >> matter, > >>> >> right? > >>> >> > >>> >> And, this target is in an embedded xml. That means, the target is > >>> called > >>> >> from the build.xml (using &build_config;) which has the > >>> >> build_config.xml > >>> >> (which has this uptodate target). > >>> >> > >>> >> When I echo the property inside this target right before the task > >>> >> uptodate, > >>> >> it shows correct path. But it still fails and complains the uptodate > >>> >> task. > >>> >> > >>> >> > >>> >> > >>> >> On 11/9/07, David Weintraub wrote: > >>> >> > > >>> >> > What version of Java are you using? With Ant1.7.0, I think you need > >>> >> > Java 1.4 or later. > >>> >> > > >>> >> > On 11/9/07, Major shao wrote: > >>> >> > > Hi, everyone > >>> >> > > > >>> >> > > i am trying to upgrade the project from ant1.5.1 to ant1.7.0 > >>> >> > > > >>> >> > > it gave error build_config.xml:151: > >>> >> > java.lang.ExceptionInInitializerError > >>> >> > > > >>> >> > > the line 151 of that xml is a uptodate task. Any idea why i got > >>> the > >>> >> > > error? Please kindly help. > >>> >> > > Your reply is highly appreciated. > >>> >> > > > >>> >> > > > >>> >> > > >>> >> > > targetfile="${get.dbversion.build.dir}/src/dbinfo.properties" > > >>> >> > > > >>> >> > > > >>> >> > > > >>> >> > > > >>> >> > > > >>> >> > > > >>> >> > > > >>> >> > > > >>> >> > > I tried to not to use the ${get.dbversion.build.dir}, it still > >>> does > >>> >> not > >>> >> > > work. Though it works if i use > >>> >> > > >>> >> > > targetfile="dbinfo.properties" > > >>> >> > > i cannot find out why. > >>> >> > > And, it looks like i have more similar issues in the other > >>> following > >>> >> > > lines in the xml. I cannot just change everything to not having > >>> the > >>> >> > > path variable. Please help! > >>> >> > > > >>> >> > > Thanks > >>> >> > > > >>> >> > > Richard > >>> >> > > > >>> >> > > > >>> --------------------------------------------------------------------- > >>> >> > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > >>> >> > > For additional commands, e-mail: user-help@ant.apache.org > >>> >> > > > >>> >> > > > >>> >> > > >>> >> > > >>> >> > -- > >>> >> > -- > >>> >> > David Weintraub > >>> >> > qazwart@gmail.com > >>> >> > > >>> >> > > >>> --------------------------------------------------------------------- > >>> >> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > >>> >> > For additional commands, e-mail: user-help@ant.apache.org > >>> >> > > >>> >> > > >>> >> > >>> > > >>> > > >>> > > >>> > -- > >>> > -- > >>> > David Weintraub > >>> > qazwart@gmail.com > >>> > > >>> > --------------------------------------------------------------------- > >>> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > >>> > For additional commands, e-mail: user-help@ant.apache.org > >>> > > >>> > > >>> > > >>> > >>> -- > >>> View this message in context: > >>> http://www.nabble.com/Ant-1.5-to-1.7-problem.-tf4776225.html#a13713015 > >>> Sent from the Ant - Users mailing list archive at Nabble.com. > >>> > >>> > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > >>> For additional commands, e-mail: user-help@ant.apache.org > >>> > >>> > >> > >> > >> > >> -- > >> -- > >> David Weintraub > >> qazwart@gmail.com > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > >> For additional commands, e-mail: user-help@ant.apache.org > >> > >> > >> > > > > > > -- > View this message in context: http://www.nabble.com/Ant-1.5-to-1.7-problem.-tf4776225.html#a13784648 > > Sent from the Ant - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org