openai/openai-java
Publicmirrored from https://github.com/openai/openai-javaAvailable
openai-java-example/build.gradle.kts
29lines · modecode
| 1 | plugins { |
| 2 | id("openai.java") |
| 3 | application |
| 4 | } |
| 5 | |
| 6 | repositories { |
| 7 | mavenCentral() |
| 8 | } |
| 9 | |
| 10 | dependencies { |
| 11 | implementation(project(":openai-java")) |
| 12 | implementation("com.azure:azure-identity:1.15.0") |
| 13 | } |
| 14 | |
| 15 | tasks.withType<JavaCompile>().configureEach { |
| 16 | // Allow using more modern APIs, like `List.of` and `Map.of`, in examples. |
| 17 | options.release.set(11) |
| 18 | } |
| 19 | |
| 20 | application { |
| 21 | // Use `./gradlew :openai-java-example:run` to run `Main` |
| 22 | // Use `./gradlew :openai-java-example:run -Pexample=Something` to run `SomethingExample` |
| 23 | mainClass = "com.openai.example.${ |
| 24 | if (project.hasProperty("example")) |
| 25 | "${project.property("example")}Example" |
| 26 | else |
| 27 | "Main" |
| 28 | }" |
| 29 | } |
| 30 | |