Git Product home page Git Product logo

Comments (3)

fbricon avatar fbricon commented on May 25, 2024

We probably need to expose classpath per scope, i.e. compile vs test for Maven, but also runtime/provided.

For Gradle projects, scope is a more "open" notion, not only are the scopes named differently (compile, compileTest) but it's open to customization. We need a way to extract those informations from Buildship's APIs, ideally. @oehme, @donat any pointers?

from eclipse.jdt.ls.

fbricon avatar fbricon commented on May 25, 2024

Note: with Java 9's modulepath, we have an extra level of project dependencies

from eclipse.jdt.ls.

donat avatar donat commented on May 25, 2024

@fbricon Actually, we're in the process of adding support separating scopes in the Eclipse runtime classpath. See the related issue and my feature branch. Basically, the idea is that the Gradle eclipse plugin produces extra classpath attributes describing dependency scopes:

Here's an example .classpath file:

<classpath>
    <classpathentry output="bin/main" kind="src" path="src/main/java">
        <attributes>
            <attribute name="gradle_scope" value="main"/>
            <attribute name="gradle_used_by_scope" value="main"/>
        </attributes>
    </classpathentry>
    <classpathentry output="bin/test" kind="src" path="src/test/java">
        <attributes>
            <attribute name="gradle_scope" value="test"/>
            <attribute name="gradle_used_by_scope" value="main,test"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
    <classpathentry path="bin/default" kind="output"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
    <classpathentry sourcepath="/Users/donat/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/a6c32b40bf3d76eca54e3c601e5d1470c86fcdfa/junit-4.12-sources.jar" kind="lib" path="/Users/donat/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar">
        <attributes>
            <attribute name="gradle_used_by_scope" value="test"/>
        </attributes>
    </classpathentry>
</classpath>

The scope information is based on the source set names (main, test, integTest, etc). By using the scope information, Buildship can figure out which output folders and dependencies should be filtered from the runtime classpath.

from eclipse.jdt.ls.

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.