source: apps/routerconsole/build.gradle @ 85db853

Last change on this file since 85db853 was def9392, checked in by str4d <str4d@…>, 19 months ago

Gradle: Disable ScalaTests? when TARGET_JAVA_HOME is set

Previously, ScalaTests? were only disabled when running Gradle with JDK 7.
Gradle 5+ only runs on JDK 8+, so when cross-compiling and testing JDK 7
we need to check for this state and disable ScalaTests?.

  • Property mode set to 100644
File size: 1.9 KB
Line 
1plugins {
2    id 'war'
3    id 'scala'
4}
5
6sourceSets {
7    main {
8        java {
9            srcDir 'java/src'
10        }
11    }
12}
13
14dependencies {
15    compile project(':core')
16    compile project(':router')
17    compile project(':installer')
18    providedCompile project(':apps:desktopgui')
19    providedCompile project(':apps:systray')
20    providedCompile project(':apps:jetty')
21    providedCompile project(':apps:jrobin')
22
23    testCompile "org.scala-lang:scala-library:2.12.4"
24    testCompile 'org.scalatest:scalatest_2.12:3.0.4'
25}
26
27if (System.getenv("TARGET_JAVA_HOME") == null && JavaVersion.current() != JavaVersion.VERSION_1_7) {
28    sourceSets {
29        test {
30            scala {
31                srcDir 'java/test/scalatest'
32            }
33        }
34    }
35    task scalaTest(dependsOn: ['testClasses'], type: JavaExec) {
36        main = 'org.scalatest.tools.Runner'
37        args = ['-R', 'build/classes/scala/test', '-o']
38        classpath = sourceSets.test.runtimeClasspath
39    }
40    test.dependsOn scalaTest
41}
42
43jar {
44    manifest {
45        // Top level installer will rename to jrobin.jar
46        // DTG added in 0.8.4, not in the classpath for very old installs,
47        // before we changed wrapper.config to specify *
48        // very old installs don't have i2psnark,jstl,standard in the classpath...
49        // not added in WebAppConfiguration any more
50        // All new jetty 7 jars should have been in 0.9.6, added in 0.9.7
51        attributes 'Class-Path': 'i2p.jar router.jar jrobin.jar desktopgui.jar i2psnark.jar jstl.jar standard.jar jetty-continuation.jar jetty-http.jar jetty-io.jar jetty-security.jar jetty-servlet.jar jetty-servlets.jar jetty-util.jar jetty-webapp.jar'
52    }
53}
54
55war {
56    from 'jsp'
57    // Remove classes from the classpath, they are in the jar.
58    // If we return to precompiling jsps this needs to change.
59    classpath = []
60    webXml = file('jsp/web.xml')
61}
Note: See TracBrowser for help on using the repository browser.