I have pieces of code, written in java, which I can convert in jar and run from the terminal.
I also have some node.js script, which I would like to run before running these jar files.
So the process of running my project is as follows:
Start mongodb from terminal->Run Node.js script-> Run the java code(jar file)
So I want to know, is there a way I could automate my project by just calling some one single file instead of running so many files separately? if so, how?
9
Expanding Florian’s comment, Ant would probably be your best bet.
There’s a decent example and explanation here. My advice to you would be to try to understand how it works, instead of just hastily modifying it to suit your needs. Ant is incredibly powerful to those who use it right.
You can call it from the command line. The ant package also comes with a bin folder containing both a batch file and a shell script to call ant in a convenient fashion:
ant -buildfile <name of build file.xml goes here> <task name>
It has the added advantage that like Java, it is platform independent and makes the difficulty of adapting it to new platforms as trivial as creating a shell script or batch file that calls it.
0