Skip to content

Latest commit

 

History

History
76 lines (62 loc) · 3.26 KB

BUILDING.md

File metadata and controls

76 lines (62 loc) · 3.26 KB

To build iText Community, Maven must be installed.

Running install without a profile will generate the iText Community jars:

$ mvn clean install \
    -Dmaven.test.skip=true \
    > >(tee mvn.log) 2> >(tee mvn-error.log >&2)

Please note that tests are not run in default profile. To run tests, Ghostscript and Imagemagick must be installed. Some of the tests compare generated PDF files with template files that show the correct results, and these tools are used to visually compare PDF files. Ghostscript is required to render PDF files into images and Imagemagick is used to compare image data. There are two options for running tests:

  1. Pass Ghostscript and Imagemagick compare commands as ITEXT_GS_EXEC and ITEXT_MAGICK_COMPARE_EXEC environment variables, respectively (Ghostscript and Imagemagick folders must be added to PATH environment variable). This option is suitable for both Windows and Unix systems. The syntax of commands depends on installed Ghostscript and Imagemagick versions (gs, gswin64c, magick compare).
  2. Pass the paths to Ghostscript and Imagemagick compare execution files as ITEXT_GS_EXEC and ITEXT_MAGICK_COMPARE_EXEC environment variables. Examples of paths on Windows:
  • C:\Program Files\gs\gs9.26\bin\gswin64c.exe
  • C:\Program Files\ImageMagick-7.0.9-Q16\compare.exe

If you have a new version of ImageMagick, then there is no compare.exe utility there, wrap the path to magick.exe in quotes and call compare command: ITEXT_MAGICK_COMPARE_EXEC="C:\Program Files\ImageMagick-7.0.9-Q16\magick.exe" compare

To run build with tests, activate the test profile and pass ITEXT_GS_EXEC and ITEXT_MAGICK_COMPARE_EXEC environment variables:

$ mvn clean install \
	-P test \
    -Dmaven.test.failure.ignore=false \
    -DITEXT_GS_EXEC="gs command" \
    -DITEXT_MAGICK_COMPARE_EXEC="magick compare command" \
    > >(tee mvn.log) 2> >(tee mvn-error.log >&2)

By default tests are run with the non FIPS mode version of Bouncy Castle. To run the tests in FIPS mode the profile bouncy-castle-test must be deactivated and the profile bouncy-castle-fips-test must be activated:

$ mvn clean install \
	-P test,bouncy-castle-fips-test,!bouncy-castle-test \
    -Dmaven.test.failure.ignore=false \
    -DITEXT_GS_EXEC="gs command" \
    -DITEXT_MAGICK_COMPARE_EXEC="magick compare command" \
    > >(tee mvn.log) 2> >(tee mvn-error.log >&2)

iText is backwards compatible in minor releases. To ensure that code changes conform to this requirement we use japicmp. Todo verify this execute following commands:

$ mvn clean install
$ mvn verify --activate-profiles qa \
    -Dcheckstyle.skip=true \
    -Ddependency-check.skip=true \
    -Dpmd.skip=true \
    -Dspotbugs.skip=true \
    -Dmaven.main.skip=true \
    -Dmaven.test.skip=true \
    -Djapicmp.breakBuildOnModifications=true \
    -Djapicmp.breakBuildOnBinaryIncompatibleModifications=true \
    -Djapicmp.breakBuildOnSourceIncompatibleModifications=true 

If you add new public methods or classes those should be documented. To verify this you can execute the following commands:

$ mvn clean install
$ mvn javadoc:javadoc | grep -E "(: warning:)|(: error:)"