gwt-gradle-plugin icon indicating copy to clipboard operation
gwt-gradle-plugin copied to clipboard

Gradle upgrade to 5.4 causes build failure

Open sandeep-khanna opened this issue 6 years ago • 3 comments

Environment

Java

openjdk 11.0.3 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu219.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu219.04.1, mixed mode, sharing)

GWT

2.8.2

GWT Gradle Plugin

0.6

Receiving the following error after upgrading Gradle from version 4.8.1 to 5.4.1

java.lang.NoSuchMethodError: org.gradle.api.tasks.SourceSetOutput.getClassesDir()Ljava/io/File;
10:12:21.117 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at de.richsource.gradle.plugins.gwt.GwtBasePlugin$5$3.call(GwtBasePlugin.java:263)
10:12:21.117 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at de.richsource.gradle.plugins.gwt.GwtBasePlugin$5$3.call(GwtBasePlugin.java:260)
10:12:21.117 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.util.GUtil.uncheckedCall(GUtil.java:459)
10:12:21.118 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.extensibility.ConventionAwareHelper$2.doGetValue(ConventionAwareHelper.java:77)
10:12:21.118 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.extensibility.ConventionAwareHelper$MappedPropertyImpl.getValue(ConventionAwareHelper.java:121)
10:12:21.118 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.extensibility.ConventionAwareHelper.getConventionValue(ConventionAwareHelper.java:104)
10:12:21.118 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at de.richsource.gradle.plugins.gwt.GwtCompile_Decorated.getClasspath(Unknown Source)
10:12:21.119 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Is the solution some local workaround or an update to the gwt-gradle-plugin?

sandeep-khanna avatar Jul 02 '19 15:07 sandeep-khanna

This project is unmaintained. The method SourceSetOutput.getClassesDir() has been deprecated in Gradle 4.x and removed in Gradle 5.x. Thus you see the error.

In case you want to fix the plugin yourself, the code should use SourceSetOutput.getClassesDirs().

jnehlmeier avatar Jul 03 '19 14:07 jnehlmeier

Understood that the project is unmaintained. I agree with your code fix and was trying to set this up locally and ran in to other Gradle build issues while trying to upgrade from Gradle version 2.4 to 5.4.1

Should I submit a merge/pull request with the code change or is there another GWT Gradle plugin that you would recommend using?

sandeep-khanna avatar Jul 03 '19 14:07 sandeep-khanna

I guess these should work with Gradle 5:

https://github.com/jiakuan/gwt-gradle-plugin https://github.com/Putnami/putnami-gradle-plugin

The first one is a direct fork of this project and fixed some stuff.

jnehlmeier avatar Jul 03 '19 14:07 jnehlmeier