Skip to content

Conversation

@SimonMarquis
Copy link
Contributor

@SimonMarquis SimonMarquis commented May 31, 2025

Since the project current modularization does not yet allow to split bindings and the rest of the code, moving the Initializers registration to the :app module makes it easier to use.

  • It avoids duplicated registrations (it was both present in :app and :core:network)
  • It avoids removing registrations on other modules that would break during instrumented tests

EnsureInitializerMetadata had to be suppressed because the Lint rule does not actually check where the initializer are registered, and always expects to see it on the same module, which is quite a simplistic assumption. https://googlesamples.github.io/android-custom-lint-rules/checks/EnsureInitializerMetadata.md.html

I also remove the hardcoded androidx.startup string with the proper string reference @string/androidx_startup.

Finally, I removed core/network/src/main/res/xml/startup_initializers.xml which seems unused and is not documented in the official APIs.

Closes #51

Since the project current modularization does not yet allow to split bindings and the rest of the code, moving the `Initializer`s registration to the `:app` module makes it easier to use.

- It avoids duplicated registrations (it was both present in `:app` and `:core:network`)
- It avoids removing registrations on other modules that would break during instrumented tests

`EnsureInitializerMetadata` had to be suppressed because the Lint rule does not actually check where the initializer are registered, and always expects to see it on the same module, which is quite a simplistic assumption.
https://googlesamples.github.io/android-custom-lint-rules/checks/EnsureInitializerMetadata.md.html

I also remove the hardcoded `androidx.startup` string with the proper string reference `@string/androidx_startup`.
@riggaroo riggaroo requested a review from keyboardsurfer June 9, 2025 14:34
@riggaroo riggaroo merged commit 1df7a12 into android:main Jun 20, 2025
3 checks passed
@SimonMarquis SimonMarquis deleted the startup-initializers branch July 7, 2025 16:15
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.

What is startup_initializers.xml used for?

3 participants