uptodate when it isn't

View: New views
5 Messages — Rating Filter:   Alert me  

uptodate when it isn't

by Andy Stevens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I've got a bit of a puzzle with an uptodate task, and I'm hoping I've
just missed something obvious...

Part of my build script "compiles" various database objects by copying
them with token replacement, to substitute the environment-specific
database name at various points.  I didn't want to do this (nor
execute them against the unit tests' database) if it wasn't necessary,
so I figured the uptodate task was the easiest answer.  However, after
running the script the first time (which did everything as expected) I
edited one of the SQL source files, but the subsequent build skipped
straight through without applying it to the database :-(
After further investigation, I found the culprit seems to be the
uptodate task - it sets the property to "true" even though one of the
source files has a later timestamp (by a few minutes) than its
equivalent target file.  The task I was using is

        <uptodate property="test.database.uptodate"
targetfile="${build.test.database.dir}">
            <srcfiles dir="${sql.dir}" includes="**/*.sql"/>
            <mapper type="identity"/>
        </uptodate>

where sql.dir=src/sql and build.test.database.dir=build/test/database.
 The source file in question is in src/sql/datamart_Views/USERS.sql,
and I can see the equivalent file in
build/test/database/datamart_Views/USERS.sql

I noticed the identity mapper docs said the from and to attributes
were ignored, and also found an open bug
(https://issues.apache.org/bugzilla/show_bug.cgi?id=15596) that looks
to be relevant.  So I tried swapping the mapper to
            <globmapper from="*" to="*"/>
but that behaves the same.  I can even delete some of the files in
build/test/database/datamart_Views, or the datamart_Views directory
itself and it still tells me I'm up to date!  But if I delete the
build/test/database directory it goes back to leaving the property
unset.

Am I missing something obvious?  Does uptodate return true if *any*
file in the set is up to date, not when all of them are?  Or is it
something else?


Andy
--
http://pseudoq.sourceforge.net/  Open source java sudoku solver

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: uptodate when it isn't

by ddevienne :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 2, 2009 at 12:21 PM, Andy
Stevens<insomniacpenguin@...> wrote:
> I've got a bit of a puzzle with an uptodate task, and I'm hoping I've
> just missed something obvious...

To cut to the chase, do yourself a favor and use Ant-Contrib's <outofdate>.

If you want to keep using <uptodate>, run in verbose mode (-v) and you
should see what uptodate is up to (pun intended :) --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


RE: uptodate when it isn't

by Ina, Antoine :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello All,
I am a new ant user and I need help solving the following problem:
I have 3 microsoft visual studio solution files A.sln, B.sln

I'd like to be able to say in ant that
- solution A--->depends on solution B
- solution A--->depends on solution C
- build B only if B changed.
- do not build C if C did not change

Can we do this in ant??? or is the answer in a super solution file that includes all the solutions
in the project????
Regards,
Antoine Ina

-----Original Message-----
From: Dominique Devienne [mailto:ddevienne@...]
Sent: 2009 Jul 02 2:52 PM
To: Ant Users List
Subject: Re: uptodate when it isn't

On Thu, Jul 2, 2009 at 12:21 PM, Andy
Stevens<insomniacpenguin@...> wrote:
> I've got a bit of a puzzle with an uptodate task, and I'm hoping I've
> just missed something obvious...

To cut to the chase, do yourself a favor and use Ant-Contrib's <outofdate>.

If you want to keep using <uptodate>, run in verbose mode (-v) and you
should see what uptodate is up to (pun intended :) --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: uptodate when it isn't

by Andy Stevens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/7/2 Dominique Devienne <ddevienne@...>:
> On Thu, Jul 2, 2009 at 12:21 PM, Andy
> Stevens<insomniacpenguin@...> wrote:
>> I've got a bit of a puzzle with an uptodate task, and I'm hoping I've
>> just missed something obvious...
>
> To cut to the chase, do yourself a favor and use Ant-Contrib's <outofdate>.
>
> If you want to keep using <uptodate>, run in verbose mode (-v) and you
> should see what uptodate is up to (pun intended :) --DD

Tried that; the relevant line says

datamart_Views\USER_INFO.sql omitted as
C:\MyProject\sql\datamart_Views\USER_INFO.sql is up to date.

Well, seeing as that's the source file, it can hardly not be up to
date!  But I was expecting it to be comparing against
C:\MyProject\build\test\database\datamart_Views\USER_INFO.sql...

I'm wondering if the problem is that the srcfiles are being resolved
to their full absolute paths before being passed in to the mapper;
such that the identity mapper (or even globbing "*" to "*") returns
the same fully qualified paths.  If so, the statement in the
documentation that "The mapper to attribute is relative to the target
file" is irrelevant because it'll still be the same file wherever it's
being taken "relative" to.
Altenatively, maybe it's just the docs being ambiguous - the complete
version of that statement is
"The mapper to attribute is relative to the target file, or to the dir
attribute of the nested srcfiles element."; so which is it, target or
dir?  Plus, assuming the mapper returns the expected relative path
(datamart_Views\USER_INFO.sql), if the srcfiles' dir location in used
in preference to the task's target, that would always give just the
source files again, which surely is not what you'd intuitively expect.
 Oh well, at least issue #15596 now has another vote ;-)

I've found a workaround that does the trick; in my "compile" target II
follow the copy task with
        <concat destfile="${build.test.database.dir}/tstamp.txt"
                force="no">
            <fileset dir="${sql.dir}" includes="**/*.sql"/>
        </concat>
and use
        <uptodate property="test.database.uptodate"
targetfile="${build.test.database.dir}/tstamp.txt">
            <srcfiles dir="${sql.dir}" includes="**/*.sql"/>
        </uptodate>
for the check instead.  It's a bit of a hack, though.
It seems to me that the merge mapper is the only one that's really
been considered/tested with the uptodate task, at least it's the only
one the task's documentation discusses...


Andy
--
http://pseudoq.sourceforge.net/  Open source java sudoku application

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: uptodate when it isn't

by Eric Fetzer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Move over to NAnt and use the <solution> task.

http://nant.sourceforge.net/

 



________________________________
From: "Ina, Antoine" <antoine.ina@...>
To: Ant Users List <user@...>
Sent: Thursday, July 2, 2009 2:45:18 PM
Subject: RE: uptodate when it isn't

Hello All,
I am a new ant user and I need help solving the following problem:
I have 3 microsoft visual studio solution files A.sln, B.sln

I'd like to be able to say in ant that
- solution A--->depends on solution B
- solution A--->depends on solution C
- build B only if B changed.
- do not build C if C did not change

Can we do this in ant??? or is the answer in a super solution file that includes all the solutions
in the project????
Regards,
Antoine Ina

-----Original Message-----
From: Dominique Devienne [mailto:ddevienne@...]
Sent: 2009 Jul 02 2:52 PM
To: Ant Users List
Subject: Re: uptodate when it isn't

On Thu, Jul 2, 2009 at 12:21 PM, Andy
Stevens<insomniacpenguin@...> wrote:
> I've got a bit of a puzzle with an uptodate task, and I'm hoping I've
> just missed something obvious...

To cut to the chase, do yourself a favor and use Ant-Contrib's <outofdate>.

If you want to keep using <uptodate>, run in verbose mode (-v) and you
should see what uptodate is up to (pun intended :) --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...