Skip to content

Commit

Permalink
No longer use 'beforeLocking()'
Browse files Browse the repository at this point in the history
Resolves #47
  • Loading branch information
jjohannes committed Aug 22, 2023
1 parent e8fd8b5 commit 1f2dabe
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.attributes.Usage;
import org.gradle.api.internal.artifacts.configurations.ConfigurationInternal;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.plugins.JavaPlatformPlugin;
import org.gradle.api.plugins.JavaPlugin;
Expand Down Expand Up @@ -54,18 +53,16 @@ private void setupForJavaProject(Project project) {
c.setCanBeConsumed(false);
});

project.getConfigurations().create("platformElements", c -> {
Configuration platformElements = project.getConfigurations().create("platformElements", c -> {
c.setCanBeResolved(false);
c.setCanBeConsumed(true);
c.setVisible(false);
c.extendsFrom(versions);
c.getAttributes().attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, JAVA_RUNTIME));
// c.getAttributes().attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.class, REGULAR_PLATFORM));
((ConfigurationInternal) c).beforeLocking(conf -> {
c.getOutgoing().capability(project.getGroup() + ":" + project.getName() + "-platform:" + project.getVersion());
});
});

project.afterEvaluate(p -> platformElements.getOutgoing().capability(project.getGroup() + ":" + project.getName() + "-platform:" + project.getVersion()));

setupVersionsDSL(project, versions);
}

Expand Down

0 comments on commit 1f2dabe

Please sign in to comment.