Skip to content

Commit

Permalink
internal_change
Browse files Browse the repository at this point in the history
RELNOTES=N/A
PiperOrigin-RevId: 569647670
  • Loading branch information
dx404 authored and Dagger Team committed Oct 2, 2023
1 parent fd907cb commit f561444
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
42 changes: 42 additions & 0 deletions java/dagger/internal/codegen/ArchipelagoComponentProcessor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (C) 2023 The Dagger Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package dagger.internal.codegen;

import com.google.auto.service.AutoService;
import com.google.common.collect.ImmutableSet;
import com.google.devtools.kotlin.compiler.plugin.codegen.archipelago.KtCodegenArchipelago;
import com.google.devtools.kotlin.compiler.plugin.codegen.archipelago.KtCodegenElectoralDistrict;
import com.google.devtools.kotlin.compiler.plugin.codegen.archipelago.KtCodegenEnvironment;

/** A KSP/KAPT processor selector for Dagger-managed processors. */
@AutoService(KtCodegenArchipelago.class)
public final class ArchipelagoComponentProcessor implements KtCodegenArchipelago {
private static final String DAGGER_JAVAC_PROCESSOR = "dagger.internal.codegen.ComponentProcessor";
private static final String DAGGER_KSP_PROCESSOR =
"dagger.internal.codegen.KspComponentProcessor$Provider";

@Override
public void onCreate(KtCodegenEnvironment env) {}

@Override
public ImmutableSet<KtCodegenElectoralDistrict> providesProcessorElectoralDistricts() {
return ImmutableSet.of(
new KtCodegenElectoralDistrict(
ImmutableSet.of(DAGGER_JAVAC_PROCESSOR),
ImmutableSet.of(DAGGER_JAVAC_PROCESSOR, DAGGER_KSP_PROCESSOR)));
}
}
5 changes: 4 additions & 1 deletion java/dagger/internal/codegen/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ java_library(
name = "processor",
srcs = glob(
["*.java"],
exclude = ["package-info.java"],
exclude = [
"package-info.java",
"ArchipelagoComponentProcessor.java",
],
),
plugins = [
"//java/dagger/internal/codegen/bootstrap",
Expand Down

0 comments on commit f561444

Please sign in to comment.