Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 53459 invoked from network); 29 May 2008 07:35:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 May 2008 07:35:55 -0000 Received: (qmail 40915 invoked by uid 500); 29 May 2008 07:35:57 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 40855 invoked by uid 500); 29 May 2008 07:35:56 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 40844 invoked by uid 99); 29 May 2008 07:35:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 May 2008 00:35:56 -0700 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 (nike.apache.org: local policy) Received: from [68.142.200.151] (HELO web30808.mail.mud.yahoo.com) (68.142.200.151) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 29 May 2008 07:34:58 +0000 Received: (qmail 38763 invoked by uid 60001); 29 May 2008 07:35:19 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=xh/6zTqzDF3qT8Wwh2sJNQXuI7AcPO4jBbMQ5KKgsJ2SJjh8qiEZetrHCAFREqV5Wzob8C3MhAazfUqsiZnHMVFbNmfYSV2orRDXKqzkgo9hnEs+7am3q9wkk6NWYNGLGf0VIoNLu5W0z9Rzx1sBGbv3zJggX7oEBuJBuMYK+DY=; X-YMail-OSG: 5QfCZpEVM1n6kLzSrhSo7MK2i98Pu.kHi7zA3XJo.lDQ_0W2cuvjw0hBNdtL1t_K0tqhJn2733lUutMtzXVrguN6rV8dwPrFSaHG4BS7HTPIAy.992S0E5LbbXQ- Received: from [134.58.179.36] by web30808.mail.mud.yahoo.com via HTTP; Thu, 29 May 2008 00:35:19 PDT X-Mailer: YahooMailRC/975.42 YahooMailWebService/0.7.185 Date: Thu, 29 May 2008 00:35:19 -0700 (PDT) From: Maarten Coene Subject: Re: [Ivy] How to add a new option to ivy settings To: Ant Developers List MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <264871.37815.qm@web30808.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Why not always use the server timestamp for the artifacts as we already do for the Ivy files? Maarten ----- Original Message ---- From: Xavier Hanin To: Ant Developers List Sent: Thursday, May 29, 2008 8:51:36 AM Subject: Re: [Ivy] How to add a new option to ivy settings As Gilles suggested, I'd better put that in settings, which is also much easier to add (you only need a setter on the resolver to recognize an attribute for the resolver in the settings file, pretty much like how Ant tasks work). Still to do what you want in the ivy file you have to modify XmlModuleDescriptorParser, the ModuleDescriptor interface and its default implementation. HTH, Xavier On Thu, May 29, 2008 at 6:13 AM, Claudio Miranda wrote: > > > I modified the code displayed below. > At BasicURLHandler, how is it possible to retrieve de value of > "timestamp" attribute (from ivy.xml) > > Index: src/java/org/apache/ivy/util/url/BasicURLHandler.java > =================================================================== > --- src/java/org/apache/ivy/util/url/BasicURLHandler.java (revision > 661197) > +++ src/java/org/apache/ivy/util/url/BasicURLHandler.java (working > copy) > @@ -131,6 +131,10 @@ > "Downloaded file size doesn't match expected > Content Length for " + src > + ". Please retry."); > } > + boolean remoteTimestamp = false; > + if (remoteTimestamp) { > + dest.setLastModified(srcConn.getLastModified()); > + } > } finally { > disconnect(srcConn); > > > Index: src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd > =================================================================== > --- src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd (revision 661197) > +++ src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd (working copy) > @@ -229,10 +229,19 @@ > > > > - name="defaultconf" type="xs:string"/> > - name="defaultconfmapping" type="xs:string"/> > + type="xs:string"/> > + type="xs:string"/> > type="xs:boolean" /> > - > + use="optional"> > + > + > + > + > + > + > + > + > > > > Index: > src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java > =================================================================== > --- > src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java > (revision 661197) > +++ > src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java > (working copy) > @@ -520,6 +520,10 @@ > if (confMappingOverride != null) { > > md.setMappingOverride(Boolean.valueOf(confMappingOverride).booleanValue()); > } > + String timestamp = > ivy.substitute(attributes.getValue("timestamp")); > + if (timestamp != null) { > + md.setTimestamp(timestamp); > + } > checkConfigurations(); > > > Claudio Miranda wrote: > > > > > > I am doing some testing with Ivy and have implemented a small > > modification, to allow the downloaded resource to have the same date > > timestamp as the file in remote repo. It is a requirement from the > > customer. > > > > At org.apache.ivy.util.url.BasicURLHandler.download(URL src, File > > dest, CopyProgressListener l) > > I added > > > > dest.setLastModified(srcConn.getLastModified()); > > > > How is it possible to add an attribute "timestamp" to the > > "dependencies" xml tag ? See below, a sample: > > > > > > > > > > > > > > > > > > > > > > It can have 2 values "remote" or "current", whereas "remote" set the > > last modified attribute, as the remote file is. The "current" means the > > current Ivy behavior. > > > > How can I read the timestamp value, at BasicURLHandler class ? > > > > This is the thread, with more explanation about this requested > > behavior > > > http://www.nabble.com/How-to-download-files-from-ivyrepo-with-the-same-last-modified-date---td17515745.html > > > > I plan to submit it as an enhancement to the Ivy issue tracking. > > > > Thanks > > > > Claudio Miranda > > > > > ----- > Claudio Miranda > http://weblogs.java.net/blog/claudio > http://www.claudius.com.br/blog > -- > View this message in context: > http://www.nabble.com/-Ivy--How-to-add-a-new-option-to-ivy-settings-tp17526130p17527290.html > Sent from the Ant - Dev mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org > > -- Xavier Hanin - Independent Java Consultant http://xhab.blogspot.com/ http://ant.apache.org/ivy/ http://www.xoocode.org/ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org