pluginConvention.getSourceSets().all(new Action<SourceSet>() {
public void execute(final SourceSet sourceSet) {
ConventionMapping outputConventionMapping = ((IConventionAware) sourceSet.getOutput()).getConventionMapping();
ConfigurationContainer configurations = project.getConfigurations();
Configuration compileConfiguration = configurations.findByName(sourceSet.getCompileConfigurationName());
if (compileConfiguration == null) {
compileConfiguration = configurations.create(sourceSet.getCompileConfigurationName());
}
compileConfiguration.setVisible(false);
compileConfiguration.setDescription(String.format("Compile classpath for %s.", sourceSet));
Configuration runtimeConfiguration = configurations.findByName(sourceSet.getRuntimeConfigurationName());
if (runtimeConfiguration == null) {
runtimeConfiguration = configurations.create(sourceSet.getRuntimeConfigurationName());
}
runtimeConfiguration.setVisible(false);
runtimeConfiguration.extendsFrom(compileConfiguration);
runtimeConfiguration.setDescription(String.format("Runtime classpath for %s.", sourceSet));