-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ide instructions in readme #106
Comments
Finally able to get everything hooked up, here are the details: 1: 2: use step b if you are using gradle, otherwise use step a. b. It appears that the gradle plugin is overwriting my IDE settings on refresh, removing my addition of the generated folder as a source folder. To get the module source setting to stick, I did the following: build.gradle: srcDir is additive, so the default srcDir is preserved. The exclude is required because gradle will perform the annotation processing. We are just adding the srcDir tag for the gradle ide integration, gradle will compile successfully without this (but your ide will be busted). Explanation: |
is there a way to turn on annotation processors using the gradle idea plugin? having a clean gradle script i can just include to make this all happen would be wonderful! assuming i can get annotations to be kept to the generated classes, i'd be willing to look into good clean intellij/gradle support :) |
…t these extra steps, the project builds successfully, but the generated classes are still flagged as unresolved in the UI.)
parboiled is PEG (Parsing Expression Grammar) implementation. PEG is more concise than regex, and regex could not handle recursive structure well. GcEventNode is added to access the parsed data easily. Its concrete class is generated by Auto Value library which utilizes annotation processing. IDE setup is required and the instruction can be found here: google/auto#106
Is there some documentation to add autovalue 1.2 manually to an eclipse project. The link in the blog post above was useful but its pretty outdated and deals with the initial release of autovalue. |
With the current additions to IntelliJ (https://www.jetbrains.com/idea/whatsnew/#v2016-3-gradle), I'm now using Auto-Value + Gradle in IntelliJ by importing the projects like this:
|
Here's an approach that automates most of the configuration from the build file. With some help from this post. In this approach, the annotation processor parts of gradle are picked up and passed into intellij's configuation. Also, the generated sources folded is injected into the configuration. For some reason using the idea plugin In this configuration you MUST still uncheck "Create separate modules per source set" when using this. (Haven't figured out how to auto configure this) idea {
project {
ipr {
withXml { provider ->
// Get XML as groovy.util.Node to work with.
def projectXml = provider.asNode()
// Find compiler configuration component.
def compilerConfiguration = projectXml.component.find { component ->
component.'@name' == 'CompilerConfiguration'
}
// Replace current annotationProcessing
// that is part of the compiler configuration.
def currentAnnotationProcessing = compilerConfiguration.annotationProcessing
currentAnnotationProcessing.replaceNode {
annotationProcessing {
profile(name: 'Default', default: true, enabled: true) {
processorPath(useClasspath: false) {
// find all annotation processors on from gradle config and
// add them as entries to the intellij config
project.configurations.annotationProcessor.each {
entry(name:"$it.path")
}
}
}
}
}
}
}
}
module {
// add the generated sources directory as a sourceDir (should be
// wherever the intellij compiler is spitting out your autovalue files).
sourceDirs += file("out/production/classes/generated")
}
} |
we ended up using a plugin to enable this for our IDEs: https://github.com/palantir/gradle-processors |
The readme instructions don't mention enabling annotation processing in your ide, and even after doing so my code compiles but intellij 13 CE (OSX) cannot find the generated classes, making the editor show compiler errors.
These instructions for eclipse look promising, but also a pain to have to set up manually.
http://www.codeaffine.com/2014/03/04/using-the-autovalue-code-generator-in-eclipse/
Btw I'm glad to have an alternative to lombok! I like the feature set but we've been plagued with compatibility issues with new ide/java/lombok versions.
The text was updated successfully, but these errors were encountered: