Java Code Examples for org.gradle.api.Action#execute()
The following examples show how to use
org.gradle.api.Action#execute() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: pushfish-android File: CollectionUtils.java License: BSD 2-Clause "Simplified" License | 6 votes |
public static <T, I> T inject(T target, Iterable<? extends I> items, Action<InjectionStep<T, I>> action) { if (target == null) { throw new NullPointerException("The 'target' cannot be null"); } if (items == null) { throw new NullPointerException("The 'items' cannot be null"); } if (action == null) { throw new NullPointerException("The 'action' cannot be null"); } for (I item : items) { action.execute(new InjectionStep<T, I>(target, item)); } return target; }
Example 2
Source Project: Pushjet-Android File: GroupedAndNamedUniqueFileStore.java License: BSD 2-Clause "Simplified" License | 5 votes |
public LocallyAvailableResource add(K key, Action<File> addAction) { //We cannot just delegate to the add method as we need the file content for checksum calculation here //and reexecuting the action isn't acceptable final File tempFile = getTempFile(); addAction.execute(tempFile); final String groupedAndNamedKey = toPath(key, getChecksum(tempFile)); return delegate.move(groupedAndNamedKey, tempFile); }
Example 3
Source Project: Pushjet-Android File: DefaultCachePolicy.java License: BSD 2-Clause "Simplified" License | 5 votes |
public boolean mustRefreshArtifact(ArtifactIdentifier artifactIdentifier, File cachedArtifactFile, long ageMillis, boolean belongsToChangingModule, boolean moduleDescriptorInSync) { CachedArtifactResolutionControl artifactResolutionControl = new CachedArtifactResolutionControl(artifactIdentifier, cachedArtifactFile, ageMillis, belongsToChangingModule); if(belongsToChangingModule && !moduleDescriptorInSync){ return true; } for (Action<? super ArtifactResolutionControl> rule : artifactCacheRules) { rule.execute(artifactResolutionControl); if (artifactResolutionControl.ruleMatch()) { return artifactResolutionControl.mustCheck(); } } return false; }
Example 4
Source Project: pushfish-android File: Transformers.java License: BSD 2-Clause "Simplified" License | 5 votes |
public static <R, I> Transformer<R, I> toTransformer(final Action<? super I> action) { return new Transformer<R, I>() { public R transform(I original) { action.execute(original); return null; } }; }
Example 5
Source Project: pushfish-android File: ChangesOnlyIncrementalTaskInputs.java License: BSD 2-Clause "Simplified" License | 5 votes |
@Override protected void doOutOfDate(final Action<? super InputFileDetails> outOfDateAction) { for (TaskStateChange change : inputFilesState) { InputFileDetails fileChange = (InputFileDetails) change; if (fileChange.isRemoved()) { removedFiles.add(fileChange); } else { outOfDateAction.execute(fileChange); } } }
Example 6
Source Project: pushfish-android File: TestResultSerializer.java License: BSD 2-Clause "Simplified" License | 5 votes |
private void readResults(Decoder decoder, Action<? super TestClassResult> visitor) throws ClassNotFoundException, IOException { int classCount = decoder.readSmallInt(); for (int i = 0; i < classCount; i++) { TestClassResult classResult = readClassResult(decoder); visitor.execute(classResult); } }
Example 7
Source Project: pushfish-android File: DefaultDomainObjectCollection.java License: BSD 2-Clause "Simplified" License | 5 votes |
public void all(Action<? super T> action) { action = whenObjectAdded(action); // copy in case any actions mutate the store // linked list because the underlying store may preserve order Collection<T> copied = new LinkedList<T>(this); for (T t : copied) { action.execute(t); } }
Example 8
Source Project: pushfish-android File: CopyFileVisitorImpl.java License: BSD 2-Clause "Simplified" License | 5 votes |
private void processFile(FileVisitDetails visitDetails) { DefaultFileCopyDetails details = createDefaultFileCopyDetails(visitDetails); for (Action<? super FileCopyDetails> action : copySpecResolver.getAllCopyActions()) { action.execute(details); if (details.isExcluded()) { return; } } action.processFile(details); }
Example 9
Source Project: Pushjet-Android File: DefaultCommandLineToolInvocation.java License: BSD 2-Clause "Simplified" License | 5 votes |
public List<String> getArgs() { List<String> transformedArgs = Lists.newArrayList(args); for (Action<List<String>> postArgsAction : postArgsActions) { postArgsAction.execute(transformedArgs); } return transformedArgs; }
Example 10
Source Project: Pushjet-Android File: GraphRenderer.java License: BSD 2-Clause "Simplified" License | 5 votes |
/** * Visits a node in the graph. */ public void visit(Action<? super StyledTextOutput> node, boolean lastChild) { if (seenRootChildren) { output.withStyle(Info).text(prefix + (lastChild ? "\\--- " : "+--- ")); } this.lastChild = lastChild; node.execute(output); output.println(); }
Example 11
Source Project: Pushjet-Android File: DefaultIvyPublication.java License: BSD 2-Clause "Simplified" License | 4 votes |
public void configurations(Action<? super IvyConfigurationContainer> config) { config.execute(configurations); }
Example 12
Source Project: app-gradle-plugin File: AppEngineAppYamlExtension.java License: Apache License 2.0 | 4 votes |
public void tools(Action<? super ToolsExtension> action) { action.execute(tools); }
Example 13
Source Project: gradle-plugins File: DefaultAspectjSourceSet.java License: MIT License | 4 votes |
@Override public AspectjSourceSet aspectj(Action<? super SourceDirectorySet> configureAction) { configureAction.execute(getAspectj()); return this; }
Example 14
Source Project: playframework File: DefaultJavaScriptSourceSet.java License: Apache License 2.0 | 4 votes |
@Override public JavaScriptSourceSet javaScript(Action<? super SourceDirectorySet> configureAction) { configureAction.execute(getJavaScript()); return this; }
Example 15
Source Project: pushfish-android File: DefaultServiceRegistry.java License: BSD 2-Clause "Simplified" License | 4 votes |
/** * Adds services to this container using the given action. */ public void register(Action<? super ServiceRegistration> action) { action.execute(newRegistration()); }
Example 16
Source Project: atlas File: AtlasExtension.java License: Apache License 2.0 | 4 votes |
public void atlasChannelConfigs(Action<? super NamedDomainObjectContainer<DefaultChannelConfig>> action) { action.execute(atlasChannelConfigs); }
Example 17
Source Project: Pushjet-Android File: Actions.java License: BSD 2-Clause "Simplified" License | 4 votes |
public void execute(T item) { for (Action<? super T> action : actions) { action.execute(item); } }
Example 18
Source Project: gradle-cpd-plugin File: Cpd.java License: Apache License 2.0 | 4 votes |
@Override public CpdReports reports(Action<? super CpdReports> action) { action.execute(this.reports); return this.reports; }
Example 19
Source Project: Pushjet-Android File: XmlTransformer.java License: BSD 2-Clause "Simplified" License | 4 votes |
public void transform(Writer destination, Action<? super Writer> generator) { StringWriter stringWriter = new StringWriter(); generator.execute(stringWriter); transform(stringWriter.toString(), destination); }
Example 20
Source Project: pushfish-android File: ExtensionsStorage.java License: BSD 2-Clause "Simplified" License | 4 votes |
public T configure(Action<? super T> action) { action.execute(extension); return extension; }