source: core/build.gradle @ 96185d0

Last change on this file since 96185d0 was 46a3421, checked in by str4d <str4d@…>, 3 years ago

Don't compile ScalaTests? on Java 7

  • Property mode set to 100644
File size: 1.7 KB
Line 
1apply plugin: 'java-library'
2apply plugin: 'scala'
3
4archivesBaseName = 'i2p'
5
6sourceSets {
7    main {
8        java {
9            srcDir 'java/src'
10            exclude 'gnu/getopt'
11            exclude 'gnu/gettext'
12        }
13        resources {
14            srcDir 'java/src'
15            include 'gnu/getopt/*.properties'
16        }
17    }
18    test {
19        java {
20            srcDir 'java/test/junit'
21            exclude 'net/i2p/AllCoreTests.java'
22            exclude 'net/i2p/data/DataTestSuite.java'
23            exclude 'net/i2p/data/i2cp/I2CPTestSuite.java'
24            exclude {
25                it.name.endsWith('IT.java')
26            }
27        }
28        resources {
29            srcDir 'java/test/junit'
30            include 'net/i2p/crypto/eddsa/test.data'
31            include 'net/i2p/crypto/eddsa/math/baseDblPrecmp'
32            include 'net/i2p/crypto/eddsa/math/basePrecmp'
33        }
34    }
35}
36
37dependencies {
38    implementation 'gnu.getopt:java-getopt:1.0.13'
39    implementation 'org.gnu.gettext:libintl:0.18.3'
40
41    testCompile "org.scala-lang:scala-library:2.12.4"
42    testCompile 'org.scalatest:scalatest_2.12:3.0.4'
43}
44
45if (JavaVersion.current() != JavaVersion.VERSION_1_7) {
46    sourceSets {
47        test {
48            scala {
49                srcDir 'java/test/scalatest'
50            }
51        }
52    }
53    task scalaTest(dependsOn: ['testClasses'], type: JavaExec) {
54        main = 'org.scalatest.tools.Runner'
55        args = ['-R', 'build/classes/scala/test', '-o']
56        classpath = sourceSets.test.runtimeClasspath
57    }
58    test.dependsOn scalaTest
59}
60
61configurations {
62    tests
63}
64task testJar(type: Jar) {
65    baseName = 'i2p-test'
66    dependsOn classes
67    from sourceSets.test.output
68}
69artifacts {
70    tests testJar
71}
Note: See TracBrowser for help on using the repository browser.