Reuse optional configuration name constant

See gh-19620
pull/19621/head
Vedran Pavic 5 years ago committed by Andy Wilkinson
parent 77badf77f7
commit 8757f63360

@ -44,7 +44,7 @@ public class OptionalDependenciesPlugin implements Plugin<Project> {
@Override
public void apply(Project project) {
Configuration optional = project.getConfigurations().create("optional");
Configuration optional = project.getConfigurations().create(OPTIONAL_CONFIGURATION_NAME);
optional.attributes((attributes) -> attributes.attribute(Usage.USAGE_ATTRIBUTE,
project.getObjects().named(Usage.class, Usage.JAVA_RUNTIME)));
project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> {

@ -57,7 +57,7 @@ public class OptionalDependenciesPluginIntegrationTests {
out.println("}");
}
BuildResult buildResult = runGradle("printConfigurations");
assertThat(buildResult.getOutput()).contains("optional");
assertThat(buildResult.getOutput()).contains(OptionalDependenciesPlugin.OPTIONAL_CONFIGURATION_NAME);
}
@Test

Loading…
Cancel
Save