Search in sources :

Example 1 with OutputChangeListener

use of org.gradle.internal.execution.OutputChangeListener in project gradle by gradle.

the class DependencyManagementBuildScopeServices method createExecutionEngine.

/**
 * Execution engine for usage above Gradle scope
 *
 * Currently used for running artifact transformations in buildscript blocks.
 */
ExecutionEngine createExecutionEngine(BuildOperationExecutor buildOperationExecutor, CurrentBuildOperationRef currentBuildOperationRef, ClassLoaderHierarchyHasher classLoaderHierarchyHasher, Deleter deleter, ExecutionStateChangeDetector changeDetector, InputFingerprinter inputFingerprinter, ListenerManager listenerManager, OutputSnapshotter outputSnapshotter, OverlappingOutputDetector overlappingOutputDetector, TimeoutHandler timeoutHandler, ValidateStep.ValidationWarningRecorder validationWarningRecorder, VirtualFileSystem virtualFileSystem, DocumentationRegistry documentationRegistry) {
    OutputChangeListener outputChangeListener = listenerManager.getBroadcaster(OutputChangeListener.class);
    // TODO: Figure out how to get rid of origin scope id in snapshot outputs step
    UniqueId fixedUniqueId = UniqueId.from("dhwwyv4tqrd43cbxmdsf24wquu");
    // @formatter:off
    return new DefaultExecutionEngine(documentationRegistry, new IdentifyStep<>(new IdentityCacheStep<>(new AssignWorkspaceStep<>(new LoadPreviousExecutionStateStep<>(new RemoveUntrackedExecutionStateStep<>(new CaptureStateBeforeExecutionStep<>(buildOperationExecutor, classLoaderHierarchyHasher, outputSnapshotter, overlappingOutputDetector, new ValidateStep<>(virtualFileSystem, validationWarningRecorder, new NoOpCachingStateStep<>(new ResolveChangesStep<>(changeDetector, new SkipUpToDateStep<>(new BroadcastChangingOutputsStep<>(outputChangeListener, new StoreExecutionStateStep<>(new CaptureStateAfterExecutionStep<>(buildOperationExecutor, fixedUniqueId, outputSnapshotter, new CreateOutputsStep<>(new TimeoutStep<>(timeoutHandler, currentBuildOperationRef, new ResolveInputChangesStep<>(new RemovePreviousOutputsStep<>(deleter, outputChangeListener, new ExecuteStep<>(buildOperationExecutor)))))))))))))))))));
// @formatter:on
}
Also used : SkipUpToDateStep(org.gradle.internal.execution.steps.SkipUpToDateStep) UniqueId(org.gradle.internal.id.UniqueId) ExecuteStep(org.gradle.internal.execution.steps.ExecuteStep) CreateOutputsStep(org.gradle.internal.execution.steps.CreateOutputsStep) CaptureStateBeforeExecutionStep(org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep) OutputChangeListener(org.gradle.internal.execution.OutputChangeListener) StoreExecutionStateStep(org.gradle.internal.execution.steps.StoreExecutionStateStep) DefaultExecutionEngine(org.gradle.internal.execution.impl.DefaultExecutionEngine) LoadPreviousExecutionStateStep(org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep) ResolveInputChangesStep(org.gradle.internal.execution.steps.ResolveInputChangesStep) IdentityCacheStep(org.gradle.internal.execution.steps.IdentityCacheStep)

Example 2 with OutputChangeListener

use of org.gradle.internal.execution.OutputChangeListener in project gradle by gradle.

the class Jar method manifestFileTree.

private FileTreeInternal manifestFileTree() {
    final Cached<ManifestInternal> manifest = Cached.of(this::computeManifest);
    final OutputChangeListener outputChangeListener = outputChangeListener();
    return fileCollectionFactory().generated(getTemporaryDirFactory(), "MANIFEST.MF", action(file -> outputChangeListener.beforeOutputChange(ImmutableList.of(file.getAbsolutePath()))), action(outputStream -> manifest.get().writeTo(outputStream)));
}
Also used : Action(org.gradle.api.Action) DefaultManifest(org.gradle.api.java.archives.internal.DefaultManifest) Closure(groovy.lang.Closure) Cached(org.gradle.internal.serialization.Cached) OutputChangeListener(org.gradle.internal.execution.OutputChangeListener) SerializableLambdas.action(org.gradle.api.internal.lambdas.SerializableLambdas.action) CopySpec(org.gradle.api.file.CopySpec) DisableCachingByDefault(org.gradle.work.DisableCachingByDefault) CustomManifestInternalWrapper(org.gradle.api.java.archives.internal.CustomManifestInternalWrapper) ConfigureUtil(org.gradle.util.internal.ConfigureUtil) ImmutableList(com.google.common.collect.ImmutableList) Charset(java.nio.charset.Charset) FileCollectionFactory(org.gradle.api.internal.file.FileCollectionFactory) ProjectInternal(org.gradle.api.internal.project.ProjectInternal) FileTreeInternal(org.gradle.api.internal.file.FileTreeInternal) FileCopyDetails(org.gradle.api.file.FileCopyDetails) Manifest(org.gradle.api.java.archives.Manifest) ManifestInternal(org.gradle.api.java.archives.internal.ManifestInternal) Input(org.gradle.api.tasks.Input) InvalidUserDataException(org.gradle.api.InvalidUserDataException) Zip(org.gradle.api.tasks.bundling.Zip) Internal(org.gradle.api.tasks.Internal) CopySpecInternal(org.gradle.api.internal.file.copy.CopySpecInternal) ManifestInternal(org.gradle.api.java.archives.internal.ManifestInternal) OutputChangeListener(org.gradle.internal.execution.OutputChangeListener)

Aggregations

OutputChangeListener (org.gradle.internal.execution.OutputChangeListener)2 ImmutableList (com.google.common.collect.ImmutableList)1 Closure (groovy.lang.Closure)1 Charset (java.nio.charset.Charset)1 Action (org.gradle.api.Action)1 InvalidUserDataException (org.gradle.api.InvalidUserDataException)1 CopySpec (org.gradle.api.file.CopySpec)1 FileCopyDetails (org.gradle.api.file.FileCopyDetails)1 FileCollectionFactory (org.gradle.api.internal.file.FileCollectionFactory)1 FileTreeInternal (org.gradle.api.internal.file.FileTreeInternal)1 CopySpecInternal (org.gradle.api.internal.file.copy.CopySpecInternal)1 SerializableLambdas.action (org.gradle.api.internal.lambdas.SerializableLambdas.action)1 ProjectInternal (org.gradle.api.internal.project.ProjectInternal)1 Manifest (org.gradle.api.java.archives.Manifest)1 CustomManifestInternalWrapper (org.gradle.api.java.archives.internal.CustomManifestInternalWrapper)1 DefaultManifest (org.gradle.api.java.archives.internal.DefaultManifest)1 ManifestInternal (org.gradle.api.java.archives.internal.ManifestInternal)1 Input (org.gradle.api.tasks.Input)1 Internal (org.gradle.api.tasks.Internal)1 Zip (org.gradle.api.tasks.bundling.Zip)1