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

Need special logic for GWT package rename.

Open michael-newsrx opened this issue 3 years ago • 3 comments
trafficstars

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.

michael-newsrx avatar Aug 10 '22 12:08 michael-newsrx

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

jiakuan avatar Aug 11 '22 00:08 jiakuan

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 avatar Aug 11 '22 17:08 michael-newsrx

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"
    }

michael-newsrx avatar Aug 11 '22 17:08 michael-newsrx