forked from census-instrumentation/opencensus-proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
60 lines (50 loc) · 1.32 KB
/
build.gradle
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
description = 'Opencensus Proto'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.1'
}
}
sourceSets {
main {
proto {
// In addition to the default 'src/main/proto'
srcDir 'stats'
srcDir 'trace'
}
}
}
dependencies {
compile 'com.google.protobuf:protobuf-java:3.4.0'
}
protobuf {
protoc {
// The artifact spec for the Protobuf Compiler
artifact = 'com.google.protobuf:protoc:3.4.0'
}
generatedFilesBaseDir = "$projectDir/gen_gradle/src"
}
// Disable all java warnings for proto generated files build
compileJava {
options.compilerArgs += ["-Xlint:none"]
options.encoding = "UTF-8"
}
clean {
delete protobuf.generatedFilesBaseDir
}
// IntelliJ complains that the generated classes are not found, ask IntelliJ to include the
// generated Java directories as source folders.
idea {
module {
sourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java");
// If you have additional sourceSets and/or codegen plugins, add all of them
}
}