fix(annotations-processors/ksp): use AutoService to register SymbolProcessorProvider

This commit is contained in:
Akash Yadav
2024-05-26 01:33:58 +05:30
parent 12ab4b0d15
commit 4370a194eb
5 changed files with 11 additions and 22 deletions
+7 -3
View File
@@ -15,20 +15,24 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.itsaky.androidide.build.config.BuildConfig
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
kotlin("kapt")
}
group = "${BuildConfig.packageName}.annotations"
dependencies {
kapt(libs.google.auto.service)
implementation(libs.google.auto.service.annotations)
implementation(kotlin("stdlib"))
implementation(projects.annotations)
implementation(libs.androidx.annotation)
implementation(libs.common.javapoet)
implementation(libs.common.ksp)
@@ -27,6 +27,7 @@ import com.google.devtools.ksp.symbol.KSClassDeclaration
import com.google.devtools.ksp.symbol.KSFunctionDeclaration
import com.google.devtools.ksp.symbol.KSType
import com.itsaky.androidide.annotations.inflater.ViewAdapter
import com.itsaky.androidide.annotations.ksp.getKSAnnotationsByType
import com.itsaky.androidide.annotations.uidesigner.IncludeInDesigner
import com.squareup.javapoet.ClassName
import com.squareup.javapoet.CodeBlock
@@ -17,6 +17,7 @@
package com.itsaky.androidide.annotations.ksp.inflater
import com.google.auto.service.AutoService
import com.google.devtools.ksp.processing.SymbolProcessor
import com.google.devtools.ksp.processing.SymbolProcessorEnvironment
import com.google.devtools.ksp.processing.SymbolProcessorProvider
@@ -27,6 +28,7 @@ import com.google.devtools.ksp.processing.SymbolProcessorProvider
*
* @author Akash Yadav
*/
@AutoService(SymbolProcessorProvider::class)
class ViewAdapterSymbolProcessorProvider : SymbolProcessorProvider {
override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor {
@@ -15,7 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itsaky.androidide.annotations.ksp.inflater
package com.itsaky.androidide.annotations.ksp
import com.google.devtools.ksp.symbol.KSAnnotated
import com.google.devtools.ksp.symbol.KSAnnotation
@@ -1,18 +0,0 @@
#
# This file is part of AndroidIDE.
#
# AndroidIDE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# AndroidIDE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
#
com.itsaky.androidide.annotations.ksp.inflater.ViewAdapterSymbolProcessorProvider