This template is a Gradle project model for building an Adelia Crystal Report Engine application in the form of a file in ZIP format.
This build can take into account Crystal Report .RPT files which are stored in a file system directory or present in the form of an artifact in Zip format generated by the execution of an application area-based or component-based Adelia build.
Creating an Adelia ACRPE build project
The project is created by decompressing the %ADELIWS%\Build\templates\acrpe application.zip file: the obtained "acrpe application" directory can be moved and renamed as required.
The Adelia ACRPE application build machine and Adelia build machine may be two different machines.
Configuring an Adelia ACRPE build project
After creating a project, it needs to be configured before it can be executed. Build project configuration and initialization are based on the settings entered in the gradle.properties file, namely:
General settings
acrpeVersion (mandatory)
Alphanumeric string representing the version number of the ACRPE runtime included in the built Adelia ACRPE application ZIP.
version (mandatory)
Alphanumeric string representing the application version number. Each artifact built will have the same version number. There are several version types:
The release (or final) versions representing the official versions of the application (e.g. 1.0.0),
The snapshot (or instantaneous) versions representing the versions of the application that are under development (e.g. 1.0.1-SNAPSHOT),
The pre-release (or release-candidate) versions representing the versions which are candidates for being final versions (e.g. 1.0.1-RC01).
group (mandatory)
Alphanumeric string representing the identifier of the group or organization instigating the project. The value follows the same naming rules as Java packages (e.g. com.hardis) and we generally choose the name of the project's main package as a value.
ACRPE application parameters
acrpeAppName (optional)
Alphanumeric string representing the name of the produced ZIP file. By default, the name of this file is <project directory name>-<version parameter value>.zip.
If this parameter is entered, the file name will be <acrpeAppName parameter value>-<version parameter value>.zip.
acrpe.port (optional)
Application's TCP listening port number. This parameter is 3007 by default.
acrpe.throttle.limitPerSecond (optional)
Maximum number of incoming HTTP requests over a period of one second. By default, this parameter specifies no limit.
acrpe.throttle.limitPerMinute (optional)
Maximum number of incoming HTTP requests over a period of one minute. By default, this parameter specifies no limit.
acrpe.throttle.limitPerHour (optional)
Maximum number of incoming HTTP requests over a period of one hour. By default, this parameter specifies no limit.
acrpe.throttle.limitPerDay (optional)
Maximum number of incoming HTTP requests over a period of one day. By default, this parameter specifies no limit.
acrpe.throttle.limitPerWeek (optional)
Maximum number of incoming HTTP requests over a period of one week. By default, this parameter specifies no limit.
rptFiles.defaultDir (optional)
Default sub-directory for storing Crystal Report (.RPT) files stored in the file system and defined by a prtFiles-type Gradle dependency. The sub-directory is relative to the "acrpe" configuration sub-directory in the root of the built archive. This parameter has an alphanumeric value. This parameter is "rptFiles" by default.
rptArtifacts.defaultDir (optional)
Default sub-directory for storing CrystalReportsCloud or CrystalReportsWeb Adelia object artifacts (from an Adelia application area-based or component-based build) defined by an rptArtifacts Gradle dependency. The sub-directory is relative to the "acrpe" configuration sub-directory in the root of the built archive. This parameter has an alphanumeric value. This parameter is "rptZip" by default.
acrpe.delegatePrinting (optional)
Used to delegate printing to the hawrite64 utility. In this delegation mode, the report is first of all exported to a file in PDF format, then the latter is printed by the hawrite64 utility and its pdfium module.
The "Y" value delegates printing and the "N" value does not delegate it. By default: "N".
Repository manager settings
Artifact repositories are used during the following phases when executing an Adelia ACRPE build:
In the ZIP file creation phase, the build uses a repository to download (download repository) the artifacts required to build the ACRPE application artifact. These artifacts are:
the ACRPE runtime artifacts required to execute an Adelia ACRPE application,
your own Adelia object artifacts comprising your ACRPE application: these are generated by the execution of an Adelia build project.
In the final build artifact storage phase, a repository can be defined to transfer (upload repository) this versioned artifact. The associated repository can be defined depending on the version type (release or snapshot).
downloadArtifactsReleaseRepo (mandatory)
Access URL to the download repository of the dependent artifacts needed for the build. This repository should make it possible to access:
Hardis repository artifacts (Adelia ACRPE runtime),
your own Adelia object artifacts comprising your ACRPE application. The artifacts are those in the release version if you perform a build of your ACRPE application in the release version.
By default, and by way of example only, the value of this parameter is the URL of the repository provided by Hardis.
In its place, in your Nexus, you need to create your own private repository so the Hardis repository and your private repository are grouped together in the release version. Depending on your own Nexus configuration used for your Adelia build projects, it is either the repository created by default by Nexus and called "Releases", or another "hosted repository" with a "Repository policy" set to Release and created by ) you.
To do this, after logging in to Nexus, in the "Repositories" view, add a new repository defined as a group of repositories described above:
- Open the repository definition window via the "Add repository group" command,
- From the "Available Repositories" section, add, in the "Ordered Group Repositories" section, the private repository which is a proxy of the Hardis repository as well as the private "hosted" repository used to store your artifacts in release version.
To finish, replace the downloadArtifactsReleaseRepo parameter value with the "Repository Path" URL of the newly created group repository.
downloadArtifactsReleaseRepo.username / downloadArtifactsReleaseRepo.password (optional)
User profile and password used to connect to the download repository.
By default, and by way of example, these identifiers are those of the Hardis download repository but they need to be replaced by those of your own group private repository (see downloadArtifactsReleaseRepo above). As you access this repository in read-only mode, Nexus authorizes an anonymous connection: in this case, leave the "username" and "password" fields blank.
downloadArtifactsSnapshotRepo (optional)
Access URL to the download repository of the dependent artifacts needed for the build. This repository should make it possible to access:
Hardis repository artifacts (Adelia ACRPE runtime). These artifacts are only available in the release version,
your own Adelia object artifacts comprising your ACRPE application. These artifacts are those of the snapshot version if you are building your ACRPE application in the snapshot version.
In your Nexus, you need to create your own private repository so the Hardis repository and your private repository are grouped together in the snapshot version. Depending on your own Nexus configuration used for your Adelia build projects, it is either the repository created by default by Nexus and called "Snapshots", or another "hosted repository" with a "Repository policy" set to Snapshot and created by ) you.
To do this, after logging in to Nexus, in the "Repositories" view, add a new repository defined as a group of repositories described above:
Open the repository definition window via the "Add repository group" command,
From the "Available Repositories" section, add, in the "Ordered Group Repositories" section, the private repository which is a proxy of the Hardis repository as well as the private hosted repository used to store your artifacts in snapshot version.
To finish, replace the downloadArtifactsSnapshotRepo parameter value with the "Repository Path" URL of the newly created group repository.
downloadArtifactsSnapshotRepo.username / downloadArtifactsSnapshotRepo.password (optional)
User profile and password used to connect to the download repository. This profile should enable you to access your own private group repository (see downloadArtifactsSnapshotRepo above). As this repository is accessed in read-only mode, Nexus authorizes an anonymous connection: in this case, leave the "username" and "password" fields blank.
uploadArchivesReleaseRepo (optional)
Access URL to the upload repository used to store the ZIP artifact built with a release version. This repository enables the artifacts to be made available in the final version.
uploadArchivesReleaseRepo.username / uploadArchivesReleaseRepo.password (optional)
User profile and password used to connect to the artifact upload repository in the release version.
uploadArchivesSnapshotRepo (optional)
Access URL to the upload repository used to store the ZIP artifact built with a snapshot version. This repository enables the artifacts under development to be made available.
uploadArchivesReleaseRepo.username / uploadArchivesReleaseRepo.password (optional)
User profile and password used to connect to the artifact upload repository in the snapshot version.
Configuring components of the Adelia ACRPE application to build
These components are Adelia object artifacts generated by the execution of an Adelia build project, or Adelia objects resulting from an interactive generation.
They need to be declared in the Adelia ACRPE build project so they can be added to the produced ZIP.
To do this:
Open the build.gradle file with a text editor, then,
in the "dependencies" section (Declare your artifacts needed to build the ACRPE application here), declare your artifacts.
Artifacts generated by the build
An artifact (CrystalReportsCloud or CrystalReportsWeb) is included in the "acrpe" configuration sub-directory of the produced archive (the default sub-directory is the rptArtifacts.defaultDir property value, or "rptZip" if it is not entered).
These artifacts must be declared by inserting the following instruction:
rptArtifacts group: '<artifact group name>', name: '<artifact file name without version>', version: '<artefact version number>', ext: 'zip'
A destination sub-directory of the declared artifacts can be forced by inserting the following instruction:
rptArtifacts (group: '<artifact group name>', name: '<artifact file name without version>', version: '<artefact version number>', ext: 'zip') {
ext.destinationDir = 'mySubDirForZip'
}
Example of declaration of artifact generated by an application area-based build:
For the CrystalReportsCloud-type artifact with the file name myapp-app_area_1_crystalreportscloud-1.1.0-SNAPSHOT.jar, enter rptArtifacts group:'my.company', name: 'myapp-app_area_1_crystalreportscloud', version: '1.1.0-SNAPSHOT', ext: 'zip'.
The group value is that of the "group" setting in the gradle.properties file of the Adelia build project which built the artifact.
Example of declaration of an artifact generated by a component-based build to the 'rptCloudEvent' sub-directory:
For the CrystalReportsCloudEvent-type artifact with the file name prefix_compo_1_crystalreportscloudevent-1.1.0-SNAPSHOT.jar, enter:
rptArtifacts (group:'my.company', name : 'prefix_compo_1_crystalreportscloudevent', version: '1.1.0-SNAPSHOT', ext: 'zip') {
ext.destinationDir = 'rptCloudEvent'
}
The group value is that of the "groupId" setting of the component which generates the artifact.
Zip artifact and FromDirs property
The sub-directories to search in the artifact's Zip file can be specified to the ACRPE. To do this, you need to declare the artifact by inserting the following instruction:
rptArtifacts (group: '<artifact group name>', name: '<artifact file name without version>', version: '<artefact version number>', ext: 'zip') {
ext.fromDirs = ['SearchRPTIntoZipfromThisSubDir1', 'SearchRPTIntoZipfromThisSubDir2/morePreciselyHere']
}
The "fromDirs" property contains the list of sub-directories to search.
Adelia objects
To package the Adelia objects (.RPT files) resulting from interactive generation in the built archive, the following instruction needs to be inserted:
rptFiles fileTree('<Adelia objects generation path>')
The path can be absolute (e.g. 'C:/my/rpt/generation/directory') or relative in relation to the Gradle build project directory (e.g. './my/rpt/generation/subDirectory') .
All the objects contained in this directory (as well as the sub-directories) will be copied into the "acrpe" configuration sub-directory of the produced archive (the default sub-directory is the rptFiles.defaultDir property value, or "rptFiles" if it is not entered).
A destination sub-directory of the declared objects can be forced by inserting the following instruction:
rptFiles (fileTree('<Adelia objects generation path>')){
ext.destinationDir = 'mySubDirForRptFiles'
Configuration files for the Adelia ACRPE application to build
By default, a number of configuration files are delivered with this template. These files are described in the following table:
File name | Path in built archive | Path in the Adelia AMBSS build project | Comment |
ACRPE.config | ZIP\acrpe\ACRPE.config | <ACRPE build project>\templates\ACRPE.config |
This configuration file is automatically produced when executing the Gradle build of the project from the gradle.properties file parameters (acrpe.port, acrpe.throttle.*) and declarations of rptFiles and rptArtifacts dependencies in the build.gradle file.
Executing an Adelia ACRPE build project
List of Gradle tasks for Adelia ACRPE build
build
Application ZIP artifact build task. This is placed in the "build\distributions" sub-directory of the build project.
clean
Task used to delete objects created when running the build task (the "build" and "acrpe" sub-directories are deleted).
publish
This task transfers the built artifact (by calling the to the upload repository.
You must specify the uploadArchivesReleaseRepo or uploadArchivesSnapshotRepo key, depending on the artifact version type.
publishToMavenLocal
This task is used to transfer the built artifact to the machine's local Maven repository (%USERPROFILE%\.m2 repository).
Structure of the produced archive
The custom ZIP archive has the following structure:
- "bin" directory: contains a script for starting the application as well as the ACRPE runtime,
- "acrpe" directory: contains the ACRPE.config configuration file (enabling the application configuration to be externalized). In addition, according to the Gradle dependencies configuration (rptFiles and/or rptArtifacts), this directory may contain sub-directories containing the binaries of the Crystal Report files to execute ("rptFiles" and "rptZip" directories by default).
Startup scripts
- The startup.bat script for starting the ACRPE in console mode is automatically generated in the archive's "bin" sub-directory. It is used to start the ACRPE_console.exe console application with the "-cfgdir" option, which points to the ACRPE.config configuration file in the "acrpe" sub-directory. This script starts without parameters.
The startup_x86.bat script for starting the ACRPE in console mode is automatically generated in the archive's "bin" sub-directory. It is used to start the ACRPE_console_x86.exe console application with the "-cfgdir" option, which points to the ACRPE.config configuration file in the "acrpe" sub-directory. This script starts without parameters.
The startup_x64.bat script for starting the ACRPE in console mode is automatically generated in the archive's "bin" sub-directory. It is used to start the ACRPE_console_x64.exe console application with the "-cfgdir" option, which points to the ACRPE.config configuration file in the "acrpe" sub-directory. This script starts without parameters.