Convert com.facebook.annotationprocessor.common.ProcessorBase to Kotlin (#45595)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45595

Changelog: [Internal][Changed] com.facebook.annotationprocessor.common.ProcessorBase -> Kotlin

Reviewed By: tdn120

Differential Revision: D60110313

fbshipit-source-id: 42e51927bc3bd56699c79f2f51293ba68ad7df22
This commit is contained in:
Nicola Corti
2024-07-26 04:51:58 -07:00
committed by Facebook GitHub Bot
parent b5a5e9d51c
commit f9ebc1d9ed
3 changed files with 26 additions and 25 deletions
@@ -11,6 +11,7 @@ import com.facebook.react.tasks.internal.*
import com.facebook.react.tasks.internal.utils.*
import de.undercouch.gradle.tasks.download.Download
import java.nio.file.Paths
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("maven-publish")
@@ -656,7 +657,6 @@ android {
"src/main/res/views/alert",
"src/main/res/views/modal",
"src/main/res/views/uimanager"))
java.exclude("com/facebook/annotationprocessors")
java.exclude("com/facebook/react/processing")
java.exclude("com/facebook/react/module/processing")
}
@@ -777,6 +777,8 @@ android {
}
}
tasks.withType<KotlinCompile>().configureEach { exclude("com/facebook/annotationprocessors/**") }
dependencies {
api(libs.androidx.appcompat)
api(libs.androidx.appcompat.resources)
@@ -1,24 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.annotationprocessors.common;
import java.util.Set;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.element.TypeElement;
public abstract class ProcessorBase extends AbstractProcessor {
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
return processImpl(annotations, roundEnv);
}
protected abstract boolean processImpl(
Set<? extends TypeElement> annotations, RoundEnvironment roundEnv);
}
@@ -0,0 +1,23 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.annotationprocessors.common
import javax.annotation.processing.AbstractProcessor
import javax.annotation.processing.RoundEnvironment
import javax.lang.model.element.TypeElement
public abstract class ProcessorBase : AbstractProcessor() {
public fun process(annotations: Set<TypeElement?>?, roundEnv: RoundEnvironment?): Boolean =
processImpl(annotations, roundEnv)
protected abstract fun processImpl(
annotations: Set<TypeElement?>?,
roundEnv: RoundEnvironment?
): Boolean
}