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

Enforce resourcePrefix on Android library modules #767

Merged
merged 2 commits into from
Dec 21, 2023

Conversation

SimonMarquis
Copy link
Contributor

@SimonMarquis SimonMarquis commented May 29, 2023

See this issue for the rationale behind this change:

:ui-test-hilt-manifest -> ui_test_hilt_manifest_
:core:analytics -> core_analytics_
:core:common -> core_common_
:core:data -> core_data_
:core:data-test -> core_data_test_
:core:database -> core_database_
:core:datastore -> core_datastore_
:core:datastore-test -> core_datastore_test_
:core:designsystem -> core_designsystem_
:core:domain -> core_domain_
:core:network -> core_network_
:core:notifications -> core_notifications_
:core:testing -> core_testing_
:core:ui -> core_ui_
:feature:bookmarks -> feature_bookmarks_
:feature:foryou -> feature_foryou_
:feature:interests -> feature_interests_
:feature:search -> feature_search_
:feature:settings -> feature_settings_
:feature:topic -> feature_topic_
:sync:sync-test -> sync_test_
:sync:work -> sync_work_

And Lint will fail as expected with these kind of errors:

nowinandroid\feature\interests\src\main\res\values\strings.xml:18: Error: Resource named 'interests' does not start with the project's resource prefix 'feature_interests_'; rename to 'feature_interests_interests' ? [ResourceName]
    <string name="interests">Interests</string>
            ~~~~~~~~~~~~~~~~

   Explanation for issues of type "ResourceName":
   In Gradle projects you can specify a resource prefix that all resources in
   the project must conform to. This makes it easier to ensure that you don't
   accidentally combine resources from different libraries, since they all end
   up in the same shared app namespace.

Closes #760

@SimonMarquis SimonMarquis marked this pull request as ready for review June 9, 2023 07:01
```
:ui-test-hilt-manifest -> ui_test_hilt_manifest_
:core:analytics -> core_analytics_
:core:common -> core_common_
:core:data -> core_data_
:core:data-test -> core_data_test_
:core:database -> core_database_
:core:datastore -> core_datastore_
:core:datastore-test -> core_datastore_test_
:core:designsystem -> core_designsystem_
:core:domain -> core_domain_
:core:network -> core_network_
:core:notifications -> core_notifications_
:core:testing -> core_testing_
:core:ui -> core_ui_
:feature:bookmarks -> feature_bookmarks_
:feature:foryou -> feature_foryou_
:feature:interests -> feature_interests_
:feature:search -> feature_search_
:feature:settings -> feature_settings_
:feature:topic -> feature_topic_
:sync:sync-test -> sync_test_
:sync:work -> sync_work_
```
@SimonMarquis
Copy link
Contributor Author

🔔 @dturner 🙈
Were there any remaining changes you wanted before merging this?

@dturner dturner merged commit 89d39a7 into android:main Dec 21, 2023
6 checks passed
@SimonMarquis SimonMarquis deleted the resource-prefix branch December 22, 2023 08:24
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.

[FR]: set resource independence at multi module
2 participants