jiakuan / gwt-gradle-plugin

Gradle plugin to support GWT related tasks.
https://gwt-gradle.docstr.org
Other
63 stars 34 forks source link

Problem with Gradle 7 #49

Closed cdietrich closed 3 years ago

cdietrich commented 3 years ago

Hi, i am not really experienced with Gradle. the following code is working fine with older gradle versions https://github.com/eclipse/xtext-lib/compare/cd_issue387 but not with gradle 7 but it seems to work if i duplicate the dependency like here https://github.com/eclipse/xtext-lib/compare/cd_gradle6CrapExperiments

jiakuan commented 3 years ago

At the moment, we have tried with Gradle 7.0 which seems working well. Not sure if there are any difference in Gradle 7.1.

cdietrich commented 3 years ago

i see the problem also with 7.0

cdietrich commented 3 years ago
> Task :org.eclipse.xtend.lib.gwt.test:compileGwt FAILED
Loading inherited module 'org.eclipse.xtend.lib.test.Test'
   Loading inherited module 'org.eclipse.xtend.lib.Lib'
      [ERROR] Unable to find 'org/eclipse/xtend/lib/Lib.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

somehow it does not find the gtw xml in another jar on the projects classpath

api project(':org.eclipse.xtend.lib.gwt') but if i add additionally the gwt config

gwt project(':org.eclipse.xtend.lib.gwt') to the dependencies, then it works.

so it looks like the api is not looked at for gwt compilation

it might also be related to the project doing some custom crap to package the xml into the jar, but it was working with older gradle versions

jiakuan commented 3 years ago

Looks like related to the Gradle dependency configuration. Not sure if it's something to do with this plugin?

cdietrich commented 3 years ago

yes i have no idea how the plugin searches the xml

jiakuan commented 3 years ago

That's managed by the GWT compiler, this plugin is just a wrapper around the GWT SDK so that it works with Gradle. The underlying GWT compiler will do the job.

cdietrich commented 3 years ago

i see. but it does not seem to use the jar but just output folders

/Users/cdietrich/xtext-master/git/xtext-lib/org.eclipse.xtend.lib.gwt.test/build/resources/main:/Users/cdietrich/xtext-master/git/xtext-lib/org.eclipse.xtend.lib.gwt/build/classes/java/main:/Users/cdietrich/xtext-master/git/xtext-lib/org.eclipse.xtend.lib/build/classes/java/main:/Users/cdietrich/xtext-master/git/xtext-lib/org.eclipse.xtext.xbase.lib.gwt/build/classes/java/main:/Users/cdietrich/xtext-master/git/xtext-lib/org.eclipse.xtend.lib.macro/build/classes/java/main:/Users/cdietrich/xtext-master/git/xtext-lib/org.eclipse.xtext.xbase.lib/build/classes/java/

so i need to do into the project custom stuff to produce the xml ...

somehow the build/resources/main fopr the depending projects it does not look at

cdietrich commented 3 years ago

where can i find the place in the plugin that populates the classpath?

cdietrich commented 3 years ago

reconfiguring java sourceset to include the xml seems to work

        java {
            srcDirs = sourceDirs
            include '**/*.java', '**/*.xtend', '*.gwt.xml'
        }

need to double check.

nope does not help. maybe its time for us to stop gwt support.

jiakuan commented 3 years ago

Although it's not documented yet, you can also configure classpath in gwt { }. Please see the source code here:

https://github.com/jiakuan/gwt-gradle-plugin/blob/cea98787fa30255f32fac8fc542ce5af2796b69f/src/main/java/org/wisepersist/gradle/plugins/gwt/AbstractGwtActionTask.java#L52

jiakuan commented 3 years ago

Close for now