Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

2017-01-28 Thread Magnus
Hello Jens!

On Saturday, January 28, 2017 at 5:24:56 PM UTC+1, Jens wrote:
>
>
>>- src/main/java/mylib/general
>>- src/main/java/mylib/web
>>
>> src/main/java/mylib/web.gwt.xml
>>
>>
>>   
>>   
>>   
>>   
>>
>>
>> That would work, as long as src/main/java/mylib or 
> src/main/java/mylib/general is not exposed to GWT compiler by any other GWT 
> module you might have.
>

I guess you mean having another *.gwt.xml file that reference some folder 
under /src/main/java/mylib/general?
 

> Its basically the same as with using client, shared and server folder
>

I already noticed this naming convention, but where is it documented?
 

> An alternative approach for library code is to not split the code up into 
> distinct packages like you did but instead use an annotation and then build 
> two different jar's (one that only contains GWT code, and another only 
> containing code incompatible to GWT) by reading the annotation. That is 
> basically the approach Guava uses to build guava.jar and guava-gwt.jar.
>

Sounds interesting. Where can I read about this?

Thank you
Magnus
 

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

2017-01-28 Thread Jens


> I'd start with a new maven project "mylib", which is based on a 
> simple archetype-quickstart maven stub, and I'd add two subfolders under 
> src/main/java/mylib:
>
>- src/main/java/mylib/general
>- src/main/java/mylib/web
>
> Then, I'd add the following file:
>
> src/main/java/mylib/web.gwt.xml
>
>
> ...with the following content:
>
>   
>   
>   
>   
>
>
> Then, I'd include mylib.general.* for server-side code, and mylib.web.* 
> for GWT-based code.
>
> Would this be the right way?
> Could I place server-side only code under general (e. g. database related 
> code) and GWT-based code under web?
> (I still feel that the GWT compiler then would "ignore" the code under the 
> general folder, doesn't it?)
>

That would work, as long as src/main/java/mylib or 
src/main/java/mylib/general is not exposed to GWT compiler by any other GWT 
module you might have. With the above only src/main/java/mylib/web would be 
analyzed and compiled by GWT compiler. Its basically the same as with using 
client, shared and server folder but the *.gwt.xml only makes the client 
and shared folder visible to the GWT compiler.

An alternative approach for library code is to not split the code up into 
distinct packages like you did but instead use an annotation and then build 
two different jar's (one that only contains GWT code, and another only 
containing code incompatible to GWT) by reading the annotation. That is 
basically the approach Guava uses to build guava.jar and guava-gwt.jar.

-- J.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

2017-01-28 Thread Magnus
Hello Thomas,

thank you for all the explanations!
I took a look at gwt-user.jar. It looks very interesting. There are a lot 
of subfolders, where each one seems to be some sort of micro system, 
including several subfolrders with the common names ("client", "public", 
...) as well as several *.gwt.xml files. I think, I'll look at it again...

However, it's hard for me to derive a minimalistic method for my goal: One 
maven project with two code bases, one for general java (or server-side) 
code, and one for GWT-related code.

I'd start with a new maven project "mylib", which is based on a 
simple archetype-quickstart maven stub, and I'd add two subfolders under 
src/main/java/mylib:

   - src/main/java/mylib/general
   - src/main/java/mylib/web
   
Then, I'd add the following file:

src/main/java/mylib/web.gwt.xml


...with the following content:

  
  
  
  


Then, I'd include mylib.general.* for server-side code, and mylib.web.* for 
GWT-based code.

Would this be the right way?
Could I place server-side only code under general (e. g. database related 
code) and GWT-based code under web?
(I still feel that the GWT compiler then would "ignore" the code under the 
general folder, doesn't it?)

Thanks
Magnus

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

2017-01-27 Thread Thomas Broyer


On Friday, January 27, 2017 at 4:07:16 AM UTC+1, Magnus wrote:
>
> Hello Thomas,
>
> I solved the actual problem by removing the Maven generated AppTest.java 
> from the src/test/ path.
> However, my further plans are concerned by what you mentioned below:
>
> GWT doesn't care about folders, it reads resources from the classpath.
>>>
>>> But then I don't really understand the sense of the *.gwt.xml files, 
>>> which explicitely include source folders.
>>>
>> No, they subset the classpath by defining subpackages, independently of 
>> where they come from (and they sort-of superset the classpath with 
>> super-source too).
>> Still, classpath/classloader based, not file/folder based.
>>
>
> This means that the GWT compiler "sees" everything on the classpath, 
> wether some subfolder is included as source code in some *.gwt.xml files or 
> not.
>
> At the moment, I have separate libraries, one for pure Java code and one 
> for GWT-based Java code. I already thought about moving them into one 
> library, where one subfolder contains the GWT-related code.
> For this one "GWT-folder", this would mean:
>
>- Only the GWT-folder must be seen by the GWT-compiler, since the 
>other code may not compile with it.
>- Only for the GWT-folder, the corresponding source code must be 
>included into the library jar file.
>
> Until now I thought I can do that by placing a *.gwt.xml file only for the 
> GWT-folder, so that all other folders are simply not existing from the 
> GWT's point of view.
> But if I understand you right, all other folders would be included by the 
> GWT-compiler, too. And I don't want to fix this by having special run 
> configurations for all my applications.
> The optimal solution for me would be: Include a single jar in an 
> application project, and have both the pure Java libraries and the 
> GWT-related libraries present in the application.
>
> Can I do this or must I keep the both libraries separated?
>

You can totally do that, specifically because .gwt.xml files subset the 
classpath.

Recap:
1. GWT reads from the classpath, it doesn't care where the files 
"physically" are: this means if your classpath is 
src/main/java:target/classes:/path/to/gwt-user.jar:/path/to/gwt-dev.jar, 
you can have target/classes/myapp/MyApp.gwt.xml (in a typical Maven setup, 
copied there from src/main/resources/myapp/MyAp.gwt.xml) that references 
src/main/java/myapp/MyApp.java as simply "myapp.MyApp": GWT doesn't care 
whether that myapp/MyApp.java actually leaves in src/main/java, 
target/classes, some JAR, etc.
2. gwt.xml files subset the classpath for GWT: by default, a gwt.xml has an 
implicit , so putting a .gwt.xml file in a package 
and referencing it from another .gwt.xml (or passing it as the input to 
GWT) will tell GWT to only consider classes (in the form of *.java 
resources) in the "client" subpackage. A typical setup would put non-GWT 
classes in a "server" subpackage, and GWT generators into a "rebind" 
subpackage; GWT will then ignore them because they're not in the "source 
path" (which only includes the "client" subpackage here).
3. gwt.xml files can also "superset" the classpath by "rerooting" some 
subpackages, through super-source. If a .gwt.xml contains , the GWT will behave as if that "super" subpackage was added 
to the classpath (note that again this is about packages, whereas the 
classpath is defined in terms of folders and jar files; what that means is 
that if myapp/MyApp.gwt.xml from the above example had , then GWT would behave as if the classpath were 
src/main/java/myapp/super:target/classes/myapp/super:src/main/java:target/classes::/path/to/gwt-user.jar::/path/to/gwt-dev.jar: – well 
actually, the precedence rules are a bit different IIRC, but you get the 
idea)
4. the  and  (and  by the way) can further 
subset things by using includes="", excludes="" and skip="" attributes, or 
,  and  child elements (the difference between 
exclude and skip: skip means "not in this module, but another module 
–generally in the same package– could include it", whereas exclude means 
"never include this, even if another module –generally in the same package– 
would include it"; of course it only works that way if both modules are 
)

Have a look inside gwt-user.jar to understand all that: in one JAR there's 
client-side code, server-side code, shared client/server code, super-source 
code; and you can find further subsetting (using include/exclude/skip) in 
some .gwt.xml files in com/google/gwt/user.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

2017-01-26 Thread Magnus
Hello Thomas,

I solved the actual problem by removing the Maven generated AppTest.java 
from the src/test/ path.
However, my further plans are concerned by what you mentioned below:

GWT doesn't care about folders, it reads resources from the classpath.
>>
>> But then I don't really understand the sense of the *.gwt.xml files, 
>> which explicitely include source folders.
>>
> No, they subset the classpath by defining subpackages, independently of 
> where they come from (and they sort-of superset the classpath with 
> super-source too).
> Still, classpath/classloader based, not file/folder based.
>

This means that the GWT compiler "sees" everything on the classpath, wether 
some subfolder is included as source code in some *.gwt.xml files or not.

At the moment, I have separate libraries, one for pure Java code and one 
for GWT-based Java code. I already thought about moving them into one 
library, where one subfolder contains the GWT-related code.
For this one "GWT-folder", this would mean:

   - Only the GWT-folder must be seen by the GWT-compiler, since the other 
   code may not compile with it.
   - Only for the GWT-folder, the corresponding source code must be 
   included into the library jar file.

Until now I thought I can do that by placing a *.gwt.xml file only for the 
GWT-folder, so that all other folders are simply not existing from the 
GWT's point of view.
But if I understand you right, all other folders would be included by the 
GWT-compiler, too. And I don't want to fix this by having special run 
configurations for all my applications.
The optimal solution for me would be: Include a single jar in an 
application project, and have both the pure Java libraries and the 
GWT-related libraries present in the application.

Can I do this or must I keep the both libraries separated?

Thank you very much!
Magnus


-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

2017-01-26 Thread Thomas Broyer


On Thursday, January 26, 2017 at 5:26:21 PM UTC+1, Magnus wrote:
>
> Hello Thomas!
>
> > I'd suggest getting Maven to work before Eclipse
>
> Let me explain this:
> I am in the middle of a migration of my code towards Maven. Before this, I 
> had this situation:
>
>- a pure java library (lib-java)
>- a GWT-based java library (lib-gwt)
>- several applications which use both libraries (lib-java and lib-gwt)
>
> In the first steps, I moved the two libraries to Maven. They compile fine 
> and the target jar's are build.
> The applications are still based on the GWT-plugin for eclipse, i. e. 
> non-Maven projects.
>
> GWT doesn't care about folders, it reads resources from the classpath.
>
>
> But then I don't really understand the sense of the *.gwt.xml files, which 
> explicitely include source folders.
>

No, they subset the classpath by defining subpackages, independently of 
where they come from (and they sort-of superset the classpath with 
super-source too).
Still, classpath/classloader based, not file/folder based.
 

> That said, a properly configured Eclipse+Maven+GWT project should 
>> configure GWT tasks to only include src/main/java.
>
>
> How do I do that, while the application is still outsife of Maven?
> (In eclipse I can only select dependend projects.)
>

In the launch configuration, you should be able to tweak the classpath 
manually to remove the src/test/java entry (which should be independent 
from the "dependent projects")

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

2017-01-26 Thread Magnus
Hello Thomas!

> I'd suggest getting Maven to work before Eclipse

Let me explain this:
I am in the middle of a migration of my code towards Maven. Before this, I 
had this situation:

   - a pure java library (lib-java)
   - a GWT-based java library (lib-gwt)
   - several applications which use both libraries (lib-java and lib-gwt)

In the first steps, I moved the two libraries to Maven. They compile fine 
and the target jar's are build.
The applications are still based on the GWT-plugin for eclipse, i. e. 
non-Maven projects.

GWT doesn't care about folders, it reads resources from the classpath.


But then I don't really understand the sense of the *.gwt.xml files, which 
explicitely include source folders.
 

> And Eclipse does not have notions of "main" and test classpaths, so 
> src/test/java is added to the classpath just like src/main/java.


But I only have included src/main/java in my *.gwt.xml file. If not the 
visibility to the GWT compiler, what else  does this mean then?
 

> That said, a properly configured Eclipse+Maven+GWT project should 
> configure GWT tasks to only include src/main/java.


How do I do that, while the application is still outsife of Maven?
(In eclipse I can only select dependend projects.)
 

> Things should also Just Work™ with Maven (I'd suggest getting Maven to 
> work before Eclipse)


As stated above, I am in the middle: The libraries are migrated to Maven 
and compile fine, while the applications are not yet.
My plan is to also move the applications to Maven. But first they should 
work in the intermediate step...

Thanks
Magnus
 

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

2017-01-25 Thread Thomas Broyer
GWT doesn't care about folders, it reads resources from the classpath. And 
Eclipse does not have notions of "main" and test classpaths, so src/test/java 
is added to the classpath just like src/main/java. That said, a properly 
configured Eclipse+Maven+GWT project should configure GWT tasks to only include 
src/main/java. Things should also Just Work™ with Maven (I'd suggest getting 
Maven to work before Eclipse)

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

2017-01-25 Thread Magnus
Hello Juan!

On Wednesday, January 25, 2017 at 7:40:06 PM UTC+1, Juan Pablo Gardella 
wrote:
>
> I believe you don't want compile junit classes. 
>
> Remove them from the src path that you instructed GWT to process. See an 
> example at: 
> http://www.gwtproject.org/doc/latest/tutorial/create.html#components 
> especially 
> at module xml, where you define the source path.
>
>>
>>
Thank you! No, I don't want to compile junit classes. But they are not in 
my path:

The library has these two folders:

   - src/main/java/msw/lib/awi
   - src/test/java/msw/lib/awi

The whole library code is below the first one and the only *.gwt.xml is:

src/main/java/msw/lib/awi.gwt.xml


It has the following contents:

  
  
  
  


Since this is the only *.gwt.xml file, I don't see where I should include 
the src/test/java/msw/lib/awi/AppTest.java, which uses junit.

I would like to understand, why the GWT compiler "sees" the AppTest.java 
file here?

Thank you
Magnus

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

2017-01-25 Thread Juan Pablo Gardella
I believe you don't want compile junit classes.

 [ERROR] Line 26: No source code is available for type
junit.framework.Test; did you forget to inherit a required module?
 [ERROR] Line 28: No source code is available for type
junit.framework.TestSuite; did you forget to inherit a required module?
 [ERROR] Line 11: No source code is available for type
junit.framework.TestCase; did you forget to inherit a required module?


Remove them from the src path that you instructed GWT to process. See an
example at:
http://www.gwtproject.org/doc/latest/tutorial/create.html#components especially
at module xml, where you define the source path.

Regards,
Juan

On Wed, 25 Jan 2017 at 15:18 Magnus  wrote:

> Hello,
>
> I just moved a Java library, which uses GWT, into a Maven project.
> The Maven project was created like this:
>
> mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart
>
>
> Then, two code folders are created, main and test. I moved my library code
> into the main folder, and I created the mylib.gwt.xml file there.
> The test folder created by the Maven template contains a file
> AppTest.java, which uses junit.
>
> I imported the Maven project into eclipse and added it as a dependend
> project to an application project, which uses the library code.
>
> Now, when I try to compile the application, I get this error:
>
> Compiling module bcs.bcs
>Tracing compile failure path for type 'msw.lib.awi.AppTest'
>   [ERROR] Errors in
> 'file:/home/warker/dvl/prj/msw-lib-awi/src/test/java/msw/lib/awi/AppTest.java'
>  [ERROR] Line 26: No source code is available for type
> junit.framework.Test; did you forget to inherit a required module?
>  [ERROR] Line 28: No source code is available for type
> junit.framework.TestSuite; did you forget to inherit a required module?
>  [ERROR] Line 11: No source code is available for type
> junit.framework.TestCase; did you forget to inherit a required module?
>[ERROR] Aborting compile due to errors in some input files
>
>
> What's going on here? Why does the GWT compiler see the test folder,
> allthough there is no *.gwt-xml file referencing it?
> How can I resolve the problem?
>
> Thanks
> Magnus
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


GWT/Maven: No source code is available for type junit.framework.Test; did you forget to inherit a required module?

2017-01-25 Thread Magnus
Hello,

I just moved a Java library, which uses GWT, into a Maven project.
The Maven project was created like this:

mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart


Then, two code folders are created, main and test. I moved my library code 
into the main folder, and I created the mylib.gwt.xml file there.
The test folder created by the Maven template contains a file AppTest.java, 
which uses junit.

I imported the Maven project into eclipse and added it as a dependend 
project to an application project, which uses the library code.

Now, when I try to compile the application, I get this error:

Compiling module bcs.bcs
   Tracing compile failure path for type 'msw.lib.awi.AppTest'
  [ERROR] Errors in 
'file:/home/warker/dvl/prj/msw-lib-awi/src/test/java/msw/lib/awi/AppTest.java'
 [ERROR] Line 26: No source code is available for type 
junit.framework.Test; did you forget to inherit a required module?
 [ERROR] Line 28: No source code is available for type 
junit.framework.TestSuite; did you forget to inherit a required module?
 [ERROR] Line 11: No source code is available for type 
junit.framework.TestCase; did you forget to inherit a required module?
   [ERROR] Aborting compile due to errors in some input files


What's going on here? Why does the GWT compiler see the test folder, 
allthough there is no *.gwt-xml file referencing it?
How can I resolve the problem?

Thanks
Magnus


-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.