aem-plugin / com.cognifide.gradle.aem / AemExtension

AemExtension

class AemExtension : Serializable

Core of library, facade for implementing tasks, configuration aggregator.

Constructors

<init>

Core of library, facade for implementing tasks, configuration aggregator.

AemExtension(project: Project)

Properties

anyInstance

Get instance from command line parameter named 'instance' which holds instance name or URL. If it is not specified, then first instance matching default filtering fill be returned.

val anyInstance: Instance

authorInstance

val authorInstance: Instance

authorInstances

Get all author instances running on current environment.

val authorInstances: List<Instance>

availableInstance

Get available instance of any type (most often first defined).

val availableInstance: Instance?

baseName

Base name used as default for CRX packages being created by compose or collect task and also for OSGi bundle JARs.

val baseName: String

buildScope

val buildScope: BuildScope

bundle

Get OSGi bundle defined to be built (could not yet exist).

val bundle: File

bundles

Get all OSGi bundles defined to be built.

val bundles: List<File>

configCommonDir

Directory for storing common files used by plugin e.g:

val configCommonDir: File

configDir

Directory for storing project specific files used by plugin e.g:

val configDir: File

env

Determines current environment name to be used in e.g package deployment.

val env: String

environment

Provides API for controlling virtualized AEM environment with HTTPD and dispatcher module.

val environment: Environment

fileTransfer

val fileTransfer: FileTransferManager

filter

val filter: FilterFile

formats

val formats: Formats

instanceActions

Provides API for performing actions affecting multiple instances at once.

val instanceActions: InstanceActionPerformer

instanceOptions

val instanceOptions: InstanceOptions

instances

All instances matching default filtering.

val instances: List<Instance>

javaPackages

Collection of all java packages from all projects applying bundle plugin.

val javaPackages: List<String>

lineSeparator

Specify characters to be used as line endings when cleaning up checked out JCR content.

var lineSeparator: String

lineSeparatorString

val lineSeparatorString: String

localInstanceManager

val localInstanceManager: LocalInstanceManager

localInstances

Get all local instances.

val localInstances: List<LocalInstance>

logger

val logger: Logger!

main

Access configuration for local instances or environment from different project (cross-project configuring).

val main: AemExtension

notifier

Provides API for displaying interactive notification during running build tasks.

val notifier: NotifierFacade

offline

Allows to disable features that are using running AEM instances.

val offline: Boolean

package

Get CRX package defined to be built (could not yet exist).

val package: File

packageOptions

val packageOptions: PackageOptions

packages

Get all CRX packages defined to be built.

val packages: List<File>

parallel

val parallel: Parallel

patterns

val patterns: Patterns

pkg

val pkg: File

project

val project: Project

projectMain

Project under which common configuration files are stored. Usually it is also configures local instances and environment (is applying corresponding plugins).

val projectMain: Project

projectName

Project name with skipped convention prefixes.

val projectName: String

projectPrefixes

Project name convention prefixes used to determine default:

val projectPrefixes: List<String>

props

Allows to read project property specified in command line and system property as a fallback.

val props: PropertyParser

publishInstance

val publishInstance: Instance

publishInstances

Get all publish instances running on current environment.

val publishInstances: List<Instance>

remoteInstances

Get all remote instances.

val remoteInstances: List<RemoteInstance>

tasks

Provides API for easier creation of tasks (e.g in sequence) in the matter of Gradle task configuration avoidance.

val tasks: AemTaskFacade

temporaryDir

Predefined temporary directory.

val temporaryDir: File

Functions

authorInstances

Work in parallel with all author instances running on current environment.

fun authorInstances(consumer: (Instance) -> Unit): Unit

composePackage

Build minimal CRX package in-place / only via code. All details like Vault properties, archive destination directory, file name are customizable.

fun composePackage(definition: PackageDefinition.() -> Unit): File

dependentBundles

Get all OSGi bundles built before running particular task.

fun dependentBundles(task: Task): List<File>

dependentPackages

Get all CRX packages built before running particular task.

fun dependentPackages(task: Task): List<File>

environment

fun environment(configurer: Environment.() -> Unit): Unit

fileTransfer

Define settings for file transfer facade which allows to perform basic file operations on remote servers like uploading and downloading files.

fun fileTransfer(options: FileTransferManager.() -> Unit): Unit

filter

Get Vault filter object for specified file.

fun filter(file: File): FilterFile

Get Vault filter object for specified path.

fun filter(path: String): FilterFile

filterInstances

Find all instances which names are matching wildcard filter specified via command line parameter 'instance.name'.

fun filterInstances(nameMatcher: String = props.string("instance.name") ?: "$env-*"): List<Instance>

http

Perform any HTTP requests to external endpoints.

fun <T> http(consumer: HttpClient.() -> T): T

httpFile

Download files using HTTP protocol using custom settings.

fun <T> httpFile(consumer: HttpFileTransfer.() -> T): T

instance

Defines instances to work with.

fun instance(options: InstanceOptions.() -> Unit): Unit

Shorthand method for getting defined instance or creating temporary instance by URL.

fun instance(urlOrName: String): Instance

instances

Work in parallel with instances matching default filtering.

fun instances(consumer: (Instance) -> Unit): Unit

Work in parallel with instances which name is matching specified wildcard filter.

fun instances(filter: String, consumer: (Instance) -> Unit): Unit

Shorthand method for getting defined instances or creating temporary instances by URLs.

fun instances(urlsOrNames: Iterable<String>): List<Instance>

localInstance

Define common settings valid only for instances created at local file system.

fun localInstance(options: LocalInstanceManager.() -> Unit): LocalInstanceManager

localInstances

Work in parallel with all local instances.

fun localInstances(consumer: LocalInstance.() -> Unit): Unit

namedInstance

Get all instances which names are matching wildcard filter specified via command line parameter 'instance.name'. By default, this method respects current environment which is used to work only with instances running locally.

fun namedInstance(desiredName: String? = props.string("instance.name"), defaultName: String = "$env-*"): Instance

notifier

fun notifier(configurer: NotifierFacade.() -> Unit): Unit

package

Defines common settings for built packages and deployment related behavior.

fun package(options: PackageOptions.() -> Unit): Unit

Read CRX package properties of specified ZIP file.

fun package(file: File): PackageFile

pkg

Defines common settings for built packages and deployment related behavior.

fun pkg(options: PackageOptions.() -> Unit): Unit

Read CRX package properties of specified ZIP file.

fun pkg(file: File): PackageFile

progress

Show asynchronous progress indicator with percentage while performing some action.

fun <T> progress(total: Int, action: ProgressIndicator.() -> T): T
fun <T> progress(total: Long, action: ProgressIndicator.() -> T): Tfun <T> progress(action: ProgressIndicator.() -> T): T

progressCountdown

Show synchronous progress countdown / time to wait after performing asynchronous operation.

fun progressCountdown(time: Long): Unit
fun progressCountdown(options: ProgressCountdown.() -> Unit): Unit

progressIndicator

Show asynchronous progress indicator while performing some action.

fun <T> progressIndicator(action: ProgressIndicator.() -> T): T

progressLogger

Show synchronous progress logger while performing some action.

fun <T> progressLogger(action: ProgressLogger.() -> T): T

publishInstances

Work in parallel with all publish instances running on current environment.

fun publishInstances(consumer: Instance.() -> Unit): Unit

rcp

Execute any Vault JCR content remote copying with customized options like content directory.

fun <T> rcp(options: RcpClient.() -> T): T

remoteInstances

Work in parallel with all remote instances.

fun remoteInstances(consumer: RemoteInstance.() -> Unit): Unit

resolveFile

Resolve single file from defined repositories or by using defined file transfers.

fun resolveFile(value: Any): File
fun resolveFile(options: FileResolver.() -> Unit): File

resolveFiles

Resolve files from defined repositories or by using defined file transfers.

fun resolveFiles(options: FileResolver.() -> Unit): List<File>
fun resolveFiles(downloadDir: File, options: FileResolver.() -> Unit): List<File>

retry

Factory method for configuration object determining how operation should be retried.

fun retry(configurer: Retry.() -> Unit): Retry

Factory method for configuration object determining that operation should not be retried.

fun retry(): Retry

runDocker

Execute any Docker command using all available images with mounting volumes etc, exposing ports etc.

fun runDocker(spec: RunSpec.() -> Unit): DockerResult

sftpFile

Transfer files using over SFTP protocol using custom settings.

fun <T> sftpFile(consumer: SftpFileTransfer.() -> T): T

smbFile

Transfer files using over SMB protocol using custom settings.

fun <T> smbFile(consumer: SmbFileTransfer.() -> T): T

sync

In parallel, work with services of all instances matching default filtering.

fun sync(action: InstanceSync.() -> Unit): Unit

Work with instance services of specified instance.

fun <T> sync(instance: Instance, action: InstanceSync.() -> T): T

In parallel, work with services of all specified instances.

fun sync(instances: Iterable<Instance>, action: InstanceSync.() -> Unit): Unit

syncBundles

In parallel, work with built OSGi bundles and services of instances matching default filtering.

fun syncBundles(action: InstanceSync.(File) -> Unit): Unit

syncFiles

In parallel, work with built packages and services of specified instances.

fun syncFiles(instances: Iterable<Instance>, packages: Iterable<File>, action: InstanceSync.(File) -> Unit): Unit

syncInstance

Work with instance services of specified instance.

fun <T> syncInstance(instance: Instance, action: InstanceSync.() -> T): T

syncInstances

In parallel, work with services of all instances matching default filtering.

fun syncInstances(action: InstanceSync.() -> Unit): Unit

In parallel, work with services of all specified instances.

fun syncInstances(instances: Iterable<Instance>, action: InstanceSync.() -> Unit): Unit

syncPackages

In parallel, work with built packages and services of instances matching default filtering.

fun syncPackages(action: InstanceSync.(File) -> Unit): Unit

tasks

fun tasks(configurer: AemTaskFacade.() -> Unit): Unit

temporaryDir

Determine temporary directory for particular task.

fun temporaryDir(task: Task): File

Determine temporary directory for particular service (any name).

fun temporaryDir(name: String): File

temporaryFile

Determine temporary file for particular service (any name).

fun temporaryFile(name: String): File

validatePackage

Validate any CRX packages.

fun validatePackage(vararg packages: File, options: PackageValidator.() -> Unit): Unit
fun validatePackage(packages: Iterable<File>, options: PackageValidator.() -> Unit): Unit

vlt

Execute any Vault command.

fun vlt(command: String): VltSummary

Execute any Vault command with customized options like content directory.

fun <T> vlt(options: VltClient.() -> T): T

waitFor

Wait some time after performing asynchronous operation.

fun waitFor(time: Long): Unit

watchFiles

React on file changes under configured directories.

fun watchFiles(options: FileWatcher.() -> Unit): Unit

Companion Object Properties

NAME

const val NAME: String

TEMPORARY_DIR

const val TEMPORARY_DIR: String

Companion Object Functions

of

fun of(project: Project): AemExtension