-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.gradle
More file actions
127 lines (110 loc) · 3.64 KB
/
Copy pathbuild.gradle
File metadata and controls
127 lines (110 loc) · 3.64 KB
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
plugins {
id 'java-library'
id 'maven-publish'
id 'com.diffplug.spotless' version '6.25.0'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
group = 'com.deepgram'
version = '0.5.0' // x-release-please-version
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenCentral()
}
dependencies {
// HTTP client
api 'com.squareup.okhttp3:okhttp:4.12.0'
// JSON serialization
api 'com.fasterxml.jackson.core:jackson-databind:2.18.6'
api 'com.fasterxml.jackson.core:jackson-core:2.18.6'
api 'com.fasterxml.jackson.core:jackson-annotations:2.18.6'
api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.6'
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.6'
// Annotations
compileOnly 'org.jetbrains:annotations:24.1.0'
// Test dependencies
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.12.0'
testImplementation 'org.assertj:assertj-core:3.25.3'
testImplementation 'com.deepgram:deepgram-sagemaker:0.1.2'
}
test {
useJUnitPlatform()
testLogging {
events 'passed', 'skipped', 'failed'
showStandardStreams = true
}
}
// Unit tests (exclude integration tests)
tasks.register('unitTest', Test) {
useJUnitPlatform()
exclude '**/IntegrationTest*'
testLogging {
events 'passed', 'skipped', 'failed'
showStandardStreams = true
}
}
// Integration tests only
tasks.register('integrationTest', Test) {
useJUnitPlatform()
include '**/IntegrationTest*'
testLogging {
events 'passed', 'skipped', 'failed'
showStandardStreams = true
}
}
// Examples source set
sourceSets {
examples {
java {
srcDir 'examples'
}
compileClasspath += sourceSets.main.output + configurations.runtimeClasspath
runtimeClasspath += sourceSets.main.output + configurations.runtimeClasspath
}
}
dependencies {
// Optional dependencies needed by example source set
examplesImplementation 'com.deepgram:deepgram-sagemaker:0.1.2'
}
// Compile all examples
tasks.register('compileExamples') {
dependsOn 'examplesClasses'
description = 'Compile all example files'
group = 'examples'
}
// Run a specific example: ./gradlew runExample -PmainClass=TranscribeUrl
tasks.register('runExample', JavaExec) {
description = 'Run an example. Usage: ./gradlew runExample -PmainClass=TranscribeUrl'
group = 'examples'
classpath = sourceSets.examples.runtimeClasspath
mainClass = project.hasProperty('mainClass') ? project.property('mainClass') : ''
}
spotless {
java {
// Only lint custom (non-generated) files — Fern output uses JavaPoet formatting
// which no standard formatter reproduces exactly
target(
'src/main/java/com/deepgram/DeepgramClient.java',
'src/main/java/com/deepgram/AsyncDeepgramClient.java',
'src/main/java/com/deepgram/DeepgramClientBuilder.java',
'src/main/java/com/deepgram/AsyncDeepgramClientBuilder.java',
'src/test/java/com/deepgram/ClientBuilderTest.java',
'src/test/java/com/deepgram/IntegrationTest.java',
'src/test/java/com/deepgram/core/EnvironmentTest.java',
'src/test/java/com/deepgram/core/RetryInterceptorTest.java',
'examples/**/*.java',
)
palantirJavaFormat('2.46.0').formatJavadoc(true)
removeUnusedImports()
}
}