gradle / gradle-native

The home of Gradle's support for natively compiled languages
https://blog.gradle.org/introducing-the-new-cpp-plugins
Apache License 2.0
92 stars 8 forks source link

Make constants public in Distribution Plugin #1080

Open Mazorius opened 3 years ago

Mazorius commented 3 years ago

Expected Behavior

I can use in my code this four constans:

private static final String DISTRIBUTION_GROUP = "distribution";
private static final String TASK_DIST_ZIP_NAME = "distZip";
private static final String TASK_DIST_TAR_NAME = "distTar";
private static final String TASK_ASSEMBLE_NAME = "assembleDist";

Current Behavior

I can not use them as they are defined as private. So I need to duplicate those strings in my code and need to hope that this strings are not changing in newer Gradle versions.

Context

Development of tasks and custom reactions are possible but online with duplicating this strings. If a Gradle release will change this strings my code needs to be changed.

It would be nice if I can simply use the constants of this strings. I also see that this strings not always used in your code as well:

                zipTaskName = dist.getName() + "DistZip";
                tarTaskName = dist.getName() + "DistTar";

Steps to Reproduce (for bugs)

Try creating a task and want to add the task in the Distribution task group.

Your Environment

macOS, Kotlin DSL and Kotlin in code.