org.gradle.api.provider.Provider类的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(304)

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

Provider介绍

暂无

代码示例

代码示例来源:origin: typelead/gradle-eta

public String getPackageName() {
  if (packageName != null) {
    return packageName.get();
  } else {
    return null;
  }
}

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

@Override
public T getOrNull() {
  return provider.getOrNull();
}

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

@Override
public OUT getOrNull() {
  if (base.isPresent() && provider.isPresent()) {
    return map(base.get(), provider.get());
  }
  return null;
}

代码示例来源:origin: palantir/sls-packaging

task.setBaseName(ext.getDistributionServiceName().get());
  task.setVersion(project.getVersion().toString());
  task.setExtension(ext.getProductType().map(productType -> {
    try {
      String productTypeString = CreateManifestTask.jsonMapper.writeValueAsString(productType);
      throw new RuntimeException(e);
  }).get());
  task.into(String.format("%s-%s/deployment", ext.getDistributionServiceName().get(), project.getVersion()));
}));

代码示例来源:origin: io.github.gradle-clojure/gradle-clojure-plugin

Provider<Set<String>> getAllNamespaces() {
 return getSourceRoots().map(roots -> {
  return Namespaces.findNamespaces(roots, Namespaces.CLOJURE_EXTENSIONS);
 });
}

代码示例来源:origin: gradle-clojure/gradle-clojure

public boolean isCompilerConfigured() {
 return getAotNamespaces().map(set -> !set.isEmpty()).getOrElse(false);
}

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

@Override
public OUT getOrNull() {
  if (provider.isPresent()) {
    return map(provider.get());
  }
  return null;
}

代码示例来源:origin: gradle-clojure/gradle-clojure

Provider<Set<String>> getAllNamespaces() {
 return getSourceRoots().map(roots -> {
  return Namespaces.findNamespaces(roots, Namespaces.CLOJURE_EXTENSIONS);
 });
}

代码示例来源:origin: io.github.gradle-clojure/gradle-clojure-plugin

public boolean isCompilerConfigured() {
 return getAotNamespaces().map(Set::isEmpty).getOrElse(false);
}

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

@Override
public T get() {
  return provider.get();
}

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

@Override
  public T getOrNull() {
    T value = provider.getOrNull();
    if (value == null || type.isInstance(value)) {
      return value;
    }
    throw new IllegalArgumentException(String.format("Cannot get the value of a property of type %s as the provider associated with this property returned a value of type %s.", type.getName(), value.getClass().getName()));
  }
};

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

@OutputFile
public final Provider<RegularFile> getTgz() {
  return getProject().getLayout()
      .file(getCacheSubdirectory().map(dir -> dir.resolve(render(FILENAME_PATTERN)).toFile()));
}

代码示例来源:origin: typelead/gradle-eta

public Optional<Boolean> getSendMetrics() {
  return sendMetrics.get();
}

代码示例来源:origin: typelead/gradle-eta

@Override
public T getOrNull() {
  T val = overriding.getOrNull();
  if (val == null || considerEphemeral.test(val)) {
    return ephemeral.getOrNull();
  }
  return val;
}

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

@OutputFile
public final Provider<RegularFile> getTgz() {
  return getProject().getLayout()
      .file(getCacheSubdirectory().map(dir -> dir.resolve(render(FILENAME_PATTERN)).toFile()));
}

代码示例来源:origin: typelead/gradle-eta

@Input
public boolean isFreezeConfigChanged() {
  return freezeConfigChanged.get();
}

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

private String readVersion() {
    Directory orNull = platformDir.getOrNull();

    if (orNull == null) {
      return "NONE";
    }
    Path buildFile = orNull.file("build.number").getAsFile().toPath();
    Properties properties = new Properties();

    try (BufferedReader br = new BufferedReader(new FileReader(buildFile.toFile()))) {
      properties.load(br);
    } catch (IOException e) {
      LOG.debug("could not open build.number", e);
    }
    String bootstrappedVersion = properties.getProperty("version", "NONE");
//        LOG.lifecycle("found hybris platform version: {}", bootstrappedVersion);
    return bootstrappedVersion;
  }

代码示例来源:origin: gradle-clojure/gradle-clojure

private void configureBuilds(Project project, ClojureExtension extension) {
  ClojureBuild main = extension.getBuilds().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
  main.checkAll();

  // any test ns needs this config to work with the Test task
  extension.getBuilds().matching(build -> build.getName().toLowerCase().contains("test")).all(test -> {
   test.aotAll();
   test.getAotNamespaces().add("gradle-clojure.tools.logger");
   test.getAotNamespaces().add("gradle-clojure.tools.clojure-test-junit4");
  });

  ClojureBuild dev = extension.getBuilds().getByName(ClojureCommonPlugin.DEV_SOURCE_SET_NAME);
  // REPL crashes if the user namespace doesn't compile, so make sure it does before starting
  // but also have to account project not having a user ns
  dev.getCheckNamespaces().set(dev.getAllNamespaces().map(nses -> {
   return nses.stream()
     .filter("user"::equals)
     .collect(Collectors.toSet());
  }));
 }
}

代码示例来源:origin: typelead/gradle-eta

@Input
public boolean getVersionsChanged() {
  return versionsChanged.get();
}

代码示例来源:origin: io.github.gradle-clojure/gradle-clojure-plugin

@Internal
public Object getSourceMap() {
 File sourceMap = sourceMapFile.getAsFile().getOrNull();
 if (sourceMap == null) {
  return sourceMapEnabled;
 } else {
  return sourceMap;
 }
}

相关文章