aboutsummaryrefslogtreecommitdiff
path: root/all/build.gradle
blob: e7a235a621b0370b7df22d33476fa673d9938d5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
apply plugin: 'com.github.kt3k.coveralls'

description = "gRPC: All"

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1'
    }
}

// Make sure that no transitive dependencies are included.
configurations.compile.transitive = false

def subprojects = [
  project(':grpc-auth'),
  project(':grpc-core'),
  project(':grpc-netty'),
  project(':grpc-okhttp'),
  project(':grpc-protobuf'),
  project(':grpc-protobuf-nano'),
  project(':grpc-stub'),
]

for (subproject in rootProject.subprojects) {
    if (subproject == project) {
        continue
    }
    evaluationDependsOn(subproject.path)
}

dependencies {
    compile subprojects
}

// Create a fat jar containing only the direct dependencies
jar {
    from {
        configurations.compile.collect {
            it.isDirectory() ? it : zipTree(it)
        }
    }
}

javadoc {
    classpath = files(subprojects.collect { subproject ->
        subproject.javadoc.classpath
    })
    for (subproject in subprojects) {
        if (subproject == project) {
            continue;
        }
        source subproject.javadoc.source
        options.links subproject.javadoc.options.links.toArray(new String[0])
    }
    exclude 'io/grpc/internal/**'
}

task jacocoMerge(type: JacocoMerge) {
    destinationFile = file("${buildDir}/jacoco/test.exec")
    executionData = files(subprojects.jacocoTestReport.executionData)
        .plus(project(':grpc-interop-testing').jacocoTestReport.executionData)
        .filter { f -> f.exists() }
}

jacocoTestReport {
    dependsOn(jacocoMerge)
    reports {
        xml.enabled = true
        html.enabled = true
    }

    additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
    sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
    classDirectories = files(subprojects.sourceSets.main.output)
    classDirectories = files(classDirectories.files.collect {
        fileTree(dir: it,
                exclude: ['**/io/grpc/okhttp/internal/**'])
    })
}

coveralls {
    sourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
}

tasks.coveralls {
    dependsOn(jacocoTestReport)
}