Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make generation task failed if there is duplicated feature flag name #36

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

r-ralph
Copy link
Member

@r-ralph r-ralph commented Feb 2, 2024

If multiple flags are defined, the current behavior is such that a field with the same name is generated, resulting in a compile-time error.
However, it is difficult to tell what the problem is just by looking at the error, and the error does not occur until the compilation task is executed.
To improve clarity and the speed at which errors are generated, check the feature flag generation task to see if there are duplicate names, and if so, make an error there.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:generateDebugFeatureFlag'.
> Duplicated feature flag definition found: FEATURE_DUPLICATED_TEST

* Try:
> Run with --info or --debug option to get more log output.
> Get more help at https://help.gradle.org.

@r-ralph r-ralph self-assigned this Feb 2, 2024
@r-ralph r-ralph requested a review from ganadist February 2, 2024 08:16
Copy link
Contributor

@ganadist ganadist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for now.

And we may migrate these to Gradle Problems API in future.
https://docs.gradle.org/current/javadoc/org/gradle/api/problems/Problems.html

@r-ralph r-ralph merged commit 0daafeb into line:master Feb 5, 2024
2 checks passed
@r-ralph r-ralph deleted the duplicated-flag-error branch February 5, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants