Code Monkey home page Code Monkey logo

Comments (6)

steffenschaefer avatar steffenschaefer commented on July 20, 2024

This should work:

dependencies {
    gwt files('sources.jar')
}

from gwt-gradle-plugin.

davepuchyr avatar davepuchyr commented on July 20, 2024

Thanks a lot for the quick reply. sources.jar actually originates from dependencies, so I get the error below. Any suggestions?

dependencies {
compile( [
'org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0:sources',
'org.apache.oltu.oauth2:org.apache.oltu.oauth2.common:1.0.0:sources'
] )

    gwt files( 'org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0:sources' )

}

...
:lib:js:d3:jar UP-TO-DATE
:app:d3showcase:compileJava

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all dependencies for configuration ':app:d3showcase:gwt'.

    Cannot convert URL 'org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0:sources' to a file.

If I exclude the gwt entry from the dependencies stanza and then compileGWT I get
...
:app:d3showcase:compileGwt
Compiling module com.avaritia.app.d3showcase.D3Showcase
Finding entry point classes
[ERROR] Errors in 'file:/home/dave/src/gwt/app/d3showcase/src/main/java/com/avaritia/app/d3showcase/client/EntryPointImpl.java'
[ERROR] Line 89: No source code is available for type org.apache.oltu.oauth2.client.request.OAuthClientRequest; did you forget to inherit a required module?

from gwt-gradle-plugin.

steffenschaefer avatar steffenschaefer commented on July 20, 2024

This should work:

dependencies {
    gwt 'org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0:sources'
}

from gwt-gradle-plugin.

davepuchyr avatar davepuchyr commented on July 20, 2024

That doesn't work for me either.

In your examples I don't see any gwt entries within a dependencies stanza but I do see "src +=" adding source files in the gwt stanzas, so I'm fundamentally not understanding where sources should be added for the compileGWT task. Could you take a few minutes and add an example to the repo that uses 3rd party sources in a jar?

I sincerely appreciate the time you've already spent helping me.

from gwt-gradle-plugin.

steffenschaefer avatar steffenschaefer commented on July 20, 2024

Both things (dependencies and source) are ultimately added to the classpath when invoking GWT compiler. So technically it doesn't matter how source files are getting referenced.

There are two sources where stuff can come from:

  • From the project itself (source folders)
  • From dependencies

src is only thought to be used to define which source folders should be used by GWT. Referencing anything that is not in the scope of the same Gradle build is not the intention of this.

Everything that comes from the outside of the project should cleanly declared as dependency. Stuff that should only be seen by the Java compiler and GWT compiler but should not be part of the resulting *.war file, can be added using the "gwt" configuration.

Two counter questions:

  • What is a stanza (Sorry I'm not a native speaker)?
  • What doesn't work?

from gwt-gradle-plugin.

davepuchyr avatar davepuchyr commented on July 20, 2024

A stanza is a block of text, eg

dependencies {
compile project(':example-library')
}

or

repositories {
mavenCentral()
}

Anyway, it seems like I had something else wrong in my build.gradle file because when I tried a minimal example then

dependencies {
gwt 'org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0:sources'
}

worked. Prior to this dialogue I didn't know that I could use dependencies { gwt ... }, so it was not a waste of time. Thank-you very much!

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.