org.gradle.api.Task.getDidWork()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.gradle.api.Task.getDidWork()方法的一些代码示例,展示了Task.getDidWork()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.getDidWork()方法的具体详情如下:
包路径:org.gradle.api.Task
类名称:Task
方法名:getDidWork

Task.getDidWork介绍

暂无

代码示例

代码示例来源:origin: org.gradle/gradle-core

@Override
public boolean dependsOnTaskDidWork() {
  DeprecationLogger.nagUserOfDiscontinuedMethod(
    "Task.dependsOnTaskDidWork()",
    "Instead, check the value of \"didWork()\" for each task, or declare the task inputs and outputs and let Gradle decide what needs to be run.");
  TaskDependency dependency = getTaskDependencies();
  for (Task depTask : dependency.getDependencies(this)) {
    if (depTask.getDidWork()) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: palantir/gradle-circle-style

@TaskAction
  public void createCircleReport() throws IOException, TransformerException {
    if (!styleTask.getDidWork()) {
      setDidWork(false);
      return;
    }

    File rootDir = getProject().getRootProject().getProjectDir();
    String projectName = getProject().getName();
    List<Failure> failures = failuresSupplier.getFailures();
    long taskTimeNanos = styleTaskTimer.getTaskTimeNanos(styleTask);

    Document report = reportToXml(failuresReport(
        rootDir, projectName, styleTask.getName(), taskTimeNanos, failures));
    targetFile.getParentFile().mkdirs();
    try (FileWriter writer = new FileWriter(targetFile)) {
      XmlUtils.write(writer, report);
    }
  }
}

代码示例来源:origin: gradle.plugin.com.palantir/gradle-circle-style

@TaskAction
  public void createCircleReport() throws IOException, TransformerException {
    if (!styleTask.getDidWork()) {
      setDidWork(false);
      return;
    }

    File rootDir = getProject().getRootProject().getProjectDir();
    String projectName = getProject().getName();
    File sourceReport = reporting.getReports().findByName("xml").getDestination();

    List<Failure> failures = reportParser.loadFailures(new FileInputStream(sourceReport));
    long taskTimeNanos = styleTaskTimer.getTaskTimeNanos(styleTask);
    Document report = reportToXml(failuresReport(
        rootDir, projectName, styleTask.getName(), taskTimeNanos, failures));
    targetFile.getParentFile().mkdirs();
    try (FileWriter writer = new FileWriter(targetFile)) {
      XmlUtils.write(writer, report);
    }
  }
}

代码示例来源:origin: palantir/gradle-baseline

@TaskAction
public final void createCircleReport() throws IOException, TransformerException {
  if (!styleTask.getDidWork()) {
    setDidWork(false);
    return;

代码示例来源:origin: com.palantir.baseline/gradle-circle-style

@TaskAction
public final void createCircleReport() throws IOException, TransformerException {
  if (!styleTask.getDidWork()) {
    setDidWork(false);
    return;

相关文章