Generating HTML reports in remote build environments
Generating HTML reports from within the remote build system
is an optional step. Follow the instructions in this topic to configure
the build for BIRT report generation.
Procedure
- Configure the build for BIRT report generation:
- In a web browser, open http://www.eclipse.org/birt and select to download version 4.4.2. Download only the Report Engine offering.
- Extract the contents of the Report Engine compressed file that you downloaded in the previous step.
- In the Rational Team Concert™ Eclipse Client, open the Build Definition and change to the Ant Configuration tab.
- In the Ant Arguments field, add the argument -lib "BIRT_runtime_install_directory\ReportEngine\lib", where BIRT_runtime_install_directory is the installation directory of the BIRT Report Engine.
- Add the org.eclipse.equinox.common JAR file to the Ant
build arguments. The JAR file is located in the Rational Application
Developer Code Coverage Extension installation directory under CodeCoverage\plugins.
For additional information on installing Rational Application Developer
Code Coverage Extension, see Installing Rational® Application
Developer Code Coverage Extension.
- Locate the JAR file in the installation directoryinstallation_directory\CodeCoverage\plugins. It is named org.eclipse.equinox.common_version_date.jar, where version_date is the version provided in the installation package.
- In the Rational Team Concert Eclipse Client, open the Build Definition and click the Ant Configuration tab.
- In the Ant Arguments field, add the argument -lib "installation_directory\CodeCoverage\plugins\org.eclipse.equinox.common_version_date.jar -lib installation_directory\CodeCoverage\plugins\jdtCompilerAdapter.jar". The installation_directory is the location where Rational Application Developer Code Coverage Extension is installed.
- Generate reports using the code-coverage-report Ant task. The general form of the Ant task is:
<path id="lib.path> <pathelement location=="${code-coverage-plugins-dir}/${llc-common-plugin}"/> <pathelement location=="${code-coverage-plugins-dir}/${llc-report-bit-plugin}"/> <pathelement location="${code-coverage-plugins-dir}/${eclipse-equinox-common-plugin}"/> <fileset dir="${birt-report-engine}/lib" includes="*.jar"/> </path> <!-- birt-report-engine is the installation directory of the BIRT Report Engine --> <taskdef name="code-coverage-report" classname="com.ibm.rational.llc.report.bit.adapters.ant.ReportGenerationTask" classpathref="lib.path"/> <code-coverage-report outputDir="${reportDir}" coverageDataFile="${coverageOutputFile}" baseLineFiles="${baseLineFile}" reportFileDirectory="${code-coverage-report-dir}" birtHome="${birt-report-engine}"> <filters> <filter type="" value=""/> </filters> <configurations> <configuration name="" value=""/> </configurations> </code-coverage-report>
Where,- llc-common-plugin - the LLC common plugin. For example: com.ibm.rational.llc.common_<latest version>.jar
- llc-report-birt-plugin - the LLC report birt plugin. For example: com.ibm.rational.llc.report.birt_<latest version>.jar
The task parameters are described in the following table:Property Description outputDir [Output] A path to a directory used to store the output of the report generation step coverageDataFile [Input] The coveragedata statistics file generated in the execution step baseLineFiles [Input] The baseline file generated for the application in the analysis step reportFileDirectory [Input] The directory containing the report design files. The path to the correct directory is defined in the ${code-coverage-report-dir} property (from the imported file CodeCoverageProperties.xml or CodeCoverageProperties64.xml.) birtHome [Input] The location of the BIRT Report Engine. This is the location of the ReportEngine directory. filters: Optional: Used for filtering report results. It contains one or more filter elements. filter: Contained by the filters property. - type: The type of filter to apply to the report.
- value: The value of the filter to apply to the report.
Line Coverage Threshold filter: Sets a threshold for the line coverage report to display data below the specified percentage value.- type=line_coverage_threshold
- value=threshold value
<filters> <filter type="line_coverage_threshold" value="80" /> </filters>
Configurations Optional: Used for specifying various calculation configurations. It contains one or more configuration elements. Configuration: Contained by the configurations property. - name: The configuration name.
- value: The value of the configuration.
Default constructor inclusion: Configure whether default constructors are excluded or included in the code coverage computations. By default, the default constructors are included. If a class does not define any constructors, then the compiler generates a default no argument constructor. However this constructor does not show up in the actual source file. During the program execution if this class is not instantiated then this hidden default constructor is not executed and hence the coverage does not come equate to 100 percent as expected.- name=excludeDefaultConstructor
- value=true or false
<configurations> <configuration name="excludeDefaultConstructor" value="true"/> </configurations>
- For Rational
Team Concert builds only Add text like the following example
so that the artifactFilePublisher Ant task compresses and publishes
the HTML reports. The reports can be downloaded by the Eclipse client.
<zip destfile="${compressedReportFile}" basedir="${reportDir}" includes="*" encoding="UTF-8"/> <artifactFilePublisher buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}" verbose="true" filePath="${compressedReportFile}" label="The HTML file" /> <buildResultPublisher buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}" />
Related tasks:
Related reference:
Feedback