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

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

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

Configuration.getFiles介绍

暂无

代码示例

代码示例来源:origin: jooby-project/jooby

public Set<File> classpath() {
 SourceSet sourceSet = sourceSet(project);
 // conf & public
 Set<File> cp = new LinkedHashSet<>(sourceSet.getResources().getSrcDirs());
 // classes/main, resources/main + jars
 cp.addAll(sourceSet.getRuntimeClasspath().getFiles());
 // provided?
 Configuration provided = project.getConfigurations().findByName("provided");
 if (provided != null) {
  cp.addAll(provided.getFiles());
 }
 return cp;
}

代码示例来源:origin: com.amazon.device.tools.build/gradle-core

@Override
  public File call() throws Exception {
    // only care about the first one. There shouldn't be more anyway.
    return config.getFiles().iterator().next();
  }
});

代码示例来源:origin: com.android.tools.build/gradle-core

@Override
  public File call() throws Exception {
    // only care about the first one. There shouldn't be more anyway.
    return config.getFiles().iterator().next();
  }
});

代码示例来源:origin: gradle.plugin.com.github.opengl-8080/assertjGen-gradle-plugin

List<String> getFiles() {
    return this.configuration.getFiles()
        .stream()
        .map(File::getPath)
        .collect(Collectors.toList());
  } 
}

代码示例来源:origin: gradle.plugin.com.github.rmee/jpa-schema-gen

private Set<File> getClassPathEntries() {
  Set<File> classpath = new HashSet<>();
  classpath.addAll(getDependencies().getFiles());
  classpath.addAll(getProjectClassPathEntries());
  LOGGER.debug("schemaGen classpath: {}", classpath);
  return classpath;
}

代码示例来源:origin: com.amazon.device.tools.build/gradle-core

@NonNull
@Override
public Collection<JavaLibrary> getJavaLibraries() {
  Set<File> files = configuration.getFiles();
  if (files.isEmpty()) {
    return Collections.emptySet();
  }
  Set<JavaLibrary> javaLibraries = Sets.newHashSet();
  for (File file : files) {
    javaLibraries.add(new JavaLibraryImpl(file, null, null));
  }
  return javaLibraries;
}

代码示例来源:origin: com.android.tools.build/gradle-core

@NonNull
public List<File> getSplitApks() {
  List<File> testedApkFiles = new ArrayList<>(testedConfiguration.getFiles());
  if (testedApkFiles.size() > 1) {
    testedApkFiles.remove(getMainApk());
    return testedApkFiles;
  } else {
    return Collections.emptyList();
  }
}

代码示例来源:origin: com.amazon.device.tools.build/gradle-core

@NonNull
public List<File> getSplitApks() {
  List<File> testedApkFiles = new ArrayList<File>(testedConfiguration.getFiles());
  if (testedApkFiles.size() > 1) {
    testedApkFiles.remove(getMainApk());
    return testedApkFiles;
  } else {
    return Collections.emptyList();
  }
}

代码示例来源: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: 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: gradle.plugin.org.jamgo/eclipselink-plugin

private URL[] getClassPath() throws MalformedURLException {
  List<URL> urls = new ArrayList<>();
  urls.add(this.getCompiledClassesDir().toURL());
  for (File eachFile : this.getProject().getConfigurations().findByName("compile").getFiles()) {
    urls.add(eachFile.toURI().toURL());
  }
  return urls.toArray(new URL[urls.size()]);
}

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

private URL[] getClassPath() throws MalformedURLException {
  List<URL> urls = new ArrayList<>();
  urls.add(this.getCompiledClassesDir().toURL());
  for (File eachFile : this.getProject().getConfigurations().findByName("compile").getFiles()) {
    urls.add(eachFile.toURI().toURL());
  }
  return urls.toArray(new URL[urls.size()]);
}

代码示例来源:origin: com.android.tools.build/gradle-core

public JacocoTransform(@NonNull  final ConfigurationContainer configurations) {
  this.jacocoClasspath = Suppliers.memoize(
      () -> configurations.getByName(JacocoPlugin.AGENT_CONFIGURATION_NAME).getFiles());
}

代码示例来源:origin: apache/meecrowave

private ClassLoader createLoader(final ClassLoader parent) {
  final Collection<URL> urls = new LinkedHashSet<>(64);
  addFiles(modules, urls);
  for (final Configuration cc : getProject().getConfigurations()) {
    if (applicationScopes.contains(cc.getName())) {
      addFiles(cc.getFiles(), urls);
    }
  }
  addFiles(classpath.getFiles(), urls);
  // use JVM loader to avoid the noise of gradle and its plugins
  return new URLClassLoader(urls.toArray(new URL[urls.size()]), new FilterGradleClassLoader(parent, classloaderFilteredPackages));
}

代码示例来源:origin: com.android.tools.build/gradle-core

/** Returns the mapping configuration of the tested app, if it is used */
@Nullable
private Configuration getTestTargetMapping(@NonNull VariantScope variantScope){
  if (mTestTargetMapping == null){
    mTestTargetMapping =
        getTestTargetConfiguration(VariantDependencies.CONFIGURATION_MAPPING);
  }
  if (mTestTargetMapping.getFiles().isEmpty()){
    return null;
  }
  else {
    return mTestTargetMapping;
  }
}

代码示例来源:origin: com.netflix.nebula/nebula-dependency-recommender

@Override
public ModelSource2 resolveModel(String groupId, String artifactId, String version) throws UnresolvableModelException {
  String notation = groupId + ":" + artifactId + ":" + version + "@pom";
  org.gradle.api.artifacts.Dependency dependency = project.getDependencies().create(notation);
  Configuration configuration = project.getConfigurations().detachedConfiguration(dependency);
  try {
    File file = configuration.getFiles().iterator().next();
    return new SimpleModelSource(new FileInputStream(file));
  } catch (Exception e) {
    throw new UnresolvableModelException(e, groupId, artifactId, version);
  }
}

代码示例来源:origin: linkedin/pygradle

private static Set<String> configurationToSet(Project project, String configurationName) {
  return configurationToSet(project.getConfigurations().getByName(configurationName).getFiles());
}

代码示例来源:origin: gradle.plugin.com.enonic.xp/xp-gradle-plugin

@InputFiles
public Set<File> getInputFiles()
{
  try
  {
    final Configuration config = getProject().getConfigurations().getByName( "compile" );
    return config.getFiles();
  }
  catch ( final Exception e )
  {
    return new HashSet<>();
  }
}

代码示例来源:origin: gradle.plugin.com.enonic.gradle/xp-gradle-plugin

@InputFiles
public Set<File> getInputFiles()
{
  try
  {
    final Configuration config = getProject().getConfigurations().getByName( "compile" );
    return config.getFiles();
  }
  catch ( final Exception e )
  {
    return new HashSet<>();
  }
}

代码示例来源:origin: gradle.plugin.org.codeartisans.gradle/gradle-wsdl-plugin

@Override
  public void execute( WorkerConfiguration config ) {
    config.setDisplayName( "Import WSDL " + wsdl.getName() + " into " + wsdl.getPackageName() );
    config.setParams( wsImportArgumentsFor( wsdl ) );
    config.setIsolationMode( IsolationMode.CLASSLOADER );
    config.classpath( jaxwsToolsConfiguration.getFiles() );
  }
} );

相关文章