component-installation-plugin / com.intershop.gradle.component.installation.tasks / InstallConfigManager

InstallConfigManager

class InstallConfigManager

The object manages all installation information of a component. It is used to create all necessary tasks.

Constructors

<init>

InstallConfigManager(prjext: InstallationExtension, tasks: ModelMap<Task>, commonName: String, descriptor: Component, compInstallDir: File, update: Boolean = false)

initializes a manager instance for a component

Properties

compInstallTask

var compInstallTask: Task?

The main installation task of the component. It will be initialized in the init method of the class.

descriptor

val descriptor: Component

the component descriptor object

fileItemSet

val fileItemSet: MutableSet<FileItem>

This is a set of file items for the installation. File items will replace existing files depending on the OS or the environment type. File items can be added from outside.

preCompInstallTaskName

var preCompInstallTaskName: String

The name of the component pre installation task. This task will be executed before a sub installation task of the component will be started.

Functions

checkForType

fun checkForType(item: DeploymentItem): Boolean

Compares the type information of an item with configured environment information.

fun checkForType(itemTypes: Set<String>): Boolean

Checks the if the types of items are included in the types (environments) of the installation configuration.

configureLibsSpec

fun configureLibsSpec(spec: CopySpec, libs: MutableMap<String, Library>): Unit

This method configures an existing copy spec for the installation of the libraries item of the component installation. The artifacts must be resolved by the special configuration.

configureModuleSpec

fun configureModuleSpec(spec: CopySpec, module: Module): Unit

This method configures an existing copy spec form the configuration of a module item. The artifacts must be resolved by the special configuration.

getDirectoryTask

fun getDirectoryTask(path: String): DirectoryTask

Adds a directory task to the task list.

getInstallTask

fun getInstallTask(taskName: String, contentType: ContentType = ContentType.UNSPECIFIED): InstallTask

Get an install task for this component installation. If the tasks exist it will be configured.

getLinkTask

fun getLinkTask(): LinkTask

Add a link task for the component to the task list.

getSuffixStr

fun getSuffixStr(vararg suffix: String): String

Get a suffix for tasks and configurations. This is specific for the component and depends from the common name.

getTargetDir

fun getTargetDir(vararg path: String): File

Get a target dir from path elements for this specific component.

initCleanupTask

fun initCleanupTask(backupDir: File): Unit

It initializes the clean up task for the component installation. Unused items will be removed or moved to a backup directory.

Companion Object Functions

checkForOS

fun checkForOS(item: OSSpecificItem): Boolean

The function returns true, if no OS configuration is specified for the item or the OS configuration matches to the environment OS.

getTargetDir

fun getTargetDir(dir: File, vararg path: String): File

Get the target dir from a base dir and additional path elements. The path elements will be filtered and adapted. Empty elements or elements with forbidden characters will be removed, spaces replaced with an underscore.