Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SuperDevListener is not correctly build includeJsInteropExports/excludeJsInteropExports args #9939

Open
MCMicS opened this issue Mar 19, 2024 · 0 comments

Comments

@MCMicS
Copy link
Contributor

MCMicS commented Mar 19, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant