|
35 | 35 | import static dagger.internal.codegen.compileroption.ProcessingEnvironmentCompilerOptions.Feature.STRICT_MULTIBINDING_VALIDATION;
|
36 | 36 | import static dagger.internal.codegen.compileroption.ProcessingEnvironmentCompilerOptions.Feature.STRICT_SUPERFICIAL_VALIDATION;
|
37 | 37 | import static dagger.internal.codegen.compileroption.ProcessingEnvironmentCompilerOptions.Feature.USE_FRAMEWORK_TYPE_IN_MAP_MULTIBINDING_CONTRIBUTION_KEY;
|
| 38 | +import static dagger.internal.codegen.compileroption.ProcessingEnvironmentCompilerOptions.Feature.USE_LEGACY_BINDING_GRAPH_FACTORY; |
38 | 39 | import static dagger.internal.codegen.compileroption.ProcessingEnvironmentCompilerOptions.Feature.VALIDATE_TRANSITIVE_COMPONENT_DEPENDENCIES;
|
39 | 40 | import static dagger.internal.codegen.compileroption.ProcessingEnvironmentCompilerOptions.Feature.WARN_IF_INJECTION_FACTORY_NOT_GENERATED_UPSTREAM;
|
40 | 41 | import static dagger.internal.codegen.compileroption.ProcessingEnvironmentCompilerOptions.Feature.WRITE_PRODUCER_NAME_IN_TOKEN;
|
@@ -203,6 +204,11 @@ public boolean generatedClassExtendsComponent() {
|
203 | 204 | return isEnabled(GENERATED_CLASS_EXTENDS_COMPONENT);
|
204 | 205 | }
|
205 | 206 |
|
| 207 | + @Override |
| 208 | + public boolean useLegacyBindingGraphFactory() { |
| 209 | + return isEnabled(USE_LEGACY_BINDING_GRAPH_FACTORY); |
| 210 | + } |
| 211 | + |
206 | 212 | @Override
|
207 | 213 | public int keysPerComponentShard(XTypeElement component) {
|
208 | 214 | if (options.containsKey(KEYS_PER_COMPONENT_SHARD)) {
|
@@ -238,15 +244,14 @@ private ProcessingEnvironmentCompilerOptions checkValid() {
|
238 | 244 | noLongerRecognized(FLOATING_BINDS_METHODS);
|
239 | 245 | noLongerRecognized(EXPERIMENTAL_AHEAD_OF_TIME_SUBCOMPONENTS);
|
240 | 246 | noLongerRecognized(USE_GRADLE_INCREMENTAL_PROCESSING);
|
241 |
| - if (!isEnabled(IGNORE_PROVISION_KEY_WILDCARDS)) { |
242 |
| - if (processingEnv.getBackend() == XProcessingEnv.Backend.KSP) { |
243 |
| - processingEnv.getMessager().printMessage( |
244 |
| - Diagnostic.Kind.ERROR, |
245 |
| - String.format( |
246 |
| - "When using KSP, you must also enable the '%s' compiler option (see %s).", |
247 |
| - "dagger.ignoreProvisionKeyWildcards", |
248 |
| - "https://dagger.dev/dev-guide/compiler-options#ignore-provision-key-wildcards")); |
249 |
| - } |
| 247 | + if (processingEnv.getBackend() == XProcessingEnv.Backend.KSP |
| 248 | + && !isEnabled(IGNORE_PROVISION_KEY_WILDCARDS)) { |
| 249 | + processingEnv.getMessager().printMessage( |
| 250 | + Diagnostic.Kind.ERROR, |
| 251 | + String.format( |
| 252 | + "When using KSP, you must also enable the '%s' compiler option (see %s).", |
| 253 | + "dagger.ignoreProvisionKeyWildcards", |
| 254 | + "https://dagger.dev/dev-guide/compiler-options#ignore-provision-key-wildcards")); |
250 | 255 | }
|
251 | 256 | return this;
|
252 | 257 | }
|
@@ -337,6 +342,8 @@ enum Feature implements EnumOption<FeatureStatus> {
|
337 | 342 |
|
338 | 343 | GENERATED_CLASS_EXTENDS_COMPONENT,
|
339 | 344 |
|
| 345 | + USE_LEGACY_BINDING_GRAPH_FACTORY(ENABLED), |
| 346 | + |
340 | 347 | USE_FRAMEWORK_TYPE_IN_MAP_MULTIBINDING_CONTRIBUTION_KEY,
|
341 | 348 |
|
342 | 349 | IGNORE_PROVISION_KEY_WILDCARDS(ENABLED),
|
|
0 commit comments