You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Emmanuel Blot <eb...@jijia12.grenoble.hp.com> on 2000/06/29 13:07:00 UTC

and autocopy

Hello,

How to disable the autocopy stuff in Ant (issued from the v3.1 tomcat release, April 18th) ?

Ant persists on _some_ targets to copy the 'package.html' file to some wrong directories.
I have tried to use the 'excludes=' keyword with *.html, **.html and **/*.html but it still
copies the package.html (and creates wrong directories in my project's top level directory) ?

Is there any way to just disable the autocopy while compiling ?

Thanks,
Emmanuel.



Re: and autocopy

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "EB" == Emmanuel Blot <eb...@jijia12.grenoble.hp.com> writes:

 EB> there may have an option to set a 'autocopy-with-complete-path'
 EB> feature, that is the src dir and the dest dir should present the
 EB> same depth.

Hmm, in your case we have src="src/a/f" and dest="/tmp". What would be
the "complete path" of src/a/f/h/package.html? What would be the same
depth (with regard to what starting point)?

Stefan

Re: and autocopy

Posted by Emmanuel Blot <eb...@jijia12.grenoble.hp.com>.
It seems that synchronizing the time between the Windows clients and the Linux box really helps.
Things start to work ok.

> is what you should expect to happen. The structure a/f/h is generated
> by javac due to your package declaration, while the path of the
> utility files relative to the src attribute is h/package.html not
> a/f/h/package.html.

I agree with that, but I think that if the autocopy feature goes on existing, there may have an option to set a
'autocopy-with-complete-path' feature,
that is the src dir and the dest dir should present the same depth.

Thanks,
Emmanuel.



Re: and autocopy

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "EB" == Emmanuel Blot <eb...@jijia12.grenoble.hp.com> writes:

 EB> I'm going slighty mad with this.  Is there a cache or anything
 EB> like this between ant runs ?

No but I've seen strange caching problems in setups similar to
yours. Windows Explorer (win98 in my case) would show a wrong
modification time of files sitting on a Linux+Samba server even hours
after I changed them - and notepad showed the old version as well.

I never figured out who was the culprit, just solved it the Windows
way (aka reboot - I didn't reboot the the Linux machine of
course). After that everything went fine for some time - so I doubt
Samba is to blame.

 EB> In fact, for a tree dir like this:

 EB> src/
 EB>    a/
 EB>       b/
 EB>          c/
 EB>          d/
 EB>          e/
 EB>       f/
 EB>          h/
 EB>          i/
 EB>          j/
 EB> tmp/

Assuming <javac src="src/a/b" dest="tmp" ...> and <javac src="src/a/f"
dest="tmp" ...> with your java classes living in packages like a.f.h,
right?

Then

tmp/
   a/
      f/
         h/*.class
         i/*.class
         j/*.class
   h/package.html
   i/package.html
   j/package.html

is what you should expect to happen. The structure a/f/h is generated
by javac due to your package declaration, while the path of the
utility files relative to the src attribute is h/package.html not
a/f/h/package.html.

Stefan

Re: and autocopy

Posted by Emmanuel Blot <eb...@jijia12.grenoble.hp.com>.
> I'm afraid there is not. But IMHO excludes="**/*.html" should work as
> well as includes="**/*.java" to restrict yourself to the java files.

That is really strange. It starts to work on my machine, _but_
as one file was still copied (a PERL script), I choose to use 'includes="**/*.java"'
rather than 'excludes="**/*.html"'. The PERL script is still copied, but the HTML not !

I'm going slighty mad with this.
Is there a cache or anything like this between ant runs ? This question seems stupid, I know, but it seems to act like the
build.xml was cached and not reload when ant starts up...
May be the problem comes from where the file is stored (ant runs on an NT box, but all the files (build.xml+java source files,
etc.) are on a Samba/Linux server.
I never encountered a problem of bad file caching before, so that sounds strange.

> As you said, this doesn't work for you. Do you think you could post
> the relevant portion of your buildfile and the "wrong" directory
> structure that gets created?

In fact, for a tree dir like this:

src/
   a/
      b/
         c/
         d/
         e/
      f/
         h/
         i/
         j/
tmp/

Where .java, package.html, and .pl files are in the src/ subtree, and where tmp/ is the destination dir (for .class)
I uses two targets (one for b/ subtree, one for f/ subtree), with all the _same_ javac parameters, but the .jar(s) in the
classpath tag.

Whenever 'bad copying' occurs, it only occurs for the second target, let's say 'f'. In this case, all the package.html files are
copied into tmp, like this:

src/
  ...

tmp/
   a/
      b/
         c/*.class
         d/*.class
         e/*.class
      f/
         h/*.class
         i/*.class
         j/*.class
   h/package.html
   i/package.html
   j/package.html

Even if package.html is copied, I think that it should be copied into the source matching subtree, for example for source file
src/a/f/h/package.html I would expect that the file is copied into tmp/a/f/h/package.html, -not- into tmp/h/package.html ...

> Telling you that the autocopy part is going to be removed won't help
> you much now.

No 8') But I think this is a good idea.

Thanks for your help.
Emmanuel.



Re: and autocopy

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "EB" == Emmanuel Blot <eb...@jijia12.grenoble.hp.com> writes:

 EB> Is there any way to just disable the autocopy while compiling ?

I'm afraid there is not. But IMHO excludes="**/*.html" should work as
well as includes="**/*.java" to restrict yourself to the java files.

As you said, this doesn't work for you. Do you think you could post
the relevant portion of your buildfile and the "wrong" directory
structure that gets created?

Telling you that the autocopy part is going to be removed won't help
you much now.

Stefan