private Configuration createBootArchivesConfiguration(Project project) { Configuration bootArchives = project.getConfigurations().create( BOOT_ARCHIVES_CONFIGURATION_NAME); bootArchives.setDescription("Configuration for Spring Boot archive artifacts."); return bootArchives; }
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; } }; }
/** * 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); } }; }); }
protected Configuration prepareConfiguration(String name) { Configuration configuration = getOrCreateConfiguration( name ); configuration.setDescription( "The JDBC dependency configuration for the [" + name + "] profile" ); return configuration; }
protected Configuration prepareConfiguration(String name) { Configuration configuration = getOrCreateConfiguration( name ); configuration.setDescription( "The JDBC dependency configuration for the [" + name + "] profile" ); return configuration; }
@Override public void execute(Configuration files) { files.setVisible(false); files.setTransitive(true); files.setDescription("The Jacoco agent to use to get coverage data."); } });
@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."); } });
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; }
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; }
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."); }
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."); }
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; }
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."); }
@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); }
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; }
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; }
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; }
/** * @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); }); } }
/** * @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); }); } }
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")); }