public class AemExtension
Core of library, facade for implementing tasks, configuration aggregator.
@NotNull public static java.lang.String NAME
@NotNull public static java.lang.String TEMPORARY_DIR
public static com.cognifide.gradle.aem.AemExtension.Companion Companion
public AemExtension(@NotNull
org.gradle.api.Project project)
Core of library, facade for implementing tasks, configuration aggregator.
public org.gradle.api.logging.Logger getLogger()
@NotNull public PropertyParser getProps()
Allows to read project property specified in command line and system property as a fallback.
@NotNull public AemExtension getMain()
Access configuration for local instances or environment from different project (cross-project configuring).
@NotNull public org.gradle.api.Project getProjectMain()
Project under which common configuration files are stored. Usually it is also configures local instances and environment (is applying corresponding plugins).
Convention assumes in case of:
multi-project build - subproject with path ':aem'
single-project build - root project
@NotNull public java.util.List<java.lang.String> getProjectPrefixes()
Project name convention prefixes used to determine default:
bundle install subdirectory
CRX package base name
OSGi bundle JAR base name
in case of multi-project build and assembly packages.
@NotNull public java.lang.String getProjectName()
Project name with skipped convention prefixes.
@NotNull public java.lang.String getBaseName()
Base name used as default for CRX packages being created by compose or collect task and also for OSGi bundle JARs.
public boolean getOffline()
Allows to disable features that are using running AEM instances.
It is more soft offline mode than Gradle's one which does much more. It will not use any Maven repository so that CI build will fail which is not expected in e.g integration tests.
@NotNull public java.lang.String getEnv()
Determines current environment name to be used in e.g package deployment.
@NotNull public java.lang.String getLineSeparator()
Specify characters to be used as line endings when cleaning up checked out JCR content.
public void setLineSeparator(@NotNull
java.lang.String p)
Specify characters to be used as line endings when cleaning up checked out JCR content.
@NotNull public java.lang.String getLineSeparatorString()
@NotNull public java.io.File getConfigDir()
Directory for storing project specific files used by plugin e.g:
Groovy Scripts to be launched by Groovy Console instance service in tasks defined in project.
@NotNull public java.io.File getConfigCommonDir()
Directory for storing common files used by plugin e.g:
CRX package thumbnail
environment configuration files (HTTPD virtual hosts, Dispatcher)
instance overrides files
tail incident filter
@Internal @NotNull public FileTransferManager getFileTransfer()
public void fileTransfer(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.transfer.FileTransferManager,kotlin.Unit> options)
Define settings for file transfer facade which allows to perform basic file operations on remote servers like uploading and downloading files.
Supports multiple protocols: HTTP, SFTP, SMB and other supported by JVM.
@NotNull public PackageOptions getPackageOptions()
public void package(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.pkg.PackageOptions,kotlin.Unit> options)
Defines common settings for built packages and deployment related behavior.
public void pkg(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.pkg.PackageOptions,kotlin.Unit> options)
Defines common settings for built packages and deployment related behavior.
@NotNull public PackageFile package(@NotNull java.io.File file)
Read CRX package properties of specified ZIP file.
@NotNull public PackageFile pkg(@NotNull java.io.File file)
Read CRX package properties of specified ZIP file.
@NotNull public InstanceOptions getInstanceOptions()
public void instance(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.InstanceOptions,kotlin.Unit> options)
Defines instances to work with.
@NotNull public LocalInstanceManager getLocalInstanceManager()
@NotNull public LocalInstanceManager localInstance(@NotNull kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.LocalInstanceManager,kotlin.Unit> options)
Define common settings valid only for instances created at local file system.
@NotNull public Environment getEnvironment()
Provides API for controlling virtualized AEM environment with HTTPD and dispatcher module.
public void environment(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.environment.Environment,kotlin.Unit> configurer)
@NotNull public NotifierFacade getNotifier()
Provides API for displaying interactive notification during running build tasks.
public void notifier(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.notifier.NotifierFacade,kotlin.Unit> configurer)
@NotNull public AemTaskFacade getTasks()
Provides API for easier creation of tasks (e.g in sequence) in the matter of Gradle task configuration avoidance.
public void tasks(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.AemTaskFacade,kotlin.Unit> configurer)
@NotNull public InstanceActionPerformer getInstanceActions()
Provides API for performing actions affecting multiple instances at once.
@NotNull public java.util.List<java.lang.String> getJavaPackages()
Collection of all java packages from all projects applying bundle plugin.
@NotNull public java.util.List<com.cognifide.gradle.aem.common.instance.Instance> getInstances()
All instances matching default filtering.
public void instances(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.Instance,kotlin.Unit> consumer)
Work in parallel with instances matching default filtering.
public void instances(@NotNull
java.lang.String filter,
@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.Instance,kotlin.Unit> consumer)
Work in parallel with instances which name is matching specified wildcard filter.
@NotNull public Instance instance(@NotNull java.lang.String urlOrName)
Shorthand method for getting defined instance or creating temporary instance by URL.
@NotNull
public java.util.List<com.cognifide.gradle.aem.common.instance.Instance> instances(@NotNull
java.lang.Iterable<java.lang.String> urlsOrNames)
Shorthand method for getting defined instances or creating temporary instances by URLs.
@NotNull public Instance getAnyInstance()
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.
Purpose of this method is to easily get any instance to work with (no matter how it will be defined).
@Nullable public Instance getAvailableInstance()
Get available instance of any type (most often first defined).
@NotNull public Instance namedInstance(@Nullable java.lang.String desiredName, @NotNull java.lang.String defaultName)
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.
If none instances will be found, throws exception.
@NotNull
public java.util.List<com.cognifide.gradle.aem.common.instance.Instance> filterInstances(@NotNull
java.lang.String nameMatcher)
Find all instances which names are matching wildcard filter specified via command line parameter 'instance.name'.
@NotNull public java.util.List<com.cognifide.gradle.aem.common.instance.Instance> getAuthorInstances()
Get all author instances running on current environment.
@NotNull public Instance getAuthorInstance()
public void authorInstances(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.Instance,kotlin.Unit> consumer)
Work in parallel with all author instances running on current environment.
@NotNull public java.util.List<com.cognifide.gradle.aem.common.instance.Instance> getPublishInstances()
Get all publish instances running on current environment.
@NotNull public Instance getPublishInstance()
public void publishInstances(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.Instance,kotlin.Unit> consumer)
Work in parallel with all publish instances running on current environment.
@NotNull public java.util.List<com.cognifide.gradle.aem.common.instance.LocalInstance> getLocalInstances()
Get all local instances.
public void localInstances(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.LocalInstance,kotlin.Unit> consumer)
Work in parallel with all local instances.
@NotNull public java.util.List<com.cognifide.gradle.aem.common.instance.RemoteInstance> getRemoteInstances()
Get all remote instances.
public void remoteInstances(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.RemoteInstance,kotlin.Unit> consumer)
Work in parallel with all remote instances.
@NotNull public java.io.File getPackage()
Get CRX package defined to be built (could not yet exist).
@NotNull public java.io.File getPkg()
@NotNull public java.util.List<java.io.File> getPackages()
Get all CRX packages defined to be built.
@NotNull
public java.util.List<java.io.File> dependentPackages(@NotNull
org.gradle.api.Task task)
Get all CRX packages built before running particular task.
@NotNull public java.io.File getBundle()
Get OSGi bundle defined to be built (could not yet exist).
@NotNull public java.util.List<java.io.File> getBundles()
Get all OSGi bundles defined to be built.
@NotNull
public java.util.List<java.io.File> dependentBundles(@NotNull
org.gradle.api.Task task)
Get all OSGi bundles built before running particular task.
public void sync(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.InstanceSync,kotlin.Unit> action)
In parallel, work with services of all instances matching default filtering.
public void syncInstances(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.InstanceSync,kotlin.Unit> action)
In parallel, work with services of all instances matching default filtering.
public <T> T sync(@NotNull
Instance instance,
@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.InstanceSync,? extends T> action)
Work with instance services of specified instance.
public <T> T syncInstance(@NotNull
Instance instance,
@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.InstanceSync,? extends T> action)
Work with instance services of specified instance.
public void sync(@NotNull
java.lang.Iterable<? extends com.cognifide.gradle.aem.common.instance.Instance> instances,
@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.InstanceSync,kotlin.Unit> action)
In parallel, work with services of all specified instances.
public void syncInstances(@NotNull
java.lang.Iterable<? extends com.cognifide.gradle.aem.common.instance.Instance> instances,
@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.instance.InstanceSync,kotlin.Unit> action)
In parallel, work with services of all specified instances.
public void syncPackages(@NotNull
kotlin.jvm.functions.Function2<? super com.cognifide.gradle.aem.common.instance.InstanceSync,? super java.io.File,kotlin.Unit> action)
In parallel, work with built packages and services of instances matching default filtering.
public void syncBundles(@NotNull
kotlin.jvm.functions.Function2<? super com.cognifide.gradle.aem.common.instance.InstanceSync,? super java.io.File,kotlin.Unit> action)
In parallel, work with built OSGi bundles and services of instances matching default filtering.
public void syncFiles(@NotNull
java.lang.Iterable<? extends com.cognifide.gradle.aem.common.instance.Instance> instances,
@NotNull
java.lang.Iterable<? extends java.io.File> packages,
@NotNull
kotlin.jvm.functions.Function2<? super com.cognifide.gradle.aem.common.instance.InstanceSync,? super java.io.File,kotlin.Unit> action)
In parallel, work with built packages and services of specified instances.
@NotNull
public java.io.File composePackage(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.pkg.PackageDefinition,kotlin.Unit> definition)
Build minimal CRX package in-place / only via code. All details like Vault properties, archive destination directory, file name are customizable.
public void validatePackage(@NotNull
java.io.File[] packages,
@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.pkg.PackageValidator,kotlin.Unit> options)
Validate any CRX packages.
public void validatePackage(@NotNull
java.lang.Iterable<? extends java.io.File> packages,
@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.pkg.PackageValidator,kotlin.Unit> options)
Validate any CRX packages.
public <T> T progress(int total,
@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.build.ProgressIndicator,? extends T> action)
Show asynchronous progress indicator with percentage while performing some action.
public <T> T progress(long total,
@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.build.ProgressIndicator,? extends T> action)
Show asynchronous progress indicator with percentage while performing some action.
public <T> T progress(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.build.ProgressIndicator,? extends T> action)
public <T> T progressIndicator(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.build.ProgressIndicator,? extends T> action)
Show asynchronous progress indicator while performing some action.
public <T> T progressLogger(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.build.ProgressLogger,? extends T> action)
Show synchronous progress logger while performing some action.
public void waitFor(long time)
Wait some time after performing asynchronous operation.
public void progressCountdown(long time)
Show synchronous progress countdown / time to wait after performing asynchronous operation.
public void progressCountdown(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.build.ProgressCountdown,kotlin.Unit> options)
Show synchronous progress countdown / time to wait after performing asynchronous operation.
@NotNull public FilterFile getFilter()
@NotNull public FilterFile filter(@NotNull java.io.File file)
Get Vault filter object for specified file.
@NotNull public FilterFile filter(@NotNull java.lang.String path)
Get Vault filter object for specified path.
@NotNull
public java.io.File temporaryDir(@NotNull
org.gradle.api.Task task)
Determine temporary directory for particular task.
@NotNull
public java.io.File temporaryDir(@NotNull
java.lang.String name)
Determine temporary directory for particular service (any name).
@NotNull
public java.io.File temporaryFile(@NotNull
java.lang.String name)
Determine temporary file for particular service (any name).
@NotNull public java.io.File getTemporaryDir()
Predefined temporary directory.
@NotNull public Retry retry(@NotNull kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.build.Retry,kotlin.Unit> configurer)
Factory method for configuration object determining how operation should be retried.
@NotNull public Retry retry()
Factory method for configuration object determining that operation should not be retried.
public void watchFiles(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.FileWatcher,kotlin.Unit> options)
React on file changes under configured directories.
@NotNull
public java.io.File resolveFile(@NotNull
java.lang.Object value)
Resolve single file from defined repositories or by using defined file transfers.
@NotNull
public java.io.File resolveFile(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.resolver.FileResolver,kotlin.Unit> options)
Resolve single file from defined repositories or by using defined file transfers.
@NotNull
public java.util.List<java.io.File> resolveFiles(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.resolver.FileResolver,kotlin.Unit> options)
Resolve files from defined repositories or by using defined file transfers.
@NotNull
public java.util.List<java.io.File> resolveFiles(@NotNull
java.io.File downloadDir,
@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.resolver.FileResolver,kotlin.Unit> options)
Resolve files from defined repositories or by using defined file transfers.
public <T> T http(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.http.HttpClient,? extends T> consumer)
Perform any HTTP requests to external endpoints.
public <T> T httpFile(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.transfer.http.HttpFileTransfer,? extends T> consumer)
Download files using HTTP protocol using custom settings.
public <T> T sftpFile(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.transfer.sftp.SftpFileTransfer,? extends T> consumer)
Transfer files using over SFTP protocol using custom settings.
public <T> T smbFile(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.transfer.smb.SmbFileTransfer,? extends T> consumer)
Transfer files using over SMB protocol using custom settings.
@NotNull public VltSummary vlt(@NotNull java.lang.String command)
Execute any Vault command.
public <T> T vlt(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.tooling.vlt.VltClient,? extends T> options)
Execute any Vault command with customized options like content directory.
public <T> T rcp(@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.tooling.rcp.RcpClient,? extends T> options)
Execute any Vault JCR content remote copying with customized options like content directory.
@NotNull public DockerResult runDocker(@NotNull kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.environment.docker.RunSpec,kotlin.Unit> spec)
Execute any Docker command using all available images with mounting volumes etc, exposing ports etc.
@NotNull public Parallel getParallel()
@NotNull public Formats getFormats()
@NotNull public Patterns getPatterns()
@NotNull public BuildScope getBuildScope()
@NotNull public org.gradle.api.Project getProject()