-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.gradle
77 lines (67 loc) · 2.12 KB
/
build.gradle
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
plugins {
id 'application'
id 'com.diffplug.spotless' version '6.25.0'
id 'org.jetbrains.kotlin.jvm' version '2.0.20'
}
application {
switch (language) {
case 'kotlin':
mainClass = 'dev.openfga.sdk.example.KotlinExample1'
break
default:
mainClass = 'dev.openfga.sdk.example.Example1'
}
}
repositories {
mavenCentral()
}
ext {
jacksonVersion = "2.17.2"
}
dependencies {
implementation("dev.openfga:openfga-sdk:0.7.0")
// Serialization
implementation("com.fasterxml.jackson.core:jackson-core:$jacksonVersion")
implementation("com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion")
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
implementation("org.openapitools:jackson-databind-nullable:0.2.6")
// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}
// Use spotless plugin to automatically format code, remove unused import, etc
// To apply changes directly to the file, run `gradlew spotlessApply`
// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle
spotless {
// comment out below to run spotless as part of the `check` task
enforceCheck false
format 'misc', {
// define the files (e.g. '*.gradle', '*.md') to apply `misc` to
target '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces() // Takes an integer argument if you don't like 4
endWithNewline()
}
java {
palantirJavaFormat()
removeUnusedImports()
importOrder()
}
}
// Use spotless plugin to automatically format code, remove unused import, etc
// To apply changes directly to the file, run `gradlew spotlessApply`
// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle
tasks.register('fmt') {
dependsOn 'spotlessApply'
}
compileKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "17"
}
}