/** * Returns a map representing the tested dependencies. This represents only the packaged * ones as they are the one that matters when figuring out what to skip in the test * graphs. * * The map represents (dependency key, version) where the key is basically * the coordinates minus the version. * * @return the map */ private static Map<String, String> collectTestedDependencyMap( @Nullable VariantDependencies testedVariantDeps) { if (testedVariantDeps == null) { return ImmutableMap.of(); } DependencyContainer packageDeps = testedVariantDeps.getPackageDependencies(); Map<String, String> map = Maps .newHashMapWithExpectedSize(packageDeps.getAllDependencies().size()); for (Dependency dependency : packageDeps.getAllDependencies()) { MavenCoordinates coordinates = dependency.getCoordinates(); map.put(coordinates.getVersionlessId(), coordinates.getVersion()); } return map; }
/** * Returns the compile classpath for this config. If the config tests a library, this * will include the classpath of the tested config * * @return a non null, but possibly empty set. */ @NonNull public Set<File> getCompileClasspath() { DependencyContainer compileDep = getCompileDependencies(); Set<File> classpath = Sets.newLinkedHashSetWithExpectedSize( compileDep.getAllDependencies().size()); for (Dependency dependency : compileDep.getAllDependencies()) { classpath.add(dependency.getClasspathFile()); List<File> additionalFiles = dependency.getAdditionalClasspath(); if (additionalFiles != null) { classpath.addAll(additionalFiles); } } return classpath; }
List<Dependency> dependencies = compileDependencies.getAllDependencies(); Set<File> jars = Sets.newLinkedHashSetWithExpectedSize(dependencies.size());
/** * Returns the list of packaged jars for this config. If the config tests a library, this * will include the jars of the tested config * * @return a non null, but possibly empty list. */ @NonNull public Set<File> getAllPackagedJars() { final DependencyContainer packageDeps = getPackageDependencies(); Set<File> jars = Sets.newLinkedHashSetWithExpectedSize( packageDeps.getAllDependencies().size()); for (Dependency dependency : packageDeps.getAllPackagedDependencies()) { File jarFile = dependency.getClasspathFile(); if (jarFile.isFile()) { jars.add(jarFile); } List<File> additionalJarFiles = dependency.getAdditionalClasspath(); if (additionalJarFiles != null) { for (File jar : additionalJarFiles) { if (jar.isFile()) { jars.add(jar); } } } } return jars; }
final DependencyContainer packageDeps = getPackageDependencies(); Set<File> jars = Sets.newLinkedHashSetWithExpectedSize( packageDeps.getAllDependencies().size());
for (Dependency dependency : compileContainer.getAllDependencies()) { sLibraryCache.get(dependency); ? packageContainer.getAllDependencies() : packageContainer.getDependencyMap().values();