openai/openai-java

Public

mirrored from https://github.com/openai/openai-javaAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v2.12.2

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

buildSrc/src/main/kotlin/openai.java.gradle.kts

55lines · modecode

1import com.diffplug.gradle.spotless.SpotlessExtension
2import org.gradle.api.tasks.testing.logging.TestExceptionFormat
3
4plugins {
5 `java-library`
6 id("com.diffplug.spotless")
7}
8
9repositories {
10 mavenCentral()
11}
12
13configure<SpotlessExtension> {
14 java {
15 importOrder()
16 removeUnusedImports()
17 palantirJavaFormat()
18 toggleOffOn()
19 }
20}
21
22java {
23 toolchain {
24 languageVersion.set(JavaLanguageVersion.of(21))
25 }
26
27 sourceCompatibility = JavaVersion.VERSION_1_8
28 targetCompatibility = JavaVersion.VERSION_1_8
29}
30
31tasks.withType<JavaCompile>().configureEach {
32 options.compilerArgs.add("-Werror")
33 options.release.set(8)
34}
35
36tasks.named<Jar>("jar") {
37 manifest {
38 attributes(mapOf(
39 "Implementation-Title" to project.name,
40 "Implementation-Version" to project.version
41 ))
42 }
43}
44
45tasks.withType<Test>().configureEach {
46 useJUnitPlatform()
47
48 // Run tests in parallel to some degree.
49 maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
50 forkEvery = 100
51
52 testLogging {
53 exceptionFormat = TestExceptionFormat.FULL
54 }
55}
56