當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。