Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.diffplug.spotless' version '6.25.0'
id("io.freefair.lombok") version "9.0.0-rc2"
id 'io.freefair.lombok' version '9.0.0-rc2'
id 'idea'
id 'eclipse'
}

idea {
module {
downloadJavadoc = true
downloadSources = true
}
}

eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
}
}

version = generateVersion() // we could cache but not worth the hassle
Expand Down Expand Up @@ -40,19 +55,19 @@ dependencies {
api "io.opentelemetry:opentelemetry-sdk-logs:${otelVersion}"
implementation "io.opentelemetry:opentelemetry-exporter-otlp:${otelVersion}"
implementation "io.opentelemetry:opentelemetry-exporter-logging:${otelVersion}"
implementation "io.opentelemetry:opentelemetry-sdk-testing:${otelVersion}"
implementation "io.opentelemetry:opentelemetry-semconv:1.30.1-alpha"

implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jacksonVersion}"

implementation "org.slf4j:slf4j-api:${slf4jVersion}"
runtimeOnly "org.slf4j:slf4j-simple:${slf4jVersion}"

implementation 'org.apache.commons:commons-lang3:3.14.0'
implementation 'com.google.code.findbugs:jsr305:3.0.2' // for @Nullable annotations

testImplementation "org.slf4j:slf4j-simple:${slf4jVersion}"
testImplementation "io.opentelemetry:opentelemetry-sdk-testing:${otelVersion}"
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"
testImplementation 'com.github.tomakehurst:wiremock-jre8:2.35.0'
Expand Down Expand Up @@ -144,11 +159,18 @@ task generateBraintrustProperties {
description = 'Generate braintrust.properties with smart git-based versioning'
group = 'build'

def outputDir = file("$buildDir/generated/resources")
def outputFile = file("$outputDir/braintrust.properties")
def outputDir = layout.buildDirectory.dir("generated/resources").get().asFile
def outputFile = new File(outputDir, "braintrust.properties")

// Tell Gradle what affects this task so it can cache properly
inputs.property("gitSha", {
['git', 'rev-parse', 'HEAD'].execute().text.trim()
})
inputs.property("gitStatus", {
['git', 'status', '--porcelain'].execute().text.trim()
})

outputs.file outputFile
outputs.upToDateWhen { false } // Always regenerate to get latest version

doLast {
outputDir.mkdirs()
Expand Down Expand Up @@ -236,7 +258,7 @@ publishing {
sourceSets {
main {
resources {
srcDir "$buildDir/generated/resources"
srcDir layout.buildDirectory.dir("generated/resources")
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ plugins {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
toolchain {
languageVersion = JavaLanguageVersion.of(17)
vendor = JvmVendorSpec.ADOPTIUM // eclipse JVM
}
withJavadocJar()
withSourcesJar()
}

repositories {
Expand All @@ -16,6 +20,7 @@ def braintrustLogLevel = System.getenv('BRAINTRUST_LOG_LEVEL') ?: 'info'

dependencies {
implementation project(':')
runtimeOnly "org.slf4j:slf4j-simple:${slf4jVersion}"
// To run otel examples
implementation "io.opentelemetry:opentelemetry-exporter-otlp:${otelVersion}"
// to run OAI instrumentation examples
Expand Down