-
Notifications
You must be signed in to change notification settings - Fork 9
Incompatible with Gradle 7 (.1.1) #13
Comments
JavaToolChain had been deprecated for quite some time and went when Gradle 7.x released. Please, compare: Looks like it's time to convert the plugin from 'software model' API to the contemporary one. |
Unfortunately, Gradle does not yet offer a good replacement for the removed (half baked) API: gradle/gradle#15942 |
Gradle's API changes certainly don't make it easy, but one can still create Java compilation tasks that use ECJ. Here's how I define a |
Thanks for sharing the solution @liblit. I think you do not necessarily need this:
If I am not mistaken, Gradle will ignore the toolchain configuration if you explicitly set an executable the fork options (which you do). So I think you do not necessarily need to extend the |
The solution was not suitable for the project I need this for, as everything needed to be done with ECJ since some code only compiles with ECJ (certain generics stuff). The project is quite large so forking a new compiler process for each subproject had quite a performance impact. What we ended up doing now is copying the implementation on JavaCompile and replacing the implementation of the Compiler interface in createCompiler() with one that delegates to the ECJ compiler. This is similar to the pre Gradle 7 solution, using more internal API. I think it is quite fragile as it may break down as soon as internals around the JavaCompile task change. Right now it works with all Gradle 7.x releases so far. Since we have a new task, we needed to register it separately - similar to @liblit's solution. We then deactivated the standard compile tasks completely. |
As [pointed out by `$RANDOM_INTERNET_PERSON`](TwoStone/gradle-eclipse-compiler-plugin#13 (comment)), this extra step is not needed. Setting an executable in the fork options (which we do) is sufficient.
As [pointed out by `$RANDOM_INTERNET_PERSON`](TwoStone/gradle-eclipse-compiler-plugin#13 (comment)), this extra step is not needed. Setting an executable in the fork options (which we do) is sufficient.
@jjohannes wrote:
You're right, so I have removed this unnecessary step. Thanks! |
Hi,
we had to go from Gradle 6.7 to 7.1.1 because of JAVA 16 support.
The problem is, that de.set.ecj fails to load.
Gradle error message:
build.gradle
Full Gradle output:
The text was updated successfully, but these errors were encountered: