Cannot resolve symbol with AutoValue and IntelliJ

后端 未结 3 1325
温柔的废话
温柔的废话 2021-02-14 08:45

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条回答
  •  -上瘾入骨i
    2021-02-14 09:33

    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"
    }
    

提交回复
热议问题