当前位置: 首页>>代码示例>>Java>>正文


Java Action.execute方法代码示例

本文整理汇总了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;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:24,代码来源:DefaultProject.java

示例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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:EclipseWtpPlugin.java

示例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);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:OutputScrapingExecutionResult.java

示例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;
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:DefaultCopySpec.java

示例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);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:CompositeDomainObjectSet.java

示例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());
  });
}
 
开发者ID:gradle-clojure,项目名称:gradle-clojure,代码行数:14,代码来源:ClojureWorkerExecutor.java

示例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;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:DefaultArtifactRepositoryContainer.java

示例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;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:DefaultCachePolicy.java

示例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;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:DefaultIncludedBuild.java

示例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;
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:DefaultCopySpec.java

示例11: capsuleManifest

import org.gradle.api.Action; //导入方法依赖的package包/类
public RootManifest capsuleManifest(Action<RootManifest> manifest) {
  manifest.execute(getCapsuleManifest());
  return this.capsuleManifest;
}
 
开发者ID:jonas-l,项目名称:gradle-capsule-plugin,代码行数:5,代码来源:Capsule.java

示例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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:DefaultVariant.java

示例13: java

import org.gradle.api.Action; //导入方法依赖的package包/类
@Override
public SourceSet java(Action<? super SourceDirectorySet> configureAction) {
    configureAction.execute(getJava());
    return this;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:6,代码来源:DefaultSourceSet.java

示例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();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:6,代码来源:DefaultFileOperations.java

示例15: reflectionWarnings

import org.gradle.api.Action; //导入方法依赖的package包/类
public ClojureCompileOptions reflectionWarnings(Action<? super ReflectionWarnings> configureAction) {
  configureAction.execute(reflectionWarnings);
  return this;
}
 
开发者ID:gradle-clojure,项目名称:gradle-clojure,代码行数:5,代码来源:ClojureCompileOptions.java


注:本文中的org.gradle.api.Action.execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。