source: core/build.gradle @ 4bd0f06

Last change on this file since 4bd0f06 was 1cc330b, checked in by str4d <str4d@…>, 14 months ago

Gradle: Generate attributes for JAR manifests

  • Property mode set to 100644
File size: 2.2 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
74jar {
75    manifest {
76        attributes 'Specification-Title': 'I2P Core API'
77        attributes 'Implementation-Title': 'I2P Java Core API'
78        attributes 'Main-Class': 'net.i2p.util.CommandLine'
79    }
80}
81
82configurations {
83    tests
84}
85task testJar(type: Jar) {
86    baseName = 'i2p-test'
87    dependsOn classes
88    from sourceSets.test.output
89}
90artifacts {
91    tests testJar
92}
Note: See TracBrowser for help on using the repository browser.