2/19/2023 0 Comments Apache ant run java![]() ![]() Copy the build.xml and test.bat (attached below), to your C: directory.Now open the command prompt,cursor pointing to C:\>.When the os attribute is specified, then the command is only executed when Apache Ant is run on one of the specified operating systems :įollowing is to run a shell script on UNIX using Ant task: To execute a script, exec command is used wrapped inside your target definition. If this condition returns true, then runscript.unix will be called.įollowing is how you can define an ant task to execute a batch script on windows: ![]() Returns true, then ant target runscript.windows is executed.Įlse, ifOSNotWindows is tested using isOSUnix property: We can see that, ifOSWindows and ifOSNotWindows are based on a condition, which if true calls the specific target. This target depends on targets ifOSWindows and ifOSNotWindows. Now we need an ant task in build file, to call the appropriate scripts depending on the operating system. Let’s assume we have two scripts, one (.bat file) which executes on windows operating system family, and other (.sh) that runs on all non-windows platforms like UNIX, Linux, etc. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |