Skip to main content
Skip table of contents

Java Development: Build Tasks

The DevKit contains gradle and some prepared gradle build scripts for you to build your library:

image-20241106-142038.png

Some of the scripts are just helper scripts or present for compatibility reasons. The following scripts are relevant in the context of this topic:

Script

Description

build

Triggers the complete build process.

Use this script if you want to build the complete library from the source code. It assembles and tests the project (unit tests), generates a ZIP file, and sends it to your PAS system to get the xlib file in return.

The xlib file then is stored to build/distributions.

buildXlib

Triggers the build process without performing the unit tests.

Use this script if you do not need to perform the unit tests.

publishXlib

Triggers the complete build process, and publishes the library to the asset repository of your PAS system.

Use this script if you want to publish your library to your PAS system directly after building it. If the library has already been build separately, publishXlib will know that and only publish it.

clean

Triggers a cleaning of the build cache.

Some stages are cached during the build process. A new xUML project ID will be used. Use this script if you are experiencing build errors you cannot find a reason for.

Before triggering a build, configure the gradle settings as described below.

gradle Settings

You can configure gradle via the file gradle.properties. Apart from some general settings, this file mainly configures access to the Git repository (if applicable) and to the asset-repository-service of your PAS installation.

Generally, you should use local.properties to configure authentication related project settings, see Java Development: Setting-up the Development Project. The local properties override the gradle properties for this very project.

You should never add any credentials to the gradle.properties or_local.properties. These files are designated to be checked into Git.

Library Configuration and PAS Access

The build process needs access to your PAS installation, because it uses the asset-repository service to transform the project ZIP file to an xlib file. Also, you need to provide some settings to be compiled to the library:

Setting

Location

Description

Example

Library Version

xibVersion

gradle.properties

Provide the version of the library. The version will be generated to the library.

1.0.0

Company Name

companyName

gradle.properties

Provide your company name to be added to the MANIFEST.MF.

ACME Corp.

PAS Base URL

pasBaseUrl

gradle.properties

Specify the base URL of your PAS system.

https://acme.saas.pas-cloud.com/pas

PAS Credentials

oauthUsername
oauthPassword

local.properties

Provide valid credentials of your PAS system for the library build.
The user must be a designer developer as described on Defining a Profile Set for Standard Users in the Administration guide.

If you do not want to save your credentials to a file, you can leave the credentials empty. The build process will then prompt you with a popup to enter your password.
Limitation: This does not work in the Windows Command Prompt.

Asset Publication

If you want to publish your library to the asset repository of your PAS instance using the pubishXlib script, you need to provide some details regarding the asset:

Setting

Location

Mandatory

Description

Example

Asset Namespace

xlibNamespace

gradle.properties

(tick)

Specify the namespace you want the library to be published to.

shared

Asset Maintainer

xlibMaintainer

gradle.properties

(tick)

Specify the email address of the library maintainer.

meredith.mitchell@acme-corp.com

Asset Summary

xlibSummary

gradle.properties

Specify the summary for the library.

This library ...

Asset Tags

xlibTags

gradle.properties

Specify a comma separated list of tags for your library.

word, docx, generate

All Configurations Overview

Setting

Description

Example

Project Settings

xlibVersion

Provide the version of the library. The version will be generated to the library.

The version of the service must follow Semantic Versioning 2.0.0: Major.Minor.Patch. A pre-release tag is optional. A version numbering that deviates from this will lead to errors.

1.0.0

uploadTimeoutSeconds

Specify an upload timeout in seconds (default is 150). You can increase this value in case you run into timeouts frequently, e.g. for big projects or slow PAS systems.

150

org.gradle.jvmargs

Specify JVM configurations for gradle. You can use this to increase your Java heap space if necessary.

-Xmx1G

PAS System Settings

companyName

Provide your company name to be added to the MANIFEST.MF.

ACME Corp.

pasBaseUrl

Specify the base URL of your PAS system. This is needed during the build process to get the xlib file from the project ZIP via the asset repository service. Authentication is granted by username and password, see oauthUsername and oauthPassword below.

https://acme.saas.pas-cloud.com/pas

xlibNamespace

Specify the namespace you want the library to be published to. Used with the publishXlib script.

shared

xlibMaintainer

Specify the email address of the library maintainer. Used with the publishXlib script.

meredith.mitchell@acme-corp.com

xlibSummary

Specify the summary for the library. Used with the publishXlib script.

This library ...

xlibTags

Specify a comma separated list of tags for your library. Used with the publishXlib script.

word, docx, generate

oauthUsername

Provide a valid username of your PAS system. This user must be a designer developer as described on Defining a Profile Set for Standard Users in the Administration guide.

meredith.mitchell

oauthPassword

Do not specify this value here but configure this in the local.properties (see Java Development: Setting-up the Development Project).

 

projectResource

Provide the API path to the project within the asset-repository service. This path is relative to the PAS base URL (pasBaseUrl).

Do not change this setting. This only needs to be changed if required by a PAS update.

api/asset-repository-service/compiler/rest/project

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.