本文整理汇总了Java中org.gradle.api.artifacts.DependencySet类的典型用法代码示例。如果您正苦于以下问题:Java DependencySet类的具体用法?Java DependencySet怎么用?Java DependencySet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DependencySet类属于org.gradle.api.artifacts包,在下文中一共展示了DependencySet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: triggerWhenEmptyActionsIfNecessary
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
@Override
public void triggerWhenEmptyActionsIfNecessary() {
if (!defaultDependencyActions.isEmpty()) {
for (Action<? super DependencySet> action : defaultDependencyActions) {
if (!dependencies.isEmpty()) {
break;
}
action.execute(dependencies);
}
}
// Discard actions
defaultDependencyActions.clear();
for (Configuration superConfig : extendsFrom) {
((ConfigurationInternal) superConfig).triggerWhenEmptyActionsIfNecessary();
}
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:DefaultConfiguration.java
示例2: configureTaskClasspathDefaults
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
/**
* Configures the classpath for Jacoco tasks using the 'jacocoAnt' configuration. Uses the version information declared in 'toolVersion' of the Jacoco extension if no dependencies are explicitly
* declared.
*
* @param extension the JacocoPluginExtension
*/
private void configureTaskClasspathDefaults(final JacocoPluginExtension extension) {
final Configuration config = this.project.getConfigurations().getAt(ANT_CONFIGURATION_NAME);
project.getTasks().withType(JacocoBase.class, new Action<JacocoBase>() {
@Override
public void execute(JacocoBase task) {
((IConventionAware) task).getConventionMapping().map("jacocoClasspath", Callables.returning(config));
}
});
config.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet dependencies) {
dependencies.add(project.getDependencies().create("org.jacoco:org.jacoco.ant:" + extension.getToolVersion()));
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:22,代码来源:JacocoPlugin.java
示例3: listProjectDepsSrcDirs
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private Collection<File> listProjectDepsSrcDirs(Project project) {
ConfigurationContainer configs = project.getConfigurations();
Configuration compileConf = configs.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME);
DependencySet depSet = compileConf.getAllDependencies();
List<File> result = Lists.newArrayList();
for (Dependency dep : depSet) {
if (dep instanceof ProjectDependency) {
Project projectDependency = ((ProjectDependency) dep).getDependencyProject();
if (projectDependency.getPlugins().hasPlugin(PwtLibPlugin.class)) {
JavaPluginConvention javaConvention = projectDependency.getConvention().getPlugin(JavaPluginConvention.class);
SourceSet mainSourceSet = javaConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
result.addAll(mainSourceSet.getAllSource().getSrcDirs());
}
}
}
return result;
}
开发者ID:Putnami,项目名称:putnami-gradle-plugin,代码行数:20,代码来源:CodeServerBuilder.java
示例4: addConfiguration
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private void addConfiguration(final Project project, final SonarRunnerRootExtension rootExtension) {
final Configuration configuration = project.getConfigurations().create(SonarRunnerExtension.SONAR_RUNNER_CONFIGURATION_NAME);
configuration
.setVisible(false)
.setTransitive(false)
.setDescription("The SonarRunner configuration to use to run analysis")
.getIncoming()
.beforeResolve(new Action<ResolvableDependencies>() {
public void execute(ResolvableDependencies resolvableDependencies) {
DependencySet dependencies = resolvableDependencies.getDependencies();
if (dependencies.isEmpty()) {
String toolVersion = rootExtension.getToolVersion();
DependencyHandler dependencyHandler = project.getDependencies();
Dependency dependency = dependencyHandler.create("org.codehaus.sonar.runner:sonar-runner-dist:" + toolVersion);
configuration.getDependencies().add(dependency);
}
}
});
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:20,代码来源:SonarRunnerPlugin.java
示例5: doResolve
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private Set<ResolvedDependency> doResolve(final Collection<ArtifactSpec> deps) {
final Configuration config = this.project.getConfigurations().detachedConfiguration();
final DependencySet dependencySet = config.getDependencies();
deps.forEach(spec -> {
final DefaultExternalModuleDependency d =
new DefaultExternalModuleDependency(spec.groupId(), spec.artifactId(), spec.version());
final DefaultDependencyArtifact da =
new DefaultDependencyArtifact(spec.artifactId(), spec.type(), spec.type(), spec.classifier(), null);
d.addArtifact(da);
d.getExcludeRules().add(new DefaultExcludeRule());
dependencySet.add(d);
});
return config.getResolvedConfiguration().getFirstLevelModuleDependencies();
}
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:17,代码来源:GradleArtifactResolvingHelper.java
示例6: dependencies
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private static void dependencies(Node node, Project project) {
final Configuration runtime = project.getConfigurations().findByName("runtime");
if (runtime != null) {
final DependencySet allDependencies = runtime.getAllDependencies();
if (!allDependencies.isEmpty()) {
final Node dependenciesNode = node.appendNode("dependencies");
for (Dependency dependency : allDependencies) {
if (dependency.getGroup() != null) {
final Node dependencyNode = dependenciesNode.appendNode("dependency");
dependencyNode.appendNode("groupId", dependency.getGroup());
dependencyNode.appendNode("artifactId", dependency.getName());
dependencyNode.appendNode("version", dependency.getVersion());
}
else {
LOG.warn("There is a \"null\" dependency (likely pointing directly to a file): ignoring it for the POM generation for {}", project);
}
}
}
else {
LOG.info("There are no dependencies in the \"runtime\" configuration for {}", project);
}
}
else {
LOG.info("There is no \"runtime\" configuration, so not adding any dependencies to the generated POM for {}", project);
}
}
开发者ID:jdigger,项目名称:gradle-defaults,代码行数:27,代码来源:MavenPublishPublications.java
示例7: configureDefaultDependencies
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private void configureDefaultDependencies(Configuration configuration) {
configuration.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet dependencies) {
dependencies.add(project.getDependencies().create("jdepend:jdepend:" + extension.getToolVersion()));
dependencies.add(project.getDependencies().create("org.apache.ant:ant-jdepend:1.9.6"));
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:JDependPlugin.java
示例8: configureDefaultDependencies
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private void configureDefaultDependencies(Configuration configuration) {
configuration.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet dependencies) {
VersionNumber version = VersionNumber.parse(extension.getToolVersion());
String dependency = calculateDefaultDependencyNotation(version);
dependencies.add(project.getDependencies().create(dependency));
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:PmdPlugin.java
示例9: configureDefaultDependencies
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private void configureDefaultDependencies(Configuration configuration) {
configuration.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet dependencies) {
dependencies.add(project.getDependencies().create("com.google.code.findbugs:findbugs:" + extension.getToolVersion()));
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:FindBugsPlugin.java
示例10: configureDefaultDependencies
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private void configureDefaultDependencies(Configuration configuration) {
configuration.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet dependencies) {
dependencies.add(project.getDependencies().create("com.puppycrawl.tools:checkstyle:" + extension.getToolVersion()));
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:CheckstylePlugin.java
示例11: configureDefaultDependencies
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private void configureDefaultDependencies(Configuration configuration) {
configuration.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet dependencies) {
dependencies.add(project.getDependencies().create("org.codenarc:CodeNarc:" + extension.getToolVersion()));
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:CodeNarcPlugin.java
示例12: configureDefaultRhinoDependency
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
public void configureDefaultRhinoDependency(Configuration configuration, final DependencyHandler dependencyHandler, final RhinoExtension extension) {
configuration.defaultDependencies(new Action<DependencySet>() {
public void execute(DependencySet dependencies) {
Dependency dependency = dependencyHandler.create(RhinoExtension.DEFAULT_RHINO_DEPENDENCY_GROUP + ":" + RhinoExtension.DEFAULT_RHINO_DEPENDENCY_MODULE + ":" + extension.getVersion());
dependencies.add(dependency);
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:RhinoPlugin.java
示例13: addConfiguration
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
public Configuration addConfiguration(ConfigurationContainer configurations, final DependencyHandler dependencies, final JsHintExtension extension) {
Configuration configuration = configurations.create(JsHintExtension.CONFIGURATION_NAME);
configuration.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet configDependencies) {
String notation = JsHintExtension.DEFAULT_DEPENDENCY_GROUP + ":" + JsHintExtension.DEFAULT_DEPENDENCY_MODULE + ":" + extension.getVersion() + "@js";
Dependency dependency = dependencies.create(notation);
configDependencies.add(dependency);
}
});
return configuration;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:JsHintPlugin.java
示例14: addConfiguration
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
public Configuration addConfiguration(ConfigurationContainer configurations, final DependencyHandler dependencies, final EnvJsExtension extension) {
Configuration configuration = configurations.create(EnvJsExtension.CONFIGURATION_NAME);
configuration.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet configDependencies) {
String notation = EnvJsExtension.DEFAULT_DEPENDENCY_GROUP + ":" + EnvJsExtension.DEFAULT_DEPENDENCY_MODULE + ":" + extension.getVersion() + "@js";
Dependency dependency = dependencies.create(notation);
configDependencies.add(dependency);
}
});
return configuration;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:EnvJsPlugin.java
示例15: addJsConfiguration
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private Configuration addJsConfiguration(ConfigurationContainer configurations, final DependencyHandler dependencies, final CoffeeScriptExtension extension) {
Configuration configuration = configurations.create(CoffeeScriptExtension.JS_CONFIGURATION_NAME);
configuration.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet configDependencies) {
String notation = CoffeeScriptExtension.DEFAULT_JS_DEPENDENCY_GROUP + ":" + CoffeeScriptExtension.DEFAULT_JS_DEPENDENCY_MODULE + ":" + extension.getVersion() + "@js";
Dependency dependency = dependencies.create(notation);
configDependencies.add(dependency);
}
});
return configuration;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:CoffeeScriptBasePlugin.java
示例16: configureAgentDependencies
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
/**
* Configures the agent dependencies using the 'jacocoAnt' configuration. Uses the version declared in 'toolVersion' of the Jacoco extension if no dependencies are explicitly declared.
*
* @param extension the extension that has the tool version to use
*/
private void configureAgentDependencies(JacocoAgentJar jacocoAgentJar, final JacocoPluginExtension extension) {
Configuration config = project.getConfigurations().getAt(AGENT_CONFIGURATION_NAME);
((IConventionAware) jacocoAgentJar).getConventionMapping().map("agentConf", Callables.returning(config));
config.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet dependencies) {
dependencies.add(project.getDependencies().create("org.jacoco:org.jacoco.agent:" + extension.getToolVersion()));
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:16,代码来源:JacocoPlugin.java
示例17: getExtraMap
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private Map<String, DependencyExtraInfo> getExtraMap() {
Map<String, DependencyExtraInfo> dependencyExtraInfoMap = new HashMap<>();
DependencySet dependencies = project.getConfigurations().getByName("compile").getDependencies();
dependencies.forEach(new Consumer<Dependency>() {
@Override
public void accept(Dependency dependency) {
String group = dependency.getGroup();
String name = dependency.getName();
String scope = "compile";
String type = "";
if (dependency instanceof DefaultProjectDependency) {
DefaultProjectDependency projectDependency = (DefaultProjectDependency)dependency;
if (projectDependency.getDependencyProject().getPlugins().hasPlugin(LibraryPlugin.class)) {
type = "aar";
}
}
dependencyExtraInfoMap.put(group + ":" + name, new DependencyExtraInfo(type, scope));
}
});
return dependencyExtraInfoMap;
}
开发者ID:alibaba,项目名称:atlas,代码行数:30,代码来源:UpdatePomTask.java
示例18: doResolve
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private Collection<ResolvedArtifact> doResolve(final Collection<ArtifactSpec> deps, boolean transitive) {
final Configuration config = this.project.getConfigurations().detachedConfiguration().setTransitive(transitive);
final DependencySet dependencySet = config.getDependencies();
deps.forEach(spec -> {
if (projects.containsKey(spec.groupId() + ":" + spec.artifactId() + ":" + spec.version())) {
dependencySet.add(new DefaultProjectDependency((ProjectInternal) projects.get(spec.groupId() + ":" + spec.artifactId() + ":" + spec.version()), new DefaultProjectAccessListener(), false));
} else {
final DefaultExternalModuleDependency d =
new DefaultExternalModuleDependency(spec.groupId(), spec.artifactId(), spec.version());
final DefaultDependencyArtifact da =
new DefaultDependencyArtifact(spec.artifactId(), spec.type(), spec.type(), spec.classifier(), null);
d.addArtifact(da);
dependencySet.add(d);
}
});
if (transitive) {
return config
.getResolvedConfiguration()
.getResolvedArtifacts();
}
return config
.getResolvedConfiguration()
.getFirstLevelModuleDependencies()
.stream()
.map(dep -> dep.getModuleArtifacts())
.flatMap(artifacts -> artifacts.stream())
.collect(Collectors.toList());
}
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:32,代码来源:GradleArtifactResolvingHelper.java
示例19: configureDefaultJavaccDependency
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
private void configureDefaultJavaccDependency(final Project project, Configuration configuration) {
configuration.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet dependencies) {
dependencies.add(project.getDependencies().create("net.java.dev.javacc:javacc:6.1.2"));
}
});
}
开发者ID:johnmartel,项目名称:javaccPlugin,代码行数:9,代码来源:JavaccPlugin.java
示例20: TasksFromProjectDependencies
import org.gradle.api.artifacts.DependencySet; //导入依赖的package包/类
public TasksFromProjectDependencies(String taskName, DependencySet dependencies, ProjectAccessListener projectAccessListener) {
this.taskName = taskName;
this.dependencies = dependencies;
this.projectAccessListener = projectAccessListener;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:6,代码来源:TasksFromProjectDependencies.java
注:本文中的org.gradle.api.artifacts.DependencySet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论