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

Improve handling of generated style extensions for components with the same class name, different qualified name #134

Open
laurakelly opened this issue May 13, 2020 · 1 comment

Comments

@laurakelly
Copy link
Collaborator

I'm using Paris in a library with many modules. We have had an issue with naming collisions for components that have a different fully qualified name but the same class name.

They all get a style extension generated for them which are all in the same package (Paris), so in this situation there is a class name conflict.

I'm wondering if it's possible to change the code generation code for Paris to avoid this conflict.

@ngsilverman
Copy link
Collaborator

@laurakelly style extension classes purposefully all use the same package so that they result in the same import statement regardless of which or how many views are being styled. However the name of the file could be changed to include the qualified name of the corresponding class here:
https://github.com/airbnb/paris/blob/master/paris-processor/src/main/java/com/airbnb/paris/processor/writers/StyleExtensionsKotlinFile.kt#L35

At the moment the name of the file will be the same as the view, like MyView.kt. We could make it something like ComExampleApplicationMyView where MyView is in the com.example.application package.

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

No branches or pull requests

2 participants