Overview |
Command Line | Meaning |
ant checkTest -Dtestclass='com.ibm.icu.dev.test.lang.TestUScript' | Runs all the tests in test class 'TestUScript'. |
ant checkTest -Dtestclass='com.ibm.icu.dev.test.lang.TestUScript' -Dtestnames='TestNewCode,TestHasScript' | Runs the tests 'TestNewCode' and 'TestHasScript' in test class 'TestUScript'. |
ant checkTest -Dtestnames='TestNewCode,TestHasScript' | Error: test class not specified. |
ant checkTest | Runs the standard ICU4J test suite (same as 'ant check'). |
The JUnit-generated test result reports are in out/junit-results/checkTest. Go into the 'html/' subdirectory and load 'index.html' into a browser.
#10513 added code coverage target "coverageJaCoCo" in the ICU4J ant build.xml. To run the target:
- Download JaCoCo library from EclEmma site.
- Extract library files to your local system - e.g. C:\jacoco-0.7.6
- Set environment variable JACOCO_DIR pointing to the directory where JaCoCo files are extracted - e.g. set JACOCO_DIR=C:\jacoco-0.7.6
- Set up ICU4J ant build environment.
- Run the ant target "coverageJaCoCo" in the top-level ICU4J build.xml
Following output report files will be generated in /out/jacoco directory.
- report.csv
- report.xml
- report_html.zip
Building ICU4J API Reference Document with JCite
Since ICU4J 49M2, JCite (Java Source Code Citation System) is integrated into ICU4J documentation build. To build the API documentation for public release, you must use JCite for embedding some coding examples in the API documentation. To set up the environment:- Download JCite binary (you need 1.13.0+ for JDK 7 support) from http://arrenbrecht.ch/jcite/
- Note that JCite no longer is available for download from the official web site, which links to Google Code, which was closed down in 2016.
- The Internet Archive has a copy of the last version of JCite found on Google Code before it was closed down: jcite-1.13.0-bin.zip
- Extract JCite file to your local system - e.g. C:\jcite-1.13.0
- Set environment variable JCITE_DIR pointing to the directory where JCite files are extracted. - e.g. set JCITE_DIR=C:\jcite-1.13.0
- Set up ICU4J ant build environment.
- Run the ant target "docs" in the top-level ICU4J build.xml
- If the build (on Linux) fails because package com.sun.javadoc is not found then set the JAVA_HOME environment variable to point to <path>/java/jdk. The Javadoc package is in <path>/java/jdk/lib/tools.jar.
Build and test ICU4J Eclipse Plugin
Building Eclipse ICU4J plugin
- Download and install the latest Eclipse release from http://www.eclipse.org/ (The latest stable milestone is desired, but the latest official release should be OK).
- cd to
<icu4j root>
directory, and make sure$ ant releaseVer
runs clean. - cd to
<icu4j root>/eclipse-build
directory. - Copy
build-local.properties.template
tobuild-local.properties
, edit the properties files - eclipse.home pointing to the directory where the latest Eclipse version is installed (the directory contains configuration, dropins, features, p2 and others)
- java.rt - see the explanation in the properties file
- Run the default ant target - $ ant The output ICU4J plugin jar file is included in
<icu4j root>/eclipse-build/out/projects/ICU4J.com.ibm.icu/com.ibm.icu-com.ibm.icu.zip
Plugin integration test
- Backup Eclipse installation (if you want to keep it - just copy the entire Eclipse installation folder)
- Delete ICU4J plugin included in Eclipse installation -
<eclipse>/plugins/com.ibm.icu_XX.Y.Z.vYYYYMMDD-HHMM.jar
XX.YY.Z is the ICU version, and YYYYMMDD-HHMM is build date. For example, com.ibm.icu_58.2.0.v20170418-1837.jar - Copy the new ICU4J plugin jar file built by previous steps (e.g. com.ibm.icu_61.1.0.v20180502.jar) to the same folder.
- Search a text "
com.ibm.icu"
in files under<eclipse>/features
. The RCP feature has a dependency on the ICU plugin and itsfeature.xml
(e.g.<eclipse>/features/org.eclipse.e4.rcp_1.6.2.v20171129-0543/feature.xml
) contains the dependent plugin information. Replace just version attribute to match the version built by above steps. You can leave size attributes unchanged. The current ICU build script does not append hour/minute in plugin jar file, so the version format is XX.Y.Z.vYYYYMMDD.<plugin
id="com.ibm.icu"
download-size="11775"
install-size="26242"
version="58.2.0.v20170418-1837" -> "61.1.0.v20180502"
unpack="false"/>
- Open
<eclipse>/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info
in a text editor, and update the line including com.ibm.icu plugin information.
com.ibm.icu,58.2.0.v20170418-1837,plugins/com.ibm.icu_58.2.0.v20170418-1837.jar,4,false
-> com.ibm.icu,61.1.0.v20190502,plugins/com.ibm.icu_61.1.0.v20190502.jar,4,false
- Make sure Eclipse can successfully starts with no errors. If ICU4J plug-in is not successfully loaded, Eclipse IDE won't start.
ICU4J plugin test - Note: This is currently broken [http://bugs.icu-project.org/trac/ticket/13072]
- Start the Eclipse (with new ICU4J plugin), and create a new workspace.
- Import existing Eclipse project from
<icu4j root>/eclipse-build/out/projects/com.ibm.icu.tests
- Run the project as JUnit Plug-in Test.
See Release Build