gwtproject / gwt

GWT Open Source Project

Home Page:http://www.gwtproject.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SuperDevListener is not correctly build includeJsInteropExports/excludeJsInteropExports args

MCMicS opened this issue · comments

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