Skip to content

Commit

Permalink
Merge pull request #5281 from JabRef/eclispejava11
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusDietz authored Sep 7, 2019
2 parents 99a0a7a + d183c60 commit dde32bd
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions eclipse.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,39 @@ eclipseJdt.doLast {
f.append('encoding/<project>=UTF-8')
}
eclipse {
//add libraries to module path: https://github.com/eclipse/buildship/issues/620#issuecomment-390469550
classpath {
project {
natures 'org.eclipse.buildship.core.gradleprojectnature'
}

classpath {
file {
whenMerged {
entries.findAll {
it.kind == 'src' || it.kind == 'lib'
}.each { it.entryAttributes['module'] = 'true' }
entries.findAll { isModule(it) }.each { //(1)
it.entryAttributes['module'] = 'true'
}

entries.findAll { isSource(it) && isTestScope(it) }.each {
it.entryAttributes['test'] = 'true'
}

entries.findAll { isLibrary(it) && isTestScope(it) }.each {
it.entryAttributes['test'] = 'true'
}
}
}

defaultOutputDir = file('build')
downloadSources = true
downloadJavadoc = true
}
}

boolean isLibrary(entry) { return entry.properties.kind.equals('lib') }
boolean isTestScope(entry) { return entry.entryAttributes.get('gradle_used_by_scope').equals('test'); }
boolean isModule(entry) { isLibrary(entry) && !isTestScope(entry); }
boolean isSource(entry) { return entry.properties.kind.equals('src'); }


// add formatter and cleanup settings to Eclipse settings
// see http://stackoverflow.com/a/27461890/873282

Expand Down Expand Up @@ -577,4 +599,4 @@ tasks.eclipse.doFirst {
sp_cleanup.use_type_arguments=false
'''. stripIndent())
}
}
}

0 comments on commit dde32bd

Please sign in to comment.