Cannot resolve symbol with AutoValue and IntelliJ

后端 未结 3 1338
粉色の甜心
粉色の甜心 2021-02-14 08:54

I have been trying to find the correct settings for IntelliJ\'s annotation processing in order for it to co-exist with Gradle\'s build process.

Whenever I build from Int

3条回答
  •  感动是毒
    2021-02-14 09:41

    Just have your build.gradle with these and it works fine, no need of touching intellij, source set etc..

        plugins {
        id 'java'
        id "net.ltgt.apt" version "0.20"
    
    }
    
    apply plugin: 'idea'
    apply plugin: 'net.ltgt.apt-idea'
    group 'abc'
    version '1.0-SNAPSHOT'
    
    sourceCompatibility = 1.8
    
    repositories {
        mavenCentral()
    }
    
    dependencies {
        testCompile group: 'junit', name: 'junit', version: '4.12'
        compile             "com.google.auto.value:auto-value-annotations:1.6.2"
        annotationProcessor "com.google.auto.value:auto-value:1.6.2"
    }
    

提交回复
热议问题