org.gradle.api.artifacts.ConfigurationContainer Java Examples
The following examples show how to use
org.gradle.api.artifacts.ConfigurationContainer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JettyServerBuilder.java From putnami-gradle-plugin with GNU Lesser General Public License v3.0 | 6 votes |
public void configure(Project project, JettyOption jettyOption, File jettyConf) { ConfigurationContainer configs = project.getConfigurations(); Configuration runtimeConf = configs.getByName(WarPlugin.PROVIDED_RUNTIME_CONFIGURATION_NAME); Configuration jettyClassPath = configs.getByName(PwtLibPlugin.CONF_JETTY); configureJavaArgs(jettyOption); addClassPath(jettyClassPath.getAsPath()); addClassPath(runtimeConf.getAsPath()); if (jettyOption.getLogRequestFile() != null) { ResourceUtils.ensureDir(jettyOption.getLogRequestFile().getParentFile()); addArg("--log", jettyOption.getLogRequestFile()); } if (jettyOption.getLogFile() != null) { ResourceUtils.ensureDir(jettyOption.getLogFile().getParentFile()); addArg("--out", jettyOption.getLogFile()); } addArg("--host", jettyOption.getBindAddress()); addArg("--port", jettyOption.getPort()); addArg("--stop-port", jettyOption.getStopPort()); addArg("--stop-key", jettyOption.getStopKey()); addArg(jettyConf.getAbsolutePath()); }
Example #2
Source File: PwtPlugin.java From putnami-gradle-plugin with GNU Lesser General Public License v3.0 | 6 votes |
private void createCompileTask(final Project project) { project.getTasks().create(GwtCompileTask.NAME, GwtCompileTask.class); final PutnamiExtension extension = project.getExtensions().getByType(PutnamiExtension.class); final War warTask = project.getTasks().withType(War.class).getByName("war"); warTask.dependsOn(GwtCompileTask.NAME); project.getTasks().withType(GwtCompileTask.class, new Action<GwtCompileTask>() { @Override public void execute(final GwtCompileTask task) { task.configure(project, extension); warTask.from(extension.getCompile().getWar()); } }); ConfigurationContainer configurationContainer = project.getConfigurations(); // Configuration gwtConfig = configurationContainer.getByName(PwtLibPlugin.CONF_GWT_SDM); // FileCollection warClasspath = warTask.getClasspath().minus(gwtConfig); // warTask.setClasspath(warClasspath); }
Example #3
Source File: GolangPluginSupport.java From gradle-golang-plugin with Mozilla Public License 2.0 | 6 votes |
@Override public void apply(Project project) { final ConfigurationContainer configurations = project.getConfigurations(); configurations.maybeCreate("test"); configurations.maybeCreate("build"); configurations.maybeCreate("tool"); final ExtensionContainer extensions = project.getExtensions(); final ExtensionAware golang = (ExtensionAware) extensions.create("golang", GolangSettings.class, true, project); golang.getExtensions().create("build", BuildSettings.class, true, project); golang.getExtensions().create("toolchain", ToolchainSettings.class, true, project); golang.getExtensions().create("dependencies", DependenciesSettings.class, true, project); golang.getExtensions().create("testing", TestingSettings.class, true, project); extensions.create(INSTANCE_PROPERTY_NAME, Reference.class, this); final TaskContainer tasks = project.getTasks(); addTasks(tasks); }
Example #4
Source File: CppPublicMacrosPlugin.java From native-samples with Apache License 2.0 | 6 votes |
private static Configuration createElementsConfiguration(ConfigurationContainer configurations, ObjectFactory objectFactory) { return configurations.create("cppPublicMacrosElements", new Action<Configuration>() { @Override public void execute(Configuration configuration) { configurations.all(new Action<Configuration>() { @Override public void execute(Configuration it) { if (it.getName().toLowerCase().endsWith("implementation")) { configuration.extendsFrom(it); } } }); configuration.setCanBeConsumed(true); configuration.setCanBeResolved(false); configuration.getAttributes().attribute(Usage.USAGE_ATTRIBUTE, objectFactory.named(Usage.class, "cpp-public-macros")); } }); }
Example #5
Source File: CppPublicMacrosPlugin.java From native-samples with Apache License 2.0 | 6 votes |
private static Configuration createConfiguration(ConfigurationContainer configurations, ObjectFactory objectFactory) { return configurations.create("cppPublicMacros", new Action<Configuration>() { @Override public void execute(Configuration configuration) { configurations.all(new Action<Configuration>() { @Override public void execute(Configuration it) { if (it.getName().toLowerCase().endsWith("implementation")) { configuration.extendsFrom(it); } } }); configuration.setCanBeConsumed(false); configuration.setCanBeResolved(true); configuration.getAttributes().attribute(Usage.USAGE_ATTRIBUTE, objectFactory.named(Usage.class, "cpp-public-macros")); } }); }
Example #6
Source File: DefaultMavenPom.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public DefaultMavenPom(ConfigurationContainer configurationContainer, Conf2ScopeMappingContainer scopeMappings, PomDependenciesConverter pomDependenciesConverter, FileResolver fileResolver) { this.configurations = configurationContainer; this.scopeMappings = scopeMappings; this.pomDependenciesConverter = pomDependenciesConverter; this.fileResolver = fileResolver; mavenProject.setModelVersion("4.0.0"); }
Example #7
Source File: DefaultDeployerFactory.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public DefaultDeployerFactory(MavenFactory mavenFactory, Factory<LoggingManagerInternal> loggingManagerFactory, FileResolver fileResolver, MavenPomMetaInfoProvider pomMetaInfoProvider, ConfigurationContainer configurationContainer, Conf2ScopeMappingContainer scopeMapping) { this.mavenFactory = mavenFactory; this.loggingManagerFactory = loggingManagerFactory; this.fileResolver = fileResolver; this.pomMetaInfoProvider = pomMetaInfoProvider; this.configurationContainer = configurationContainer; this.scopeMapping = scopeMapping; }
Example #8
Source File: DefaultDeployerFactory.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public DefaultDeployerFactory(MavenFactory mavenFactory, Factory<LoggingManagerInternal> loggingManagerFactory, FileResolver fileResolver, MavenPomMetaInfoProvider pomMetaInfoProvider, ConfigurationContainer configurationContainer, Conf2ScopeMappingContainer scopeMapping) { this.mavenFactory = mavenFactory; this.loggingManagerFactory = loggingManagerFactory; this.fileResolver = fileResolver; this.pomMetaInfoProvider = pomMetaInfoProvider; this.configurationContainer = configurationContainer; this.scopeMapping = scopeMapping; }
Example #9
Source File: DefaultMavenPomFactory.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public DefaultMavenPomFactory(ConfigurationContainer configurationContainer, Conf2ScopeMappingContainer conf2ScopeMappingContainer, PomDependenciesConverter pomDependenciesConverter, FileResolver fileResolver) { this.configurationContainer = configurationContainer; this.conf2ScopeMappingContainer = conf2ScopeMappingContainer; this.pomDependenciesConverter = pomDependenciesConverter; this.fileResolver = fileResolver; }
Example #10
Source File: WarPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public 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 WAR 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 WAR archive."); configurationContainer.getByName(JavaPlugin.COMPILE_CONFIGURATION_NAME).extendsFrom(provideCompileConfiguration); configurationContainer.getByName(JavaPlugin.RUNTIME_CONFIGURATION_NAME).extendsFrom(provideRuntimeConfiguration); }
Example #11
Source File: JavaPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
void configureConfigurations(Project project) { ConfigurationContainer configurations = project.getConfigurations(); Configuration compileConfiguration = configurations.getByName(COMPILE_CONFIGURATION_NAME); Configuration runtimeConfiguration = configurations.getByName(RUNTIME_CONFIGURATION_NAME); Configuration compileTestsConfiguration = configurations.getByName(TEST_COMPILE_CONFIGURATION_NAME); compileTestsConfiguration.extendsFrom(compileConfiguration); configurations.getByName(TEST_RUNTIME_CONFIGURATION_NAME).extendsFrom(runtimeConfiguration, compileTestsConfiguration); configurations.getByName(Dependency.DEFAULT_CONFIGURATION).extendsFrom(runtimeConfiguration); }
Example #12
Source File: WarPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public 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 WAR 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 WAR archive."); configurationContainer.getByName(JavaPlugin.COMPILE_CONFIGURATION_NAME).extendsFrom(provideCompileConfiguration); configurationContainer.getByName(JavaPlugin.RUNTIME_CONFIGURATION_NAME).extendsFrom(provideRuntimeConfiguration); }
Example #13
Source File: DefaultMavenPom.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public DefaultMavenPom(ConfigurationContainer configurationContainer, Conf2ScopeMappingContainer scopeMappings, PomDependenciesConverter pomDependenciesConverter, FileResolver fileResolver) { this.configurations = configurationContainer; this.scopeMappings = scopeMappings; this.pomDependenciesConverter = pomDependenciesConverter; this.fileResolver = fileResolver; mavenProject.setModelVersion("4.0.0"); }
Example #14
Source File: DefaultScriptHandlerFactory.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public ScriptHandler create(ScriptSource scriptSource, ClassLoaderScope classLoaderScope, DomainObjectContext context) { DependencyResolutionServices services = dependencyManagementServices.create(fileResolver, dependencyMetaDataProvider, projectFinder, context); RepositoryHandler repositoryHandler = services.getResolveRepositoryHandler(); ConfigurationContainer configurationContainer = services.getConfigurationContainer(); DependencyHandler dependencyHandler = services.getDependencyHandler(); return new DefaultScriptHandler(scriptSource, repositoryHandler, dependencyHandler, configurationContainer, new ScriptHandlerClassLoaderFactory(scriptSource, classLoaderScope)); }
Example #15
Source File: EarPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private void configureConfigurations(final Project project) { ConfigurationContainer configurations = project.getConfigurations(); Configuration moduleConfiguration = configurations.create(DEPLOY_CONFIGURATION_NAME).setVisible(false) .setTransitive(false).setDescription("Classpath for deployable modules, not transitive."); Configuration earlibConfiguration = configurations.create(EARLIB_CONFIGURATION_NAME).setVisible(false) .setDescription("Classpath for module dependencies."); configurations.getByName(Dependency.DEFAULT_CONFIGURATION) .extendsFrom(moduleConfiguration, earlibConfiguration); }
Example #16
Source File: DefaultDependencyHandler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public DefaultDependencyHandler(ConfigurationContainer configurationContainer, DependencyFactory dependencyFactory, ProjectFinder projectFinder, ComponentMetadataHandler metadataHandler, ArtifactResolutionQueryFactory resolutionQueryFactory) { this.configurationContainer = configurationContainer; this.dependencyFactory = dependencyFactory; this.projectFinder = projectFinder; this.metadataHandler = metadataHandler; this.resolutionQueryFactory = resolutionQueryFactory; }
Example #17
Source File: AbstractScriptHandler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public AbstractScriptHandler(RepositoryHandler repositoryHandler, DependencyHandler dependencyHandler, ScriptSource scriptSource, ConfigurationContainer configContainer) { this.repositoryHandler = repositoryHandler; this.dependencyHandler = dependencyHandler; this.scriptSource = scriptSource; this.configContainer = configContainer; classpathConfiguration = configContainer.create(CLASSPATH_CONFIGURATION); }
Example #18
Source File: DefaultMavenPomFactory.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public DefaultMavenPomFactory(ConfigurationContainer configurationContainer, Conf2ScopeMappingContainer conf2ScopeMappingContainer, PomDependenciesConverter pomDependenciesConverter, FileResolver fileResolver) { this.configurationContainer = configurationContainer; this.conf2ScopeMappingContainer = conf2ScopeMappingContainer; this.pomDependenciesConverter = pomDependenciesConverter; this.fileResolver = fileResolver; }
Example #19
Source File: MavenPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private void configureJavaScopeMappings(ConfigurationContainer configurations, Conf2ScopeMappingContainer mavenScopeMappings) { mavenScopeMappings.addMapping(COMPILE_PRIORITY, configurations.getByName(JavaPlugin.COMPILE_CONFIGURATION_NAME), Conf2ScopeMappingContainer.COMPILE); mavenScopeMappings.addMapping(RUNTIME_PRIORITY, configurations.getByName(JavaPlugin.RUNTIME_CONFIGURATION_NAME), Conf2ScopeMappingContainer.RUNTIME); mavenScopeMappings.addMapping(TEST_COMPILE_PRIORITY, configurations.getByName(JavaPlugin.TEST_COMPILE_CONFIGURATION_NAME), Conf2ScopeMappingContainer.TEST); mavenScopeMappings.addMapping(TEST_RUNTIME_PRIORITY, configurations.getByName(JavaPlugin.TEST_RUNTIME_CONFIGURATION_NAME), Conf2ScopeMappingContainer.TEST); }
Example #20
Source File: EarPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private void configureConfigurations(final Project project) { ConfigurationContainer configurations = project.getConfigurations(); Configuration moduleConfiguration = configurations.create(DEPLOY_CONFIGURATION_NAME).setVisible(false) .setTransitive(false).setDescription("Classpath for deployable modules, not transitive."); Configuration earlibConfiguration = configurations.create(EARLIB_CONFIGURATION_NAME).setVisible(false) .setDescription("Classpath for module dependencies."); configurations.getByName(Dependency.DEFAULT_CONFIGURATION) .extendsFrom(moduleConfiguration, earlibConfiguration); }
Example #21
Source File: AbstractScriptHandler.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public AbstractScriptHandler(RepositoryHandler repositoryHandler, DependencyHandler dependencyHandler, ScriptSource scriptSource, ConfigurationContainer configContainer) { this.repositoryHandler = repositoryHandler; this.dependencyHandler = dependencyHandler; this.scriptSource = scriptSource; this.configContainer = configContainer; classpathConfiguration = configContainer.create(CLASSPATH_CONFIGURATION); }
Example #22
Source File: JavaPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
void configureConfigurations(Project project) { ConfigurationContainer configurations = project.getConfigurations(); Configuration compileConfiguration = configurations.getByName(COMPILE_CONFIGURATION_NAME); Configuration runtimeConfiguration = configurations.getByName(RUNTIME_CONFIGURATION_NAME); Configuration compileTestsConfiguration = configurations.getByName(TEST_COMPILE_CONFIGURATION_NAME); compileTestsConfiguration.extendsFrom(compileConfiguration); configurations.getByName(TEST_RUNTIME_CONFIGURATION_NAME).extendsFrom(runtimeConfiguration, compileTestsConfiguration); configurations.getByName(Dependency.DEFAULT_CONFIGURATION).extendsFrom(runtimeConfiguration); }
Example #23
Source File: JavaPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
void configureConfigurations(Project project) { ConfigurationContainer configurations = project.getConfigurations(); Configuration compileConfiguration = configurations.getByName(COMPILE_CONFIGURATION_NAME); Configuration runtimeConfiguration = configurations.getByName(RUNTIME_CONFIGURATION_NAME); Configuration compileTestsConfiguration = configurations.getByName(TEST_COMPILE_CONFIGURATION_NAME); compileTestsConfiguration.extendsFrom(compileConfiguration); configurations.getByName(TEST_RUNTIME_CONFIGURATION_NAME).extendsFrom(runtimeConfiguration, compileTestsConfiguration); configurations.getByName(Dependency.DEFAULT_CONFIGURATION).extendsFrom(runtimeConfiguration); }
Example #24
Source File: JavaBasePlugin.java From javaide with GNU General Public License v3.0 | 5 votes |
private BridgedBinaries configureSourceSetDefaults(final JavaPluginConvention pluginConvention) { final Project project = pluginConvention.getProject(); final List<ClassDirectoryBinarySpecInternal> binaries = Lists.newArrayList(); pluginConvention.getSourceSets().all(new Action<SourceSet>() { public void execute(final SourceSet sourceSet) { ConventionMapping outputConventionMapping = ((IConventionAware) sourceSet.getOutput()).getConventionMapping(); ConfigurationContainer configurations = project.getConfigurations(); defineConfigurationsForSourceSet(sourceSet, configurations); definePathsForSourceSet(sourceSet, outputConventionMapping, project); createProcessResourcesTaskForBinary(sourceSet, sourceSet.getResources(), project); createCompileJavaTaskForBinary(sourceSet, sourceSet.getJava(), project); createBinaryLifecycleTask(sourceSet, project); DefaultComponentSpecIdentifier binaryId = new DefaultComponentSpecIdentifier(project.getPath(), sourceSet.getName()); ClassDirectoryBinarySpecInternal binary = instantiator.newInstance(DefaultClassDirectoryBinarySpec.class, binaryId, sourceSet, javaToolChain, DefaultJavaPlatform.current(), instantiator, taskFactory); Classpath compileClasspath = new SourceSetCompileClasspath(sourceSet); DefaultJavaSourceSet javaSourceSet = instantiator.newInstance(DefaultJavaSourceSet.class, binaryId.child("java"), sourceSet.getJava(), compileClasspath); JvmResourceSet resourceSet = instantiator.newInstance(DefaultJvmResourceSet.class, binaryId.child("resources"), sourceSet.getResources()); binary.addSourceSet(javaSourceSet); binary.addSourceSet(resourceSet); attachTasksToBinary(binary, sourceSet, project); binaries.add(binary); } }); return new BridgedBinaries(binaries); }
Example #25
Source File: DefaultMavenPomFactory.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public DefaultMavenPomFactory(ConfigurationContainer configurationContainer, Conf2ScopeMappingContainer conf2ScopeMappingContainer, PomDependenciesConverter pomDependenciesConverter, FileResolver fileResolver) { this.configurationContainer = configurationContainer; this.conf2ScopeMappingContainer = conf2ScopeMappingContainer; this.pomDependenciesConverter = pomDependenciesConverter; this.fileResolver = fileResolver; }
Example #26
Source File: EarPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private void configureConfigurations(final Project project) { ConfigurationContainer configurations = project.getConfigurations(); Configuration moduleConfiguration = configurations.create(DEPLOY_CONFIGURATION_NAME).setVisible(false) .setTransitive(false).setDescription("Classpath for deployable modules, not transitive."); Configuration earlibConfiguration = configurations.create(EARLIB_CONFIGURATION_NAME).setVisible(false) .setDescription("Classpath for module dependencies."); configurations.getByName(Dependency.DEFAULT_CONFIGURATION) .extendsFrom(moduleConfiguration, earlibConfiguration); }
Example #27
Source File: BaseExtension.java From javaide with GNU General Public License v3.0 | 5 votes |
protected void createConfiguration( @NonNull ConfigurationContainer configurations, @NonNull String configurationName, @NonNull String configurationDescription) { logger.info("Creating configuration {}", configurationName); Configuration configuration = configurations.findByName(configurationName); if (configuration == null) { configuration = configurations.create(configurationName); } configuration.setVisible(false); configuration.setDescription(configurationDescription); }
Example #28
Source File: DefaultScriptHandler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public DefaultScriptHandler( ScriptSource scriptSource, RepositoryHandler repositoryHandler, DependencyHandler dependencyHandler, ConfigurationContainer configContainer, Factory<ClassLoader> classLoaderFactory ) { this.repositoryHandler = repositoryHandler; this.dependencyHandler = dependencyHandler; this.scriptSource = scriptSource; this.configContainer = configContainer; this.classLoaderFactory = classLoaderFactory; classpathConfiguration = configContainer.create(CLASSPATH_CONFIGURATION); }
Example #29
Source File: DefaultScriptHandlerFactory.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public ScriptHandler create(ScriptSource scriptSource, ClassLoaderScope classLoaderScope, DomainObjectContext context) { DependencyResolutionServices services = dependencyManagementServices.create(fileResolver, dependencyMetaDataProvider, projectFinder, context); RepositoryHandler repositoryHandler = services.getResolveRepositoryHandler(); ConfigurationContainer configurationContainer = services.getConfigurationContainer(); DependencyHandler dependencyHandler = services.getDependencyHandler(); return new DefaultScriptHandler(scriptSource, repositoryHandler, dependencyHandler, configurationContainer, new ScriptHandlerClassLoaderFactory(scriptSource, classLoaderScope)); }
Example #30
Source File: DefaultScriptHandlerFactory.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public ScriptHandler create(ScriptSource scriptSource, ClassLoaderScope classLoaderScope, DomainObjectContext context) { DependencyResolutionServices services = dependencyManagementServices.create(fileResolver, dependencyMetaDataProvider, projectFinder, context); RepositoryHandler repositoryHandler = services.getResolveRepositoryHandler(); ConfigurationContainer configurationContainer = services.getConfigurationContainer(); DependencyHandler dependencyHandler = services.getDependencyHandler(); return new DefaultScriptHandler(scriptSource, repositoryHandler, dependencyHandler, configurationContainer, new ScriptHandlerClassLoaderFactory(scriptSource, classLoaderScope)); }