-
Notifications
You must be signed in to change notification settings - Fork 274
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
compileJava task fails if Java files generating is disabled #333
Comments
protobuf-gradle-plugin/src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy Line 128 in 3fd3c64
configures the sourceSet of More specifically, protobuf-gradle-plugin/src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy Line 457 in 3fd3c64
configures every compile task for each supported language with current sourceSet's |
the dummy java file would sort of get around this error, when can we have a fix for this ? @voidzcy |
The change might be somewhat involved, need to look even deeper and figure out a proper way for resolving this issue. Currently, I do not have a foreseeable timeline. More discussions and PRs are welcome. |
We are also seeing this issue. Is anything been done to resolve it, or is there a better way to get around this than using an empty dummy-file? |
@Chr1stian what programming language is your project? As mentioned in README, we are primarily targeting for Java and Android (Kotlin) users. You should get a configuration exception if none of Java or Android plugins is applied. However, applying some plugins (e.g., the scala plugin) indirectly applies the Java plugin and bypasses our prerequisite plugin check. The result is that the generated code (not Java or Kotlin) will be fed to the the Java plugin's compile tasks and causes no source files error. We probably do not want to prohibit such usages for scala users immediately (as there are already some projects depending on it), and currently we do not know if there are other plugins work similar to the scala plugin. I previously created #375, which is a benign mitigation for use cases similar to scala (basically we only automatically feed generated Java/Kotlin code to Java/Kotlin compilation tasks, other languages need to manually add generated code in their compilation sourceSets). We may also want to further clean up/clarify the README a bit to let non-Java/Android users be aware of this. /cc @ejona86 |
Its a Scala-only project |
I am also running into this on a scala-only build, I'll be using the dummy java file for now as a workaround, though it would be great to have a fix for this upstream. It was confusing to figure out why |
This should have been fixed by #375. Stay tuned for 0.8.14 release. |
Still not solved... happens in 0.8.17 |
This GitHub repository reproduces the error.
If there is a project that doesn't contain any Java code, and also Java code generating is disabled, then you get following error:
The is a dummy Java file that causes the project is passing now. If you remove this file, the project fails.
The text was updated successfully, but these errors were encountered: