
Introduction
There is a huge and painful job when the project is big and required a lot of ant target to be executed to build the project.
IBM Cúram is also a very big project and required to execute a lot of ant target in order to set up the project. There is some way to automate this process so the user can just enter the revision number to complete the build.
This tutorial helps to write one batch file which downloads code from the SVN and will execute all required ant target sequentially. This Batch File will help developers to complete the project update and build overnight and save productive time.
Batch File Information
Developer can write the Batch Script and scheduled using the Window or any other third party scheduler.
Please find Batch Script information in below screenshot –
This is a very simple Batch script and most of the sentence is self-explanatory.
First Line: To Start the Batch Script.
2nd to 5th Line: Developer wants to verify if any setting needs to be updated before starting the Batch Script. If Developer enter Y then it will start the next process otherwise it will terminate the process.
7th Line: Suppose Developer enter Y then it will execute the SVN Client to start download code.
8th Line: This line is very important as the developer has to enter the revision number to download the code till that revision number.
9th Line & 10th Line: The code in these lines will help to download the code to their respective folder location.
11th to End of the File: These lines help to navigate to the respective folder to start the ant build target command.
Like here, We moved to EJB server folder and executed build server database build target to build server-side code.
Once above build targets completed then we moved back to the previous folder and finally moved to the webclient folder to execute build client external -client -Dapp=NavigatorS build target to build client-side code.
Write code using the above screenshot and developer can add or remove steps from the above example. There are various options available and the developer can include them to make it more flexible and readable.
Batch File execution
- Save the Batch File in *.bat format in your computer.
- Double Click on the File to start the execution.
- Enter Y to execute the next step.
- Enter the revision number and hit the enter button.
- Once hit the enter button then SVN Client will start downloading or updating project from the SVN Repository.
- Once Project downloaded or update completed then it will start executing build target.
- The developer can configure this file to any scheduler to start automatically. (Optional)