Skip to content

Commit

Permalink
no point checking for the testClassesProperty if we will read it anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
maiflai committed Nov 27, 2020
1 parent fe79524 commit 5920f79
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/groovy/com/github/maiflai/ScalaTestAction.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.github.maiflai
import groovy.transform.Immutable
import org.gradle.api.Action
import org.gradle.api.GradleException
import org.gradle.api.internal.file.FileResolver
import org.gradle.api.logging.configuration.ConsoleOutput
import org.gradle.api.reporting.DirectoryReport
import org.gradle.api.tasks.testing.Test
Expand Down Expand Up @@ -144,12 +143,12 @@ class ScalaTestAction implements Action<Test> {
def escapeFile = { File f ->
f.absolutePath.replace(' ', '\\ ')
}
if (t.hasProperty("testClassesDirs") && t.getTestClassesDirs().size() > 1) {
args.add('-R')
args.add(t.getTestClassesDirs().collect { escapeFile(it) }.join(' '))
args.add('-R')
def testClassesDirs = t.getTestClassesDirs()
if (testClassesDirs.size() > 1) {
args.add(testClassesDirs.collect { escapeFile(it) }.join(' '))
} else {
args.add('-R')
args.add(escapeFile(t.getTestClassesDirs().singleFile))
args.add(escapeFile(testClassesDirs.singleFile))
}
def appendTestPattern = { String it ->
if (it =~ maybeTest) {
Expand Down

0 comments on commit 5920f79

Please sign in to comment.