openai/openai-java

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
e8fc6aa620dddcde92a5aaedb7aa90ae1b3ac852

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

58lines · modecode

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