source: core/build.gradle @ ad5301a

Last change on this file since ad5301a was ad5301a, checked in by str4d <str4d@…>, 22 months ago

Gradle: Integrate JMH benchmarks

Run with ./gradlew jmh —no-daemon

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