Nice one, Fredrik! :-)
I'll try it out later but it totally seems like the right track. I was
looking at the antlr plugin which does exactly the same!
Thanks
nacho
Fredrik Vraalsen wrote:
Nacho G. Mac Dowell wrote:
- When building JS's tests the first thing I did was to build the
auxiliary files on a temp directory and then compile with ant the
JS.src and the temp directory all together. The thing is that we'd
need hsqldb.jar and junit.jar on the repository. I was thinking of
generating the auxiliary files (EnumExample, ...) on the JS.src
folder with a different package name:
org.apache.ws.jaxme.js.junit.temp (or similar) so after compilation
they can safely be deleted from the JS.src folder. Any other ideas?
If I understand correctly, the auxiliary files are generated Java
source files which you need to compile in addition to the test sources?
I've just recently mavenized a project myself where I am including
java source generated from UML models. When generating java source to
be compiled, the common way of handling it in maven seems to be
placing them somewhere under the 'target' directory and adding the new
source path to 'maven.compile.src.set'. See also
http://maven.apache.org/faq.html#multiple-source-directories
To do the same for the maven test goal, I think you just need to add
the path to 'maven.test.compile.src.set' instead, e.g. by putting
something like the following in your maven.xml:
<project xmlns:maven="jelly:maven" xmlns:ant="jelly:ant">
<preGoal name="test:compile">
<!-- generate your source files here -->
<ant:path id="generated.test.src.set"
location="${maven.build.dir}/generated-test"/>
<maven:addPath id="maven.test.compile.src.set"
refid="generated.test.src.set"/>
</preGoal>
</project>
By placing the generated files under the target dir they will be
removed by 'maven clean'. You could also remove them explicitly by
adding something like the following to maven.xml:
<postGoal name="test:test">
<ant:delete dir="${maven.build.dir}/generated-test"/>
</postGoal>
Hope this helps.
Best regards,
Fredrik Vraalsen
SINTEF
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]