Shiv Kumar Ganesh
Shiv Kumar Ganesh

Reputation: 3825

How to make custom ant task?

I am learning a new upcoming language known as Visage. This language is almost the same as the Open Source JavaFX 1.3 . My problem is that Visage has its own compiler and to compile a visage file I need to use 'visagec filename.visage' and the run the class file generated I need to use 'visage filename'. I want this task to be automated using the ant script. I also need to include some jar files in the classpath while doing so. Can someone please let me know how to write a custom ant script for the above language. I have already added VISAGE_HOME in my environment variables.

Upvotes: 2

Views: 4381

Answers (2)

Shiv Kumar Ganesh
Shiv Kumar Ganesh

Reputation: 3825

The resources mentioned by Alex were really useful and I was amazed to see how easy it was to make a little changes here and there and get through it.The links that helped me were:-

Upvotes: 1

ewan.chalmers
ewan.chalmers

Reputation: 16255

Maybe you can achieve what you need using an exec task - where you execute your compiler using a system command? The apply task might also be useful.

If you do implement your own compiler task, I would suggest looking at the source code of an existing Ant compilation task, e.g. org.apache.tools.ant.taskdefs.Javac.

If you do implement your own task, then the references suggested in AlexK's comment are required reading. I'll copy them here:

Upvotes: 3

Related Questions