diff options
Diffstat (limited to 'java/com')
3 files changed, 8 insertions, 13 deletions
diff --git a/java/com/android/dialer/rootcomponentgenerator/processor/MetadataGeneratingStep.java b/java/com/android/dialer/rootcomponentgenerator/processor/MetadataGeneratingStep.java index 70ad1b2e7..b7d31c0e9 100644 --- a/java/com/android/dialer/rootcomponentgenerator/processor/MetadataGeneratingStep.java +++ b/java/com/android/dialer/rootcomponentgenerator/processor/MetadataGeneratingStep.java @@ -18,7 +18,6 @@ package com.android.dialer.rootcomponentgenerator.processor; import static javax.tools.Diagnostic.Kind.ERROR; -import com.android.dialer.rootcomponentgenerator.annotation.DialerComponent; import com.android.dialer.rootcomponentgenerator.annotation.InstallIn; import com.android.dialer.rootcomponentgenerator.annotation.RootComponentGeneratorMetadata; import com.google.auto.common.BasicAnnotationProcessor.ProcessingStep; @@ -26,6 +25,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.SetMultimap; import com.squareup.javapoet.AnnotationSpec; import com.squareup.javapoet.TypeSpec; +import dagger.Subcomponent; import java.lang.annotation.Annotation; import java.util.Collections; import java.util.Set; @@ -33,7 +33,7 @@ import javax.annotation.processing.ProcessingEnvironment; import javax.lang.model.element.Element; /** - * Genereates metadata for every type annotated by {@link InstallIn} and {@link DialerComponent}. + * Genereates metadata for every type annotated by {@link InstallIn} and {@link Subcomponent}. * * <p>The metadata has the information where the annotated types are and it is used by annotation * processor when the processor tries to generate root component. @@ -48,15 +48,15 @@ final class MetadataGeneratingStep implements ProcessingStep { @Override public Set<? extends Class<? extends Annotation>> annotations() { - return ImmutableSet.of(DialerComponent.class, InstallIn.class); + return ImmutableSet.of(Subcomponent.class, InstallIn.class); } @Override public Set<? extends Element> process( SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) { - for (Element element : elementsByAnnotation.get(DialerComponent.class)) { - generateMetadataFor(DialerComponent.class, element); + for (Element element : elementsByAnnotation.get(Subcomponent.class)) { + generateMetadataFor(Subcomponent.class, element); } for (Element element : elementsByAnnotation.get(InstallIn.class)) { if (element.getAnnotation(InstallIn.class).variants().length == 0) { diff --git a/java/com/android/dialer/rootcomponentgenerator/processor/RootComponentGeneratingStep.java b/java/com/android/dialer/rootcomponentgenerator/processor/RootComponentGeneratingStep.java index 86a030856..9b97adafd 100644 --- a/java/com/android/dialer/rootcomponentgenerator/processor/RootComponentGeneratingStep.java +++ b/java/com/android/dialer/rootcomponentgenerator/processor/RootComponentGeneratingStep.java @@ -20,7 +20,6 @@ import static com.google.auto.common.AnnotationMirrors.getAnnotationValue; import static com.google.auto.common.MoreElements.getAnnotationMirror; import static com.google.auto.common.MoreElements.isAnnotationPresent; -import com.android.dialer.rootcomponentgenerator.annotation.DialerComponent; import com.android.dialer.rootcomponentgenerator.annotation.DialerRootComponent; import com.android.dialer.rootcomponentgenerator.annotation.DialerVariant; import com.android.dialer.rootcomponentgenerator.annotation.InstallIn; @@ -36,6 +35,7 @@ import com.squareup.javapoet.AnnotationSpec; import com.squareup.javapoet.ClassName; import com.squareup.javapoet.TypeSpec; import dagger.Component; +import dagger.Subcomponent; import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.Collections; @@ -90,11 +90,7 @@ final class RootComponentGeneratingStep implements ProcessingStep { .addAnnotation(Singleton.class); for (TypeElement componentWithSuperInterface : componentList) { rootComponentClassBuilder.addSuperinterface( - ClassName.get(componentWithSuperInterface) - .peerClass( - RootComponentUtils.GENERATED_COMPONENT_PREFIX - + componentWithSuperInterface.getSimpleName()) - .nestedClass("HasComponent")); + ClassName.get(componentWithSuperInterface).nestedClass("HasComponent")); } AnnotationSpec.Builder componentAnnotation = AnnotationSpec.builder(Component.class); for (TypeElement annotatedElement : componentModuleMap.get(dialerVariant)) { @@ -108,7 +104,7 @@ final class RootComponentGeneratingStep implements ProcessingStep { private List<TypeElement> generateComponentList() { List<TypeElement> list = new ArrayList<>(); - extractInfoFromMetadata(DialerComponent.class, list::add); + extractInfoFromMetadata(Subcomponent.class, list::add); return list; } diff --git a/java/com/android/dialer/rootcomponentgenerator/processor/RootComponentProcessor.java b/java/com/android/dialer/rootcomponentgenerator/processor/RootComponentProcessor.java index 5e083d29d..56caa9ea4 100644 --- a/java/com/android/dialer/rootcomponentgenerator/processor/RootComponentProcessor.java +++ b/java/com/android/dialer/rootcomponentgenerator/processor/RootComponentProcessor.java @@ -29,7 +29,6 @@ public class RootComponentProcessor extends BasicAnnotationProcessor { @Override protected Iterable<? extends ProcessingStep> initSteps() { return ImmutableList.of( - new ComponentGeneratingStep(processingEnv), new MetadataGeneratingStep(processingEnv), new RootComponentGeneratingStep(processingEnv)); } |