• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 The Dagger Authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package dagger.internal.codegen;
18 
19 import javax.inject.Inject;
20 
21 /**
22  * Test classes for {@link ComponentProcessorTest}.
23  *
24  * <p>These classes live in a separate library to test the case where the Dagger compiler is not run
25  * during compilation.
26  */
27 public final class ComponentProcessorTestClasses {
28   public static final class NoInjectMemberNoConstructor {}
29 
30   public static final class NoInjectMemberWithConstructor {
31      @Inject
NoInjectMemberWithConstructor()32      NoInjectMemberWithConstructor() {}
33   }
34 
35   public abstract static class LocalInjectMemberNoConstructor {
36     @Inject Object object;
37   }
38 
39   public static final class LocalInjectMemberWithConstructor {
40     @SuppressWarnings("BadInject") // Ignore this check as we want to test this case in particular.
41     @Inject Object object;
42 
43     @Inject
LocalInjectMemberWithConstructor()44     LocalInjectMemberWithConstructor() {}
45   }
46 
47   public static final class ParentInjectMemberNoConstructor extends LocalInjectMemberNoConstructor {
48   }
49 
50   public static final class ParentInjectMemberWithConstructor
51       extends LocalInjectMemberNoConstructor {
52     @Inject
ParentInjectMemberWithConstructor()53     ParentInjectMemberWithConstructor() {}
54   }
55 
ComponentProcessorTestClasses()56   private ComponentProcessorTestClasses() {}
57 }
58