Task:
Write a script for the Apache Ant utility that implements compilation, testing, and packaging into a jar-archive of the project code from laboratory work #2 in the "Web-programming" discipline.
My assignment is slightly different from the options given by my classmates due to the fact that laboratory work #3 in the "Web Programming" discipline (which everyone is invited to test) is not yet ready for me, since I recently transferred to this faculty and have not yet managed to pass the necessary laboratory work. However, according to the teacher, you can do the task on any program with some kind of interactive, so I will do it on the specified one.
Each stage should be separated into a separate script block; all variables and constants used in the script must be placed in a separate parameter file; MANIFEST.MF should contain information about the version and about the class being started.
The script must implement the following targets:
- compile — compilation of project source codes.
- build — Compiling project sources and packing them into an executable jar. Compilation of source codes is implemented by calling the compile target.
- clean — remove compiled project classes and all temporary files (if any).
- test — run the project's junit tests. Before running the tests, you need to build the project (build target).
- xml — validation of all xml files in the project.
- report — in case of successful tests, saves the junit report in xml format, adds it to the git repository and commits.
Questions for the defense of laboratory work:
- Software testing. Purpose of testing, types of testing.
- Unit testing, basic principles and approaches used.
- JUnit package, core APIs.
- Automatic assembly systems. Purpose, principles of operation, examples of systems.
- Make utility. Makefiles, targets and rules.
- Ant utility. Build scripts, targets and commands.