use of org.gradle.api.artifacts.dsl.DependencyHandler in project gradle-eta by typelead.
the class EtaInstallAllDependencies method installAllDependencies.
@TaskAction
public void installAllDependencies() {
final File workingDir = getDestinationDir();
/* Fork an etlas process to install the dependencies. */
final EtlasCommand etlas = new EtlasCommand(project);
etlas.getWorkingDirectory().set(workingDir);
boolean isUpToDate = etlas.deps(EtlasCommand.libTarget(getProject().getName()), dependencyGraph -> {
for (Project p : project.getAllprojects()) {
if (p.getConvention().findPlugin(EtaPluginConvention.class) != null) {
DependencyHandler dependencies = p.getDependencies();
for (Configuration c : p.getConfigurations()) {
final EtaConfiguration etaConfiguration = ExtensionHelper.getExtension(c, EtaConfiguration.class);
if (etaConfiguration != null) {
etaConfiguration.resolve(project, dependencies, dependencyGraph);
}
}
}
}
for (Project p : project.getAllprojects()) {
if (p.getPlugins().findPlugin(EtaPlugin.class) == null && p.getConvention().findPlugin(JavaPluginConvention.class) != null) {
p.getTasks().withType(EtaInjectDependencies.class).all(EtaInjectDependencies::injectDependencies);
}
}
});
setDidWork(!isUpToDate);
}
use of org.gradle.api.artifacts.dsl.DependencyHandler in project atlas by alibaba.
the class AtlasDependencyGraph method handleSources.
private static void handleSources(@NonNull Project project, @NonNull Set<ComponentIdentifier> artifacts, @NonNull Consumer<SyncIssue> failureConsumer) {
final DependencyHandler dependencies = project.getDependencies();
try {
ArtifactResolutionQuery query = dependencies.createArtifactResolutionQuery();
query.forComponents(artifacts);
@SuppressWarnings("unchecked") Class<? extends Artifact>[] artifactTypesArray = (Class<? extends Artifact>[]) new Class<?>[] { SourcesArtifact.class };
query.withArtifacts(JvmLibrary.class, artifactTypesArray);
query.execute().getResolvedComponents();
} catch (Throwable t) {
DependencyFailureHandlerKt.processDependencyThrowable(t, s -> null, (data, messages) -> failureConsumer.accept(new SyncIssueImpl(SyncIssue.TYPE_GENERIC, SyncIssue.SEVERITY_WARNING, null, String.format("Unable to download sources: %s", messages.get(0)), messages)));
}
}
use of org.gradle.api.artifacts.dsl.DependencyHandler in project curiostack by curioswitch.
the class CuriostackPlugin method addStandardJavaTestDependencies.
private static void addStandardJavaTestDependencies(Project project) {
Configuration testConfiguration = project.getPlugins().hasPlugin(JavaLibraryPlugin.class) ? project.getConfigurations().getByName(JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME) : project.getConfigurations().getByName(JavaPlugin.TEST_COMPILE_CONFIGURATION_NAME);
DependencyHandler dependencies = project.getDependencies();
dependencies.add(JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME, "com.google.code.findbugs:jsr305");
dependencies.add(testConfiguration.getName(), "org.curioswitch.curiostack:curio-testing-framework");
dependencies.add(testConfiguration.getName(), "org.assertj:assertj-core");
dependencies.add(testConfiguration.getName(), "org.awaitility:awaitility");
dependencies.add(testConfiguration.getName(), "junit:junit");
dependencies.add(testConfiguration.getName(), "org.mockito:mockito-core");
dependencies.add(testConfiguration.getName(), "info.solidsoft.mockito:mockito-java8");
dependencies.add(testConfiguration.getName(), "org.junit.jupiter:junit-jupiter-api");
dependencies.add(JavaPlugin.TEST_RUNTIME_ONLY_CONFIGURATION_NAME, "org.junit.jupiter:junit-jupiter-engine");
dependencies.add(JavaPlugin.TEST_RUNTIME_ONLY_CONFIGURATION_NAME, "org.junit.vintage:junit-vintage-engine");
}
Aggregations