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

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

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

Configuration.setDescription介绍

暂无

代码示例

代码示例来源:origin: alipay/sofa-boot

private Configuration createBootArchivesConfiguration(Project project) {
  Configuration bootArchives = project.getConfigurations().create(
    BOOT_ARCHIVES_CONFIGURATION_NAME);
  bootArchives.setDescription("Configuration for Spring Boot archive artifacts.");
  return bootArchives;
}

代码示例来源:origin: diffplug/spotless

public static Provisioner fromProject(Project project) {
  Objects.requireNonNull(project);
  return (withTransitives, mavenCoords) -> {
    try {
      Dependency[] deps = mavenCoords.stream()
          .map(project.getBuildscript().getDependencies()::create)
          .toArray(Dependency[]::new);
      Configuration config = project.getRootProject().getBuildscript().getConfigurations().detachedConfiguration(deps);
      config.setDescription(mavenCoords.toString());
      config.setTransitive(withTransitives);
      return config.resolve();
    } catch (Exception e) {
      logger.log(Level.SEVERE,
          StringPrinter.buildStringFromLines("You probably need to add a repository containing the '" + mavenCoords + "' artifact in the 'build.gradle' of your root project.",
              "E.g.: 'buildscript { repositories { mavenCentral() }}'",
              "Note that included buildscripts (using 'apply from') do not share their buildscript repositories with the underlying project.",
              "You have to specify the missing repository explicitly in the buildscript of the root project."),
          e);
      throw e;
    }
  };
}

代码示例来源:origin: diffplug/spotless

/**
 * Creates a Provisioner for the given repositories.
 *
 * The first time a project is created, there are ~7 seconds of configuration
 * which will go away for all subsequent runs.
 *
 * Every call to resolve will take about 1 second, even when all artifacts are resolved.
 */
private static Supplier<Provisioner> createLazyWithRepositories(Consumer<RepositoryHandler> repoConfig) {
  // Running this takes ~3 seconds the first time it is called. Probably because of classloading.
  return Suppliers.memoize(() -> {
    Project project = ProjectBuilder.builder().build();
    repoConfig.accept(project.getRepositories());
    return (withTransitives, mavenCoords) -> {
      Dependency[] deps = mavenCoords.stream()
          .map(project.getDependencies()::create)
          .toArray(Dependency[]::new);
      Configuration config = project.getConfigurations().detachedConfiguration(deps);
      config.setTransitive(withTransitives);
      config.setDescription(mavenCoords.toString());
      try {
        return config.resolve();
      } catch (ResolveException e) {
        /* Provide Maven coordinates in exception message instead of static string 'detachedConfiguration' */
        throw new ResolveException(config.getDescription(), e);
      }
    };
  });
}

代码示例来源:origin: gradle.plugin.org.hibernate.build.gradle/hibernate-matrix-testing

protected Configuration prepareConfiguration(String name) {
  Configuration configuration = getOrCreateConfiguration( name );
  configuration.setDescription( "The JDBC dependency configuration for the [" + name + "] profile" );
  return configuration;
}

代码示例来源:origin: gradle.plugin.org.hibernate.build/database-profile-plugin

protected Configuration prepareConfiguration(String name) {
  Configuration configuration = getOrCreateConfiguration( name );
  configuration.setDescription( "The JDBC dependency configuration for the [" + name + "] profile" );
  return configuration;
}

代码示例来源:origin: com.android.tools.build/gradle-core

@Override
  public void execute(Configuration files) {
    files.setVisible(false);
    files.setTransitive(true);
    files.setDescription("The Jacoco agent to use to get coverage data.");
  }
});

代码示例来源:origin: com.android.tools.build/gradle-core

@Override
  public void execute(Configuration files) {
    files.setVisible(false);
    files.setTransitive(true);
    files.setDescription(
        "The Jacoco ant tasks to use to get execute Gradle tasks.");
  }
});

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

private Configuration _addConfigurationJSCompile(Project project) {
  Configuration configuration = GradleUtil.addConfiguration(
    project, JS_COMPILE_CONFIGURATION_NAME);
  configuration.setDescription(
    "Configures additional JavaScript dependencies.");
  configuration.setVisible(false);
  return configuration;
}

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

private Configuration _addConfigurationSoyCompile(Project project) {
  Configuration configuration = GradleUtil.addConfiguration(
    project, SOY_COMPILE_CONFIGURATION_NAME);
  configuration.setDescription("Configures additional Soy dependencies.");
  configuration.setVisible(false);
  return configuration;
}

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

private void configureSpotBugsConfigurations() {
  Configuration configuration = project.getConfigurations().create("spotbugsPlugins");
  configuration.setVisible(false);
  configuration.setTransitive(true);
  configuration.setDescription("The SpotBugs plugins to be used for this project.");
}

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

private void configureSpotBugsConfigurations() {
  Configuration configuration = project.getConfigurations().create("spotbugsPlugins");
  configuration.setVisible(false);
  configuration.setTransitive(true);
  configuration.setDescription("The SpotBugs plugins to be used for this project.");
}

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

private Configuration createJavaccConfiguration(Project project) {
  Configuration configuration = project.getConfigurations().create("javacc");
  configuration.setVisible(false);
  configuration.setTransitive(true);
  configuration.setDescription("The javacc dependencies to be used.");
  return configuration;
}

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

private void configureFindBugsConfigurations() {
  Configuration configuration = project.getConfigurations().create("findbugsPlugins");
  configuration.setVisible(false);
  configuration.setTransitive(true);
  configuration.setDescription("The FindBugs plugins to be used for this project.");
}

代码示例来源: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.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: me.seeber.gradle/gradle-project-config

/**
   * @see me.seeber.gradle.plugin.AbstractProjectConfigPlugin#initialize()
   */
  @Override
  protected void initialize() {
    getProject().getPlugins().apply(ProjectConfigPlugin.class);
    getProject().getPlugins().apply(JavaPlugin.class);

    getProject().getConfigurations().create("annotate", c -> {
      c.setDescription("Modules annotated by this project.");
      c.setVisible(true);
      c.setTransitive(false);
    });
  }
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config

/**
   * @see me.seeber.gradle.plugin.AbstractProjectConfigPlugin#initialize()
   */
  @Override
  protected void initialize() {
    getProject().getPlugins().apply(ProjectConfigPlugin.class);
    getProject().getPlugins().apply(JavaPlugin.class);

    getProject().getConfigurations().create("annotate", c -> {
      c.setDescription("Modules annotated by this project.");
      c.setVisible(true);
      c.setTransitive(false);
    });
  }
}

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

protected void createConfigurations() {
  Configuration configuration = project.getConfigurations().create(getConfigurationName());
  configuration.setVisible(false);
  configuration.setTransitive(true);
  configuration.setDescription("The " + getToolName() + " libraries to be used for this project.");
  // Don't need these things, they're provided by the runtime
  configuration.exclude(excludeProperties("ant", "ant"));
  configuration.exclude(excludeProperties("org.apache.ant", "ant"));
  configuration.exclude(excludeProperties("org.apache.ant", "ant-launcher"));
  configuration.exclude(excludeProperties("org.slf4j", "slf4j-api"));
  configuration.exclude(excludeProperties("org.slf4j", "jcl-over-slf4j"));
  configuration.exclude(excludeProperties("org.slf4j", "log4j-over-slf4j"));
  configuration.exclude(excludeProperties("commons-logging", "commons-logging"));
  configuration.exclude(excludeProperties("log4j", "log4j"));
}

相关文章