@@ -58,39 +58,28 @@ public void apply(final Project project) {
5858
5959 SourceSetContainer sourceSets = project .getExtensions ().getByType (SourceSetContainer .class );
6060
61- // TODO: we no longer care about descriptor remove as inputs
62- // TODO: we no longer care about policy-yaml file remove as inputs
6361 var testBuildInfoTask = project .getTasks ().register ("generateTestBuildInfo" , GenerateTestBuildInfoTask .class , task -> {
64- var pluginProperties = project .getTasks ().withType (GeneratePluginPropertiesTask .class ).named ("pluginProperties" );
65- // task.getDescriptorFile().set(pluginProperties.flatMap(GeneratePluginPropertiesTask::getOutputFile));
6662 var propertiesExtension = project .getExtensions ().getByType (PluginPropertiesExtension .class );
6763 task .getComponentName ().set (providerFactory .provider (propertiesExtension ::getName ));
68- var policy = project .getLayout ().getProjectDirectory ().file ("src/main/plugin-metadata/entitlement-policy.yaml" );
69- if (policy .getAsFile ().exists ()) {
70- // task.getPolicyFile().set(policy);
71- }
72- // TODO: get first class of each location in deterministic order
73- // TODO: filter META_INF and module-info.class out of these
74-
7564 task .getCodeLocations ()
7665 .set (
7766 project .getConfigurations ()
7867 .getByName ("runtimeClasspath" )
7968 .minus (project .getConfigurations ().getByName (CompileOnlyResolvePlugin .RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME ))
8069 .plus (sourceSets .getByName (SourceSet .MAIN_SOURCE_SET_NAME ).getOutput ().getClassesDirs ())
8170 );
82-
83- Provider <Directory > directory = project .getLayout ().getBuildDirectory ().dir ("generated-build-info/test" );
71+ Provider <Directory > directory = project .getLayout ().getBuildDirectory ().dir ("generated-build-info" );
8472 task .getOutputDirectory ().set (directory );
8573 });
8674
87- sourceSets .named (SourceSet .TEST_SOURCE_SET_NAME ).configure (sourceSet -> { sourceSet .getResources ().srcDir (testBuildInfoTask ); });
88-
8975 project .getTasks ().withType (ProcessResources .class ).named ("processResources" ).configure (task -> {
90- // TODO: this is a copy task
91- // TODO: do this for descriptor and policy-yaml file
92- // TODO: use child copy spec
93- // task.into()
76+ var componentName = project .getExtensions ().getByType (PluginPropertiesExtension .class ).getName ();
77+ var pluginProperties = project .getTasks ().withType (GeneratePluginPropertiesTask .class ).named ("pluginProperties" );
78+ task .into ("META-INF/es-plugins/" + componentName + "/" , copy -> {
79+ copy .from (pluginProperties );
80+ copy .from (project .getLayout ().getProjectDirectory ().file ("src/main/plugin-metadata/entitlement-policy.yaml" ));
81+ });
82+ task .into ("META-INF" , copy -> copy .from (testBuildInfoTask ));
9483 });
9584 }
9685
0 commit comments