-
Notifications
You must be signed in to change notification settings - Fork 8
Description
The AmpPlugin iterates over all amp sourcesets to register amp tasks:
| ampBasePlugin.allAmpSourceSetConfigurations(ampSourceSetConfig -> { |
It looks like it was intended to only run for sourcesets where an amp {} configuration block is present (given the null-check):
alfresco-gradle-sdk/src/main/java/eu/xenit/gradle/alfrescosdk/AmpBasePlugin.java
Lines 151 to 156 in d804a6d
| project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets().all(sourceSet -> { | |
| var config = new DslObject(sourceSet).getExtensions().getByType(AmpSourceSetConfiguration.class); | |
| if (config != null) { | |
| configure.execute(config); | |
| } | |
| }); |
However, the amp configurations are registered for all sourcesets, so AMP tasks are created even when totally unconfigured:
alfresco-gradle-sdk/src/main/java/eu/xenit/gradle/alfrescosdk/AmpBasePlugin.java
Lines 44 to 46 in d804a6d
| project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets().all(sourceSet -> { | |
| var ampSourceSetConfig = (DefaultAmpSourceSetConfiguration)new DslObject(sourceSet).getExtensions() | |
| .create(AmpSourceSetConfiguration.class, "amp", DefaultAmpSourceSetConfiguration.class, project, sourceSet); |
This can be confusing, because even in a default configuration, there is a testAmp task present, which creates an AMP for the test sourceset. The amp is unusable because in the default setup, alfrescoProvided dependencies are also on the runtime classpath and are packaged inside the amp.
An unconfigured AMP is also uninstallable together with the main AMP, because it has the same module id