Skip to content

Commit

Permalink
Enable Gradle's incremental annotation processing always.
Browse files Browse the repository at this point in the history
We haven't received any reports of this not working correctly.

RELNOTES=Gradle's incremental annotation processing is now enabled for all builds

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=258623443
  • Loading branch information
ronshapiro committed Jul 19, 2019
1 parent 67acb2e commit 50bc180
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
16 changes: 7 additions & 9 deletions java/dagger/internal/codegen/ComponentProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@

package dagger.internal.codegen;

import static net.ltgt.gradle.incap.IncrementalAnnotationProcessorType.DYNAMIC;
import static net.ltgt.gradle.incap.IncrementalAnnotationProcessorType.ISOLATING;

import com.google.auto.common.BasicAnnotationProcessor;
import com.google.auto.service.AutoService;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.errorprone.annotations.CheckReturnValue;
import dagger.BindsInstance;
Expand All @@ -48,7 +49,7 @@
*
* <p>TODO(gak): give this some better documentation
*/
@IncrementalAnnotationProcessor(DYNAMIC)
@IncrementalAnnotationProcessor(ISOLATING)
@AutoService(Processor.class)
public class ComponentProcessor extends BasicAnnotationProcessor {
private final Optional<ImmutableSet<BindingGraphPlugin>> testingPlugins;
Expand Down Expand Up @@ -95,13 +96,10 @@ public SourceVersion getSupportedSourceVersion() {

@Override
public Set<String> getSupportedOptions() {
ImmutableSet.Builder<String> options = ImmutableSet.builder();
options.addAll(ProcessingEnvironmentCompilerOptions.supportedOptions());
options.addAll(bindingGraphPlugins.allSupportedOptions());
if (compilerOptions.useGradleIncrementalProcessing()) {
options.add("org.gradle.annotation.processing.isolating");
}
return options.build();
return Sets.union(
ProcessingEnvironmentCompilerOptions.supportedOptions(),
bindingGraphPlugins.allSupportedOptions())
.immutableCopy();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ private ProcessingEnvironmentCompilerOptions checkValid() {
noLongerRecognized(EXPERIMENTAL_ANDROID_MODE);
noLongerRecognized(FLOATING_BINDS_METHODS);
noLongerRecognized(EXPERIMENTAL_AHEAD_OF_TIME_SUBCOMPONENTS);
noLongerRecognized(USE_GRADLE_INCREMENTAL_PROCESSING);
return this;
}

Expand Down

0 comments on commit 50bc180

Please sign in to comment.