Code Monkey home page Code Monkey logo

Comments (4)

steffenschaefer avatar steffenschaefer commented on July 20, 2024

Please, try the following:

gwt {
    modules 'org.sample.project.client.ProjectWebApp'
    src new File(projectDir.parentFile, 'org.sample.project.client/src')
}

from gwt-gradle-plugin.

wtfguy avatar wtfguy commented on July 20, 2024

Hm that did not work for me. However i managed to find my ProjectWebApp.gwt.xml by adjusting the source settings to the following:

sourceSets {
main { java { srcDir 'src' } }
test { java { srcDir 'test' } }
}

I advanced my project to the following structure:
org.sample.project
org.sample.project.client
org.sample.project.shared

'org.sample.project.shared' has its own gwt.xml file and thus is a gwt module.
Now i use MultiProjectBuild and in 'org.sample.project' i aditionally have a gradle.settings file with the following content:

includeFlat 'org.sample.project.shared', 'org.sample.project.client'

The Problem is now that gwtCompile cant find the Shared.gwt.xml because its not on the classpath.
How do i solve this? I think the 'shared' should be compiled into a jar which is then included into the war of the client. As you might guess i am working on eclipse and i do not want to use the defaut maven structure to port my old projects to gradle. Could you mockup a little tutorial on how to build multi project dependency gwt with multiproject layout gradle with your plugin?
I am a little bit lost on this :/
Others seem to have similar problems.

from gwt-gradle-plugin.

steffenschaefer avatar steffenschaefer commented on July 20, 2024

To make the compiled classes of the shared project to be included in the war, you simply have to declare a dependency:

dependencies {
    compile project(':org.sample.project.shared')
}

To make the GWT compiler to see all the sources, you need a little ugly solution:

gwt {
    src += files(project(':example-library').sourceSets.main.allJava.srcDirs) + files(project(':example-library').sourceSets.main.output.resourcesDir)
}

If you do not have a special resourcesDir (that's the case if all *.java files and resources are located under /src), you can simply remove the second part including the resourcesDir.

Btw: there is an example project named 'war-using-library' showing how to include sources from a sibling project.

from gwt-gradle-plugin.

shabunc avatar shabunc commented on July 20, 2024

Is it still a case?
I should add that adding project(':example-library').sourceSets.main.allJava.srcDirs
quite often won't be enough - example libary is not necessarily evaluated up to the moment gwt declaration is evaluated.

that said, one need to add evaluationDependsOn(':example-library') as well.

That's well, seems non-optimal to me.

from gwt-gradle-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.