private void prepareConfigurations(Project project) { ConfigurationContainer confs = project.getConfigurations(); azureTestCompileConf = confs.create(AZURE_TEST_COMPILE_CONF, (Configuration c) -> { c.extendsFrom(confs.getByName("testCompile")); }); azureRuntimeConf = confs.create(AZURE_TEST_RUNTIME_CONF, (Configuration c) -> { c.extendsFrom(confs.getByName("testRuntime")); }); }
private static void createCqPackageConf(Project project) { LOG.debug("Creating configuration: {}", CqPackagePlugin.CQ_PACKAGE); val cqPackageConf = project.getConfigurations().create(CqPackagePlugin.CQ_PACKAGE); // attach to "runtime", but don't insist that it have to be there first (or will ever be there) project.getConfigurations().withType(Configuration.class, conf -> { if (conf.getName().equals("runtime")) { LOG.debug("Making {} extend from {}", CqPackagePlugin.CQ_PACKAGE, conf.getName()); cqPackageConf.extendsFrom(conf); } }); }
@Override public VariantScope create(BaseVariant v, VariantScope parent) { VariantScope child = create(v); // TODO: should androidTest variant extendsFrom normal variant ? child.getCaptConfiguration().extendsFrom(parent.getCaptConfiguration()); return child; } }
private void configureConfigurations( ConfigurationContainer configurationContainer) { Configuration provideCompileConfiguration = configurationContainer .create(PROVIDED_COMPILE_CONFIGURATION_NAME) .setVisible(false) .setDescription( "Additional compile classpath for libraries that should not be part of the FSM archive."); Configuration provideRuntimeConfiguration = configurationContainer .create(PROVIDED_RUNTIME_CONFIGURATION_NAME) .setVisible(false) .extendsFrom(provideCompileConfiguration) .setDescription( "Additional runtime classpath for libraries that should not be part of the FSM archive."); configurationContainer.getByName(JavaPlugin.COMPILE_CONFIGURATION_NAME) .extendsFrom(provideCompileConfiguration); configurationContainer.getByName(JavaPlugin.RUNTIME_CONFIGURATION_NAME) .extendsFrom(provideRuntimeConfiguration); }
private static void createConfiguration(Project project, String configurationName) { Configuration configuration = project.getConfigurations().create(configurationName); project.getConfigurations().getByName("default").extendsFrom(configuration); }
private void addLibraryConfig() { final Configuration libConfig = this.project.getConfigurations().create( "include", conf -> conf.setTransitive( true ) ); this.project.getConfigurations().getByName( "compile" ).extendsFrom( libConfig ); }
private void addLibraryConfig() { final Configuration libConfig = this.project.getConfigurations().create( "include", conf -> conf.setTransitive( true ) ); this.project.getConfigurations().getByName( "compile" ).extendsFrom( libConfig ); }
getAnnotationProcessorConfiguration().extendsFrom( getCompileConfiguration(), getPackageConfiguration());
@Override public void execute(Configuration configuration) { if (container.getExcludedConfigurations().contains(configuration.getName())) { return; } if (configuration.getState() == Configuration.State.UNRESOLVED) { Configuration toExtend = bom; if (!project.getRootProject().equals(project)) { toExtend = bom.copy(); toExtend.setVisible(false); project.getConfigurations().add(toExtend); } configuration.extendsFrom(toExtend); } else { logger.info("Configuration '" + configuration.getName() + "' has already been resolved and cannot be included for recommendation"); } } }
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); }); }
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); }); }
@Override protected void applyVanillaUserPlugin() { final ConfigurationContainer configs = this.project.getConfigurations(); configs.maybeCreate(CONFIG_LL_DEOBF_COMPILE); configs.maybeCreate(CONFIG_LL_DC_RESOLVED); configs.getByName(CONFIG_DC_RESOLVED).extendsFrom(configs.getByName(CONFIG_LL_DC_RESOLVED)); final DelayedFile versionJson = delayedFile(VERSION_JSON_FILE); final DelayedFile versionJsonEtag = delayedFile(VERSION_JSON_FILE + ".etag"); setJson(JsonFactory.loadLiteLoaderJson(getWithEtag(VERSION_JSON_URL, versionJson.call(), versionJsonEtag.call()))); String baseName = MODFILE_PREFIX + this.project.property("archivesBaseName").toString().toLowerCase(); TaskContainer tasks = this.project.getTasks(); final Jar jar = (Jar)tasks.getByName("jar"); jar.setExtension(MODFILE_EXTENSION); jar.setBaseName(baseName); final Jar sourceJar = (Jar)tasks.getByName("sourceJar"); sourceJar.setBaseName(baseName); makeTask(TASK_LITEMOD, LiteModTask.class); }
private void configureDev(Project project, JavaPluginConvention javaConvention) { SourceSet main = javaConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME); SourceSet test = javaConvention.getSourceSets().getByName(SourceSet.TEST_SOURCE_SET_NAME); SourceSet dev = javaConvention.getSourceSets().create(DEV_SOURCE_SET_NAME); dev.setCompileClasspath(project.files(test.getOutput(), main.getOutput(), project.getConfigurations().getByName(dev.getCompileClasspathConfigurationName()))); dev.setRuntimeClasspath(project.files(dev.getAllSource().getSourceDirectories(), test.getAllSource().getSourceDirectories(), main.getAllSource().getSourceDirectories(), project.getConfigurations().getByName(dev.getRuntimeClasspathConfigurationName()))); Stream.<Function<SourceSet, String>>of(SourceSet::getCompileConfigurationName, SourceSet::getImplementationConfigurationName, SourceSet::getRuntimeConfigurationName, SourceSet::getRuntimeOnlyConfigurationName).forEach(getter -> { Configuration devConf = project.getConfigurations().getByName(getter.apply(dev)); Configuration testConf = project.getConfigurations().getByName(getter.apply(test)); devConf.extendsFrom(testConf); }); project.getTasks().create("clojureRepl", ClojureNRepl.class, task -> { task.setGroup("run"); task.setDescription("Starts an nREPL server."); task.setClasspath(dev.getRuntimeClasspath()); }); } }
@Override public void apply(Project project) { project.getPlugins().apply(JSassBasePlugin.class); Configuration webjars = project.getConfigurations().create("webjars"); project.getPlugins().withType(JavaPlugin.class, javaPlugin -> webjars.extendsFrom(project.getConfigurations().getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME)) ); TaskProvider<PrepareWebjars> prepareWebjarsTaskProvider = project.getTasks().register("prepareWebjars", PrepareWebjars.class, prepareWebjars -> { prepareWebjars.getWebjars().from(webjars); prepareWebjars.getOutputDirectory().set(project.getLayout().getBuildDirectory().dir("jsass/webjars")); }); project.getTasks().withType(SassCompile.class) .configureEach(sassCompile -> sassCompile.getIncludePaths().from(prepareWebjarsTaskProvider)); } }
.extendsFrom(lombokPlugin.getLombokConfiguration()); getProject().getConfigurations().getByName(androidSourceSet.getAnnotationProcessorConfigurationName()) .extendsFrom(lombokPlugin.getLombokConfiguration()); });
c.setVisible(false); c.setTransitive(true); c.extendsFrom( getProject().getConfigurations().getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME));
c.setVisible(false); c.setTransitive(true); c.extendsFrom( getProject().getConfigurations().getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME));
private static void createConfigurations(Project project) { Configuration pythonConf = project.getConfigurations().create(CONFIGURATION_PYTHON.getValue()); /* * To resolve transitive dependencies, we need the 'default' configuration * to extend the 'python' configuration. This is because the source * configuration must match the configuration which the artifact is * published to (i.e., 'default' in our case). */ project.getConfigurations().getByName("default").extendsFrom(pythonConf); project.getConfigurations().create(CONFIGURATION_BOOTSTRAP_REQS.getValue()); project.getConfigurations().create(CONFIGURATION_SETUP_REQS.getValue()); Configuration buildReq = project.getConfigurations().create(CONFIGURATION_BUILD_REQS.getValue()); project.getConfigurations().create(CONFIGURATION_PYDOCS.getValue()); project.getConfigurations().create(CONFIGURATION_TEST.getValue()); project.getConfigurations().create(CONFIGURATION_VENV.getValue()); Configuration flake8 = project.getConfigurations().create(CONFIGURATION_FLAKE8.getValue()); project.getConfigurations().create(CONFIGURATION_WHEEL.getValue()); //So flake8 will be installed into the activate-able venv buildReq.extendsFrom(flake8); }
private static void createConfigurations(Project project) { Configuration pythonConf = project.getConfigurations().create(CONFIGURATION_PYTHON.getValue()); /* * To resolve transitive dependencies, we need the 'default' configuration * to extend the 'python' configuration. This is because the source * configuration must match the configuration which the artifact is * published to (i.e., 'default' in our case). */ project.getConfigurations().getByName("default").extendsFrom(pythonConf); project.getConfigurations().create(CONFIGURATION_BOOTSTRAP_REQS.getValue()); project.getConfigurations().create(CONFIGURATION_SETUP_REQS.getValue()); Configuration buildReq = project.getConfigurations().create(CONFIGURATION_BUILD_REQS.getValue()); project.getConfigurations().create(CONFIGURATION_PYDOCS.getValue()); project.getConfigurations().create(CONFIGURATION_TEST.getValue()); project.getConfigurations().create(CONFIGURATION_VENV.getValue()); Configuration flake8 = project.getConfigurations().create(CONFIGURATION_FLAKE8.getValue()); project.getConfigurations().create(CONFIGURATION_WHEEL.getValue()); //So flake8 will be installed into the activate-able venv buildReq.extendsFrom(flake8); }
project.getConfigurations().getByName(sourceSet.getCompileOnlyConfigurationName()).extendsFrom(lombokConfiguration); project.getConfigurations().getByName(sourceSet.getAnnotationProcessorConfigurationName()).extendsFrom(lombokConfiguration);