Skip to content

Commit

Permalink
Some changes to test handling.
Browse files Browse the repository at this point in the history
- Add grails-core jar to testRuntime classpath and make test tasks dependent on the jar.
- Remove 'target' dir from testRuntime classpath (it never belonged there).
- Changed order in which build scripts are applied so that the jar task is available to the test tasks.
- Refactoring: Move testRuntime declaration to unit-test.gradle.
  • Loading branch information
hansd committed Mar 9, 2010
1 parent 8a6d774 commit df04297
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Expand Up @@ -24,7 +24,6 @@ dependencies {
lib = "$projectDir/lib"
groovy files("$lib/groovy-all-1.7.1.jar")
compile files(fileTree(dir: lib as File, includes: ['*.jar'], excludes: ['jsp-api-2.1.jar', 'groovy-all-1.7.1.jar']), "${System.getenv('JAVA_HOME')}/lib/tools.jar")
testRuntime files('src/test', 'target', 'src/grails/grails-app/utils', ".", "src/war/WEB-INF")
jsp21 files("$lib/jsp-api-2.1.jar")
}

Expand Down Expand Up @@ -81,8 +80,8 @@ configure([compileJava, compileTestJava]) {

apply {
url 'gradle/docs.gradle'
url 'gradle/unit-test.gradle'
url 'gradle/assemble.gradle'
url 'gradle/unit-test.gradle'
url 'gradle/maven.gradle'
url 'gradle/findbugs.gradle'
}
Expand Down
3 changes: 2 additions & 1 deletion gradle/unit-test.gradle
Expand Up @@ -11,6 +11,7 @@ configurations {
}

dependencies {
files('src/test', 'src/grails/grails-app/utils', projectDir, "src/war/WEB-INF", coreJar.archivePath)
coverage("net.sourceforge.cobertura:cobertura:1.9.3")
}

Expand Down Expand Up @@ -87,7 +88,7 @@ def createTestTaskWithoutSuffix(String name, includes, excludes) {
classpath = project.files(instrumentForCoverage.instrumentedClassesDir) + classpath + project.rootProject.configurations.coverage
}
test.dependsOn task
task.dependsOn instrumentForCoverage
task.dependsOn instrumentForCoverage, coreJar
}

tasks.addRule("Pattern: testSingle<Name> will test **/<Name>Tests.class") { String taskName ->
Expand Down

0 comments on commit df04297

Please sign in to comment.