Skip to content

Instantly share code, notes, and snippets.

@ashwinraghav
Created January 28, 2023 05:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashwinraghav/af2679e974cf034acba4a8f39d357d5e to your computer and use it in GitHub Desktop.
Save ashwinraghav/af2679e974cf034acba4a8f39d357d5e to your computer and use it in GitHub Desktop.
Composable Libraries
@Keep
public class AbtRegistrar implements ComponentRegistrar {
private static final String LIBRARY_NAME = "fire-abt";
@Override
public List<Component<?>> getComponents() {
return Arrays.asList(
Component.builder(AbtComponent.class)
.name(LIBRARY_NAME)
.add(Dependency.required(Context.class))
.add(Dependency.optionalProvider(AnalyticsConnector.class))
.factory(
container ->
new AbtComponent(
container.get(Context.class),
container.getProvider(AnalyticsConnector.class)))
.build(),
LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment