org.gradle.api.artifacts.Configuration.defaultDependencies()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(11.2k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.gradle.api.artifacts.Configuration.defaultDependencies()方法的一些代码示例,展示了Configuration.defaultDependencies()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.defaultDependencies()方法的具体详情如下:
包路径:org.gradle.api.artifacts.Configuration
类名称:Configuration
方法名:defaultDependencies

Configuration.defaultDependencies介绍

暂无

代码示例

代码示例来源:origin: gradle.plugin.com.github.spotbugs/gradlePlugin

private void configureDefaultDependencies(Configuration configuration) {
  configuration.defaultDependencies(new Action<DependencySet>() {
    @Override
    public void execute(DependencySet dependencies) {
      dependencies.add(project.getDependencies().create("com.github.spotbugs:spotbugs:" + extension.getToolVersion()));
    }
  });
}

代码示例来源:origin: gradle.plugin.ca.coglinc2/javacc-gradle-plugin

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"));
    }
  });
}

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-lang-builder

private Configuration _addConfigurationLangBuilder(final Project project) {
  Configuration configuration = GradleUtil.addConfiguration(
    project, CONFIGURATION_NAME);
  configuration.defaultDependencies(
    new Action<DependencySet>() {
      @Override
      public void execute(DependencySet dependencySet) {
        _addDependenciesLangBuilder(project);
      }
    });
  configuration.setDescription(
    "Configures Liferay Lang Builder for this project.");
  configuration.setVisible(false);
  return configuration;
}

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-theme-builder

private Configuration _addConfigurationThemeBuilder(final Project project) {
  Configuration configuration = GradleUtil.addConfiguration(
    project, THEME_BUILDER_CONFIGURATION_NAME);
  configuration.defaultDependencies(
    new Action<DependencySet>() {
      @Override
      public void execute(DependencySet dependencySet) {
        _addDependenciesThemeBuilder(project);
      }
    });
  configuration.setDescription(
    "Configures Liferay Portal Tools Theme Builder for this project.");
  configuration.setVisible(false);
  return configuration;
}

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-rest-builder

private Configuration _addConfigurationRESTBuilder(final Project project) {
  Configuration configuration = GradleUtil.addConfiguration(
    project, CONFIGURATION_NAME);
  configuration.defaultDependencies(
    new Action<DependencySet>() {
      @Override
      public void execute(DependencySet dependencySet) {
        _addDependenciesRESTBuilder(project);
      }
    });
  configuration.setDescription(
    "Configures Liferay REST Builder for this project.");
  configuration.setVisible(false);
  return configuration;
}

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-wsdl-builder

private Configuration _addConfigurationWSDLBuilder(final Project project) {
  Configuration configuration = GradleUtil.addConfiguration(
    project, CONFIGURATION_NAME);
  configuration.defaultDependencies(
    new Action<DependencySet>() {
      @Override
      public void execute(DependencySet dependencySet) {
        _addDependenciesWSDLBuilder(project);
      }
    });
  configuration.setDescription(
    "Configures Apache Axis for generating WSDL client stubs.");
  configuration.setVisible(false);
  return configuration;
}

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-css-builder

private Configuration _addConfigurationCSSBuilder(final Project project) {
  Configuration configuration = GradleUtil.addConfiguration(
    project, CSS_BUILDER_CONFIGURATION_NAME);
  configuration.defaultDependencies(
    new Action<DependencySet>() {
      @Override
      public void execute(DependencySet dependencySet) {
        _addDependenciesCSSBuilder(project);
      }
    });
  configuration.setDescription(
    "Configures Liferay CSS Builder for this project.");
  configuration.setVisible(false);
  return configuration;
}

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-tlddoc-builder

protected static Configuration addConfigurationTLDDoc(
  final Project project) {
  Configuration configuration = GradleUtil.addConfiguration(
    project, CONFIGURATION_NAME);
  configuration.defaultDependencies(
    new Action<DependencySet>() {
      @Override
      public void execute(DependencySet dependencySet) {
        _addDependenciesTLDDoc(project);
      }
    });
  configuration.setDescription(
    "Configures Tag Library Documentation Generator for this project.");
  configuration.setVisible(false);
  return configuration;
}

代码示例来源:origin: gradle.plugin.com.github.spotbugs/spotbugs-gradle-plugin

private void configureDefaultDependencies(Configuration configuration) {
  configuration.defaultDependencies((DependencySet dependencies) ->
    dependencies.add(project.getDependencies().create("com.github.spotbugs:spotbugs:" + extension.getToolVersion()))
  );
}

代码示例来源:origin: gradle.plugin.de.neckert/jpaprintdiff

@Override public void apply(Project project) {
 Configuration configuration = project.getConfigurations().create("hbm2ddlConfig")
   .setVisible(true)
   .setDescription("Description");
 configuration.defaultDependencies(
   dependencies -> {
    dependencies.add(project.getDependencies().create("org.hibernate:hibernate-core:5.2.16.Final"));
    dependencies.add(project.getDependencies().create("org.springframework.boot:spring-boot:2.0.1.RELEASE"));
   });
 HibernateSchemaExtension hbm2ddl = project.getExtensions().create("hbm2ddl", HibernateSchemaExtension.class, project);
 project.getTasks().create("generateDiffSchema", HbmDiffTask.class);
}

代码示例来源:origin: io.freefair.gradle/android-gradle-plugins

private void configureDefaultDependencies(Configuration configuration) {
  configuration.defaultDependencies(dependencies -> dependencies.add(project.getDependencies().create("com.google.code.findbugs:findbugs:" + extension.getToolVersion())));
}

代码示例来源:origin: io.freefair.gradle/android-gradle-plugins

private void configureDefaultDependencies(Configuration configuration) {
  configuration.defaultDependencies(dependencies -> dependencies.add(project.getDependencies().create("com.puppycrawl.tools:checkstyle:" + extension.getToolVersion())));
}

代码示例来源:origin: gradle.plugin.com.jonaslasauskas.capsule/gradle-capsule-plugin

@Override public void apply(Project project) {
 project.getPluginManager().apply(JavaPlugin.class);
 
 project.getConfigurations().create("capsule").defaultDependencies(dependencySet -> {
  dependencySet.add(project.getDependencies().create("co.paralleluniverse:capsule:1.0.3"));
 });
 
 project.getTasks().withType(Capsule.class).all(task -> task.executesInside(project));
 
 Capsule capsuleTask = project.getTasks().create("capsule", Capsule.class);
 capsuleTask.setGroup(BUILD_GROUP);
 capsuleTask.setDescription("Assembles a jar archive containing Capsule, caplets, and necessary jars to run an application.");
 
 Task assembleTask = project.getTasks().findByName("assemble");
 assembleTask.dependsOn(capsuleTask);
 
 Task jarTask = project.getTasks().findByName("jar");
 capsuleTask.dependsOn(jarTask);
}

代码示例来源:origin: io.freefair.gradle/android-gradle-plugins

private void configureDefaultDependencies(Configuration configuration) {
  configuration.defaultDependencies(dependencies -> {
    VersionNumber version = VersionNumber.parse(extension.getToolVersion());
    String dependency = calculateDefaultDependencyNotation(version);
    dependencies.add(project.getDependencies().create(dependency));
  });
}

代码示例来源:origin: io.freefair.gradle/lombok-plugin

@Override
public void apply(Project project) {
  this.project = project;
  lombokExtension = project.getExtensions().create("lombok", LombokExtension.class);
  lombokExtension.getConfig().put("config.stopBubbling", "true");
  lombokConfiguration = project.getConfigurations().create("lombok");
  lombokConfiguration.defaultDependencies(dependencySet -> dependencySet.add(
      project.getDependencies().create("org.projectlombok:lombok:" + lombokExtension.getVersion())
  ));
  generateLombokConfig = project.getTasks().register("generateLombokConfig", GenerateLombokConfig.class, genConfig -> {
    genConfig.getProperties().convention(lombokExtension.getConfig());
    genConfig.setGroup("lombok");
  });
  project.getTasks().withType(Delombok.class).configureEach(this::configureDelombokDefaults);
  project.getPlugins().withType(JavaPlugin.class, javaPlugin -> configureJavaPluginDefaults());
}

代码示例来源:origin: io.github.udaychandra.susel/susel-gradle-plugin

private Configuration addToolDependency(Project project) {
  Configuration config = project.getConfigurations().create("susel")
      .setVisible(false)
      .setDescription("Process and create metadata for all service providers.");
  config.defaultDependencies(dependencies ->
      dependencies.add(project.getDependencies().create("io.github.udaychandra.susel:tool:0.1.2")));
  return config;
}

代码示例来源:origin: gradle.plugin.hu.advanceweb/scott-gradle-plugin

private Configuration configureAgentDependencies(Project project, ScottPluginExtension extension) {
  Configuration agentConf = project.getConfigurations().create(AGENT_CONFIGURATION_NAME);
  agentConf.setVisible(false);
  agentConf.setTransitive(true);
  agentConf.setDescription("The Scott agent to use detailed failure reports and hassle free assertions for Java tests");
  agentConf.defaultDependencies(dependencies ->
    dependencies.add(project.getDependencies().create("hu.advancedweb:scott:" + extension.getToolVersion()))
  );
  return agentConf;
}

代码示例来源:origin: dodie/scott

private Configuration configureAgentDependencies(Project project, ScottPluginExtension extension) {
  Configuration agentConf = project.getConfigurations().create(AGENT_CONFIGURATION_NAME);
  agentConf.setVisible(false);
  agentConf.setTransitive(true);
  agentConf.setDescription("The Scott agent to use detailed failure reports and hassle free assertions for Java tests");
  agentConf.defaultDependencies(dependencies ->
    dependencies.add(project.getDependencies().create("hu.advancedweb:scott:" + extension.getToolVersion()))
  );
  return agentConf;
}

代码示例来源:origin: io.github.gradle-clojure/gradle-clojure-plugin

private void configureToolsConfigurations(Project project) {
 Configuration tools = project.getConfigurations().create(TOOLS_CONFIGURATION_NAME);
 tools.defaultDependencies(deps -> {
  deps.add(project.getDependencies().create("io.github.gradle-clojure:gradle-clojure-tools:" + getVersion()));
 });
 // TODO does this JAR get included via shadow or application plugins?
 project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().all(sourceSet -> {
  project.getConfigurations().getByName(sourceSet.getCompileClasspathConfigurationName()).extendsFrom(tools);
  project.getConfigurations().getByName(sourceSet.getRuntimeClasspathConfigurationName()).extendsFrom(tools);
 });
}

代码示例来源:origin: gradle-clojure/gradle-clojure

private void configureToolsConfigurations(Project project) {
 Configuration tools = project.getConfigurations().create(TOOLS_CONFIGURATION_NAME);
 tools.defaultDependencies(deps -> {
  deps.add(project.getDependencies().create("io.github.gradle-clojure:gradle-clojure-tools:" + getVersion()));
 });
 // TODO does this JAR get included via shadow or application plugins?
 project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().all(sourceSet -> {
  project.getConfigurations().getByName(sourceSet.getCompileClasspathConfigurationName()).extendsFrom(tools);
  project.getConfigurations().getByName(sourceSet.getRuntimeClasspathConfigurationName()).extendsFrom(tools);
 });
}

相关文章