org.gradle.api.artifacts.Configuration.getAsPath()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(148)

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

Configuration.getAsPath介绍

暂无

代码示例

代码示例来源:origin: me.seeber.gradle/gradle-project-config

/**
   * Get the URLs for the classpath during annotation processing
   *
   * @return Classpath URLs
   */
  @Input
  @Classpath
  protected Set<URL> getClasspathUrls() {
    Configuration compileConfiguration = getProject().getConfigurations()
        .getByName(EclipseConfigPlugin.ECLIPSE_ANNOTATIONS_CONFIGURATION);

    getLogger().info("Using classpath '{}'", compileConfiguration.getAsPath());

    Set<URL> urls = compileConfiguration.getFiles().stream().map(f -> {
      try {
        return f.toURI().toURL();
      }
      catch (MalformedURLException e) {
        throw new GradleException(
            String.format("Could not create classpath for annotations task %s.", getName()), e);
      }
    }).collect(Collectors.toSet());

    return ImmutableSet.copyOf(urls);
  }
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config

/**
   * Get the URLs for the classpath during annotation processing
   *
   * @return Classpath URLs
   */
  @Input
  @Classpath
  protected Set<URL> getClasspathUrls() {
    Configuration compileConfiguration = getProject().getConfigurations()
        .getByName(EclipseConfigPlugin.ECLIPSE_ANNOTATIONS_CONFIGURATION);

    getLogger().info("Using classpath '{}'", compileConfiguration.getAsPath());

    Set<URL> urls = compileConfiguration.getFiles().stream().map(f -> {
      try {
        return f.toURI().toURL();
      }
      catch (MalformedURLException e) {
        throw new GradleException(
            String.format("Could not create classpath for annotations task %s.", getName()), e);
      }
    }).collect(Collectors.toSet());

    return ImmutableSet.copyOf(urls);
  }
}

代码示例来源:origin: MinecraftForge/ForgeGradle

.put("failonerror", true)
.put("includeantruntime", false)
.put("classpath", getProject().getConfigurations().getByName(classpath).getAsPath())
.put("encoding", "utf-8")
.put("source", "1.8")

代码示例来源:origin: gradle.plugin.org.jamgo/eclipselink-plugin

private void performWeaving(ClassLoader classLoader) throws URISyntaxException, IOException {
    this.logger.debug("source = " + this.source);
    this.logger.debug("target = " + this.target);
    this.logger.debug("classpath = " + this.getProject().getConfigurations().findByName("compile").getAsPath());
    final StaticWeaveProcessor weaveProcessor = new StaticWeaveProcessor(this.source, this.target);
    weaveProcessor.setPersistenceInfo(this.getTemporaryDir().toURI().toURL());
    weaveProcessor.setClassLoader(classLoader);
    weaveProcessor.setLog(new PrintWriter(System.out));
    weaveProcessor.setLogLevel(AbstractSessionLog.translateStringToLoggingLevel(Optional.ofNullable(this.logLevel).orElse(DEFAULT_LOG_LEVEL).toUpperCase()));
    weaveProcessor.performWeaving();
  }
}

代码示例来源:origin: com.github.rodm/gradle-teamcity-dsl-plugin

@Override
public void execute(JavaExecSpec spec) {
  getLogger().lifecycle(CONFIG_MESSAGE, getFormat(), formatPath(getBaseDir()), formatPath(getDestDir()));
  getLogger().info("Using main class {}", getMainClass());
  Configuration configuration = getProject().getConfigurations().getAt(CONFIGURATION_NAME);
  String toolPath = configuration.getAsPath();
  spec.setIgnoreExitValue(true);
  spec.setClasspath(createToolClasspath(configuration));
  spec.setMain(getMainClass());
  spec.args(getFormat(), getBaseDir().getAbsolutePath(), getDestDir().getAbsolutePath(), toolPath);
}

代码示例来源:origin: Putnami/putnami-gradle-plugin

public void configure(Project project, JettyOption jettyOption, File jettyConf) {
  ConfigurationContainer configs = project.getConfigurations();
  Configuration runtimeConf = configs.getByName(WarPlugin.PROVIDED_RUNTIME_CONFIGURATION_NAME);
  Configuration jettyClassPath = configs.getByName(PwtLibPlugin.CONF_JETTY);
  configureJavaArgs(jettyOption);
  addClassPath(jettyClassPath.getAsPath());
  addClassPath(runtimeConf.getAsPath());
  if (jettyOption.getLogRequestFile() != null) {
    ResourceUtils.ensureDir(jettyOption.getLogRequestFile().getParentFile());
    addArg("--log", jettyOption.getLogRequestFile());
  }
  if (jettyOption.getLogFile() != null) {
    ResourceUtils.ensureDir(jettyOption.getLogFile().getParentFile());
    addArg("--out", jettyOption.getLogFile());
  }
  addArg("--host", jettyOption.getBindAddress());
  addArg("--port", jettyOption.getPort());
  addArg("--stop-port", jettyOption.getStopPort());
  addArg("--stop-key", jettyOption.getStopKey());
  addArg(jettyConf.getAbsolutePath());
}

代码示例来源:origin: gradle.plugin.de.esoco.gwt/gwt-gradle-plugin

public void configure(Project project, JettyOption jettyOption, File jettyConf) {
  ConfigurationContainer configs = project.getConfigurations();
  Configuration runtimeConf = configs.getByName(WarPlugin.PROVIDED_RUNTIME_CONFIGURATION_NAME);
  Configuration jettyClassPath = configs.getByName(GwtLibPlugin.CONF_JETTY);
  configureJavaArgs(jettyOption);
  addClassPath(jettyClassPath.getAsPath());
  addClassPath(runtimeConf.getAsPath());
  if (jettyOption.getLogRequestFile() != null) {
    ResourceUtils.ensureDir(jettyOption.getLogRequestFile().getParentFile());
    addArg("--log", jettyOption.getLogRequestFile());
  }
  if (jettyOption.getLogFile() != null) {
    ResourceUtils.ensureDir(jettyOption.getLogFile().getParentFile());
    addArg("--out", jettyOption.getLogFile());
  }
  addArg("--host", jettyOption.getBindAddress());
  addArg("--port", jettyOption.getPort());
  addArg("--stop-port", jettyOption.getStopPort());
  addArg("--stop-key", jettyOption.getStopKey());
  addArg(jettyConf.getAbsolutePath());
}

代码示例来源:origin: Putnami/putnami-gradle-plugin

addClassPath(compileConf.getAsPath());
addClassPath(sdmConf.getAsPath());

代码示例来源:origin: Putnami/putnami-gradle-plugin

addClassPath(mainSourceSet.getAllJava().getSrcDirs());
addClassPath(mainSourceSet.getCompileClasspath().getAsPath());
addClassPath(sdmConf.getAsPath());

代码示例来源:origin: gradle.plugin.de.esoco.gwt/gwt-gradle-plugin

addClassPath(mainSourceSet.getAllJava().getSrcDirs());
addClassPath(mainSourceSet.getCompileClasspath().getAsPath());
addClassPath(sdmConf.getAsPath());

代码示例来源:origin: gradle.plugin.de.esoco.gwt/gwt-gradle-plugin

addClassPath(compileConf.getAsPath());
addClassPath(sdmConf.getAsPath());

相关文章

微信公众号

最新文章

更多