source: core/build.gradle @ d7d1dcb5

Last change on this file since d7d1dcb5 was d244d17, checked in by str4d <str4d@…>, 16 months ago

Gradle: Optionally include jbigi at runtime for core

This enables running the benchmarks with jbigi present:

./gradlew -Pwith.jbigi jmh —no-daemon

  • Property mode set to 100644
File size: 2.0 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    if (project.hasProperty("with.jbigi")) {
51        runtimeOnly project(path: ':installer', configuration: 'jbigi')
52    }
53
54    testCompile "org.scala-lang:scala-library:2.12.4"
55    testCompile 'org.scalatest:scalatest_2.12:3.0.4'
56}
57
58if (System.getenv("TARGET_JAVA_HOME") == null && JavaVersion.current() != JavaVersion.VERSION_1_7) {
59    sourceSets {
60        test {
61            scala {
62                srcDir 'java/test/scalatest'
63            }
64        }
65    }
66    task scalaTest(dependsOn: ['testClasses'], type: JavaExec) {
67        main = 'org.scalatest.tools.Runner'
68        args = ['-R', 'build/classes/scala/test', '-o']
69        classpath = sourceSets.test.runtimeClasspath
70    }
71    test.dependsOn scalaTest
72}
73
74configurations {
75    tests
76}
77task testJar(type: Jar) {
78    baseName = 'i2p-test'
79    dependsOn classes
80    from sourceSets.test.output
81}
82artifacts {
83    tests testJar
84}
Note: See TracBrowser for help on using the repository browser.