Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 73192 invoked from network); 22 Oct 2004 06:05:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 22 Oct 2004 06:05:20 -0000 Received: (qmail 16897 invoked by uid 500); 22 Oct 2004 06:05:09 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 16799 invoked by uid 500); 22 Oct 2004 06:05:07 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 16783 invoked by uid 99); 22 Oct 2004 06:05:07 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=HTML_60_70,HTML_MESSAGE,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [193.109.238.66] (HELO dnsinet.rzf-nrw.de) (193.109.238.66) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 21 Oct 2004 23:05:06 -0700 Received: from z011104.bk.fin.local (z011104.bk.fin.local [193.109.238.140]) by dnsinet.rzf-nrw.de (8.12.10/8.12.10) with ESMTP id i9M64xvR002212 for ; Fri, 22 Oct 2004 08:05:00 +0200 Received: by z011104.bk.fin.local with Internet Mail Service (5.5.2657.72) id ; Fri, 22 Oct 2004 08:05:00 +0200 Message-ID: <879A5AD5DD0ED511891F0003473A9B560E23F74A@Z011004> From: Jan.Materne@rzf.fin-nrw.de To: user@ant.apache.org Subject: AW: Way for buildfile to verify that Ant version is 1.5.2 or grea ter ? Date: Fri, 22 Oct 2004 08:05:00 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C4B7FD.106219D0" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C4B7FD.106219D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable A non usual way is checking for the existing of special classes. So you 'only' have to check which classes were added in a release and you could check for them. Alternativly I can send two scriptdef=B4s I wrote in that area. "checkAnt" parses the ${ant.version} string and stores additional information (compile date - useful if you work with cvs-versions). "needAnt" executes a if the actual version is lower than a = required one. Jan " + neededInt); verbose("Actual: " + actual + " --> " + actualInt); check =3D false; if (actualInt >=3D neededInt) check =3D true; if (!check) { java.lang.System.out.println(" -- abbruch --"); fail =3D project.createTask("fail"); fail.setMessage("Needed Ant-Version (" + needed + ") = not available. Was: " + actual); fail.perform(); } // convert the version string to int value for easier = comparison function getInt(string) { if (string.equals("1.1")) return 11; if (string.equals("1.2")) return 12; if (string.equals("1.3")) return 13; if (string.equals("1.4")) return 14; if (string.equals("1.4.1")) return 14.1; if (string.equals("1.5")) return 15; if (string.equals("1.5.1")) return 15.1; if (string.equals("1.5.2")) return 15.2; if (string.equals("1.5.3")) return 15.3; if (string.equals("1.5.4")) return 15.4; if (string.equals("1.5alpha")) return 15.880; if (string.equals("1.6beta1")) return 15.991; if (string.equals("1.6beta2")) return 15.992; if (string.equals("1.6beta3")) return 15.993; if (string.equals("1.6")) return 16; if (string.equals("1.6.0") ) return 16; if (string.equals("1.6.1") ) return 16.1; if (string.equals("1.6.2") ) return 16.2; if (string.equals("1.6.3") ) return 16.3; if (string.equals("1.7alpha")) return 16.880; if (string.equals("1.7beta")) return 16.990; if (string.equals("1.7")) return 17; if (string.equals("1.7.0")) return 17; if (string.equals("1.7.1")) return 17.1; if (string.equals("1.7.2")) return 17.2; return 0; } // log-message function verbose(msg) { project.log("[needAnt] " + msg, project.MSG_VERBOSE); } ]]> > -----Urspr=FCngliche Nachricht----- > Von: Rich Wagner [mailto:rich.wagner@savaJe.com] > Gesendet am: Donnerstag, 21. Oktober 2004 21:08 > An: user@ant.apache.org > Cc: rich.wagner@savaJe.com > Betreff: Way for buildfile to verify that Ant version is 1.5.2 or > greater ? > Note that comparing "ant.version" to "1.5.2" for equality is NOT=20 > sufficient, since - for instance - a build should NOT fail if the ant = > version is 1.6.1. >=20 > Is there an easier way to get what I want than (say) writing my own=20 > custom task to parse "ant.version" and compare the major, minor, etc. = > version numbers ? ------_=_NextPart_001_01C4B7FD.106219D0--