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

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

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

Task.onlyIf介绍

暂无

代码示例

代码示例来源:origin: gradle.plugin.org.mockito/release

task.onlyIf(new SpecAdapter(allower));
postStep.onlyIf(new Spec<Task>() {
  public boolean isSatisfiedBy(Task t) {
    return task.getState().getFailure() == null;
  postStep.onlyIf(new SpecAdapter(allower));

代码示例来源:origin: org.shipkit/shipkit

@Override
public void apply(final Project project) {
  final ShipkitConfiguration conf = project.getPlugins().apply(ShipkitConfigurationPlugin.class).getConfiguration();
  project.getPlugins().apply(LocalMavenSnapshotPlugin.class);
  project.getPlugins().apply("com.gradle.plugin-publish");
  //Above also applies 'java' plugin
  final Task publishPlugins = project.getTasks().getByName(PUBLISH_PLUGINS_TASK);
  LazyConfiguration.lazyConfiguration(publishPlugins, () -> {
    authenticate(PUBLISH_KEY_PROPERTY, project, PUBLISH_KEY_ENV, envVariables);
    authenticate(PUBLISH_SECRET_PROPERTY, project, PUBLISH_SECRET_ENV, envVariables);
  });
  publishPlugins.onlyIf(t -> {
    if (conf.isDryRun()) {
      LOG.info("dryRun is enabled, skipping '{}' using 'onlyIf'", t.getName());
    }
    return !conf.isDryRun();
  });
}

代码示例来源:origin: mockito/shipkit

@Override
public void apply(final Project project) {
  final ShipkitConfiguration conf = project.getPlugins().apply(ShipkitConfigurationPlugin.class).getConfiguration();
  project.getPlugins().apply(LocalMavenSnapshotPlugin.class);
  project.getPlugins().apply("com.gradle.plugin-publish");
  //Above also applies 'java' plugin
  final Task publishPlugins = project.getTasks().getByName(PUBLISH_PLUGINS_TASK);
  LazyConfiguration.lazyConfiguration(publishPlugins, () -> {
    authenticate(PUBLISH_KEY_PROPERTY, project, PUBLISH_KEY_ENV, envVariables);
    authenticate(PUBLISH_SECRET_PROPERTY, project, PUBLISH_SECRET_ENV, envVariables);
  });
  publishPlugins.onlyIf(t -> {
    if (conf.isDryRun()) {
      LOG.info("dryRun is enabled, skipping '{}' using 'onlyIf'", t.getName());
    }
    return !conf.isDryRun();
  });
}

代码示例来源:origin: gradle.plugin.mpern.sap.commerce/commerce-gradle-plugin

t.onlyIf(o -> versionMismatch(extension, t.getLogger()));
});
unpackPlatform.mustRunAfter(cleanOnVersionChange);

相关文章