Gradle: Run ScalaTest tests in addition to the JUnit tests

This commit is contained in:
str4d
2017-12-09 01:43:09 +00:00
parent a67ea4b2f2
commit 4512a940fb
3 changed files with 32 additions and 0 deletions

View File

@ -1,4 +1,5 @@
apply plugin: 'war' apply plugin: 'war'
apply plugin: 'scala'
sourceSets { sourceSets {
main { main {
@ -6,6 +7,11 @@ sourceSets {
srcDir 'java/src' srcDir 'java/src'
} }
} }
test {
scala {
srcDir 'java/test/scalatest'
}
}
} }
dependencies { dependencies {
@ -16,8 +22,18 @@ dependencies {
providedCompile project(':apps:systray') providedCompile project(':apps:systray')
providedCompile project(':apps:jetty') providedCompile project(':apps:jetty')
providedCompile project(':apps:jrobin') providedCompile project(':apps:jrobin')
testCompile "org.scala-lang:scala-library:2.12.4"
testCompile 'org.scalatest:scalatest_2.12:3.0.4'
} }
task scalaTest(dependsOn: ['testClasses'], type: JavaExec) {
main = 'org.scalatest.tools.Runner'
args = ['-R', 'build/classes/scala/test', '-o']
classpath = sourceSets.test.runtimeClasspath
}
test.dependsOn scalaTest
jar { jar {
manifest { manifest {
// Top level installer will rename to jrobin.jar // Top level installer will rename to jrobin.jar

View File

@ -1,3 +1,5 @@
apply plugin: 'idea'
// Exclude apps/ dir itself, but include its subdirs // Exclude apps/ dir itself, but include its subdirs
def javaProjects = subprojects - project(':apps') def javaProjects = subprojects - project(':apps')

View File

@ -1,4 +1,5 @@
apply plugin: 'java-library' apply plugin: 'java-library'
apply plugin: 'scala'
archivesBaseName = 'i2p' archivesBaseName = 'i2p'
@ -30,14 +31,27 @@ sourceSets {
include 'net/i2p/crypto/eddsa/math/baseDblPrecmp' include 'net/i2p/crypto/eddsa/math/baseDblPrecmp'
include 'net/i2p/crypto/eddsa/math/basePrecmp' include 'net/i2p/crypto/eddsa/math/basePrecmp'
} }
scala {
srcDir 'java/test/scalatest'
}
} }
} }
dependencies { dependencies {
implementation 'gnu.getopt:java-getopt:1.0.13' implementation 'gnu.getopt:java-getopt:1.0.13'
implementation 'org.gnu.gettext:libintl:0.18.3' implementation 'org.gnu.gettext:libintl:0.18.3'
testCompile "org.scala-lang:scala-library:2.12.4"
testCompile 'org.scalatest:scalatest_2.12:3.0.4'
} }
task scalaTest(dependsOn: ['testClasses'], type: JavaExec) {
main = 'org.scalatest.tools.Runner'
args = ['-R', 'build/classes/scala/test', '-o']
classpath = sourceSets.test.runtimeClasspath
}
test.dependsOn scalaTest
configurations { configurations {
tests tests
} }