You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Adam Jack <aj...@openbiz.biz> on 2002/06/20 20:44:40 UTC

JAR/FTP only if (or ) did anything

I have my ANT script compiling, JARing, and FTPing. Unfortunately I can't
seem to find a way to link the latter two to "only if a compile occurred".

I see that FTP will only upload if the timestamps indicate a need, so if I
could "only re-JAR if needed" I think I'd be in good shape. Unfortunately I
see that JAR will allow create a JAR file only if it does not exist, or one
can force an update, but I can't see how to "update only if one the contents
indicate a need". Is there a way?

Alternatively [and what seems ant-like, but I am no expert] I could use
<task "jarEmAllUp" if="" --- if I could set a property with number of
compiled files -- or if compile --- with <javac> or if I could do similarly
or <depend>. Does any such thing exist?

Any suggestions? Thanks in advance.

regards,

Adam
--
Open Business Interchange: <http://www.openbiz.biz>
The Revolutionary B2Bi Web Service ...


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: causes to rebuild (was RE: JAR/FTP only if ...)

Posted by Stefan Bodewig <bo...@apache.org>.
On 21 Jun 2002, Stefan Bodewig <bo...@apache.org> wrote:

> To confirm it has been fixed, please try the latest version from
> <http://cvs.apache.org/~bodewig/gump/ant1.5beta>

where latest is the one available in two hours from now, sorry.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: causes to rebuild (was RE: JAR/FTP only if ...)

Posted by Stefan Bodewig <bo...@apache.org>.
See <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9713>

To confirm it has been fixed, please try the latest version from
<http://cvs.apache.org/~bodewig/gump/ant1.5beta> or wait for the beta3
release (in a few days).

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: causes to rebuild (was RE: JAR/FTP only if ...)

Posted by Adam Jack <aj...@openbiz.biz>.
	> Sadly it seems that the <manifest> entry is causing the rebuild
	> of the JAR.

	According to the doc, if you have use the <manifest> element, it checks
	whether the build file is newer than the jar -- have you tried running
	your target twice in a row without any build-file diddling in-between?

Neat concept. Wouldn't have caught me putting ${DSTAMP}${TSTAMP} in the
manifest, but it seems a good enough call.

Yes, I ran it a few times in a row --- it still did it...

I have:

	06/20/2002  01:27p                 352 build.xml
	06/20/2002  01:53p                 337 jar.jar

but I still get:

test:
fileset: Setup scanner in dir E:\data\test\src with patternSet{ includes: []
excludes: [] }
      [jar] Updating jar since jar manifest has changed
      [jar] Building jar: E:\data\test\jar.jar
      [jar] adding directory META-INF/
      [jar] adding entry META-INF/MANIFEST.MF
fileset: Setup scanner in dir E:\data\test\src with patternSet{ includes: []
excludes: [] }

after:

	06/20/2002  01:27p                 352 build.xml
	06/20/2002  01:57p                 337 jar.jar

Phew --- no diddling in-betweens for me! ;-) ;-)

Also, I wondered if my having an empty  test directory was throwing it off
so I add a test file. I ran it twice in a row and it added the file twice.
Almost as if once it decides to rebuilds it re-adds everything. No
objections, just not was I understood from docs (since *I* didn't find it in
the docs) and mailing liat (DH) inputs  --- jsut for the record...

regards

Adam


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: causes to rebuild (was RE: JAR/FTP only if ...)

Posted by Diane Holt <ho...@yahoo.com>.
> Sadly it seems that the <manifest> entry is causing the rebuild
> of the JAR.

According to the doc, if you have use the <manifest> element, it checks
whether the build file is newer than the jar -- have you tried running
your target twice in a row without any build-file diddling in-between?

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


causes to rebuild (was RE: JAR/FTP only if ...)

Posted by Adam Jack <aj...@openbiz.biz>.
	--- Adam Jack <aj...@openbiz.biz> wrote:
	> I see that FTP will only upload if the timestamps indicate a need, so if
	> I could "only re-JAR if needed" I think I'd be in good shape.

	That should be the default behaviour. Are you saying it recreates the jar
	even if none of the files that go into it are newer than the jar?

I wrote a small build file to test this out, and you seem correct on vanilla
<JAR>. Sadly it seems that the <manifest> entry is causing the rebuild of
the JAR. I suspected it was 'cos I have date/time stamp properties in my
attributes, but even without those, with static content it always seems to
generate a JAR rebuild.

<?xml version="1.0"?>
<project name="TEST" default="test" basedir=".">
	<target name="test">
		<jar jarfile="jar.jar" basedir="src">
			<manifest>
				<section name="Yada">
      				<attribute name="Specification-Title"
					value="Something that does not change..." />
				</section>
  			</manifest>
		</jar>
	</target>
</project>


ant -debug gives ......

	[...]

test:
fileset: Setup scanner in dir E:\data\test\src with patternSet{ includes: []
exc
ludes: [] }
      [jar] Updating jar since jar manifest has changed
      [jar] Building jar: E:\data\test\jar.jar
      [jar] adding directory META-INF/
      [jar] adding entry META-INF/MANIFEST.MF
fileset: Setup scanner in dir E:\data\test\src with patternSet{ includes: []
exc
ludes: [] }

I do not know if there is a "better" behaviour for <manifest> checking for
update, since clearly it isn't a file w/ a timestamp (and if it were it's
timestamp would be 'now') -- but could it's output not be compared to that
of the manifest? Less complex -- and perhaps still a better (for me ;-)
default -- could it not just be ignored in the check? I'd rather not create
a new JAR w/ a new manifest if nothing else had changed (even though I
realize that could loose a manifest content change.)

regards,

Adam


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: JAR/FTP only if (or ) did anything

Posted by Diane Holt <ho...@yahoo.com>.
--- Adam Jack <aj...@openbiz.biz> wrote:
> No, I am saying I never knew that from my reading of the documentation.
> It makes sense, although it tends to contradict the documentation
> section on the "update" attribute.

The 'update' attr specifies whether to recreate the jar, or just update an
existing jar with the newer files (or with additional files, specified in
another <jar> task).

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: JAR/FTP only if (or ) did anything

Posted by Adam Jack <aj...@openbiz.biz>.
	--- Adam Jack <aj...@openbiz.biz> wrote:
	> I see that FTP will only upload if the timestamps indicate a need, so if
	> I could "only re-JAR if needed" I think I'd be in good shape.

Diane wrote:

	That should be the default behaviour. Are you saying it recreates the jar
	even if none of the files that go into it are newer than the jar?

No, I am saying I never knew that from my reading of the documentation. It
makes sense, although it  tends to contradict the documentation section on
the "update" attribute.

Let me try it and see, thanks...

regards

Adam


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JAR/FTP only if (or ) did anything

Posted by Diane Holt <ho...@yahoo.com>.
--- Adam Jack <aj...@openbiz.biz> wrote:
> I see that FTP will only upload if the timestamps indicate a need, so if
> I could "only re-JAR if needed" I think I'd be in good shape.

That should be the default behaviour. Are you saying it recreates the jar
even if none of the files that go into it are newer than the jar?

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>