Gradle

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
To raise new issues or bugs against Gradle, please use forums.gradle.org.
  • Gradle
  • GRADLE-2368

Eclipse plugin loses java source folder.

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Resolution: Unresolved
  • Affects Version/s: 1.0
  • Fix Version/s: None

Description

In a setup where java sources and other resources are kept in the same folder and separated by include directives, the eclipseClasspath task fails to generate a classpathentry node for the actual java sources.

Consider the following build.gradle file:

apply plugin: 'java'
apply plugin: 'eclipse'

sourceSets {
    main {
        java {
            srcDir file('src')
            include '**/*.java'
        }
        resources {
            srcDir file('src')
            include '**/*.png'
        }
    }
}

The affected gradle version will generate the following .classpath file:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
        <classpathentry kind="output" path="bin"/>
        <classpathentry including="**/*.png" kind="src" path="src"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" exported="true"/>
</classpath>

It should generate this instead:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
        <classpathentry kind="output" path="bin"/>
        <classpathentry including="**/*.java" kind="src" path="src"/>
        <classpathentry including="**/*.png" kind="src" path="src"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" exported="true"/>
</classpath>

Activity

  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Commits
  • Source
  • Reviews
Hide
Permalink
Christian Graefe added a comment - 29/Jun/12 8:32 AM

Sorry. As it turns out, Eclipse does not allow multiple classpathentry nodes with the same path attribute. Still, just falling back to the last seen filter setting might not be the way to go.

Show
Christian Graefe added a comment - 29/Jun/12 8:32 AM Sorry. As it turns out, Eclipse does not allow multiple classpathentry nodes with the same path attribute. Still, just falling back to the last seen filter setting might not be the way to go.

People

  • Assignee:
    Unassigned
    Reporter:
    Christian Graefe
Vote (0)
Watch (1)

Dates

  • Created:
    29/Jun/12 7:24 AM
    Updated:
    29/Jun/12 8:32 AM
  • Atlassian JIRA (v5.0.3#729-sha1:bf569e4)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Gradle. Try JIRA - bug tracking software for your team.