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

Provide a better message for erroneous values folder files #4490

Conversation

writtmeyer
Copy link

The task generateComposeResClass created an error message that didn't help the user to understand the problem if files other than strings.xml were in the values folder. This fix improves on the message so that users can quickly fix the underlying issue.

The old message was "Unknown resource type: 'values'." But not values is the problem, but a file like - in my case - colors.xml which I copied from an existing Android project (well, yeah, I shouldn't have done that, but anyway, the message was not helpful).

The new message would be "Forbidden file name 'colors.xml'! Only a file for string resources named 'strings.xml' is valid in the 'values' folder." I also added a check for this in the ResourcesTest's testGeneratedAccessors() method.

The task generateComposeResClass created an error message that didn't
help the user to understand the problem if files other than strings.xml
were in the values folder. This fix improves on the message so that users
can quickly fix the underlying issue.
@terrakok
Copy link
Collaborator

@writtmeyer check the tests, please.

@writtmeyer
Copy link
Author

I have serious trouble using act to run this as an action locally on my machines (Mac and Ubuntu). And running the tests itself on both systems doesn't run into these failures. And as far as I see it only the test log, but not the log of the specific failing gradle runs executed within the failing test method are available. Thus I'm really not sure as to what the reason for these failures is.

@terrakok
Copy link
Collaborator

terrakok commented Apr 4, 2024

Since any xml files were supported in the values directory I will close the issue

@terrakok terrakok closed this Apr 4, 2024
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.

None yet

2 participants