Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make JabRef work in eclipse #5281

Merged
merged 1 commit into from
Sep 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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())
}
}
}