ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Stephenson <bstephen...@thortech-solutions.com>
Subject Re: Uptodate task not working
Date Thu, 15 Jan 2009 15:35:39 GMT
You need to write a mapper for the srcfiles element, that will present the
files as you need them presented to the UpToDate task.  What wrappers are
and what they do is something difficult to encapsulate in a single message.
I usually dislike answers that just deflect someone to another reference,
but I really do suggest that you go to Apache.org and go the ANT section, go
to the manual, and read the instructions for the UptToDate task. It contains
an explanation on how to use more than one file to compare to one file
(using the srcfiles element) and has a link to how to use mappers to create
a list of file that is in the proper format for the UpToDate task.

Brian

On Thu, Jan 15, 2009 at 9:38 AM, Faded-Maximus <fadedmaximus@gmail.com>wrote:

>
> Thanks for the reply. I understand what you mean and it makes sense that
> it's
> not working. I'm not sure how I would go about implementing what I actually
> want too though. If the zip file is newer then any file in the unzipped
> location, I want to unzip the zipped file again so I have the most uptodate
> files. Do you have any ideas about how I can implement this?
>
>
> Brian Stephenson wrote:
> >
> > Hope that wasn't a direct cut-and-paste from the XML file, an
> > important typo in there (the double quotes to open
> > the "Required" property name).
> >
> > Nevertheless, I think that your problem relates to your use of the
> > srcfiles element in the uptodate task.
> >
> > As quoted in the ANT manual: "If a <srcfiles> element is used, without
> > also specifying a <mapper> element, the default behavior is to use a
> > merge mapper, with the "to" attribute set to the value of the
> > "targetfile" attribute."  So I think your srcfiles element is
> > mergemapped into becoming "build.zip", not the list of files, and if
> > so an existing copy of a file is always considered more up to date
> > than a non-existent copy. Have not had a chance to cobble up a test
> > script, so not sure, but I would start there.
> >
> > Brian Stephenson
> > ThorTech Solutions
> > www.thortech-solutions.com
> >
> > On Jan 14, 2009, at 1:14 PM, Faded-Maximus wrote:
> >
> >>
> >> I am trying to use the uptodate task to see if I need to rebuild my
> >> program.
> >>
> >> [code]
> >> <target name="buildrequired">
> >>              <uptodate property=Required" targetfile="build.zip">
> >>                      <srcfiles dir="${unzip.location}" includes="**/*"
> />
> >>              </uptodate>
> >>                <antcall target="update" />
> >>                <antcall target="else" />
> >>      </target>
> >>      <target name="update" if="Required">
> >>              <echo message="A new build is required." />
> >>      </target>
> >>      <target name="else" unless="Required"
> >>              <echo message="No new build is required." />
> >>      </target>
> >> [/code]
> >>
> >> Based on my understanding. If the build.zip file has a last modified
> >> date
> >> newer then any files in the ${unzip.location}, the Required property
> >> will be
> >> set to true and a message will appear saying that a new build is
> >> required.
> >> if the unzipped location is newer then the build.zip then a message
> >> will
> >> appear that no new build is required. Testing this, I have tried and
> >> older
> >> build.zip file and a newer build.zip file. Both cases Required is
> >> always
> >> set, and a message appears saying a new build is required. Can
> >> somebody help
> >> me figure out where I am going wrong?
> >>
> >> Thanks.
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Uptodate-task-not-working-tp21461848p21461848.html
> >> 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
> >>
> >
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Uptodate-task-not-working-tp21461848p21478875.html
> 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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message