Skip to content
Permalink
Browse files
skip groovy-all, groovy-bom, etc. non-java projects
  • Loading branch information
eric-milles committed May 24, 2022
1 parent bcf66b5 commit 899ab952c98914c93d68b0947ba0916c81e255a6
Showing 1 changed file with 14 additions and 0 deletions.
@@ -33,6 +33,8 @@ if (gradle.startParameter.taskNames.any { it =~ /(?i)eclipse/ }) {
}

project.tasks.eclipse.doLast {
if (!file("${project.projectDir}/.classpath").exists()) return

file("${project.projectDir}/.settings/org.eclipse.jdt.groovy.core.prefs").with { prefs ->
if (!prefs.exists()) {
append('''\
@@ -106,6 +108,7 @@ if (gradle.startParameter.taskNames.any { it =~ /(?i)eclipse/ }) {
}

eclipse.classpath.file.whenMerged {
// it's just 'src/test' not 'src/test/java' and 'src/test/groovy'
entries.removeAll { entry -> entry.path in ['src/test/groovy', 'src/test-resources'] }

entries.findAll { entry -> entry.path =~ '^build/generated/sources/antlr' }.each { entry ->
@@ -114,6 +117,17 @@ if (gradle.startParameter.taskNames.any { it =~ /(?i)eclipse/ }) {
}
}

// exclude folder 'subprojects' from root project
eclipse.project.resourceFilter {
type = 'EXCLUDE_ALL'
appliesTo = 'FOLDERS'
recursive = false
matcher {
id = 'org.eclipse.ui.ide.multiFilter'
arguments = '1.0-projectRelativePath-matches-true-false-subprojects'
}
}

sourceSets.main.java.srcDirs += "${buildDir}/generated/sources/antlr4"

eclipseClasspath.dependsOn(generateGrammarSource)

0 comments on commit 899ab95

Please sign in to comment.