Configure automated builds for a BlackBerry UEM plug-in
BlackBerry UEM
plug-inAfter 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 theversion.propertiesfile 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 anEclipsebuild, set aWindowsenvironment 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 thebuild.gradlefile 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, publishZipPublicationToMavenRepository can be invoked during a build to upload the publication to Nexus.In theBlackBerry UEM Integration SDKversion 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 forUEM12.7 to the SDK forUEM12.8 or later, this change has two implications:
- Importing a plug-in into yourEclipseenvironment 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 newUEMinstance, 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 buildPrerequisitesWithSdkThis command creates abuild-prerequisites-with-sdk.zipfile in a "dist" folder at the project root. The .zip file contains the prerequisites that are required to build aUEMplug-in. Publishbuild-prerequisites-with-sdk.zipto a location where the automated build system can retrieve it. Note that whenever you upgradeUEMor get a new version of theUEM Integration SDK, you must recreatebuild-prerequisites-with-sdk.zipand publish it again.
Configure your automated build system to do the
following:
- Create a "build" folder in<project_root>\buildsys\. Unpackbuild-prerequisites-with-sdk.zipinto<project_root>\buildsys\build\.
- Change the directory to<project_root>\buildsys\build\sdk\tools and invokeg initLocal.
- Change the directory to the project root and invokeg zipto build the plug-in.