Code Monkey home page Code Monkey logo

Comments (14)

cdietrich avatar cdietrich commented on July 16, 2024

sry i have no idea on that. this has to be investigated. unfortunately the classpath regarding model/ is different in gradle and eclipse. maybe a issue with buildship.

in buildship model/* is added to the jar and this makes it part of the classpath.
i guess someone who knows gradle should have a look

from xtext-extras.

LorenzoBettini avatar LorenzoBettini commented on July 16, 2024

Exactly the same problem here: org.eclipse.xtext.xtext.URIsInEcoreFilesTest

from xtext-extras.

cdietrich avatar cdietrich commented on July 16, 2024

@oehme do you have an idea how that could be solved?

from xtext-extras.

LorenzoBettini avatar LorenzoBettini commented on July 16, 2024

I don't know gradle, but if it behaves like tycho-surefire-plugin then it executes the tests in an OSGI environment (without the UI) and this would make platform URIs work

from xtext-extras.

cdietrich avatar cdietrich commented on July 16, 2024

no, these uris actually work. the problem is that the classpath uri does not work cause model/* is not on classpath in eclipse. same for org/..../Xtext.ecore/genmodel.

these files are jared like

jar {
    from('.') {
        include 'org/**', 'modeling32.png'
    }
}

or

jar {
    from ('.') {
        include 'about*.*', 'plugin.xml', 'schema/**', 'model/**'
    }
    metaInf {
        from 'META-INF'
    }
}

from xtext-extras.

LorenzoBettini avatar LorenzoBettini commented on July 16, 2024

but these tests used to work before the repo splitting, didn't they? I guess because at that time they were Eclipse plug-in projects (PDE nature). Could that be?

Or probably setting 'model' as a source folder would do the trick, because then their contents would be copied to the bin folder?

from xtext-extras.

cdietrich avatar cdietrich commented on July 16, 2024

I did not look at the old state. I don't know why this is done this way / why the files are not in a src folder

from xtext-extras.

cdietrich avatar cdietrich commented on July 16, 2024

For setting model as source folder the places that look for model/xxxx.ecore/genmodel would have to be changed

from xtext-extras.

oehme avatar oehme commented on July 16, 2024

This is indeed caused by switching off the plugin nature. The model folder was added to the output of the project through a declaration in build.properties.

You cannot make model a source folder because of how platform resource URIs work: They require the resource to have the same relative path inside the workspace project and the final jar file.

The only solution I can think of is to add the project root folder as a source folder with a single include for model. For now you'd have to check in that customization in your .classpath file. With Gradle 3.0/Buildship 1.0.18 (both out soon), you'll be able to automate this customization.

from xtext-extras.

LorenzoBettini avatar LorenzoBettini commented on July 16, 2024

and what about simply adding the plugin nature back? It will be used only when opening the project in Eclipse and it should not disturb anything else, I guess.

from xtext-extras.

oehme avatar oehme commented on July 16, 2024

I see no problem with that. I was only offering the alternative if for some reason you really don't want the plugin nature :)

from xtext-extras.

oehme avatar oehme commented on July 16, 2024

Oh another obvious solution I missed: Use classpath URIs and put the model in src/main/resources.

from xtext-extras.

cdietrich avatar cdietrich commented on July 16, 2024

ill try to fix this using a custom urlclassloader

from xtext-extras.

cdietrich avatar cdietrich commented on July 16, 2024

Fixed in 2.13

from xtext-extras.

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.