stevesaliman / gradle-properties-plugin

Gradle plugin to simplify loading project properties from external environment specific files
Apache License 2.0
192 stars 28 forks source link

When I applied this plugin for project, the registerTaskListener will cause some task execute failed #45

Open simonjhy opened 1 year ago

simonjhy commented 1 year ago

When I applied this plugin for project, I debuged and comfirm if the plugin run the registerTaskListener, some tasks will failed. When I comment this line code, the task result will be correct. Is the properties plugin found task not match some require condition?

stevesaliman commented 1 year ago

Do you have any more details on this? Exactly what is the failure? What line of code are you commenting out?

Essentially, I think I'll need to be able to reproduce the failure to be able to give more information on what might be causing it.

simonjhy commented 1 year ago

when we use this code("project.apply(Collections.singletonMap("plugin", PropertiesPlugin.class));") to apply propertiesPlugin in our gradle plugin. It will cause we failed to set ourself property to gradle project. we used this method to set property.

public static void setProperty(ExtensionAware extensionAware, String name, Object value) { ExtensionContainer extensionContainer = extensionAware.getExtensions(); ExtraPropertiesExtension extraPropertiesExtension = extensionContainer.getExtraProperties(); extraPropertiesExtension.set(name, value); }

I debuged it will be correct when I disable registerTaskListener related code in propertiesPlugin codes. Is there special something need to set when we applied your plugin?