File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
src/main/java/org/gradlex/javamodule/dependencies Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 2121import org .gradle .api .Project ;
2222import org .gradle .api .artifacts .Configuration ;
2323import org .gradle .api .attributes .Usage ;
24- import org .gradle .api .internal .artifacts .configurations .ConfigurationInternal ;
2524import org .gradle .api .model .ObjectFactory ;
2625import org .gradle .api .plugins .JavaPlatformPlugin ;
2726import org .gradle .api .plugins .JavaPlugin ;
@@ -54,18 +53,16 @@ private void setupForJavaProject(Project project) {
5453 c .setCanBeConsumed (false );
5554 });
5655
57- project .getConfigurations ().create ("platformElements" , c -> {
56+ Configuration platformElements = project .getConfigurations ().create ("platformElements" , c -> {
5857 c .setCanBeResolved (false );
5958 c .setCanBeConsumed (true );
6059 c .setVisible (false );
6160 c .extendsFrom (versions );
6261 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- });
6762 });
6863
64+ project .afterEvaluate (p -> platformElements .getOutgoing ().capability (project .getGroup () + ":" + project .getName () + "-platform:" + project .getVersion ()));
65+
6966 setupVersionsDSL (project , versions );
7067 }
7168
You can’t perform that action at this time.
0 commit comments