Skip Navigation

Configure automated builds for a
BlackBerry UEM
plug-in

After you set up a development environment for a
BlackBerry UEM
plug-in and make the projects available in a code respository, you can configure an automated build process.
  • Obtain the latest project code and file structure from the code repository. This should place the files in a project root folder, for example, C:\example_plugin.
  • In the project root file path (for example, C:\example_plugin), open the
    version.properties
    file and specify the DEV_VERSION major, minor, and patch version numbers (integer values) that you want to use for the build process. To specify a fourth version number within the plug-in version string, set the BUILD_VERSION variable in your build system or command line environment for a command line plug-in build. To set the value for an
    Eclipse
    build, set a
    Windows
    environment variable. The build script combines these values with a generated build number and passes it as build.version on the command line.
  • To publish build products to an artifact repository, in the project root file path, open the
    build.gradle
    file and modify it to specify the credentials, publication, and repository values required to publish to your artifact repository. The following example uses the Nexus repository manager:
    //----------------------------------------------------------------------- // Main distribution //----------------------------------------------------------------------- publishing { // Define repositories to publish to repositories { maven { credentials { username System.getProperty('NEXUS_USER') password System.getProperty('NEXUS_PASSWORD') } // The following URL is a sample of what can be dynamically constructed. // Java or Groovy expression, can change as needed: url 'http://' + System.getProperty('NEXUS_REPO') + '/nexus/content/repositories/releases/' } } // Define publications to publish publications { zip(org.gradle.api.publish.maven.MavenPublication) { groupId snapinId // like "com/company/platform/mdm/mycomponent" +$build.branch artifactId artifactId // component name version componentDevelopmentVersion // version string, from $build.version artifact zip { classifier "snapin" // Sample only, hard-coded constant can be used } } } }
    After this information is added, a new set of build tasks is available with names generated based on this template: publish
    <PublicationName>
    PublicationTo
    <RepositoryName>
    Repository. For example, publish
    Zip
    PublicationTo
    Maven
    Repository can be invoked during a build to upload the publication to Nexus.
    In the
    BlackBerry UEM Integration SDK
    version 12.8, some plug-in build instructions have been removed from the plug-in build.gradle file and are now handled by the SDK build tooling. If you are upgrading from the SDK for
    UEM
    12.7 to the SDK for
    UEM
    12.8 or later, this change has two implications:
    • Importing a plug-in into your
      Eclipse
      environment with the 12.8 SDK will fail
    • The plug-in standalone build process will fail
    To correct this issue, remove the following build instructions from the plug-in build.gradle file: snapinManifest, translations, zip. If you import an existing plug-in with UI and Core launchers and integrate it with a new
    UEM
    instance, you may need to regenerate the UI and Core server launchers.
  • Open the command prompt as an administrator, change the directory to the project root folder, and run the following command:
    g buildPrerequisitesWithSdk
    This command creates a
    build-prerequisites-with-sdk.zip
    file in a "dist" folder at the project root. The .zip file contains the prerequisites that are required to build a
    UEM
    plug-in. Publish
    build-prerequisites-with-sdk.zip
    to a location where the automated build system can retrieve it. Note that whenever you upgrade
    UEM
    or get a new version of the
    UEM Integration SDK
    , you must recreate
    build-prerequisites-with-sdk.zip
    and publish it again.
Configure your automated build system to do the following:
  1. Create a "build" folder in
    <project_root>
    \buildsys\. Unpack
    build-prerequisites-with-sdk.zip
    into
    <project_root>
    \buildsys\build\.
  2. Change the directory to
    <project_root>
    \buildsys\build\sdk\tools and invoke
    g initLocal
    .
  3. Change the directory to the project root and invoke
    g zip
    to build the plug-in.