dep -> { if (dep.getVersion() == null || dep.getVersion().length() == 0) { return String.format("%s-%s", dep.getGroup(), dep.getName()); } else { return String.format( "%s-%s-%s", dep.getGroup(), dep.getName(), dep.getVersion()); dep.getGroup() != null && dep.getGroup().equals(AnnotationProcessorCache.AUTO_VALUE_GROUP) && dep.getName().equals(AnnotationProcessorCache.AUTO_VALUE_NAME)) .map( dep -> String.format("%s-%s-%s", dep.getGroup(), dep.getName(), dep.getVersion())) .findAny();
dependency.getGroup() != null && dependency.getGroup().equals(AUTO_VALUE_GROUP) && dependency.getName().startsWith(AUTO_VALUE_NAME));
return VersionlessDependency.builder() .setGroup(group) .setName(dependency.getName()) .build(); })
@Override public boolean isSatisfiedBy(Dependency element) { return element.getName().equals(GROUP_FG); } }), null);
@Override public void inspectDependency(Dependency dependency) { if (dependency.getVersion() != null && !dependency.getVersion().isEmpty()) { firstOrderDepsWithVersions.add(dependency.getGroup() + ":" + dependency.getName()); } }
public String getArtifactWithVersion(String groupId, String artifactId, String configurationName) { final ResolvedConfiguration resolvedConfiguration = configurations.getByName( configurationName ).getResolvedConfiguration(); resolvedConfiguration.rethrowFailure(); final LenientConfiguration lenientConfiguration = resolvedConfiguration.getLenientConfiguration(); final Optional<ResolvedDependency> dependency = lenientConfiguration. getFirstLevelModuleDependencies( d -> ( d.getGroup().equals( groupId ) && d.getName().equals( artifactId ) ) ) .stream() .findFirst(); return dependency.get().getModuleVersion(); }
private boolean isDirectDependency(DependencyResolveDetails details) { if (this.directDependencies == null) { Set<String> directDependencies = new HashSet<String>(); for (Dependency dependency : this.configuration.getAllDependencies()) { directDependencies.add(dependency.getGroup() + ":" + dependency.getName()); } this.directDependencies = directDependencies; } return this.directDependencies.contains(details.getRequested().getGroup() + ":" + details.getRequested().getName()); }
public static Optional<TestEngine> select(Project project) { var configurations = project.getConfigurations(); var testImplementation = configurations.getByName("testImplementation").getDependencies().stream(); var testCompile = configurations.getByName("testCompile").getDependencies().stream(); return Stream.concat(testImplementation, testCompile) .map(d -> TestEngine.select(d.getGroup(), d.getName())) .filter(Optional::isPresent) .map(Optional::get) .findAny(); }
public ParallelWheelGenerationTask() { onlyIf(task -> { ByteArrayOutputStream stdOut = new ByteArrayOutputStream(); getProject().exec(execSpec -> { execSpec.setExecutable(getPythonDetails().getVirtualEnvInterpreter()); execSpec.args(getPythonDetails().getVirtualEnvironment().getPip(), "freeze", "--all"); execSpec.setStandardOutput(stdOut); }); Configuration requiredDependencies = getProject().getConfigurations() .getByName(CONFIGURATION_SETUP_REQS.getValue()); Set<String> setupRequiresDependencies = requiredDependencies.getIncoming().getDependencies().stream() .flatMap(it -> Stream.of(it.getName(), it.getName().replace("-", "_"))) .collect(Collectors.toSet()); Set<String> extraDependencies = Arrays.stream(stdOut.toString().trim().split(System.lineSeparator())) .filter(it -> it.contains("==")).map(it -> it.split("==")[0]) .filter(it -> !setupRequiresDependencies.contains(it)) .collect(Collectors.toSet()); if (!extraDependencies.isEmpty()) { logger.info("Extra dependencies found ({}). Skipping parallel wheel building.", extraDependencies); } return extraDependencies.isEmpty(); }); }
public ParallelWheelGenerationTask() { onlyIf(task -> { ByteArrayOutputStream stdOut = new ByteArrayOutputStream(); getProject().exec(execSpec -> { execSpec.setExecutable(getPythonDetails().getVirtualEnvInterpreter()); execSpec.args(getPythonDetails().getVirtualEnvironment().getPip(), "freeze", "--all"); execSpec.setStandardOutput(stdOut); }); Configuration requiredDependencies = getProject().getConfigurations() .getByName(CONFIGURATION_SETUP_REQS.getValue()); Set<String> setupRequiresDependencies = requiredDependencies.getIncoming().getDependencies().stream() .flatMap(it -> Stream.of(it.getName(), it.getName().replace("-", "_"))) .collect(Collectors.toSet()); Set<String> extraDependencies = Arrays.stream(stdOut.toString().trim().split(System.lineSeparator())) .filter(it -> it.contains("==")).map(it -> it.split("==")[0]) .filter(it -> !setupRequiresDependencies.contains(it)) .collect(Collectors.toSet()); if (!extraDependencies.isEmpty()) { logger.info("Extra dependencies found ({}). Skipping parallel wheel building.", extraDependencies); } return extraDependencies.isEmpty(); }); }
@Override Set<File> getFilesOnConfiguration() { List<Dependency> rawPomDependencies = new ArrayList<>(); for(org.gradle.api.artifacts.Dependency dependency: configuration.getDependencies()) { rawPomDependencies.add(project.getDependencies().create(dependency.getGroup() + ":" + dependency.getName() + ":" + dependency.getVersion() + "@pom")); } return project.getConfigurations().detachedConfiguration( rawPomDependencies.toArray(new org.gradle.api.artifacts.Dependency[0])).resolve(); } }
/** * Format a dependency for printing * * @param dependency Dependency to format * @return Dependency information for printing */ private String formatDependency(Dependency dependency) { @NonNull String info; if (dependency instanceof SelfResolvingDependency) { SelfResolvingDependency selfResolvingDependency = (SelfResolvingDependency) dependency; info = Validate.notNull(Joiner.on(", ").join(selfResolvingDependency.resolve())); } else { info = dependency.getGroup() + ":" + dependency.getName() + ":" + dependency.getVersion(); } return info; } }
/** * Format a dependency for printing * * @param dependency Dependency to format * @return Dependency information for printing */ private String formatDependency(Dependency dependency) { @NonNull String info; if (dependency instanceof SelfResolvingDependency) { SelfResolvingDependency selfResolvingDependency = (SelfResolvingDependency) dependency; info = Validate.notNull(Joiner.on(", ").join(selfResolvingDependency.resolve())); } else { info = dependency.getGroup() + ":" + dependency.getName() + ":" + dependency.getVersion(); } return info; } }
System.out.println("Dep: "+d); if(d.getName().equals("evosuite-gradle-plugin")){
hasConflict = true; project.getLogger().warn("Found " + dependencyGroup + ":" + dependency.getName() + ":" + dependencyVersion + ", but version " + moduleVersion + " is needed for the google-services plugin.");
@Override protected void applyOnce(Project project) { ProjectDepsExtension extension = project.getExtensions().create(ProjectDepsExtension.NAME, ProjectDepsExtension.class); EclipseProjectPlugin.modifyEclipseProject(project, eclipseModel -> { // find the project's referenced projects and reference them explicitly in the eclipse model Task prepareEclipse = project.task("prepareEclipse"); prepareEclipse.doLast(task -> { Set<String> referencedProjects = eclipseModel.getProject().getReferencedProjects(); project.getConfigurations().stream() .flatMap(config -> config.getDependencies().stream()) .filter(dep -> dep instanceof ProjectDependency) .forEach(dep -> { referencedProjects.add(dep.getName()); }); }); // it's needed for generating the eclipseClasspath and eclipseProject Iterables.getOnlyElement(project.getTasksByName("eclipseClasspath", false)).dependsOn(prepareEclipse); Iterables.getOnlyElement(project.getTasksByName("eclipseProject", false)).dependsOn(prepareEclipse); // create robust classpath entries for all referenced projects eclipseModel.getClasspath().getFile().getXmlTransformer().addAction(xmlProvider -> { modifyClasspath(xmlProvider.asNode(), eclipseModel, extension); }); }); }
public GolangDependency(@Nonnull Dependency raw) { if (raw instanceof GolangDependency) { final GolangDependency original = (GolangDependency) raw; setGroup(original.getGroup()); setVersion(original.getVersion()); setRepositoryUri(original.getRepositoryUri()); setRepositoryType(original.getRepositoryType()); setUpdatePolicy(original.getUpdatePolicy()); } else { final String name = raw.getName(); if (StringUtils.isEmpty(name)) { setGroup(raw.getGroup()); } else { setGroup(raw.getGroup() + "/" + name); } final String version = raw.getVersion(); if (StringUtils.isNotEmpty(version) && !"default".equalsIgnoreCase(version)) { setVersion(version); } } }
getLogger().error( "Version '{}' of local project '{}' does not match version '{}' specified in build file '{}'", projectDependency.getVersion(), projectDependency.getName(), dependency.getVersion(), project.getRootProject().relativePath(project.getBuildFile()));
Nodes.setChildValue(dependencyNode, "artifactId", dependency.getName()); Nodes.setChildValue(dependencyNode, "version", dependency.getVersion()); Nodes.setChildValue(dependencyNode, "scope", scope);
Nodes.setChildValue(dependencyNode, "artifactId", dependency.getName()); Nodes.setChildValue(dependencyNode, "version", dependency.getVersion()); Nodes.setChildValue(dependencyNode, "scope", scope);