forked from Unidata/netcdf-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprotobuf.gradle
More file actions
32 lines (28 loc) · 1.19 KB
/
Copy pathprotobuf.gradle
File metadata and controls
32 lines (28 loc) · 1.19 KB
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
apply plugin: 'com.google.protobuf'
apply plugin: 'java'
apply plugin: 'jacoco'
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${depVersion.protobuf}"
}
}
// Add generated sources to the main sourceSet, which keeps intellij happy.
// Now, we could use the idea plugin and let gradle generate intellij project files, but it seems as though gradle is
// considering deprecating their plugin and upstreaming it to JetBrains. Might not be a good bet to start relying on
// the idea plugin at this point.
// https://github.com/gradle/gradle/issues/1366#issuecomment-546928184
sourceSets.main.java.srcDirs += ['build/generated/sources/proto/main/java',
'build/generated/sources/proto/main/grpc']
jacocoTestReport {
afterEvaluate {
// Exclude proto generated sources and classes from the coverage reports
sourceDirectories.setFrom(files(sourceDirectories.files.collect {
fileTree(dir: it, excludes:['**/*Proto.java'])
}))
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, excludes:['**/*Proto.class', '**/*Proto$*.class'])
}))
}
}
compileJava.dependsOn 'generateProto'
sourceJar.dependsOn 'generateProto'