org.gradle.api.provider.Provider.get()方法的使用及代码示例

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

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

Provider.get介绍

暂无

代码示例

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

private String getSendMetricsFlag() {
  return sendMetrics.get()
    .map(x -> x.equals(Boolean.TRUE)?
       "--enable-send-metrics" : "--disable-send-metrics")
    .orElse(null);
}

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

@Input
public Set<String> getDependencies() {
  return dependencies.get().stream()
    .map(Object::toString).collect(Collectors.toSet());
}

代码示例来源:origin: gradle.plugin.org.itsallcode/openfasttrace-gradle

private File getOuputFileInternal()
  {
    return outputFile.getAsFile().get();
  }
}

代码示例来源:origin: gradle.plugin.org.itsallcode/openfasttrace-gradle

private List<Path> getAllImportFiles()
{
  final Stream<Path> importedRequirementPaths = importedRequirements.get().stream()
      .map(File::toPath);
  final Stream<Path> inputDirPaths = Stream.of(requirementsFile.getAsFile().get().toPath());
  return Stream.concat(importedRequirementPaths, inputDirPaths).collect(toList());
}

代码示例来源:origin: com.ca.apim.gateway/gateway-export-plugin

@TaskAction
  public void perform() throws TransformerException, FileNotFoundException {
    final StreamSource source = new StreamSource(inputBundleFile.getAsFile().get());
    final StreamResult streamResult = new StreamResult(new FileOutputStream(outputBundleFile.getAsFile().get()));
    transformer.transform(source, streamResult);
  }
}

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

private File maybeCreateOutputDirectory() throws IOException {
  File directory = getOutputFile().get().getAsFile().getParentFile();
  Files.createDirectories(directory.toPath());
  return directory;
}

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

private String generateClasspathArgument() {
  Set<File> classpathArgument = new LinkedHashSet<>();
  classpathArgument.addAll(classpath.get().getFiles());
  classpathArgument.add(jarFile.getAsFile().get());
  return classpathArgument.stream().map(File::getAbsolutePath).collect(Collectors.joining(":"));
}

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

private String generateClasspathArgument() {
  Set<File> classpathArgument = new LinkedHashSet<>();
  classpathArgument.addAll(classpath.get().getFiles());
  classpathArgument.add(jarFile.getAsFile().get());
  return classpathArgument.stream().map(File::getAbsolutePath).collect(Collectors.joining(":"));
}

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

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

代码示例来源:origin: gradle.plugin.edu.wpi.first/gradle-jni

public FileCollection getIncludeRoots() {
 ExtractJniFilesTask extractTask = (ExtractJniFilesTask) m_property.get();
 File dir = new File(extractTask.outputDirectory.getAsFile().get(), "arm-linux-jni");
 File linuxDir = new File(dir, "linux");
 return m_project.files(dir, linuxDir);
}

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

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

代码示例来源:origin: com.ca.apim.gateway/gateway-export-plugin

@TaskAction
public void perform() throws DocumentParseException {
  ExplodeBundle explodeBundle = ExportPluginModule.getInjector().getInstance(ExplodeBundle.class);
  checkExportEntities();
  explodeBundle.explodeBundle(folderPath.getOrElse("/"), toFilterConfiguration(exportEntities.getOrElse(Collections.emptyMap())), inputBundleFile.getAsFile().get(), exportDir.getAsFile().get());
}

代码示例来源:origin: gradle.plugin.org.itsallcode/openfasttrace-gradle

private File getOuputFileInternal()
{
  if (outputFile.isPresent())
  {
    return outputFile.getAsFile().get();
  }
  return getDefaultOutputFile();
}

代码示例来源:origin: gradle.plugin.com.ca.apim.gateway/gateway-developer-plugin

@TaskAction
  public void perform() {
    BundleBuilder bundleBuilder = new BundleBuilder(documentTools, documentFileUtils, fileUtils, jsonTools);
    bundleBuilder.buildBundle(from.getAsFile().get(), into.getAsFile().get(), dependencies.getFiles(), getProject().getName());
  }
}

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

public DownloadGraalTask() {
  setGroup(GradleGraalPlugin.TASK_GROUP);
  setDescription("Downloads and caches GraalVM binaries.");
  onlyIf(task -> !getTgz().get().getAsFile().exists());
}

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

public DownloadGraalTask() {
  setGroup(GradleGraalPlugin.TASK_GROUP);
  setDescription("Downloads and caches GraalVM binaries.");
  onlyIf(task -> !getTgz().get().getAsFile().exists());
}

代码示例来源:origin: com.ca.apim.gateway/gateway-developer-plugin

@TaskAction
  public void perform() {
    BundleFileBuilder bundleFileBuilder = ConfigBuilderModule.getInjector().getInstance(BundleFileBuilder.class);
    bundleFileBuilder.buildBundle(from.isPresent() ? from.getAsFile().get() : null, into.getAsFile().get(), filterBundleFiles(dependencies.getFiles()), getProject().getName() + '-' + getProject().getVersion());
  }
}

代码示例来源:origin: com.ca.apim.gateway/gateway-developer-plugin

private static BuildFullBundleTask createBuildFullBundleTask(@NotNull Project project, GatewayDeveloperPluginConfig pluginConfig, BuildDeploymentBundleTask buildDeploymentBundleTask) {
  // Create build-full-bundle task
  final BuildFullBundleTask buildFullBundleTask = project.getTasks().create(BUILD_FULL_BUNDLE, BuildFullBundleTask.class, t -> {
    t.getEnvironmentConfig().set(pluginConfig.getEnvironmentConfig());
    t.getDependencyBundles().setFrom(project.getConfigurations().getByName(BUNDLE_CONFIGURATION));
  });
  project.afterEvaluate(p ->
      buildFullBundleTask.getOutputBundle().set(new File(pluginConfig.getBuiltEnvironmentBundleDir().getAsFile().get(), p.getName() + '-' + p.getVersion() + "-full.bundle")));
  buildFullBundleTask.dependsOn(buildDeploymentBundleTask);
  return buildFullBundleTask;
}

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

public ExtractGraalTask() {
  setGroup(GradleGraalPlugin.TASK_GROUP);
  setDescription("Extracts GraalVM tooling from downloaded tgz archive using the system's tar command.");
  onlyIf(task -> !getOutputDirectory().get().getAsFile().exists());
  outputDirectory.set(graalVersion.map(v ->
      getProject().getLayout().getProjectDirectory()
          .dir(cacheDir.get().toFile().getAbsolutePath())
          .dir(v)
          .dir("graalvm-ce-" + v)));
}

代码示例来源:origin: joinfaces/joinfaces

@TaskAction
public void scanClasses() throws IOException {
  ClasspathScanner.builder()
      .classpathRoot(getDestinationDir().getAsFile().get())
      .classGraphConfigurer(classGraph -> classGraph.overrideClasspath(getClasspath()))
      .build()
      .scanClasses();
}

相关文章