3

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 :(

ksrb
  • 1,797
  • 12
  • 22

1 Answers1

6

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.

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • Thanks I had a feeling I was being dumb. Using -src widgets/ com.myProject.Widgets worked. But I'm a little confused about the second part of your answer: "Note that only modules with an ...". Are you saying that my Widgets.gwt.xml file should also have a entry point? Cause right now it doesn't and its working. – ksrb Dec 02 '13 at 18:22
  • And I'm using eclipse so the widgets folder should have already been added to the classpath? At least in the various configuration windows, I'm seeing my folder being added... – ksrb Dec 02 '13 at 18:28
  • Oh nvm I was being dumb just read you answer again. I was under the impression that "-src src/ com.my.Project.MyProject" was one argument lol. Not two separate argument. – ksrb Dec 02 '13 at 18:38
  • Re. ``, I was saying that you shouldn't pass Widgets as argument given that it has no entry point. – Thomas Broyer Dec 03 '13 at 08:51