aboutsummaryrefslogtreecommitdiffstats
path: root/buildSrc/src/main/groovy/refinery-java-test-fixtures.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'buildSrc/src/main/groovy/refinery-java-test-fixtures.gradle')
-rw-r--r--buildSrc/src/main/groovy/refinery-java-test-fixtures.gradle35
1 files changed, 0 insertions, 35 deletions
diff --git a/buildSrc/src/main/groovy/refinery-java-test-fixtures.gradle b/buildSrc/src/main/groovy/refinery-java-test-fixtures.gradle
deleted file mode 100644
index 02568abd..00000000
--- a/buildSrc/src/main/groovy/refinery-java-test-fixtures.gradle
+++ /dev/null
@@ -1,35 +0,0 @@
1import org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry
2
3plugins {
4 id 'java-test-fixtures'
5 id 'refinery-java-conventions'
6}
7
8eclipse.classpath {
9 containsTestFixtures = true
10
11 file.whenMerged { classpath ->
12 def hasTest = classpath.entries.any { entry ->
13 entry in AbstractClasspathEntry &&
14 entry.entryAttributes['gradle_scope'] == 'test'
15 }
16 for (entry in classpath.entries) {
17 // Workaround https://github.com/gradle/gradle/issues/11845 based on
18 // https://discuss.gradle.org/t/gradle-used-by-scope-not-correctly-generated-when-the-java-test-fixtures-plugin-is-used/39935/2
19 if (entry in AbstractClasspathEntry) {
20 def usedBy = new LinkedHashSet(
21 Arrays.asList((entry.entryAttributes['gradle_used_by_scope'] ?: '').split(','))
22 )
23 if (usedBy.contains('main')) {
24 usedBy += 'testFixtures'
25 }
26 if (hasTest && usedBy.contains('testFixtures')) {
27 usedBy += 'test'
28 }
29 if (!usedBy.empty) {
30 entry.entryAttributes['gradle_used_by_scope'] = usedBy.join(',')
31 }
32 }
33 }
34 }
35}