From 2b0ea71890c168498a671dc09327f0a66358c8f0 Mon Sep 17 00:00:00 2001 From: Chris Henson Date: Tue, 13 Oct 2015 12:58:01 -0400 Subject: [PATCH] exclude target directory --- symmetric-assemble/common.gradle | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/symmetric-assemble/common.gradle b/symmetric-assemble/common.gradle index 8b69446580..c4bd4b964b 100644 --- a/symmetric-assemble/common.gradle +++ b/symmetric-assemble/common.gradle @@ -36,12 +36,38 @@ allprojects { } } + eclipse.project.file.withXml { provider -> + ignoreDerivedResources(provider.asNode()) + } + ext { majorMinorVersion = version.substring(0, version.indexOf(".", version.indexOf(".")+ 1)) } } +def ignoreDerivedResources(projectDescription, directories = ["build", "target", "test-output"]) { + 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 { + if (file(it).exists()) { + def dirMatcher = arguments.appendNode("matcher") + dirMatcher.appendNode("id", "org.eclipse.ui.ide.multiFilter") + dirMatcher.appendNode("arguments", "1.0-projectRelativePath-matches-false-false-${it}") + } + } + } +} + subprojects { subproject -> apply plugin:'license-report'