-
Notifications
You must be signed in to change notification settings - Fork 7
/
eclipse.gradle
38 lines (35 loc) · 1.37 KB
/
eclipse.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import org.gradle.plugins.ide.eclipse.model.AccessRule
apply plugin: 'eclipse'
eclipse.project.file.withXml { provider ->
ignoreDerivedResources(provider.asNode())
}
def ignoreDerivedResources(projectDescription, directories = ["build", ".gradle", ".git", ".settings"]) {
def count = directories.count { file(it).exists() }
if (count > 0) {
def filter = projectDescription
.appendNode("filteredResources")
.appendNode("filter")
filter.appendNode("id", System.currentTimeMillis().toString().trim())
filter.appendNode("type", "26")
filter.appendNode("name")
def matcher = filter.appendNode("matcher")
matcher.appendNode("id", "org.eclipse.ui.ide.orFilterMatcher")
def arguments = matcher.appendNode("arguments")
directories.each {
def dirMatcher = arguments.appendNode("matcher")
dirMatcher.appendNode("id", "org.eclipse.ui.ide.multiFilter")
dirMatcher.appendNode("arguments", "1.0-projectRelativePath-matches-false-false-${it}")
}
}
}
eclipse.classpath.file{
whenMerged { classpath ->
classpath.getEntries().each{ entry ->
if(entry.getKind().equals("con")){ //there should only ever be one container, the JDK
//println("DEBUG: entry is: " + entry)
AccessRule javafxRule = new AccessRule("accessible", "javafx/**")
entry.getAccessRules().add(javafxRule)
}
}
}
}