Advertisement

自定义 kapt

阅读量:

一、 添加依赖

根目录-> new-> java 或 Kotlin Library

需将工程所使用的 gradle-wrapper 与 gradle-plugin 版本分别调整至 4.10.1 和 3.2.0。详细原因

若不打算对 gradle 进行版本降级,则需在 自定义注解解析器 中增加相应的依赖配置

复制代码
    annotationProcessor 'com.google.auto.service:auto-service:1.0-rc6'

    
    
    
        
        

对自定义注解库的构建配置文件 build.gradle 进行设置

复制代码
    plugins {  
     id 'java-library'  
     id 'kotlin'  
    }  
      
    tasks.withType(JavaCompile) {  
     options.encoding = "UTF-8"  
    }  
    dependencies {  
     implementation fileTree(dir: 'libs', include: ['*.j

全部评论 (0)

还没有任何评论哟~