xref: /aosp_15_r20/external/opencensus-java/examples/spring/servlet/build.gradle (revision a24ffb47c3166327784aa05b149974e82e8f71b8)
1description = 'OpenCensus Examples Spring Servlet'
2
3buildscript {
4    repositories {
5        mavenCentral()
6        mavenLocal()
7        maven {
8            url "https://plugins.gradle.org/m2/"
9        }
10    }
11    dependencies {
12        classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.5.RELEASE'
13        classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
14        classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.8"
15    }
16}
17
18apply plugin: "checkstyle"
19apply plugin: 'com.github.sherter.google-java-format'
20apply plugin: 'idea'
21apply plugin: 'java'
22
23// Display the version report using: ./gradlew dependencyUpdates
24// Also see https://github.com/ben-manes/gradle-versions-plugin.
25apply plugin: 'com.github.ben-manes.versions'
26
27repositories {
28    mavenCentral()
29    mavenLocal()
30}
31
32group = "io.opencensus"
33version = "0.32.0-SNAPSHOT" // CURRENT_OPENCENSUS_VERSION
34
35def opencensusVersion = "0.26.0" // LATEST_OPENCENSUS_RELEASE_VERSION
36def prometheusVersion = "0.6.0"
37def httpasyncclientVersion = "4.1.4"
38
39
40tasks.withType(JavaCompile) {
41    sourceCompatibility = '1.8'
42    targetCompatibility = '1.8'
43}
44
45googleJavaFormat {
46    toolVersion '1.7'
47    source = 'src/main'
48    include '**/*.java'
49}
50
51verifyGoogleJavaFormat {
52    source = 'src/main'
53    include '**/*.java'
54}
55
56// Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code.
57sourceSets {
58    main {
59        java {
60            srcDir 'src'
61        }
62    }
63}
64
65checkstyle {
66    configFile = file("$rootDir/../../../buildscripts/checkstyle.xml")
67    toolVersion = "8.12"
68    ignoreFailures = false
69    configProperties["rootDir"] = "$rootDir/../../.."
70}
71
72// Disable checkstyle if no java8.
73checkstyleMain.source = 'src/main'
74checkstyleTest.source = 'src/main'
75buildscript {
76    dependencies {
77        classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.5.RELEASE'
78    }
79}
80
81apply plugin: 'java'
82apply plugin: 'org.springframework.boot'
83apply plugin: 'io.spring.dependency-management'
84
85bootJar {
86    mainClassName = 'com.baeldung.Application'
87    baseName = 'opencensus-examples-spring-servlet'
88    version = "0.32.0-SNAPSHOT" // CURRENT_OPENCENSUS_VERSION
89}
90
91sourceCompatibility = 1.8
92targetCompatibility = 1.8
93
94dependencyManagement {
95    imports {
96        mavenBom "io.opencensus:opencensus-contrib-spring-starter:${opencensusVersion}"
97    }
98}
99
100dependencies {
101    compile("io.opencensus:opencensus-contrib-spring-starter:${opencensusVersion}")
102
103    compile("io.opencensus:opencensus-exporter-stats-prometheus:${opencensusVersion}",
104            "io.opencensus:opencensus-exporter-trace-logging:${opencensusVersion}",
105            "io.prometheus:simpleclient_httpserver:${prometheusVersion}",
106            "org.apache.httpcomponents:httpasyncclient:${httpasyncclientVersion}")
107}
108