File tree 1 file changed +3
-6
lines changed
src/main/java/org/gradlex/javamodule/dependencies
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 21
21
import org .gradle .api .Project ;
22
22
import org .gradle .api .artifacts .Configuration ;
23
23
import org .gradle .api .attributes .Usage ;
24
- import org .gradle .api .internal .artifacts .configurations .ConfigurationInternal ;
25
24
import org .gradle .api .model .ObjectFactory ;
26
25
import org .gradle .api .plugins .JavaPlatformPlugin ;
27
26
import org .gradle .api .plugins .JavaPlugin ;
@@ -54,18 +53,16 @@ private void setupForJavaProject(Project project) {
54
53
c .setCanBeConsumed (false );
55
54
});
56
55
57
- project .getConfigurations ().create ("platformElements" , c -> {
56
+ Configuration platformElements = project .getConfigurations ().create ("platformElements" , c -> {
58
57
c .setCanBeResolved (false );
59
58
c .setCanBeConsumed (true );
60
59
c .setVisible (false );
61
60
c .extendsFrom (versions );
62
61
c .getAttributes ().attribute (Usage .USAGE_ATTRIBUTE , objects .named (Usage .class , JAVA_RUNTIME ));
63
- // c.getAttributes().attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.class, REGULAR_PLATFORM));
64
- ((ConfigurationInternal ) c ).beforeLocking (conf -> {
65
- c .getOutgoing ().capability (project .getGroup () + ":" + project .getName () + "-platform:" + project .getVersion ());
66
- });
67
62
});
68
63
64
+ project .afterEvaluate (p -> platformElements .getOutgoing ().capability (project .getGroup () + ":" + project .getName () + "-platform:" + project .getVersion ()));
65
+
69
66
setupVersionsDSL (project , versions );
70
67
}
71
68
You can’t perform that action at this time.
0 commit comments