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 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
|
description = 'OpenCensus Examples'
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.8"
}
}
apply plugin: "checkstyle"
apply plugin: 'com.google.protobuf'
apply plugin: 'com.github.sherter.google-java-format'
apply plugin: 'idea'
apply plugin: 'java'
// Display the version report using: ./gradlew dependencyUpdates
// Also see https://github.com/ben-manes/gradle-versions-plugin.
apply plugin: 'com.github.ben-manes.versions'
repositories {
mavenCentral()
mavenLocal()
}
group = "io.opencensus"
version = "0.24.0" // CURRENT_OPENCENSUS_VERSION
def opencensusVersion = "0.23.0" // LATEST_OPENCENSUS_RELEASE_VERSION
def grpcVersion = "1.22.1" // CURRENT_GRPC_VERSION
def prometheusVersion = "0.6.0"
def jettyVersion = "9.4.17.v20190418"
def tcnativeVersion = "2.0.20.Final"
tasks.withType(JavaCompile) {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
dependencies {
compile "com.google.api.grpc:proto-google-common-protos:1.12.0",
"io.opencensus:opencensus-api:${opencensusVersion}",
"io.opencensus:opencensus-contrib-zpages:${opencensusVersion}",
"io.opencensus:opencensus-contrib-grpc-metrics:${opencensusVersion}",
"io.opencensus:opencensus-contrib-http-util:${opencensusVersion}",
"io.opencensus:opencensus-contrib-http-servlet:${opencensusVersion}",
"io.opencensus:opencensus-contrib-http-jetty-client:${opencensusVersion}",
"io.opencensus:opencensus-exporter-metrics-ocagent:${opencensusVersion}",
"io.opencensus:opencensus-exporter-stats-prometheus:${opencensusVersion}",
"io.opencensus:opencensus-exporter-stats-stackdriver:${opencensusVersion}",
"io.opencensus:opencensus-exporter-trace-jaeger:${opencensusVersion}",
"io.opencensus:opencensus-exporter-trace-stackdriver:${opencensusVersion}",
"io.opencensus:opencensus-exporter-trace-logging:${opencensusVersion}",
"io.opencensus:opencensus-exporter-trace-ocagent:${opencensusVersion}",
"io.grpc:grpc-protobuf:${grpcVersion}",
"io.grpc:grpc-stub:${grpcVersion}",
"io.grpc:grpc-netty-shaded:${grpcVersion}",
"io.prometheus:simpleclient_httpserver:${prometheusVersion}",
"javax.servlet:javax.servlet-api:3.1.0",
"org.eclipse.jetty:jetty-server:${jettyVersion}",
"org.eclipse.jetty:jetty-client:${jettyVersion}",
"org.eclipse.jetty:jetty-servlet:${jettyVersion}",
"org.slf4j:slf4j-log4j12:1.7.25"
runtime "io.opencensus:opencensus-impl:${opencensusVersion}",
"io.netty:netty-tcnative-boringssl-static:${tcnativeVersion}"
}
googleJavaFormat {
toolVersion '1.7'
source = 'src/main'
include '**/*.java'
}
verifyGoogleJavaFormat {
source = 'src/main'
include '**/*.java'
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.6.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'
}
}
}
checkstyle {
configFile = file("$rootDir/../buildscripts/checkstyle.xml")
toolVersion = "8.12"
ignoreFailures = false
configProperties["rootDir"] = "$rootDir/.."
}
// Disable checkstyle if no java8.
checkstyleMain.source = 'src/main'
checkstyleTest.source = 'src/main'
// Provide convenience executables for trying out the examples.
apply plugin: 'application'
startScripts.enabled = false
task tagContextExample(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.tags.TagContextExample'
applicationName = 'TagContextExample'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task multiSpansTracing(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.trace.MultiSpansTracing'
applicationName = 'MultiSpansTracing'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task multiSpansScopedTracing(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.trace.MultiSpansScopedTracing'
applicationName = 'MultiSpansScopedTracing'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task multiSpansContextTracing(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.trace.MultiSpansContextTracing'
applicationName = 'MultiSpansContextTracing'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task zPagesTester(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.zpages.ZPagesTester'
applicationName = 'ZPagesTester'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task quickStart(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.helloworld.QuickStart'
applicationName = 'QuickStart'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task helloWorldServer(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.grpc.helloworld.HelloWorldServer'
applicationName = 'HelloWorldServer'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task helloWorldClient(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.grpc.helloworld.HelloWorldClient'
applicationName = 'HelloWorldClient'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task repl(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.quickstart.Repl'
applicationName = 'Repl'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task stackdriverStatsQuickstart(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.stats.StackdriverQuickstart'
applicationName = 'StackdriverQuickstart'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task derivedDoubleGaugeQuickstart(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.gauges.DerivedDoubleGaugeQuickstart'
applicationName = 'DerivedDoubleGaugeQuickstart'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task derivedLongGaugeQuickstart(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.gauges.DerivedLongGaugeQuickstart'
applicationName = 'DerivedLongGaugeQuickstart'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task doubleGaugeQuickstart(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.gauges.DoubleGaugeQuickstart'
applicationName = 'DoubleGaugeQuickstart'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task longGaugeQuickstart(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.gauges.LongGaugeQuickstart'
applicationName = 'LongGaugeQuickstart'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task httpJettyServer(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.http.jetty.server.HelloWorldServer'
applicationName = 'HttpJettyServer'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task httpJettyClient(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.http.jetty.client.HelloWorldClient'
applicationName = 'HttpJettyClient'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task ocAgentExportersQuickStart(type: CreateStartScripts) {
mainClassName = 'io.opencensus.examples.ocagent.OcAgentExportersQuickStart'
applicationName = 'OcAgentExportersQuickStart'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
applicationDistribution.into('bin') {
from(multiSpansTracing)
from(multiSpansScopedTracing)
from(multiSpansContextTracing)
from(tagContextExample)
from(zPagesTester)
from(quickStart)
from(helloWorldServer)
from(helloWorldClient)
from(repl)
from(stackdriverStatsQuickstart)
from(derivedDoubleGaugeQuickstart)
from(derivedLongGaugeQuickstart)
from(doubleGaugeQuickstart)
from(longGaugeQuickstart)
from(httpJettyServer)
from(httpJettyClient)
from(ocAgentExportersQuickStart)
fileMode = 0755
}
|