Gld Extension Development: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 57: Line 57:
* Initialize the 'main' module.
* Initialize the 'main' module.
** Use this [[gld Extension Main Module pom.xml|pom.xml]] sample as template.
** Use this [[gld Extension Main Module pom.xml|pom.xml]] sample as template.
** Create the source root (src/main/java/io/novaordis/gld/extensions/jboss/datagrid)
** Create the source root (src/main/java/io/novaordis/gld/extensions/jboss/datagrid). It is important that "io.novaordis.gld.extensions." prefixes the package name.
** Create the test root (src/test/java/io/novaordis/gld/extensions/jboss/datagrid)
** Create the test root (src/test/java/io/novaordis/gld/extensions/jboss/datagrid)
* Initialize the 'release' module.
* Initialize the 'release' module.

Revision as of 20:36, 19 January 2017

Internal

Overview

Extensions are developed independently of the core, which include API and the load driver. Once a new core version has been released, the extensions that wish to use it should update their <gld.api.version>...</gld.api.version> in the topmost POM.

To get to the work area of an extension (jboss-datagrid-7 in this case):

cdgldjdg7
cd projects/gld/extensions/<extension-name>
release snapshot

The above will build the extension and install it in $RUNTIME_DIR/gld/extensions. For more details about the release process, see The Release Process below.

Extension Name

The extension name, as described in the gld Concepts - Extension Name section, must be specified as the "extension.name" property in the extension project POM:

<project ...>
    ...
    <properties>

        <extension.name>jboss-datagrid-7</extension.name>

        ...
    </properties>
   ...
</project>

The POM "extension.name" property is the authoritative source of information for extension name, and it will be inferred from it everywhere extension name is necessary. For consistency, it is recommended that the extension top-level directory of the extension project has the same name as "extension.name".

Extension Version

Use a variant of the procedure described here Nova Ordis Utilities Version Metadata Handling, with the difference that the resource file has an extension-specific name (example: "jboss-datagrid-7-extension-version") and call VersionUtilities.getVersion(<extension-specific-resource-file-name>) instead.

New Extension

  • Create the project root directory under git@github.com:NovaOrdis/gld/extensions.
  • The directory name should follow the guidelines exposed here.
  • Start from the following pom.xml.
  • Update the following:
    • The <name>.
    • groupId/artifactId/version.
    • The "extension.name" property, It should follow the guidelines exposed here and ideally should be identical with the name of the project root directory.
    • Various dependency versions.
    • Repositories, if specific repositories are necessary.
  • Create the 'main' and 'release' directories.
  • Initialize the 'main' module.
    • Use this pom.xml sample as template.
    • Create the source root (src/main/java/io/novaordis/gld/extensions/jboss/datagrid). It is important that "io.novaordis.gld.extensions." prefixes the package name.
    • Create the test root (src/test/java/io/novaordis/gld/extensions/jboss/datagrid)
  • Initialize the 'release' module.
    • Use this pom.xml sample as template.
    • Initialize src/assembly/release.xml using the sample available here.
  • Convenience aliases (cdgldjdg7)
  • Create the IntelliJ IDEA project:
    • The root of the project should be the project directory name. There will be an independent IntelliJ IDEA project per extension.
    • Project Name: "GLD Extension for JBoss Data Grid 7"
  • Code:
    • io.novaordis.gld.extensions.jboss.datagrid.JBossDatagrid6Service extends CacheServiceBase.
  • Release infrastructure:
    • main/src/main/resources/jboss-datagrid-7-extension-version, with the following content: version=${project.version}.
    • release/src/main/bash/.install. Template available here: .install.
    • .nort/project.yml.
  • Version reporting: taken care automatically if the above infrastructure is put in place.

The Release Process

An extension source tree is completely independent of core. The only relationship is the API version specified in the extension's POM file.

The release process should be as simple as:

release snapshot|minor|...

nort will install the extension into the local gld deployment. The location of the installation directory can be configured in <extension-name>/.nort/project.yml, as "install/installation.directory".