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; }
@Override public File call() throws Exception { // only care about the first one. There shouldn't be more anyway. return config.getFiles().iterator().next(); } });
@Override public File call() throws Exception { // only care about the first one. There shouldn't be more anyway. return config.getFiles().iterator().next(); } });
List<String> getFiles() { return this.configuration.getFiles() .stream() .map(File::getPath) .collect(Collectors.toList()); } }
private Set<File> getClassPathEntries() { Set<File> classpath = new HashSet<>(); classpath.addAll(getDependencies().getFiles()); classpath.addAll(getProjectClassPathEntries()); LOGGER.debug("schemaGen classpath: {}", classpath); return classpath; }
@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; }
@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(); } }
@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(); } }
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(":")); }
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(":")); }
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()]); }
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()]); }
public JacocoTransform(@NonNull final ConfigurationContainer configurations) { this.jacocoClasspath = Suppliers.memoize( () -> configurations.getByName(JacocoPlugin.AGENT_CONFIGURATION_NAME).getFiles()); }
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)); }
/** 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; } }
@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); } }
private static Set<String> configurationToSet(Project project, String configurationName) { return configurationToSet(project.getConfigurations().getByName(configurationName).getFiles()); }
@InputFiles public Set<File> getInputFiles() { try { final Configuration config = getProject().getConfigurations().getByName( "compile" ); return config.getFiles(); } catch ( final Exception e ) { return new HashSet<>(); } }
@InputFiles public Set<File> getInputFiles() { try { final Configuration config = getProject().getConfigurations().getByName( "compile" ); return config.getFiles(); } catch ( final Exception e ) { return new HashSet<>(); } }
@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() ); } } );