Question

I'm trying to fix a build file where a part of it runs a bash script to generate a file. This file generation takes under a second and wasn't a problem until we moved to eclipse.

The issue is that if I save any file in eclipse with a change and then run ant to build. I get a "class not found" error on the generated file. Seems like eclipse is doing something to the newly generated file (it even shows it with an error check box)

If I wait a few seconds more and run the build again, it works fine.

What I have been trying to use is this.

<waitfor maxwait="30" maxwaitunit="second">
        <available file="${src}/thefile.java"/>
</waitfor>

It does not work. I also tried to look at something called <readable> under the selectors set which by the documentation could be used in junction with some other waitfor methods.

How can I fix this problem or is there another way around it?

Was it helpful?

Solution

Found the issue. Eclipse was locking the generated file while it was building the workspace so the bash script that generated it would mess up.

The building of the workspace took 4-5 seconds so that was the delay.

I was able to speed up the building of the workspace by disabling the XML and DTD validation. (Window > Preferences > Validation)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top