Products Downloads


French version


 

Component approach to an Adelia application

 

An application is a set of software components (or modules) with shared characteristics, providing and using services (functions, procedures, types, etc.). A software component is a logical representation of the application.

 

In Adelia, an application is defined in an environment containing all of its objects.

To create it, these objects need to be grouped in one or more components: a component is an Adelia object which is used as a functional container for Adelia binary objects (programs, classes, error messages, reports, etc.) constituting the processes.

A functional dependency can also be defined between two application components.

 

When the application's binary objects are built, each component is converted into an artifact. An artifact is a deliverable used in a particular version of the application. Lastly, each versioned artifact is saved in a repository via a delivery manager. The role of this repository is to centralize and version all artifacts produced by developers.

 

The functional division of an application into Adelia components as well as the maintenance of these components is carried out via the Adelia  Build component manager utility.

This is started from the Adelia Studio window by selecting Selection > Utilities > Build components in the menu bar.

 

↑ Top of page


Adelia objects and related artifacts

 

Each Adelia component contains a set of objects of different types (programs, error messages, reports, resources, classes, etc.).

Similarly, when the application is built, each generation platform type produces different types of binary objects. The artifact generation process therefore depends on:

  • the Adelia component,

  • the Adelia object type,

  • the generation platform type.

 

Each artifact contains the binary objects produced by generating objects of the same type, in the same component, with the same visibility, for the same generation platform.

 

The application build process supports the following Adelia object types:

Program objects with the source types:

  • Adelia,

    • SAdelia (Adelia server),

    • VAdelia (Visual Adelia Batch and Interactive),

    • WAdelia (Adelia Web Batch and Interactive)

  • Class objects,

  • Web service objects:

    • DOCUMENT,

    • DOCUMENT_JAXWS,

    • REST

  • Crystal Reports Report objects,

  • Error Message objects.

 

The application build process supports the following generation platforms:

  • Windows,

  • Java (Standard and Cloud),

  • AS400

 

Generated artifact types:

Artifact type

Content

Container file type

As400Adelia

Contains the binary objects produced during AS400 generation of Adelia Interactive and Batch programs

ZIP file containing a SAVF file for an AS400 library

As400Server

Contains the binary objects produced during AS400 generation of SAdelia programs and the server parts of VAdelia programs

ZIP file containing a SAVF file for an AS400 library

Cloud

Contains the binary objects produced during Cloud (Java) generation of the client parts of VAdelia programs

JAR file containing Java .class files and other resource files

CloudSelenium

Contains the binary objects – used when executing Selenium test scenarios - produced during Cloud (Java) generation of VAdelia Interactive programs

JAR file containing Java .class files

CrystalReportsCloud

Contains the Crystal Reports report templates produced during Cloud generation of VAdelia Batch programs with reports.

ZIP file containing the .RPT files for the Crystal Reports templates

CrystalReportsWeb

Contains the Crystal Reports report templates produced during Java generation of WAdelia Batch programs with reports.

ZIP file containing the .RPT files for the Crystal Reports templates

JavaClient

Contains the binary objects produced during Java generation of the client parts of VAdelia programs

JAR file containing Java .class files and other resource files

JavaServer

Contains the binary objects produced during Java generation of SAdelia programs and the server parts of VAdelia and WAdelia programs

JAR file containing Java .class files and other resource files

Pojo

Contains the binary objects produced during Java generation of Class objects

JAR file containing Java .class files and other resource files

Web

Contains the binary objects produced during Java generation of the client parts of WAdelia programs

JAR file containing Java .class files and other resource files

WinClient

Contains the binary objects produced during Windows generation of the client parts of VAdelia programs

ZIP file containing .exe and .dll files

WinServer

Contains the binary objects produced during Windows generation of SAdelia programs and the server parts of VAdelia and WAdelia programs

ZIP file containing .exe and .dll files

WSRest

Contains the binary objects produced when REST Web Services (Java) are generated for VAdelia Batch programs

JAR file containing Java .class files and other resource files

WSSoapAar

Contains the binary objects produced when DOCUMENT Web Services (Java) are generated for VAdelia Batch programs

AAR file containing Java .class files and other resource files

WSSoapJar

Contains the binary objects produced when DOCUMENT_JAXWS Web Services (Java) are generated for VAdelia Batch programs

ZIP file containing .jar files

Table 1: List of artifact types produced by an Adelia build project

↑ Top of page

 

 

The Gradle automatic artifact builder

 

Gradle (https://gradle.org/) is an open-source build tool, like Ant and Maven.

These tools are designed to automate IT project building, using a process that can be broken down into a number of tasks, the main steps in which are described below:

  • The resource files are prepared, for example by adjusting the property files to suit the target environment (e.g. development, approval or production environment),

  • The sources are then compiled (Java, C, C++, etc.),

  • These tasks are then executed for the resources and source code of the unit tests,

  • The unit tests are then run for the project,

  • Lastly, the deliverables (JAR, WAR, EAR, ZIP, etc.) are created, containing the project's binary objects and resources.

 

In addition to these tasks, other tasks may be required, such as:

  • Deploying the generated deliverable, either in a general repository or on an application server (Tomcat, Glassfish, etc.),

  • Creating code quality reports ( Sonar , Checkstyle , Cobertura , PMD , FindBugs , JUnit , etc.),

  • Generating and deploying the project site.

 

Gradle can be used to define tasks (and related processes) in a declaratory approach, using a language based on Groovy. A task is defined by:

  • its name,

  • its type (e.g. Compile, Zip, Jar, Copy, JavaDoc, ProcessResources, Test, etc.),

  • its input data/output data (e.g. typed value, file, directory, outputs from another task, etc.),

  • its configuration (e.g. source directory, target directory, compilation options, etc.),

  • any dependencies on other tasks,

  • additional processes other than the default processes defined by the task type.

 

Together, these tasks form a Gradle project and are declared in a build.gradle file.

It is possible to specify a set of properties and constants for the project, in the gradle.properties file.

 

Gradle provides a range of plugins enabling users to expand the basic model.

Each plugin adds a specific set of tasks (for example, a Java plugin to compile, test and package Java sources, Maven to implement support for publishing artifacts in Maven-compatible repositories, objective-c to compile Objective-C sources and package native libraries, etc.).

 

Gradle build projects are executed by running the highest-level task via the gradle taskName command line.

To process this task, Gradle:

  1. calculates the dependency matrix of the tasks to be executed (the highest-level task generally defines a set of subtasks as a means of defining modular processes),

  2. executes each task in the matrix. If a task returns an error, the build is stopped.

 

While executing a task, Gradle manages a cache containing its inputs: if the input data is identical to the inputs for the previous execution and the outputs are unchanged, the task is considered to be up to date (upToDate). None of the processes associated with the task are performed.

 

The following example features a number of Gradle command line entries:

Command line

Description

gradle help

Shows help in the Gradle help console (executes the task named help).

gradle tasks

Lists the descriptions of all tasks defined in the build project.

gradle --help

Displays the full list of Gradle execution options.

gradle task1 task2

Executes the task named task1 and then the task named task2, in that order. If task1 generates an error, task2 will not be executed.

gradle build uploadArchives

In a project using the Java and Maven plugins, this command line entry builds (via the build task) a JAR archive from Java source files, and makes this deliverable available in a repository (via the uploadArchives tasks).

 

Note: In the rest of the Help, Gradle command line examples use the gradlew command.

Using the gradle command requires the Gradle tool to be installed manually, whereas the gradlew command (supplied in Adelia Studio) performs a silent installation the first time the Gradle tool is used.

↑ Top of page

 

Adelia build by components prerequisites

A number of hardware and architecture constraints apply when executing an Adelia build.

 

Build workstation prerequisites

The following conditions must be satisfied:

  • Adelia Studio must be installed, with the compilation server option (a default installation option), on the workstation running the Adelia build,

  • The compatible Adelia environment databases include all database management systems supported by Adelia, with the exception of Access, which does not allow multiple parallel accesses,

  • The workstation must have JDK 1.8 installed. 
    Caution: from Adelia Studio version 14 onwards, the JAVA_HOME system variable is no longer entered. This variable needs to be set to enable Gradle to run properly.

 

Continuous integration architecture prerequisites

The Adelia build operation is part of a broader continuous integration approach.

 

This approach requires delivery managers to be used, to centralize access to and storage of artifacts in repositories. When executing an Adelia build, these repositories are used in two different ways:

  1. During the binary object construction phase, the Adelia runtime artifacts required for the compilation operation are retrieved from the (external or remote) Hardis repository,

    Furthermore, if the component being built depends on a component which is already build, a repository is used to retrieve the binaries required for the build. The repository is usually the one defined for phase 2.

  2. During the Adelia build completion phase, a (personal or local) repository is used to store the built artifacts.

 

Delivery managers compatible with Maven must be used for this purpose, such as Nexus (https://www.sonatype.com/nexus-repository-oss) or Artifactory (https://www.jfrog.com/artifactory/).

 

Nexus Sonatype is used in the remainder of this documentation.

 

To simplify the architecture, it is possible to use a single delivery manager, which can be configured to be compatible with both types of repository used during the aforementioned two phases.

 

Upon installing Nexus, the following repositories are available by default, accessible via the "Repositories" view:

  • The repository named "Central", defined as a gateway (or proxy) to the remote "Maven Central" store: this repository contains a vast array of open-source artifacts (including the artifacts used by the Adelia runtime),

  • The repository named "Releases", defined as a local repository in which to store the release version of artifacts,

  • The repository named "Snapshots", defined as a local repository in which to store the snapshot version of artifacts.

 

In this view, a new repository must be added, defined as a proxy for the Hardis remote repository:

  • Open the repository definition screen via the "Add proxy repository" command,

  • In the "Remote storage location" section, enter the URL https://pid.hardis.fr/nexus/content/groups/HardisISV/ ,

  • Click "Authentication (optional)" and enter the values "adelia" and "readonly" (Hardis repository login details) in the "Username" and "Password" fields,

  • During the Adelia build project configuration phase, the value of the downloadArtifactsRepo key in the gradle.properties file must be replaced with the "Repository Path" URL of the newly-created gateway repository.

 

Similarly, there are two ways to define the local repositories in which to store the built artifacts:

  • Either use the two predefined repositories named "Releases" and "Snapshots",

  • Or add two new local repositories (using the "Add hosted repository" command).
    The repository in which the release version of artifacts will be stored must have its "Repository policy" field set to "Release"; the corresponding field in the repository for snapshot versions must be set to "Snapshot".

 

In both cases, during the Adelia build project configuration phase, the values of the uploadArchivesReleaseRepo and uploadArchivesSnapshotRepo keys in the gradle.properties file must be replaced with the values of the "Repository Path" field of the release and snapshot repositories, respectively.

 

By default, Nexus sets the login details for these repositories as deployment-  / deployment  (with Write privileges).

 

↑ Top of page


  • Aucune étiquette