This document describes the Gradle DSL extension of the Intershop assembly plugins. The target group of this document are developers who want to extend the provided plugins by introducing own or changing existing functionality. Before starting, you should have knowledge of the following documents:
The plugins, extensions, tasks and types described in this document are available in the
com.intershop.build.gradle:assembly
com.intershop.build.gradle:ish-assembly
components. If you want to make them available in your build script, add the following lines to your build.gradle file :
buildscript { dependencies { classpath 'com.intershop.build.gradle:assembly' classpath 'com.intershop.build.gradle:ish-assembly' classpath 'com.intershop.build.gradle:plugin-tests' } }
Deep Links and Gradle Versions
This document describes Intershop's Assembly Tools in different versions. Information that applies only to a certain version of the tools is clearly marked as such.
Also the document contains deep links into the Gradle's documentation. For technical reasons they always point to Gradle version 1.8. For Assembly Tools version >= 2.0, please refer to the Gradle Build Language Referenc and Javadoc for Gradle version 2.0 instead. Mostly it is enough to substitute the version number in the URL, e.g., change:
http://www.gradle.org/docs/1.8/dsl/org.gradle.api.Task.html
into
Phrase | Meaning |
---|---|
Version Control System (VCS) | Also known as source control, source code management systems (SCM), or revision control systems (RCS). VCS is a mechanism for keeping multiple versions of your files, so that when you modify a file you can still access the previous revisions. |
Artifact Repository | Place, where build and package software components are located. Provide a common interface to a dependency management system. |
Code Analysis | Process to analyze source code to calculate metrics, find bugs, etc. |
Continuous Delivery Pipeline | Sometimes called Deployment Pipeline, describes the stages, which code artifacts runs through source to production system. |
System Component | A software package of different code artifacts and files, that have to be deployed together. |
System Component Set | Is a container for system components, that needs to be build and branched together. |
Assembly | An assembly references one or more system components residing in the same or a configured artifact repository in order to deploy or deliver them together. |
Build Process | Compiles and packages files and code artifacts from a source project to deployable artifacts. |
Publish Process | The process which transfers the deployable artifacts to a configured artifact repository. |
Assembly Process | This process combines several system components to an assembly. |
Deployment Process | This process extracts files and code artifacts from an artifact repository and applies the configuration. |
Project Gradle Distribution | This is a customized Gradle distribution with the preconfigured artifact repositories and Gradle plugins. |
Gradle Plugin | A Gradle plugin packages up reusable pieces of build logic, which can be used across many different projects and builds. |
Project Gradle Plugin | This is a Gradle plugin which contains special corporate respectively project settings. |
Corporate Plugin | The term is used as a synonym for Project Gradle Plugin. |
Gradle Extension Object | Java Bean compliant class holding configurations for Gradle plugins. |
Gradle Wrapper | The Gradle Wrapper is the preferred way of starting a Gradle build. The wrapper is a batch script on Windows, and a shell script for other operating systems. When you start a Gradle build via the wrapper, Gradle will be automatically downloaded and used to run the build. See for more information The Gradle Wrapper in the Gradle documentation (2.11, 2.7, 2.3, 2.0, 1.8) |
Intershop Cluster | A number of hosts of different types serving an Intershop 7. |
Cluster Node | One separately deployable part of an Intershop cluster. A host can run multiple nodes of one Intershop cluster. |
Gradle plugins are reusable pieces of build logic that can be used across many different projects. This section describes the plugins which have been added by Intershop.
com.intershop.build.gradle.plugins.
AssemblyPlugin
Augments Gradle's 'ivy-publish'
plugin so the generated Ivy file matches the constraints of the concept assembly:
If any of the files <project directory>/deploy.gradle or <project directory>/deploy-settings.gradle exists they are added as an artifact.
Attaches the
AssemblyExtension
as property assembly
to the project.
com.intershop.build.
gradle.plugins.
ComponentSetPlugin
(
component-set
)
The plugin allows to define a component set. It creates a simple assembly with all sub projects as dependencies when applied to your project. Additionally, it creates a consolidated test report of all sub projects when running the test task. Upon applying the plugin, the AssemblyPlugin is also applied to the project.
Task Type | Task Name | Description |
---|---|---|
UseSetAsFilter
| useSetAsFilter | Registers the component set version published by this build as version filter in the gradle.properties file in the Gradle User Home. |
ProvideSourceCartridges
| provideSourceCartridges | Registers all components in the set as source cartridges in the gradle.properties file in the Gradle User Home. |
com.intershop.build.assembly.hosttype.HostTypeAssemblyPlugin
Allows to define host-types and environments and their contained components.
The
adds the properties HostTypeAssemblyPlugin
hostTypes
, environments
, initTypes
and cartridges
to the
AssemblyExtension
(see properties list). It also creates the concrete Gradle Configuration
objects for those subset types and for adding the subsets to the assembly's Ivy file. It also creates and registers the associated
ConfigurationFactory
and
InheritedSubsetProvider
objects used when defining assembly inheritance options (see
AssemblyInheritance
) for those subsets. Upon applying the plugin, the AssemblyPlugin is also applied to the project.
For Gradle tools version >= 1.1:
The HostTypeAssemblyPlugin
will configure the AssemblyExtension
to sort all dependencies in the ivy.xml file of the assembly in the following way:
order
of the Cartridges
extension.The order of the ivy.xml file will be used during deployment to define the order of cartridges in <IS_SHARE>/system/cartridges/cartridgelist.properties.
If a file cartridge-order.txt exists in the project directory the contents of this file will be used to fill the property order
, otherwise the property will be empty by default and must be filled otherwise.
com.intershop.build.assembly.IshAssemblyPlugin(ish-assembly)
Applies the
IshAssemblyBuildPlugin
to the project.
com.intershop.build.assembly.IshAssemblyBuildPlugin
Provides tasks for deployment and database handling during the assembly process.
As sensible defaults the IshAssemblyBuildPlugin
creates the default environments production, development, test, the default init type init and the host type for the shared host share. Also it adds standard deployment plugins as assembly dependency.
Attaches the
IshAssemblyBuildExtension
as property assemblyBuild
to the project.
Upon applying this plugin, the
AssemblyPlugin
and
HostTypeAssemblyPlugin
are also applied to the project.
For Gradle tools version 1.0:
When applying this plugin, the order of dependencies of the final assembly will be calculated using a cartridge-order.txt file which specifies the order. See Cookbook - Gradle Assembly Tools for details on how the file has to be structured.
For cartridge ordering in Gradle tools version >= 1.1, see HostTypeAssemblyPlugin
.
Task Type | Task Name | Description | Task Dependencies |
---|---|---|---|
GenerateSettingsGradle
| generateSettingsGradle | Generates a settings.gradle file used for the deployment from the template file and environment specific properties. Task is configured at the
IshAssemblyBuildExtension . | |
GenerateRepositoryGradle
| generateBuildRepositoryGradle | Generates a build-repository.gradle file which contains information about the repository used while deploying . Task is c onfigured at the
IshAssemblyBuildExtension . | |
DeployServer
| deployServer | Deploys a server from the assembly where the task is called. Task is c onfigured at the Arguments: | depends on: generateSettingsGradle generateBuildRepositoryGradle (publish task) finalized by: deployEnvironmentProperties |
DeployServer
| deployCartridges | Deploys all source cartridges into the server. Task is c onfigured at the Arguments:
| depends on: generateSettingsGradle generateBuildRepositoryGradle (publish task) |
Copy
| deployEnvironmentProperties | Deploys the environment properties file (i.e., development.properties, production.properties, etc) in the IS_SHARE/system/config/cluster directory of the deployed server. | |
RunNestedGradle
| undeployServer | Removes all deployed files from the server directory. Task is c onfigured at the
IshAssemblyBuildExtension . | |
CleanDBSchemaTask
| cleanDatabase | Drops all database tables, views and procedures. Task is c onfigured at the Arguments:
| depends on: deployServer |
DBInitTask
| dbinit | Starts a DBInit for the configured init cartridges. Task is configured at the | depends on: deployServer cleanDatabase importBaseDump for Gradle tools version 1.0-1.1 importDbinitBaseDump for Gradle tools version >= 2.0 must run after: configurePlainEncryption |
DBMigrateTask
| dbmigrate | Starts a DBMigrate. Task is configured at the Only for Gradle tools version >= 2.0. | depends on: deployServer cleanDatabase importDBMigrateBaseDump |
ImportDatabaseDumpTask
| importBaseDump | Imports the base database dump to the deployed server's configured database. The base dump is usually the one inherited from another assembly, but may also be configured differently. Task is configured at the Removed and replaced by | depends on: deployServer cleanDatabase |
ImportDatabaseDumpTask
| importDbinitBaseDump | Imports the base database dump for a dbinit to the deployed server's configured database. The base dump is usually the one inherited from another assembly, but may also be configured differently. The dump is configured at the Only for Gradle tools version >= 2.0. | depends on: deployServer cleanDatabase |
ImportDatabaseDumpTask
| importDbmigrateBaseDump | Imports the database dump to import before dbmigrate. The dump is configured at the Only for Gradle tools version >= 2.0. | depends on: deployServer cleanDatabase |
ExportDatabaseDumpTask
| exportDump | Exports the content of the deployed server's database into a local dump file. Task is configured at the
IshAssemblyBuildExtension . Is automatically called upon publishing if the flag
IshAssemblyBuildExtension.releaseWithDump
is set. | depends on: deployServer configurePlainEncryption dbinit if dbmigrate if |
ConfigurePlainEncryption
| configurePlainEncryption | Disables the encryption of database content in IS_SHARE/system/config/cluster/encryption.properties. This is necessary to be able to use the database dump on other systems than the one where it was created. | must run after: deployServer |
UpdateDumpVersionFilter
| updateDumpVersion | Updates the version filter specifying the dump version used when importing a release dump (dump.<project-group>.<project-name> in <gradle-user-home>/gradle.properties file) to the latest release version. | |
ImportDatabaseDumpTask
| importDump | Imports the latest release dump (specified by the dump's version filter, see task updateDumpVersion) to the deployed server's database. | depends on: deployBrandingInstallations updateDumpVersion (if version filter not set) |
Task
| deployBrandingInstallations | Unpacks the branding files delivered together with the release dump to the deployed server. Also see
IshAssemblyBrandingPlugin . | depends on: updateDumpVersion (if version filter not set) |
com.intershop.build.assembly.IshAssemblyBrandingPlugin
(
ish-assembly-branding
)
The plugin adds installed branding packages created during DBInit as artifacts to the assembly. It adds a new task for packaging the branding files which will automatically be called upon publishing the project. Upon applying the plugin, the IshAssemblyBuildPlugin is also applied to the project.
Task Type | Task Name | Description |
---|---|---|
Zip
| packBranding | Bundles the branding artifacts which have been created during DBInit together in a ZIP file. Is automatically published together with the project if released with a database dump. |
This section describes the extension objects which have been added by Intershop to configure the different plugins.
Extension Object
com.intershop.build.gradle.plugins.AssemblyExtension
Extension which contains the configuration of an assembly. Is created by the AssemblyPlugin and contains methods to define assembly inheritance and additional attributes. The extension is registered at the Gradle project.
assembly { inheritFrom('com.intershop.assembly:intershop7') { includeArtifacts type:['deploy-settings-gradle', 'deploy-gradle'] } extraAttributes = [ 'productName': 'Intershop 7', 'copyrightOwner': 'Intershop Communications', 'copyrightFrom': '2005' ] }
Type | Property Name | Description | Default value |
---|---|---|---|
List<AssemblyDependency>
| dependencies | Sorted list of dependencies from each configuration in this assembly. Read-only. | Empty list |
Set<Configuration>
| configurations | Set of dependency configurations of the resulting assembly. | Empty set |
Map<String,String> | extraAttributes | Additional attributes that are added to the <info> header of the assembly's Ivy file. | n/a |
HostTypeAssemblyPlugin
Type | Property Name | Description | Default value |
---|---|---|---|
NamedDomainObjectContainer
<
HostType
> | hostTypes | Collection of host types of this assembly. Also includes inherited host types. | Empty container |
NamedDomainObjectContainer
<
CartridgeType
> | environments | Collection of environments of this assembly. Also includes inherited environments. | Empty container |
NamedDomainObjectContainer
<
CartridgeType
> | initTypes | Collection of init types of this assembly. Also includes inherited init types. | Empty container |
Cartridges
| cartridges | Extension object for including cartridges in or excluding cartridges from certain cartridge type objects (i.e., specific environments or init types). | n/a |
HostTypeAssemblyPlugin
Type | Property Name | Description |
---|---|---|
HostType
| <Name of the host type> | Each host type which has been created in this assembly or which has been inherited from another assembly. |
Environment
| <Name of the environment> | Each environment which has been created in this assembly or which has been inherited from another assembly. |
InitType
| <Name of the init type> | Each init type which has been created in this assembly or which has been inherited from another assembly. |
Return Type | Method Name | Description |
---|---|---|
void | force(Object... moduleVersionSelectorNotations) | Forces the version of one or more dependencies in all subsets and configurations, overriding the version inherited from other assemblies. (No warning or error will occur if the specified module is not included in the assembly.) Parameters:
|
void | requireGradle(Map<String, Object> params) | Sets a Gradle version which this assembly requires (optionally). If not matching, a warning will be displayed during deployment. Parameters:
|
void |
requireJDK(Map<String, Object> params)
| Sets a JDK version and vendor which this assembly requires (optional). If not matching, a warning is displayed during deployment. Parameters:
|
void | sortPerConfiguration(Closure configureClosure = null) | Defines dependency sorting options per configuration (sets). Allows to specify different sorting options for different sets of configurations. Parameters:
|
void | sortByDependencies(Closure configureClosure = null) | Defines dependency sorting by using the dependency graph. Parameters:
|
void | sortByExternalList(File listSource) | Defines dependency sorting by using an external file which specifies the order of dependencies. Parameters:
|
void | inheritFrom(Object assembly, Closure<?> closure = null) | Defines inheritance rules to inherit configurations, dependencies and artifacts from the given assembly. Parameters:
closure- Configuration for the AssemblyInheritance object which defines inheritance options. |
void | registerInheritedSubsetProvider(
InheritedSubsetProvider provider)
| Registers a new provider to retrieve inherited subsets. These providers are used to get configuration-like objects from an inherited assembly (e.g., InheritedHostType, InheritedEnvironment, etc). As each InheritedSubsetProvider is also a ConfigurationFactory, calling this method also calls Parameters:
|
void | registerConfigurationFactory(
ConfigurationFactory factory)
| Registers a new configuration factory. A configuration factory is used to create actual configuration objects from configuration-like objects ( e.g., InheritedHostType, InheritedEnvironment, etc). Parameters: factory- Factory to register. |
For Gradle tools version >= 1.1:
Return Type | Method Name | Description |
---|---|---|
void | sortByList(List<String> order) | Defines dependency sorting by using a list of (unqualified) component names. Parameters:
|
List<String> |
| Returns the unqualified names of the components contained in the given assembly in the order that they appear in the ivy.xml file. Parameters:
|
List<String> | listFromFile(File orderFile) | Reads a list of component names from a given file. The file format is expected as follows:
Parameters:
|
Type
com.intershop.build.assembly.hosttype.Cartridges
Extension which is used to add cartridges to or remove them from certain cartridge types (i.e., environments or init types).
assembly { cartridges { include( 'com.intershop:tools', 'com.intershop:pf_cartridge', // ... in:[development, test, production] ) exclude module:'pf_core_test', from:environments.'test' } }
For Gradle tools version >= 1.1:
Type | Property Name | Description | Default Value |
---|---|---|---|
List<String> | order | List of unqualified cartridge names by which the cartridges in the assemblies ivy.xml file (and through the deployment in the cartridgelist.properties file) are sorted. Each cartridge included in the assembly must appear exactly once in this list, or an exception will be thrown during publishing. | If the file cartridge-order.txt exists in the project directory, listFromFile(file('cartridge-order.txt')) , otherwise an empty list. |
Return Type | Method Name | Description |
---|---|---|
void | include(Map<String, Object> paramMap, Object... paramArray) | Adds the given cartridges to the given cartridge type(s). Parameters:
|
void | exclude(Map<String, Object> params) | Removes the given cartridges from the given cartridge type(s). Also see Parameters:
|
Type com.intershop.build.assembly.IshAssemblyBuildExtension
Extension object which contains Intershop specific assembly properties. The default values for those properties are set in the IshAssemblyBuildPlugin
.
Example for Gradle tools version 1.0-1.1:
assemblyBuild { database { inherit('com.intershop.assembly:intershop7') initCartridges = ['ucm_demo'] } }
Example for Gradle tools version >= 2.0:
assemblyBuild { dbinit{ importFrom('com.intershop.assembly:intershop7') initCartridges = ['ucm_demo'] } dbmigrate { importFrom('com.intershop.assembly:primetech:7.4.6.1.+') } }
Type | Property Name | Description | Default value |
---|---|---|---|
File | serverDirectory | Directory where the server is deployed into. | Project property serverDirectory or, if not set, <build-directory>/server. |
File | environmentProperties | File which contains environment properties used when deploying the server from an assembly. | Project property buildEnvironmentProperties or, if not set, <project directory>/environment.properties file. |
File | javadocDirectory | Directory where the JavaDoc files will be deployed into. | Project property javadocDirectory or, if not set, <build-directory>/javadoc. |
String | bootstrapVersion | Version number of the deployment-bootstrap plugin used in the generated settings.gradle file for the deployment. | Module version of the deployment-bootstrap dependency of the assembly. |
String | publicationName | Name of the publication used when publishing the project. This is not the publication used when the assembly is published into the local or release repository, but rather the one used for deploying the server before generating the database dump file. | buildAssembly |
String | publicationRevision | Revision number of the build publication (see publicationName). | build |
String | repositoryName | Name of the (local) repository used for deploying the server from the assembly. | build |
String | repoUrl | URL to the repository used for deploying the server from the assembly. | <build-directory>/build-repo |
String | repoPattern | Pattern describing the structure of the repository used for deploying the server from the assembly. | [organisation]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext] |
String | assembly | Assembly module version identifier used in the generated settings.gradle file for the deployment. Read-only. | <project-group>:<project-name>:<publicationRevision> |
String
|
environment
| Type of environment which will be deployed (by default either production, development or test). Read-only. | Property with name environment in environment.properties file (see property environmentProperties) or, if not set, production . |
List<String> | sourceCartridges | List of cartridges residing in source folders. Files of those cartridges will later on be loaded directly from the source directory in the server. | Single project property sourceCartridges or multiple project properties starting with sourceCartridges .*, each with space-separated list of cartridge names. Empty list if not set. |
List<String> | sourceDirectories | Source directories used for looking up source cartridges. Also see property sourceCartridges. | Project property
sourceDirectories
containing a list of path names separated by the system specific path separator character. |
boolean | releaseWithDump | Defines if the project should be published together with a database dump. If set to Since Gradle tools version 2.0: Set the project property | Project property
releaseWithDump
or false if not set. |
DatabaseBuildConfiguration
| database | Defines how the database dump is generated/dbinit is executed. Deprecated since Gradle tools version 2.0. Use | n/a |
DbinitConfiguration
| dbinit | Defines how dbinit is executed. Only for Gradle tools version >= 2.0. | n/a |
DbmigrateConfiguration
| dbmigrate | Defines how dbmigrate is executed. Only for Gradle tools version >= 2.0. | n/a |
Return Type | Method Name | Description |
---|---|---|
void | database(Closure configure) | Configures the Deprecated since Gradle tools version 2.0. Use Parameters:
|
void | dbinit(Closure configure) | Configures the Parameters:
|
void | dbmigrate(Closure configure) | Configures the Parameters:
|
Type com.intershop.build.assembly.DatabaseBuildConfiguration
(Deprecated since version 2.0, see DbinitConfiguration
and DbmigrateConfiguration
instead)
Extension object which contains database specific assembly properties. The default values for those properties will be set in the IshAssemblyBuildPlugin
.
Type | Property Name | Description | Default value |
---|---|---|---|
File
| importFile | Dump file which will be imported when inheriting from another assembly's dump file and performing only a partial deployment. Returns | The inherited assembly's dump file or null if not specified. Also see method inherit(String, Closure) . |
File
| exportFile | Dump file which will be generated and published after performing the DBInit. | <build-directory>/dump/database-dump.dmp |
Collection<String>
| initCartridges | Set of cartridges for which a partial DBInit will be performed when inheriting another assembly's dump file. Returns | n/a |
Return Type | Method Name | Description |
---|---|---|
void | inherit(String from, Closure artifactFilter = { it.type == 'dump' }) | Specifies an assembly from which to inherited the database dump. Used for performing a partial DBInit only. Parameters:
|
Type com.intershop.build.assembly.DbinitConfiguration
(For Gradle tools version >= 2.0)
Configures how to run DBInit. The default values for those properties will be set in the IshAssemblyBuildPlugin
.
Type | Property Name | Description | Default value |
---|---|---|---|
File
| importFile | Dump file which will be imported when inheriting from another assembly's dump file and performing only a partial deployment. Returns | null |
Collection<String>
| initCartridges | Set of cartridges for which a partial DBInit will be performed when inheriting another assembly's dump file. Returns | n/a |
Return Type | Method Name | Description |
---|---|---|
void | importFrom(String from, Closure artifactFilter = { it.type == 'dump' }) | Specifies an assembly from which to inherited the database dump. Used for performing a partial DBInit only. Parameters:
|
Type com.intershop.build.assembly.DbmigrateConfiguration
(For Gradle tools version >= 2.0)
Configures how to run DBMigrate.
Type | Property Name | Description | Default value |
---|---|---|---|
File
| importFile | Dump file which will be imported before running dbmigrate. Also see task importDbmigrateBaseDump at the | null |
Return Type | Method Name | Description |
---|---|---|
void | importFrom(String from, Closure artifactFilter = { it.type == 'dump' }) | Specifies an assembly from which to inherited the database dump. Used for performing a partial DBInit only. Parameters:
|
This section describes the custom task types available in the Intershop assembly plugins.
.
UseSetAsFilter
Task for registering the published project version number as version filter in the gradle.properties file.
Type | Property Name | Description | Default value |
---|---|---|---|
File | propertiesFile | Properties file where the version number is stored. | n/a |
com.intershop.build.gradle.plugins.
ProvideSourceCartridges
Task for updating the 'sourceCartridges' property of the project with the list of source cartridges (i.e., the list of sub projects) in the gradle.properties file.
Type | Property Name | Description | Default value |
---|---|---|---|
File | propertiesFile | Properties file where the list of source cartridges is stored. | n/a |
com.intershop.build.assembly.task.AbstractServerTask
Abstract super type for tasks which run the deployed server.
Type | Property Name | Description | Default value |
---|---|---|---|
boolean | isWindows | Return | n/a |
boolean | isLinux | Return | n/a |
File | serverDirectory | Directory where the server has been deployed into. | n/a |
Return Type | Method Name | Description |
---|---|---|
Collection<String> | getCommandWithEnvironment(Collection<String> command) | Creates an executable system environment specific command which includes the environment script of the server. Parameters:
|
Collection<String> | getAntCommand(def parameters = [])
| Creates an executable system environment specific Ant command which includes the environment script of the server. Parameters:
|
com.intershop.build.assembly.task.CleanDBSchemaTask
Task for cleaning the database schema of the database configured at the deployed server. It executes the dbschema-clean
Ant task in IS_HOME/tools/misc.
This class extends the super type AbstractServerTask
.
com.intershop.build.assembly.task.ConfigurePlainEncryption
Task for setting the PLAIN encryption properties in a given properties file. This is used to remove encryption when generating a database dump which is to be used on multiple independent systems.
Type | Property Name | Description | Default value |
---|---|---|---|
File | propertiesFile | Properties file where the encryption properties should be stored. | n/a |
com.intershop.build.assembly.task.DBInitTask
Task for executing a DBInit at the deployed server. A set of cartridges can be specified to only execute a partial DBInit for this set of cartridges. Before executing the DBInit, existing DBInit log files are removed.
This class extends the super type AbstractServerTask
.
Type | Property Name | Description | Default value |
---|---|---|---|
Collection<String> | initCartridges | Set of init cartridges to execute a partial DBInit for. If not specified, a full DBInit is performed (optional). | n/a |
Return Type | Method Name | Description |
---|---|---|
void | cleanLogDirectory() | Removes existing DBInit and SQL log files. |
Object
| getCommand()
| Returns the command used to execute the DBInit. |
com.intershop.build.assembly.task.DBMigrateTask
(Only for Gradle tools version >= 2.0)
Task for executing a DBMigrate at the deployed server. Before executing the DBMigrate, existing DBMigrate log files are removed.
This class extends the super type AbstractServerTask
.
Return Type | Method Name | Description |
---|---|---|
void | cleanLogDirectory() | Removes existing DBMigrate and SQL log files. |
Object
| getCommand()
| Returns the command used to execute the DBMigrate. |
com.intershop.build.assembly.task.DeployServer
Task for deploying the server from a given assembly. It runs a nested Gradle instance inside the deployed server with the passed settings.gradle file.
This class extends the super type RunNestedGradle.
Type | Property Name | Description | Default value |
---|---|---|---|
File | targetDirectory | Directory in which to execute the deployment. | n/a |
File |
settingsGradleFile
| The settings.gradle file used for the deployment. | n/a |
com.intershop.build.assembly.task.ExportDatabaseDumpTask
Task for exporting the database content into a given dump file. It executes the export
Ant task in IS_HOME/tools/misc.
This class extends the super type AbstractServerTask
.
Type | Property Name | Description | Default value |
---|---|---|---|
File | dumpFile | File to which the database content is exported. | n/a |
com.intershop.build.assembly.task.GenerateRepositoryGradle
Task for generating the repository Gradle file which contains information about the repository which will be used for the deployment.
Type | Property Name | Description | Default value |
---|---|---|---|
File | repositoryGradleFile | Resulting file with information about the deployment repository. | n/a |
String | repoUrl | URL to the repository used for deploying the server. | n/a |
String | repoPattern | Pattern describing the structure of the repository used for deploying the server. | n/a |
String | repositoryName | Name of the repository used for deploying the server. | n/a |
com.intershop.build.assembly.task.GenerateSettingsGradle
Task for generating the settings.gradle file used during deployment from an assembly. The file will be generated from an (internal) template by replacing the placeholders with task properties resp. properties of the environment.properties file.
Type | Property Name | Description | Default value |
---|---|---|---|
File | settingsGradleFile | Resulting settings.gradle file generated from properties. | n/a |
File | environmentPropertiesFile | File which contains environment specific properties used during deployment. These properties replace the placeholders in the template file. | n/a |
File
| javadocDirectory | Directory to which the JavaDoc files are deployed. | n/a |
String | assemblyId | Module version identifier of the assembly used for the deployment. | n/a |
String | deploymentBootstrapVersion | Version number of the deployment-bootstrap plugin used for the deployment. | n/a |
List<String> | sourceCartridges | List of cartridges which are read directly from the source folders of the server. The are copied in the cartridges.source property in the IS_SHARE/system/cartridges/cartridgelist.properties file during deployment (optional). | n/a |
List<String>
| sourceDirectories | List of source directories used for source cartridge lookup. They are copied into the IS_SOURCE property in the IS_HOME/intershop.properties file during deployment (optional). | n/a |
com.intershop.build.assembly.task.ImportDatabaseDumpTask
Task for importing the given dump file into the deployed server's database. It executes the import
Ant task in IS_HOME/tools/misc.
This class extends the super type AbstractServerTask
.
Type | Property Name | Description | Default value |
---|---|---|---|
File | dumpFile | Dump file which will be imported into the database. | n/a |
com.intershop.build.assembly.task.UpdateDumpVersionFilter
Task for updating the version filter that contains the release version number of the current project's assembly database dump to the latest release.
Type | Property Name | Description | Default value |
---|---|---|---|
File | propertiesFile | Properties file where the version filter property will be stored. | n/a |
String | dumpPropertyName | Property name which is used for storing the version number. | n/a |
com.intershop.common.nested.RunNestedGradle
Task for executing a nested Gradle instance inside another directory.
Type | Property Name | Description | Default value |
---|---|---|---|
File | projectDir | Directory in which to start the nested Gradle instance. | n/a |
File | gradleHomeDir | Gradle's home directory. | n/a |
File | gradleUserHomeDir | Gradle's user home directory. | n/a |
List<String> | tasks | List of tasks to execute in the nested instance. | n/a |
List<String> | arguments | List of additional arguments which will be passed to the nested Gradle instance. | Empty list |
List<String> | effectiveArguments | List of effective arguments, including init scripts and Gradle logging and start parameters. Read-only. | n/a |
Collection<File> | initScripts | Set of init scripts used in the deployment. | n/a |
Return Type | Method Name | Description |
---|---|---|
void | cleanLogDirectory() | Removes existing DBInit and SQL log files. |
This section describes other types which are specified in this reference and which do not belong to any other category.
Type
org.gradle.api.Project
AssemblyPlugin
Type | Property Name | Description | Default value |
---|---|---|---|
AssemblyExtension | assembly | Extension for defining assembly specific properties. | n/a |
IshAssemblyBuildPlugin
Type | Property Name | Description | Default value |
---|---|---|---|
IshAssemblyBuildExtension
| assemblyBuild | Extension for defining Intershop specific assembly properties. | n/a |
com.intershop.build.assembly.inheritance.AssemblyInheritanceSpec
Interface used to describe what is inherited from an assembly, i.e., which artifacts and which dependencies by an arbitrary number of include and exclude statements.
The suffix Spec
is following Gradle's
CopySpec
for copying files.
Return Type | Method Name | Description |
---|---|---|
void | includeDependencies(Object... dependencies) | Includes the given dependencies of the inherited assembly in this assembly (context). Parameters:
|
void | includeDependencies(Map<String, Object> params, Object... dependencies) | Includes the given dependencies of the inherited assembly in this assembly (context). An optional named parameter from may be specified to include dependencies only from a certain set of configurations. Parameters:
|
void | includeDependencies(Closure<?> closure) | Includes the given dependencies of the inherited assembly in this assembly. The closure defines rules when to include a dependency. Parameters:
|
void | excludeDependencies(Object... dependencies) | Excludes the given dependencies of the inherited assembly from this assembly (context). Parameters:
|
void | excludeDependencies(Map<String, Object> params, Object... dependencies) | Excludes the given dependencies of the inherited assembly from this assembly (context). An optional named parameter from may be specified to exclude dependencies only from a certain set of configurations. Parameters:
|
void | excludeDependencies(Closure<?> closure) | Excludes the given dependencies of the inherited assembly from this assembly. The closure defines rules for when to exclude a dependency. Parameters:
|
void | includeArtifacts(Map<String, Object> params) | Includes the artifacts of the inherited assembly with the given parameters in this assembly. Parameters:
|
void | includeArtifacts(Closure closure) | Includes the given artifacts of the inherited assembly in this assembly. The closure defines rules for when to include an artifact. Parameters:
|
void |
excludeArtifacts(Map<String, Object> params)
| Excludes the artifacts of the inherited assembly with the given parameters from this assembly. Parameters:
|
void
|
excludeArtifacts(Closure closure)
| Excludes the given artifacts of the inherited assembly from this assembly. The closure defines rules for when to exclude an artifact. Parameters:
|
com.intershop.build.assembly.inheritance.AssemblyInheritance
This class defines the assembly inheritance process. When inheriting from another assembly, all dependencies and artifacts of the root assembly are inherited by default. Defining an exclude statement excludes specific dependencies resp. artifacts from the assembly. In contrast, when specifying an include statement explicitly, all dependencies resp. artifacts will no longer be inherited automatically, but only the ones defined in the include statement. However, this only affects the given context. Specific contexts can be constrained by using the within(InheritanceContext, Closure)
method.
After inheriting, dependencies and artifacts can be manipulated by using the eachDependency(Closure)
and eachArtifact(Closure)
methods.
This class implements the super type AssemblyInheritanceSpec.
assembly { inheritFrom('com.intershop.assembly:intershop7') { // no other artifacts will be included includeArtifacts type:['deploy-settings-gradle', 'deploy-gradle'] // inherited environment 'development' will only include // 'cartridge1', but other environments will still include every // inherited dependency within(development) { includeDependencies 'cartridge1' } // 'cartridge2' will be excluded from every configuration excludeDependencies 'cartridge2' // use another version of inherited dependencies eachDependency { dependency -> dependency.setVersion("2") } } }
Type | Property Name | Description | Default value |
---|---|---|---|
Object | from | Fully qualified dependency notation name of the assembly module which is to be inherited from. | n/a |
AssemblyExtension
Type | Property Identifier | Description |
---|---|---|
InheritedSubset
| Name of the inherited subset | Inherited subsets of the assembly which is to be inherited from. Are provided by the |
InheritanceContext
| Name of the inheritance context | Inheritance contexts of the assembly which is to be inherited from. Are provided by the
InheritedSubsetProvider . |
Return Type | Method Name | Description |
---|---|---|
void | eachDependency(Closure closure) | Perform certain operations on each inherited dependency. Parameters:
|
void |
eachArtifact(Closure closure)
| Perform certain operations on each inherited artifact. Parameters:
|
void | within(
InheritanceContextcontext, Closure closure)
| Defines a new context in which additional include and exclude statements can be specified. These statements does not affect other contexts or the root inheritance context. Parameters:
|
com.intershop.build.assembly.inheritance.ContextInheritanceSpec
This class defines the assembly inheritance include and exclude methods for a given InheritanceContext. Can be created easily and configured by using the AssemblyInheritance.within( InheritanceContext context, Closure closure) method.
This class implements the super type
AssemblyInheritanceSpec
.
Type | Property Name | Description | Default value |
---|---|---|---|
InheritanceContext
| context | Context in which the include and exclude statements has to be valid. | n/a |
com.intershop.build.assembly.inheritance.InheritanceContext
Inheritance context which can be specified in an statement. An inheritance context can be used to restrict specific inheritance include and exclude statements to certain configuration subsets or subset types.
This interface extends the super type Named.
Return Type | Method Name | Description |
---|---|---|
boolean | contains(InheritedSubset object) | Checks whether this context contains the given inherited subset. Returns true if the subset is part of this context; else false. Parameters: object - Inherited subset to check. |
com.intershop.build.assembly.inheritance.InheritedArtifact
Wrapper class for ResolvedArtifact objects. Objects of this class are provided in the
AssemblyInheritance.eachArtifact(Closure)
statements to be able to change artifact attributes and configurations after inheriting.
Type | Property Name | Description | Default value |
---|---|---|---|
String | name | Name of the inherited artifact. | Name of the inherited ResolvedArtifact object. |
String | type | Type of the inherited artifact. | Type of the inherited ResolvedArtifact object. |
String | extension | Extension of the inherited artifact. | Extension of the inherited ResolvedArtifact object. |
String | classifier | Classifier of the inherited artifact. | Classifier of the inherited ResolvedArtifact object. |
File | file | File representation of the inherited artifact. Read-only. | File representation of the inherited ResolvedArtifact object. |
ResolvedModuleVersion | moduleVersion | Module this inherited artifact belongs to. Read-only. | Module the inherited ResolvedArtifact object belongs to. |
Collection | configurations | Set of configurations and configuration subsets in which this artifact is to be included. | Empty list. |
com.intershop.build.assembly.inheritance.InheritedDependency
Wrapper class for ModuleVersionIdentifier objects. Objects of this class will be provided in the AssemblyInheritance.eachDependency(Closure) statements to be able to change dependency attributes and configurations after inheriting.
Type | Property Name | Description | Default value |
---|---|---|---|
String | name | Name of the inherited dependency. | Name of the inherited ModuleVersionIdentifier object. |
String | group | Group of the inherited dependency. | Group of the inherited ModuleVersionIdentifier object. |
String | version | Version of the inherited dependency. | Version of the inherited ModuleVersionIdentifier object. |
ModuleIdentifier | module | Identifier containing the group and the name of the inherited dependency. Read-only. | Identifier containing the group and the name of the inherited ModuleVersionIdentifier object. |
Collection | configurations | Set of configurations and configuration subsets in which this dependency is to be included. | Empty list. |
com.intershop.build.assembly.inheritance.InheritedSubset
Interface for inherited configuration-like subsets (e.g., inherited host types, environments, etc). Each subset will be mapped to a specific Configuration in the resulting assembly.
This interface extends the super type InheritanceContext, i.e., all inherited subsets can also be used as contexts in the AssemblyInheritance.within( InheritanceContext context, Closure closure) method.
Type | Property Name | Description | Default value |
---|---|---|---|
String | configurationName | Name of the Configuration this subset will be mapped to in the final Ivy file. | n/a |
com.intershop.build.assembly.inheritance.InheritedSubsetProvider
Provider interface for inherited subsets. Whenever a new subset type is introduced in the base assembly, a new provider of this class needs to be registered at AssemblyExtension.registerInheritedSubsetProvider(InheritedSubsetProvider) to be able to use the inherited subsets in inheritance include and exclude statements.
Also provides additional InheritanceContext objects which can be used in the AssemblyInheritance.within( InheritanceContext context, Closure closure) method. In the default providers, the type of the respective subset is added for context lookups (e.g., environments
, hostTypes
, etc).
This interface extends the super type ConfigurationFactory.
Return Type | Method Name | Description |
---|---|---|
void | provideSubsets(Object assemblyDependency, Collection< InheritedSubset> inheritedSubsets) | Adds or removes configuration-like objects (e.g., host types) from the given inherited assembly to or from the given collection of inherited configuration-like objects. Is called by AssemblyExtension.inheritFrom(Object, groovy.lang.Closure) to find configuration-like entities. Parameters: assemblyDependency - Gradle dependency notation for the assembly to inherit from. inheritedSubsets- Collection of inheritable subsets (e.g., configurations, host-types, environments, etc). |
void | hideSubsets(Collection< InheritedSubset> inheritedSubsets) | Cleans up the given list of inherited subsets by removing subsets (mostly configurations) used as physical containers for conceptually higher level subsets (e.g., host-types, environments) from the given collection. Parameters: inheritedSubsets- Collection of inherited subsets to clean up. |
void | provideContexts(Collection< InheritanceContext> inheritanceContexts) | Adds additional contexts that can be used for scoping include and excludes of artifacts or dependencies to the given collection. Subsets provided by this provider are used as contexts automatically. Parameters: inheritanceContexts- Collection of inheritance context which additional contexts provided by this provider should be added to |
com.intershop.build.assembly.inheritance.ConfigurationFactory
Factory for creating a concrete Configuration object from a given configuration-like object (e.g., HostType, Environment, specific InheritedSubsets etc). For each type of configuration-like objects (including inherited types), a factory must be registered at AssemblyExtension.registerConfigurationFactory(ConfigurationFactory) to be able to create a configuration object when inheriting from another assembly.
Return Type | Method Name | Description |
---|---|---|
Configuration | createTargetConfiguration(Object configuration) | Creates a configuration from the given configuration-like object at the project. Returns null if it does not "know" how to create it. Parameters: configuration - Object from which a configuration can be created. |
com.intershop.build.gradle.plugins.AssemblyDependency
Class for modeling dependencies which are part of the final assembly.
Type | Property Name | Description | Default value |
---|---|---|---|
ModuleVersionIdentifier | id | ModuleVersionIdentifier of the dependency. When changing this, the version field will also be updated to the version of the ModuleVersionIdentifier. | n/a |
String | version | Version number of this dependency. May differ from the version in the ModuleVersionIdentifier in case another version should be used in the assembly. | n/a |
Set< Configuration> | configurations | Configurations this dependency belongs to. | n/a |
com.intershop.build.gradle.plugins.CompoundSortingExtension
Configurable object for defining different dependency sorting options for different configuration sets. Is configured by method sortPerConfiguration(Closure)
in the AssemblyExtension.
assembly.sortPerConfiguration { sort(configurationSet1).byModuleId() sort(configurationSet2).byDependencies() sort(configurationSet3).byExternalList(file('cartridge-order.txt')) }
Return Type | Method Name | Description |
---|---|---|
Entry | sort(List< Configuration> configurations) | Creates a new sorting entry for the given configurations. See Entry for specifying sorting methods for the given configurations. Parameters: configurations- Configurations to sort separately. |
Entry | sort(Configuration configurations) | Creates a new sorting entry for the given configuration. See Entry for specifying sorting methods for the given configurations. Parameters: configuration - Configuration to sort separately. |
Entry | sortRemaining() | Creates an artifical sorting entry for the remaining (unsorted) configurations. See Entry for specifying sorting methods for the given configurations. |
com.intershop.build.gradle.plugins.CompoundSortingExtension.Entry
Entry for storing information about which configuration set should be sorted by which sorting type. See CompoundSortingExtension for how an object of this class can be created.
Return Type | Method Name | Description |
---|---|---|
void | byDependencies(Closure configureClosure = null) | Sorts the dependencies of configurations of this sorting entry by the dependency graph. Parameters: configureClosure - Configures a DependencyGraphSortingExtension which sets the sorting options. A manual order in which certain components relate to each other may be specified here. |
void | byExternalList(File listSource) | Sorts the dependencies of configurations of this sorting entry by an external list defining the dependency order. Parameters: listSource - Specifies the file which is used to read the dependency order from. See Cookbook - Gradle Assembly Tools for details on how the file is structured. |
void | byModuleId() | Sorts the dependencies canonically by the ModuleVersionIdentifier. The dependencies are ordered in the following way:
|
com.intershop.build.gradle.plugins.DependencyGraphSortingExtension
Configurable object for defining options for sorting by the dependency graph. It is configured by method
sortByDependencies(Closure)
in the AssemblyExtension resp. by method
sortByDependencies(Closure)
and using a CompoundSortingExtension.
// alternative #1 assembly.sortByDependencies { order ('com.example:component-b').after 'com.example:component-a' } // alternative #2 assembly.sortPerConfiguration { sort(configurationSet).byDependencies() { order ('com.example:component-b').before 'com.example:component-c' } }
Return Type | Method Name | Description |
---|---|---|
DependencyOrder | order(Object dependencyNotation) | Defines additional order criteria. By default the dependencies are ordered by the dependency graph, but by using this method, a fixed order between certain dependencies can be defined. Returns a DependencyOrder object where additional order rules for the given dependency can be defined. Parameters: dependencyNotation- Fully qualified name of the dependency to be order separately |
com.intershop.build.gradle.plugins.DependencyOrder
Class used to specify additional sorting rules for a given dependency when sorting by the dependency graph. Also see DependencyGraphSortingExtension.
Return Type | Method Name | Description |
---|---|---|
void | after(Object dependencyNotation) | Sorts the configured dependency after the dependency given as parameter. Parameters: dependencyNotation - Fully qualified name of the dependency which will be placed before the configured dependency of this ordering rule in the resulting order. |
void | before(Object dependencyNotation) | Sorts the configured dependency before the dependency given as parameter. Parameters: dependencyNotation - Fully qualified name of the dependency which will be placed after the configured dependency of this ordering rule in the resulting order. |
void | independentOf(Object dependencyNotation) | Marks the configured dependency and the dependency given as parameter as independent of each other, i.e., the resulting order will not matter. Parameters: dependencyNotation - Fully qualified name of the dependency which should be marked as independent in relation to the configured dependency. |
com.intershop.build.assembly.hosttype.CartridgeType
Super class for configuration subsets which cartridges can be added to, e.g., Environments and InitTypes.
Type | Property Name | Description | Default value |
---|---|---|---|
String | name | Name of the cartridge type. | n/a |
Configuration | cartridgesConfiguration | Concrete configuration object of the cartridge type. It is created by the HostTypeAssemblyPlugin for environments and init types. | n/a |
com.intershop.build.assembly.hosttype.Environment
CartridgeType for environments. Environments are different stages in the life-cycle of an assembly, like development, test and production. At time of deployment exactly one environment is selected. Environments are provided as extension of the project's assembly extension by the HostTypeAssemblyPlugin.
com.intershop.build.assembly.hosttype.InitType
CartridgeType for init types. Init types are types of configurations that contain system components that should be deployed as cartridges, but only be loaded by the DBInit tool and not by the application server. Init types are provided as extension of the project's assembly extension by the HostTypeAssemblyPlugin.
com.intershop.build.assembly.hosttype.HostType
Class for representing host types. Host types are types of nodes in a cluster deployment. At time of deployment exactly one host type is selected. In a single-machine-installation an implicit host type named all
may be selected which deploys all known host types. Host types are provided as extension of the project's assembly extension by the HostTypeAssemblyPlugin. The host type extension works similar to the cartridges extension but also allows to add non-cartridge components to the given host type.
hostTypes { webserver { include ( 'com.intershop:3rd_jdk', 'com.intershop:3rd_apache', // ... ) exclude module:'3rd_tomcat' } }
Type | Property Name | Description | Default value |
---|---|---|---|
String | name | Name of the host type. | n/a |
boolean | includeCartridges | During deployment, if set to | false |
boolean | includeShare | System components may contain artifacts which are to be deployed to the IS_SHARE directory of the shared host. If this flag is set to | false |
boolean | includeLocal | System components may contain artifacts which are to be deployed to the local IS_HOME directory of non-shared hosts. If this flag is set to | false |
boolean | includeJavadoc | If this flag is set to true , JavaDoc will be deployed additionally for all components. | false |
Configuration | configuration | Actual configuration object of the host type. It is created by the HostTypeAssemblyPlugin. | n/a |
Return Type | Method Name | Description |
---|---|---|
void | include(Object... paramArray) | Adds the given components to this host type. Parameters: paramArray - List of fully qualified component names (i.e., |
void | exclude(Map<String, Object> excludeParams) | Removes the given components from this host type. Also see ModuleDependency.exclude(). Parameters: excludeParams - Map of named parameters
|
com.intershop.build.assembly.DatabaseBuildConfiguration
(Deprecated since version 2.0, see DbinitConfiguration
and DbmigrateConfiguration
instead)
Extension object which contains database specific assembly properties. The default values for those properties will be set in the IshAssemblyBuildPlugin
.
Type | Property Name | Description | Default value |
---|---|---|---|
File
| importFile | Dump file which will be imported when inheriting from another assembly's dump file and performing only a partial deployment. Returns | The inherited assembly's dump file or null if not specified. Also see method inherit(String, Closure) . |
File
| exportFile | Dump file which will be generated and published after performing the DBInit. | <build-directory>/dump/database-dump.dmp |
Collection<String>
| initCartridges | Set of cartridges for which a partial DBInit will be performed when inheriting another assembly's dump file. Returns | n/a |
Return Type | Method Name | Description |
---|---|---|
void | inherit(String from, Closure artifactFilter = { it.type == 'dump' }) | Specifies an assembly from which to inherited the database dump. Used for performing a partial DBInit only. Parameters:
|