jiakuan / gwt-gradle-plugin

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

Need special logic for GWT package rename. #63

Closed michael-newsrx closed 2 weeks ago

michael-newsrx commented 2 years ago

When specifying gwtSdk as:

    gwtSdk 'org.gwtproject:gwt-user:2.10.0'
    gwtSdk 'org.gwtproject:gwt-dev:2.10.0'

The htmlunit dependency chain is not handled properly when depending on projects such as gwt-material resulting in an incorrect version of Jetty being used for super-dev mode.

I'm guessing this is at least in part due to the package rename.

One has to add providedCompile "net.sourceforge.htmlunit:htmlunit:2.55.0" to get superdev mode working.

jiakuan commented 2 years ago

Is there a minimal sample project demonstrating the issue? What is the expected result? I guess we wanted the htmlunit from the GWT dependencies?

michael-newsrx commented 2 years ago

I'll try and put together a minimal project.

Near as I can tell the gwtSdk directive does not seem to be applying the dependency requirements to the superdev run.

In my case, when I use gwtmaterial as a dependency they have their setup so that it shows older gwt-dev and older gwt-user as required and pulls in those older versions htmlunit dependency instead.

As a starting point I've attached two dependency reports, both with and without the htmlunit stanza.

Look specifically for +--- com.github.gwtmaterialdesign:gwt-material:2.6.0 to see the source of the older htmlunit dependency.

Without stanza: dependencies-without-htmlunit-stanza.txt

With stanza: dependencies-with-htmlunit-stanza.txt

michael-newsrx commented 2 years ago

build.gradle fragments

gwt {
    logLevel = 'INFO'
    maxHeapSize = "2048M"
    modules 'api.test.ApiTestClient'
    src += files(compileJava.options.annotationProcessorGeneratedSourcesDirectory)
    compiler {
        disableClassMetadata = false
        strict = true
        style = "OBF"
    }
    superDev {
        noPrecompile = false
        failOnError = false
        bindAddress = "0.0.0.0"
    }
}
dependencies {
    gwtSdk 'org.gwtproject:gwt-user:2.10.0'
    gwtSdk 'org.gwtproject:gwt-dev:2.10.0'
    providedCompile "net.sourceforge.htmlunit:htmlunit:2.55.0" // to get superdev mode working

String materialVersion = "2.6.0"
    compileOnly('com.github.gwtmaterialdesign:gwt-material:' + materialVersion) {
        exclude module: "gwt-user"
        exclude module: "gwt-dev"
    }
    compileOnly('com.github.gwtmaterialdesign:gwt-material-addins:' + materialVersion) {
        exclude module: "gwt-user"
        exclude module: "gwt-dev"
    }
    compileOnly('com.github.gwtmaterialdesign:gwt-material-table:' + materialVersion) {
        exclude module: "gwt-user"
        exclude module: "gwt-dev"
    }
    compileOnly('com.github.gwtmaterialdesign:gwt-material-themes:' + materialVersion) {
        exclude module: "gwt-user"
        exclude module: "gwt-dev"
    }
    compileOnly('com.github.gwtmaterialdesign:gwt-material-jquery:' + materialVersion) {
        exclude module: "gwt-user"
        exclude module: "gwt-dev"
    }
jiakuan commented 2 weeks ago

May be out of date, please check v2