Code Monkey home page Code Monkey logo

Comments (3)

steffenschaefer avatar steffenschaefer commented on July 20, 2024

Without having it tested I would say it looks good but:

  • "from project.sourceSets.main.output" should not be necessary as this references the compiler output that should already be included in the jar.
  • "from project.sourceSets.main.allJava" and "from('src/main/java')" does the same, so it's redundant. I would prefer to use "from project.sourceSets.main.allJava" and put the inclusions to this one.
  • It seems you missed to include "*.java" files

Counter question: doesn't it work? If not, what does not work?

from gwt-gradle-plugin.

johnthad avatar johnthad commented on July 20, 2024

Yes, I can remove "from project.sourceSets.main.output". I missed that before

If I remove "from project.sourceSets.main.allJava", I must add "include '*/.java'" to "from('src/main/java')". Either works.

The problem is that merely using "from project.sourceSets.main.allJava" does not pick up UiBinder files, files ending in *.ui.xml. The *.gwt.xml files from src/main/resources are there, but not the *.ui.xml files from src/main/java. Other non-java files from src/main/java are picked up, but not *.ui.xml without the "from('src/main/java')" closure. After some clean-up, my jar closure looks like

jar {
  manifest {
    attributes 'Implementation-Title': 'GWT Widgets', 'Implementation-Version': version
  }
  from project.sourceSets.main.allJava
  from('src/main/java') {
    include '**/*.ui.xml'
  }
}

I had expected the gwt-gradle-plugin to tweak jar such that "from project.sourceSets.main.allJava" and "from('src/main/java')" would not be required, but the approach above works for me.

from gwt-gradle-plugin.

jnehlmeier avatar jnehlmeier commented on July 20, 2024

Oh man I just stumbled upon this.

In my case I have a multi module GWT library project and I couldn't run GwtTestCases through the test task because

dependencies { gwt project(":utils") } //utils is a gwt-base project

pulls in an utils.jar on classpath that does not have any source/gwt.xml files in it. That is unintuitive.

I think this plugin should really add sources/resources to the jar if only gwt-base is applied. Alternatively leave gwt-base as is and introduce gwt-library that does the adjustments.

Also wouldn't that solve the annoyance that gwt.src needs to be adjusted manually if you have a war project that uses gwt-base project dependencies like in
https://github.com/steffenschaefer/gwt-gradle-plugin/blob/master/examples/war-using-library/build.gradle#L16 ? If not then the plugin should also adjust gwt.src automatically if needed.

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.