diff options
Diffstat (limited to 'buildSrc/src/main/groovy/refinery-java-test-fixtures.gradle')
-rw-r--r-- | buildSrc/src/main/groovy/refinery-java-test-fixtures.gradle | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/buildSrc/src/main/groovy/refinery-java-test-fixtures.gradle b/buildSrc/src/main/groovy/refinery-java-test-fixtures.gradle index 693cba98..02568abd 100644 --- a/buildSrc/src/main/groovy/refinery-java-test-fixtures.gradle +++ b/buildSrc/src/main/groovy/refinery-java-test-fixtures.gradle | |||
@@ -1,3 +1,5 @@ | |||
1 | import org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry | ||
2 | |||
1 | plugins { | 3 | plugins { |
2 | id 'java-test-fixtures' | 4 | id 'java-test-fixtures' |
3 | id 'refinery-java-conventions' | 5 | id 'refinery-java-conventions' |
@@ -8,15 +10,15 @@ eclipse.classpath { | |||
8 | 10 | ||
9 | file.whenMerged { classpath -> | 11 | file.whenMerged { classpath -> |
10 | def hasTest = classpath.entries.any { entry -> | 12 | def hasTest = classpath.entries.any { entry -> |
11 | entry in org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry && | 13 | entry in AbstractClasspathEntry && |
12 | entry.entryAttributes['gradle_scope'] == 'test' | 14 | entry.entryAttributes['gradle_scope'] == 'test' |
13 | } | 15 | } |
14 | for (entry in classpath.entries) { | 16 | for (entry in classpath.entries) { |
15 | // Workaround https://github.com/gradle/gradle/issues/11845 based on | 17 | // Workaround https://github.com/gradle/gradle/issues/11845 based on |
16 | // https://discuss.gradle.org/t/gradle-used-by-scope-not-correctly-generated-when-the-java-test-fixtures-plugin-is-used/39935/2 | 18 | // https://discuss.gradle.org/t/gradle-used-by-scope-not-correctly-generated-when-the-java-test-fixtures-plugin-is-used/39935/2 |
17 | if (entry in org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry) { | 19 | if (entry in AbstractClasspathEntry) { |
18 | def usedBy = new LinkedHashSet( | 20 | def usedBy = new LinkedHashSet( |
19 | Arrays.asList((entry.entryAttributes['gradle_used_by_scope'] ?: '').split(',')) | 21 | Arrays.asList((entry.entryAttributes['gradle_used_by_scope'] ?: '').split(',')) |
20 | ) | 22 | ) |
21 | if (usedBy.contains('main')) { | 23 | if (usedBy.contains('main')) { |
22 | usedBy += 'testFixtures' | 24 | usedBy += 'testFixtures' |