source: build.gradle @ a02cccaa

Last change on this file since a02cccaa was a02cccaa, checked in by str4d <str4d@…>, 2 years ago

Only use SonarQube? with Java 8

It fails on Java 7, and is unsupported on Java 9.

  • Property mode set to 100644
File size: 1.9 KB
Line 
1// SonarQube is currently only supported on Java 8
2// https://docs.sonarqube.org/display/SONAR/Requirements#Requirements-SupportedPlatforms
3if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
4    plugins {
5        id "org.sonarqube" version "2.6.1"
6    }
7}
8
9// Exclude apps/ dir itself, but include its subdirs
10def javaProjects = subprojects - project(':apps')
11
12configure(javaProjects) {
13    apply plugin: 'java'
14    apply plugin: 'jacoco'
15    apply plugin: 'eclipse'
16    apply plugin: 'idea'
17
18    repositories {
19        jcenter()
20    }
21
22    dependencies {
23        testCompile 'junit:junit:4.+'
24        testCompile 'org.hamcrest:hamcrest-library:1.3'
25        testCompile 'org.mockito:mockito-core:2.11.0'
26    }
27
28    jar {
29        manifest {
30            attributes 'Implementation-Version': '0.9.31-7'
31        }
32    }
33
34    sourceCompatibility = 1.7
35    // Set i2pBootClasspath=/path/to/rt.jar:/path/to/jce.jar in ~/.gradle/gradle.properties if needed
36    if (i2pBootClasspath) {
37        tasks.withType(AbstractCompile, { AbstractCompile ac ->
38            ac.options.bootstrapClasspath = files(i2pBootClasspath)
39        })
40    }
41}
42
43task codeCoverageReport(type: JacocoReport) {
44    dependsOn(javaProjects.test)
45
46    jacocoClasspath = project(':core').configurations.jacocoAnt
47    additionalSourceDirs = files(javaProjects.sourceSets.main.allSource.srcDirs)
48    sourceDirectories = files(javaProjects.sourceSets.main.allSource.srcDirs)
49    classDirectories = files(javaProjects.sourceSets.main.output)
50    executionData = files(javaProjects.jacocoTestReport.executionData)
51
52    doFirst {
53        executionData = files(executionData.findAll { it.exists() })
54    }
55
56    reports {
57        xml.enabled true
58        xml.destination "${buildDir}/reports/jacoco/report.xml"
59        html.enabled true
60        html.destination "${buildDir}/reports/jacoco/html"
61    }
62}
63
64//apply from: file('gradle/update.gradle')
Note: See TracBrowser for help on using the repository browser.