Great answer Rajeev! I worked up a simple example that works in development mode and production mode. Here's the link again.
http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml I had the mindset that the server side code always included all of the client side code. This is not the case. The fourth directory is not used by the server. DIRECTORY CLIENT PACKAGE SERVER PACKAGE src\package1\client package1.client package1.client src\package1\server -- none -- package1.server src\package2 -- none -- package2 src\package1\jscriptSrc\package2 package2 -- none -- This shows that the client and server have two different definitions of 'package2'. Why does src\package1\jscriptSrc\package2 not create package1.jscriptSrc.package2? "The <super-source> tag instructs the compiler to 're-root' a source path." **** File: src\package1\Test001.gwt.xml **** ... <source path='client' /> <super-source path='jscriptSrc'/> ... ********************************************* Please note: This convention confuses Eclipse, so exclude jscriptSrc from the buildPath. This allows me to create one definition of a class for the server and another for the client. The server version may use any java class, such as java.io.File. ***** File: src\package2\WhoAmI.java ********* package package2; import java.io.File; public class WhoAmI { public static String name="Server"; } ***** File: src\package1\jscriptSrc\package2\WhoAmI.java ********* package package2; public class WhoAmI { public static String name="Client"; } On Feb 22, 12:14 pm, Rajeev Dayal <[email protected]> wrote: > I think you can achieve this by using GWT's <super-source> mechanism: > > http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjec... > > > > On Fri, Feb 19, 2010 at 2:48 PM, Tim K <[email protected]> wrote: > > I have a server version of a class in one jar, and a client version of > > the class in another. The client version is restricted to JRE > > emulation, while the server version can use the entire JRE. Can the > > google plug-in for eclipse be configured to use the server jar for the > > server code and the client jar for the client code? > > > *** Server jar *** > > class X { > > X() { ... } > > X( File directory ) { ..... } > > ... > > > *** Client jar *** > > class X { > > X() { ... } > > // Can't access a file on client side, so disable this constructor > > // X( File directory ) { ..... } > > ... > > > Regards, > > Tim K > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Web Toolkit" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<google-web-toolkit%2Bunsubs > > [email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
