klaxit / hidden-secrets-gradle-plugin

🔒 Deeply hide secrets on Android
MIT License
395 stars 40 forks source link

Make Constants public #11

Closed Mazorius closed 3 years ago

Mazorius commented 3 years ago

I think it would be nice to make the constants here public. This would enable everyone to us this in their code instead of creating duplicated strings.

For example:

...
project.tasks.withName(Class.CONSTANT)
...
ben-j69 commented 3 years ago

@Mazorius thanks for the suggestion, it would not be hard to make them public but do you see any use case of this public constants for our plugin users ?

Mazorius commented 3 years ago

If you write a custom plugin which applies your plugin or you want to extend or reconfigure the your created tasks.

I think currently a developer needs to hope you will not change the names in the future as they declare this names as strings instead of using your well defined constants.

For example I used the SonarQube plugin in my projects an need to say ... with the sonarqube plugin do this. Much better would it to use a constant so SonarQube can change their plugin name and I do not care as developer. Because I am using the constant which they will change ;-)

ben-j69 commented 3 years ago

Thanks @Mazorius , done in https://github.com/klaxit/hidden-secrets-gradle-plugin/pull/20 to be able to use them in tests, if you can check the code please ;)

Mazorius commented 3 years ago

Looks good ;-)

Mazorius commented 3 years ago

Maybe you will check the constants content in tests so that changing them will result in test failures?

ben-j69 commented 3 years ago

@Mazorius I agree with you, done in https://github.com/klaxit/hidden-secrets-gradle-plugin/pull/20

So I close this issue ;)

Thanks