/
build.gradle
104 lines (89 loc) · 3.09 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
description = 'OpenCensus Game of Life Example'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
// ASSUMES GRADLE 2.12 OR HIGHER. Use plugin version 0.7.5 with earlier
// gradle versions
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
}
}
repositories {
mavenCentral()
mavenLocal()
}
group = "io.opencensus"
version = "0.13.0-SNAPSHOT" // CURRENT_OPENCENSUS_VERSION
def opencensusVersion = "0.12.2" // LATEST_OPENCENSUS_RELEASE_VERSION
def grpcVersion = "1.9.0" // CURRENT_GRPC_VERSION
def prometheusVersion = "0.3.0"
tasks.withType(JavaCompile) {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
dependencies {
compile "com.google.api.grpc:proto-google-common-protos:1.0.5",
"io.opencensus:opencensus-api:${opencensusVersion}",
"io.opencensus:opencensus-contrib-zpages:${opencensusVersion}",
"io.opencensus:opencensus-contrib-grpc-metrics:${opencensusVersion}",
"io.opencensus:opencensus-exporter-stats-prometheus:${opencensusVersion}",
"io.opencensus:opencensus-exporter-stats-stackdriver:${opencensusVersion}",
"io.opencensus:opencensus-exporter-trace-stackdriver:${opencensusVersion}",
"io.opencensus:opencensus-exporter-trace-logging:${opencensusVersion}",
"io.grpc:grpc-protobuf:${grpcVersion}",
"io.grpc:grpc-stub:${grpcVersion}",
"io.grpc:grpc-netty:${grpcVersion}",
"io.prometheus:simpleclient_httpserver:${prometheusVersion}"
runtime "io.opencensus:opencensus-impl:${opencensusVersion}"
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.5.1-1'
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
ofSourceSet('main')
}
}
// Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code.
sourceSets {
main {
java {
srcDir 'src'
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
}
}
// Provide convenience executables for trying out the examples.
apply plugin: 'application'
startScripts.enabled = false
task gameOfLifeServer(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.grpc.gameoflife.GameOfLifeServer'
applicationName = 'GameOfLifeServer'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task gameOfLifeClient(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.grpc.gameoflife.GameOfLifeClient'
applicationName = 'GameOfLifeClient'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
applicationDistribution.into('bin') {
from(gameOfLifeServer)
from(gameOfLifeClient)
fileMode = 0755
}