本文整理汇总了Java中org.gradle.api.Action.execute方法的典型用法代码示例。如果您正苦于以下问题:Java Action.execute方法的具体用法?Java Action.execute怎么用?Java Action.execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gradle.api.Action
的用法示例。
在下文中一共展示了Action.execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTasksByName
import org.gradle.api.Action; //导入方法依赖的package包/类
public Set<Task> getTasksByName(final String name, boolean recursive) {
if (!isTrue(name)) {
throw new InvalidUserDataException("Name is not specified!");
}
final Set<Task> foundTasks = new HashSet<Task>();
Action<Project> action = new Action<Project>() {
public void execute(Project project) {
// Don't force evaluation of rules here, let the task container do what it needs to
((ProjectInternal) project).evaluate();
Task task = project.getTasks().findByName(name);
if (task != null) {
foundTasks.add(task);
}
}
};
if (recursive) {
allprojects(action);
} else {
action.execute(this);
}
return foundTasks;
}
示例2: maybeAddTask
import org.gradle.api.Action; //导入方法依赖的package包/类
private <T extends Task> void maybeAddTask(Project project, IdePlugin plugin, String taskName, Class<T> taskType, Action<T> action) {
if (project.getTasks().findByName(taskName) != null) {
return;
}
T task = project.getTasks().create(taskName, taskType);
action.execute(task);
plugin.addWorker(task);
}
示例3: eachLine
import org.gradle.api.Action; //导入方法依赖的package包/类
private void eachLine(Action<String> action) {
BufferedReader reader = new BufferedReader(new StringReader(getOutput()));
String line;
try {
while ((line = reader.readLine()) != null) {
action.execute(line);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
示例4: from
import org.gradle.api.Action; //导入方法依赖的package包/类
public CopySpec from(Object sourcePath, Action<? super CopySpec> configureAction) {
if (configureAction == null) {
from(sourcePath);
return this;
} else {
CopySpecInternal child = addChild();
child.from(sourcePath);
CopySpecWrapper wrapper = instantiator.newInstance(CopySpecWrapper.class, child);
configureAction.execute(wrapper);
return wrapper;
}
}
示例5: removeCollection
import org.gradle.api.Action; //导入方法依赖的package包/类
public void removeCollection(DomainObjectCollection<? extends T> collection) {
getStore().removeComposited(collection);
Action<? super T> action = this.backingSet.getEventRegister().getRemoveAction();
for (T item : collection) {
action.execute(item);
}
}
示例6: submit
import org.gradle.api.Action; //导入方法依赖的package包/类
public void submit(Action<ClojureWorkerConfiguration> action) {
ClojureWorkerConfiguration config = new ClojureWorkerConfiguration();
action.execute(config);
FileCollection realClasspath = config.getClasspath().plus(resolveShim());
workerExecutor.submit(ClojureWorker.class, worker -> {
worker.setIsolationMode(IsolationMode.PROCESS);
worker.params(config.getNamespace(), config.getFunction(), config.getArgs());
config.getConfigureFork().forEach(worker::forkOptions);
worker.forkOptions(fork -> fork.systemProperty("shim.classpath", realClasspath.getAsPath()));
worker.classpath(resolveWorker());
});
}
示例7: addWithUniqueName
import org.gradle.api.Action; //导入方法依赖的package包/类
private <T extends ArtifactRepository> T addWithUniqueName(T repository, String defaultName, Action<? super T> insertion) {
String repositoryName = repository.getName();
if (!GUtil.isTrue(repositoryName)) {
repository.setName(uniquifyName(defaultName));
} else {
repository.setName(uniquifyName(repositoryName));
}
assertCanAdd(repository.getName());
insertion.execute(repository);
return repository;
}
示例8: mustRefreshArtifact
import org.gradle.api.Action; //导入方法依赖的package包/类
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;
}
示例9: resolveDependencySubstitutions
import org.gradle.api.Action; //导入方法依赖的package包/类
public DependencySubstitutionsInternal resolveDependencySubstitutions() {
if (dependencySubstitutions == null) {
dependencySubstitutions = DefaultDependencySubstitutions.forIncludedBuild(this);
for (Action<? super DependencySubstitutions> action : dependencySubstitutionActions) {
action.execute(dependencySubstitutions);
}
}
return dependencySubstitutions;
}
示例10: into
import org.gradle.api.Action; //导入方法依赖的package包/类
public CopySpec into(Object destPath, Action<? super CopySpec> copySpec) {
if (copySpec == null) {
into(destPath);
return this;
} else {
CopySpecInternal child = addChild();
child.into(destPath);
CopySpecWrapper wrapper = instantiator.newInstance(CopySpecWrapper.class, child);
copySpec.execute(wrapper);
return wrapper;
}
}
示例11: capsuleManifest
import org.gradle.api.Action; //导入方法依赖的package包/类
public RootManifest capsuleManifest(Action<RootManifest> manifest) {
manifest.execute(getCapsuleManifest());
return this.capsuleManifest;
}
示例12: artifact
import org.gradle.api.Action; //导入方法依赖的package包/类
@Override
public void artifact(Object notation, Action<? super ConfigurablePublishArtifact> configureAction) {
ConfigurablePublishArtifact publishArtifact = artifactNotationParser.parseNotation(notation);
artifacts.add(publishArtifact);
configureAction.execute(publishArtifact);
}
示例13: java
import org.gradle.api.Action; //导入方法依赖的package包/类
@Override
public SourceSet java(Action<? super SourceDirectorySet> configureAction) {
configureAction.execute(getJava());
return this;
}
示例14: javaexec
import org.gradle.api.Action; //导入方法依赖的package包/类
public ExecResult javaexec(Action<? super JavaExecSpec> action) {
JavaExecAction javaExecAction = instantiator.newInstance(DefaultJavaExecAction.class, fileResolver);
action.execute(javaExecAction);
return javaExecAction.execute();
}
示例15: reflectionWarnings
import org.gradle.api.Action; //导入方法依赖的package包/类
public ClojureCompileOptions reflectionWarnings(Action<? super ReflectionWarnings> configureAction) {
configureAction.execute(reflectionWarnings);
return this;
}