Question

Problem
Is there any way Codeserver accept more than one dir in the -src flag?

Details
I'm trying to separate my source code into folders like this:

  • src
  • widgets
  • utility
  • main

I got the regular dev mode to compile my code via the following *.gwt.xml files:

src/MyProject.gwt.xml

<module>
    <inherits name='com.google.gwt.user.User' />
    <inherits name="com.my.project.Widget"/>
    <entry-point class="com.my.project.Test" />
</module>

widgets/Widgets.gwt.xml

<module>
    <inherits name='com.google.gwt.user.User' />
    <inherits name="com.my.project.Widgets"/>
</module>

But every time I try to run in the Codeserver (SuperDevMode), it will say it can't find classes in com.my.project.Widgets package.

I'm running SuperDevMode using the following arguments:

-src src/ com.my.Project.MyProject

But I'm guessing I need something like:

-src src/ com.my.Project.MyProject widgets/ com.my.Project.Widgets

FYI
I know you can organize the classes using packages but I would prefer to have them in separate source folders, so later on I can easily repackage them into separate jars.

Update
Just tried adding the [module]:

-src src/ com.my.Project.MyProject com.my.Project.Widgets

Didn't work :(

Was it helpful?

Solution

Just pass -src as many times as you need it:

-src src/ -src widgets/

The modules comes last on the command line, and are looked up in all source folders and the classpath:

-src src/ -src widgets/ com.my.Project.MyProject

Note that only modules with an <entry-point> (or inheriting a module that has an <entry-point>) can be passed that way on the command line; without entry-point the module is only a "library" to be inherited by other modules, not an "application".

Note, you could also just add all your source folders to the classpath, instead of using -src.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top