Skip to content

Commit

Permalink
Remove the attached configurations because it is not needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
marchermans committed May 1, 2024
1 parent 67324fb commit f2be0b0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Project getProject() {
}

public Configuration getConfiguration() {
final Configuration configuration = ConfigurationUtils.temporaryAttachedConfiguration(project);
final Configuration configuration = ConfigurationUtils.temporaryConfiguration(project);
configuration.fromDependencyCollector(this.getRuntime());
return configuration;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,6 @@ class ConfigurationUtils {
throw new IllegalStateException("Can not instantiate an instance of: ConfigurationUtils. This is a utility class")
}

/**
* Creates an attached configuration that can be resolved, but not consumed.
*
* @param project The project to create the configuration for
* @param dependencies The dependencies to add to the configuration
* @return The detached configuration
*/
static Configuration temporaryAttachedConfiguration(final Project project, final Dependency... dependencies) {
final Configuration configuration = project.getConfigurations().create("ng_do_not_use_this_configuration_${temporaryConfigurationCounter.incrementAndGet()}", new Action<Configuration>() {
@Override
void execute(Configuration files) {
files.setCanBeConsumed(false)
files.setCanBeResolved(true)
files.getDependencies().addAll(dependencies)

final DependencyReplacement dependencyReplacement = project.getExtensions().getByType(DependencyReplacement.class)
dependencyReplacement.handleConfiguration(files)
}
});

return configuration
}

/**
* Creates a detached configuration that can be resolved, but not consumed.
*
Expand Down

0 comments on commit f2be0b0

Please sign in to comment.