Skip to content

SuperDevListener is not correctly build includeJsInteropExports/excludeJsInteropExports args #9939

Closed

Description

@MCMicS

GWT version: 2.11.0
Browser (with version):
Operating System:


Description

includeJsInteropExports/excludeJsInteropExports arguments cannot be used when launching application with com.google.gwt.dev.DevMode. It comes because The RegexFiler add an +or - and in SuperDevListener the additional +will not be removed which leads to an error because +/- is not allowed there.
This happen for example in Intellij with GWT Run Configration because it uses the DevMode

Code with issue:

    for (String regex : options.getJsInteropExportFilter().getValues()) {
      if (regex.startsWith("-")) {
        args.add("-excludeJsInteropExports");
        args.add(regex.substring(1));
      } else {
        args.add("-includeJsInteropExports");
        args.add(regex);
      }
    }

Possible solution:

    for (String regex : options.getJsInteropExportFilter().getValues()) {
      if (regex.startsWith("-")) {
        args.add("-excludeJsInteropExports");
        args.add(regex.substring(1));
      } else {
        args.add("-includeJsInteropExports");
        args.add(regex.startsWith("+") ? regex.substring(1) : regex);
      }
    }

IC will test it the days and can create a Pull Request then if the solution sounds ok.

Steps to reproduce
  1. Download GWT Zip (like gwt-2.11.0.zip) and extract it
  2. Running following command
java -cp gwt-dev.jar;gwt-user.jar;samples/Hello/src com.google.gwt.dev.DevMode -logdir logs -startupUrl Hello.html -war samples/Hello/war -generateJsInteropExports -includeJsInteropExports com.google.* com.google.gwt.sample.hello.Hello
  1. The DevMode will not start and shows that following args are transferred to CodeServer (found in logs/main.log):
Running CodeServer with parameters: [-noprecompile, -port, 9876, -sourceLevel, 1.8, -bindAddress, 127.0.0.1, -launcherDir, P:\GWT\gwt-2.11.0\samples\Hello\war, -logLevel, INFO, -includeJsInteropExports, +com.google.*, -style, OBFUSCATED, com.google.gwt.sample.hello.Hello]

Error Message:

-includeJsInteropExports regex cannot start with '+' or '-'

The wrong part is in my opinion: -includeJsInteropExports, +com.google.*

Links to further discussions

Activity

  1. niloc132 commented on Aug 9, 2024

    @niloc132
    Member

    Fixed by #9940.

  2. added this to the 2.12 milestone on Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions