How to make custom ant task?

2019-07-14 16:29发布

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.

标签: ant
2条回答
Summer. ? 凉城
2楼-- · 2019-07-14 16:52

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:

查看更多
Viruses.
3楼-- · 2019-07-14 17:12

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:-

查看更多
登录 后发表回答