use of org.gradle.plugins.ide.idea.model.internal.GeneratedIdeaScope in project gradle by gradle.
the class IdeaPlugin method setupScopes.
private void setupScopes(GenerateIdeaModule ideaModule) {
Map<String, Map<String, Collection<Configuration>>> scopes = Maps.newLinkedHashMap();
for (GeneratedIdeaScope scope : GeneratedIdeaScope.values()) {
Map<String, Collection<Configuration>> plusMinus = Maps.newLinkedHashMap();
plusMinus.put(IdeaDependenciesProvider.SCOPE_PLUS, Lists.<Configuration>newArrayList());
plusMinus.put(IdeaDependenciesProvider.SCOPE_MINUS, Lists.<Configuration>newArrayList());
scopes.put(scope.name(), plusMinus);
}
Project project = ideaModule.getProject();
ConfigurationContainer configurations = project.getConfigurations();
Collection<Configuration> provided = scopes.get(GeneratedIdeaScope.PROVIDED.name()).get(IdeaDependenciesProvider.SCOPE_PLUS);
provided.add(configurations.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME));
Collection<Configuration> runtime = scopes.get(GeneratedIdeaScope.RUNTIME.name()).get(IdeaDependenciesProvider.SCOPE_PLUS);
runtime.add(configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME));
Collection<Configuration> test = scopes.get(GeneratedIdeaScope.TEST.name()).get(IdeaDependenciesProvider.SCOPE_PLUS);
test.add(configurations.getByName(JavaPlugin.TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME));
test.add(configurations.getByName(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME));
ideaModule.getModule().setScopes(scopes);
}
use of org.gradle.plugins.ide.idea.model.internal.GeneratedIdeaScope in project gradle by gradle.
the class IdeaPlugin method setupScopes.
private void setupScopes(Project project) {
Map<String, Map<String, Collection<Configuration>>> scopes = Maps.newLinkedHashMap();
for (GeneratedIdeaScope scope : GeneratedIdeaScope.values()) {
Map<String, Collection<Configuration>> plusMinus = Maps.newLinkedHashMap();
plusMinus.put(IdeaDependenciesProvider.SCOPE_PLUS, Lists.<Configuration>newArrayList());
plusMinus.put(IdeaDependenciesProvider.SCOPE_MINUS, Lists.<Configuration>newArrayList());
scopes.put(scope.name(), plusMinus);
}
ConfigurationContainer configurations = project.getConfigurations();
Collection<Configuration> provided = scopes.get(GeneratedIdeaScope.PROVIDED.name()).get(IdeaDependenciesProvider.SCOPE_PLUS);
provided.add(configurations.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME));
Collection<Configuration> runtime = scopes.get(GeneratedIdeaScope.RUNTIME.name()).get(IdeaDependenciesProvider.SCOPE_PLUS);
runtime.add(configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME));
Collection<Configuration> test = scopes.get(GeneratedIdeaScope.TEST.name()).get(IdeaDependenciesProvider.SCOPE_PLUS);
test.add(configurations.getByName(JavaPlugin.TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME));
test.add(configurations.getByName(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME));
ideaModel.getModule().setScopes(scopes);
}
Aggregations