Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 31394 invoked from network); 8 Oct 2004 02:03:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Oct 2004 02:03:12 -0000 Received: (qmail 3155 invoked by uid 500); 8 Oct 2004 02:03:10 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 2994 invoked by uid 500); 8 Oct 2004 02:03:09 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 2972 invoked by uid 99); 8 Oct 2004 02:03:09 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO tsws1) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 07 Oct 2004 19:03:08 -0700 Message-ID: <014201c4acdb$0c03d6d0$6501a8c0@sybase.com> From: "Adam R. B. Jack" To: "Ant Developers List" References: <20041007225432.69637.qmail@minotaur.apache.org> Subject: Re: cvs commit: ant build.xml Date: Thu, 7 Oct 2004 20:03:45 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Seems this change made something not happy on the JDK1.4 that Gump runs (namely, that below). Does the bootstrap-ant script need to be aware of some conditional compilation? --------------------------------------------- ... Bootstrapping Ant Distribution ... Compiling Ant Classes src/main/org/apache/tools/ant/taskdefs/condition/IsPingable.java:81: cannot resolve symbol symbol : method isReachable (int) location: class java.net.InetAddress return address.isReachable(timeout*1000); ^ Note: Some input files use or override a deprecated API. Note: Recompile with -deprecation for details. 1 error ... Failed compiling Ant classes ! --------------------------------------------- regards Adam ----- Original Message ----- From: To: Sent: Thursday, October 07, 2004 4:54 PM Subject: cvs commit: ant build.xml > stevel 2004/10/07 15:54:32 > > Modified: . build.xml > Added: src/main/org/apache/tools/ant/taskdefs/condition > IsPingable.java > Log: > First of the Java1.5 extensions. Closest j2se has for detecting offline state, though I note J2ME and JavaWebStart have offline tests. > Needs tests. > > Revision Changes Path > 1.1 ant/src/main/org/apache/tools/ant/taskdefs/condition/IsPingable.java > > Index: IsPingable.java > =================================================================== > /* > * Copyright 2004 The Apache Software Foundation > * > * Licensed 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. > * > */ > > package org.apache.tools.ant.taskdefs.condition; > > import org.apache.tools.ant.ProjectComponent; > import org.apache.tools.ant.BuildException; > import org.apache.tools.ant.Project; > > import java.net.InetAddress; > import java.net.UnknownHostException; > import java.io.IOException; > > /** > * Test for a host being reachable using ICMP "ping" packets. > * Ping packets are very reliable for assessing reachability in a LAN or WAN, > * but they do not get through any well-configured firewall. > * > * This condition turns unknown host exceptions into false conditions. This is > * because on a laptop, DNS is one of the first services when the network goes; you > * are implicitly offline. > * Requires Java1.5+ to work > * @since Ant1.7 > */ > public class IsPingable extends ProjectComponent implements Condition { > > private String host; > public static final int DEFAULT_TIMEOUT = 30; > private int timeout=DEFAULT_TIMEOUT; > public static final String ERROR_NO_HOSTNAME = "No hostname defined"; > public static final String ERROR_BAD_TIMEOUT = "Invalid timeout value"; > public static final String ERROR_UNKNOWN_HOST = "Unknown host:"; > public static final String ERROR_ON_NETWORK = "network error to "; > > /** > * the host to ping > * @param host > */ > public void setHost(String host) { > this.host = host; > } > > /** > * timeout for the reachability test -in seconds > * @param timeout > */ > public void setTimeout(int timeout) { > this.timeout = timeout; > } > > /** > * Is this condition true? > * > * @return true if the condition is true > * @throws org.apache.tools.ant.BuildException > * if an error occurs > */ > public boolean eval() throws BuildException { > if(host==null && host.length()==0) { > throw new BuildException(ERROR_NO_HOSTNAME); > } > if(timeout<0) { > throw new BuildException(ERROR_BAD_TIMEOUT); > } > try { > InetAddress address=InetAddress.getByName(host); > return address.isReachable(timeout*1000); > } catch (UnknownHostException e) { > log(ERROR_UNKNOWN_HOST+host,Project.MSG_VERBOSE); > return false; > } catch (IOException e) { > log(ERROR_ON_NETWORK + host +": "+e.toString(), > Project.MSG_VERBOSE); > return false; > } > } > } > > > > 1.431 +7 -0 ant/build.xml > > Index: build.xml > =================================================================== > RCS file: /home/cvs/ant/build.xml,v > retrieving revision 1.430 > retrieving revision 1.431 > diff -u -r1.430 -r1.431 > --- build.xml 3 Oct 2004 14:06:52 -0000 1.430 > +++ build.xml 7 Oct 2004 22:54:32 -0000 1.431 > @@ -152,6 +152,12 @@ > > > > + > + > + > + > + > + > > > @@ -637,6 +643,7 @@ > > > > + > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org