本文整理匯總了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;
}