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.
Asked
Active
Viewed 4,340 times
2
-
1For using ant's scriptdef (http://ant.apache.org/manual/Tasks/scriptdef.html) the language must be a supported Apache BSF or JSR 223. The article at the link above has several samples of using different languages – Alex K Nov 14 '11 at 12:58
-
@AlexK The language is actually an upcoming one.I am searching for smoething easy like setting the classpath and some other data to get a tag like
for compilation and – Shiv Kumar Ganesh Nov 14 '11 at 13:27for running the program ? -
Did you find `visage` ant task? If you want to write your own task you can read this articles: http://ant.apache.org/manual/develop.html and http://ant.apache.org/manual/tutorial-writing-tasks.html – Alex K Nov 14 '11 at 13:31
-
@AlexK Nope visage ant task does not exist. It is an upcoming language still under development. I want to make a new ant task. I will go through the manual. Since the language is very new I am a bit confused whether I would be able to generate the task?? :-/ – Shiv Kumar Ganesh Nov 14 '11 at 13:38
-
2@ShivKumarGanesh Alex gave you all the answers you will ever need from this forum. I suggest you answer yourself, after you figure out what to do and accept your answer. – FailedDev Nov 14 '11 at 14:07
-
@FailedDev definitely I would follow up and put the correct answer and tag it as a wiki. :) Thanks – Shiv Kumar Ganesh Nov 14 '11 at 14:19
-
@FailedDev Actually I got the answers from the links which Alex gave me. So i guess I would either prepare a small post so that things are aligned or I will try putting it in some better way. – Shiv Kumar Ganesh Nov 23 '11 at 14:04
-
@FailedDev please mark my answer as a WIKI – Shiv Kumar Ganesh Nov 24 '11 at 14:57
2 Answers
3
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:

ewan.chalmers
- 16,145
- 43
- 60
1
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:-

Shiv Kumar Ganesh
- 3,799
- 10
- 46
- 85