-
Notifications
You must be signed in to change notification settings - Fork 23
Java plugin's generated code not discovered by IntelliJ #3
Comments
I think you can also just add the folder to the main source set. Will experiment with when I get some time. sourceSets.main.srcDirs += 'build/generated/proto' |
for reference, I added a question to an old IDEA issue: probably won't get response and i'll create another issue later |
As another workaround you can also do this: ext.generatedFilesDir = "${projectDir}/proto-gen-src"
tasks["generateWireProtos"].outputDir = file(generatedFilesDir)
tasks["clean"] << {
file(generatedFilesDir).deleteDir()
}
sourceSets.main.java.srcDir generatedFilesDir In general, I think it makes sense to provide an option to specify output directory for Wire task in easier way, and maybe make default output directory outside of "build" folder for Java projects. |
Other plugins ( |
So this plugin does not configure IntelliJ. But if you have any other plugin that does that, it should just work. So apply both
Then add this below in your
|
Unlike the Android plugin, the Java gradle plugin doesn't seem to provide a way to configure a directory as a generated source directory so that it gets picked up by the IDE as source, and have it generated when you click "Sync Now". See square/wire#177 (comment) for the original report.
There are some hacky workarounds at http://stackoverflow.com/questions/16702126/how-to-specify-intellij-exclude-directories-using-gradle but none of them are particularly appealing. Notably, the question author there says they're using a protobuf plugin (not this one, ostensibly) that has this same problem.
The text was updated successfully, but these errors were encountered: