@@ -30,7 +30,7 @@ If you want to always use the latest version, add another magic before `%use dat
30
30
If you want to use specific version of the Kotlin DataFrame library, you can specify it in brackets:
31
31
32
32
``` text
33
- %use dataframe(0.8.1 )
33
+ %use dataframe(%dataFrameVersion% )
34
34
```
35
35
36
36
After loading, all essential types will be already imported, so you can start using the Kotlin DataFrame library. Enjoy!
@@ -52,45 +52,57 @@ The simplest way of doing this is shown on screenshot:
52
52
The Kotlin DataFrame library is published to Maven Central, so you can simply add the following line to your Kotlin DSL
53
53
buildscript to depend on it:
54
54
55
- ### All-in-one artifact
55
+ ### General configuration
56
56
57
57
<tabs >
58
58
<tab title =" Kotlin DSL " >
59
59
60
60
``` kotlin
61
+ plugins {
62
+ id(" org.jetbrains.kotlinx.dataframe" ) version " %dataFrameVersion%"
63
+ }
64
+
61
65
dependencies {
62
- implementation(" org.jetbrains.kotlinx:dataframe:<version> " )
66
+ implementation(" org.jetbrains.kotlinx:dataframe:%dataFrameVersion% " )
63
67
}
64
68
```
65
69
66
70
</tab >
67
71
68
72
<tab title =" Groovy DSL " >
69
73
70
- ``` kotlin
74
+ ``` groovy
75
+ plugins {
76
+ id("org.jetbrains.kotlinx.dataframe") version "%dataFrameVersion%"
77
+ }
78
+
71
79
dependencies {
72
- implementation ' org.jetbrains.kotlinx:dataframe:<version> '
80
+ implementation 'org.jetbrains.kotlinx:dataframe:%dataFrameVersion% '
73
81
}
74
82
```
75
83
76
84
</tab >
77
85
78
86
</tabs >
79
87
80
- ### Only what you need
88
+ Note that it's better to use the same version for a library and plugin to avoid unpredictable errors.
89
+ After plugin configuration you can try it out with [ example] ( gradle.md#annotation-processing ) .
90
+
91
+ ### Custom configuration
81
92
82
- If you want to avoid adding unnecessary dependency, you can choose whatever you need :
93
+ If you want to avoid adding unnecessary dependency, you can choose from following artifacts :
83
94
84
95
<tabs >
85
96
<tab title =" Kotlin DSL " >
86
97
87
98
``` kotlin
88
99
dependencies {
89
100
// Artifact containing all APIs and implementations
90
- implementation(" org.jetbrains.kotlinx:dataframe-core:<version> " )
101
+ implementation(" org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion% " )
91
102
// Optional formats support
92
- implementation(" org.jetbrains.kotlinx:dataframe-excel:<version>" )
93
- implementation(" org.jetbrains.kotlinx:dataframe-arrow:<version>" )
103
+ implementation(" org.jetbrains.kotlinx:dataframe-excel:%dataFrameVersion%" )
104
+ implementation(" org.jetbrains.kotlinx:dataframe-arrow:%dataFrameVersion%" )
105
+ implementation(" org.jetbrains.kotlinx:dataframe-openapi:%dataFrameVersion%" )
94
106
}
95
107
```
96
108
@@ -101,38 +113,27 @@ dependencies {
101
113
``` groovy
102
114
dependencies {
103
115
// Artifact containing all APIs and implementations
104
- implementation 'org.jetbrains.kotlinx:dataframe-core:<version> '
116
+ implementation 'org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion% '
105
117
// Optional formats support
106
- implementation 'org.jetbrains.kotlinx:dataframe-excel:<version>'
107
- implementation 'org.jetbrains.kotlinx:dataframe-arrow:<version>'
118
+ implementation 'org.jetbrains.kotlinx:dataframe-excel:%dataFrameVersion%'
119
+ implementation 'org.jetbrains.kotlinx:dataframe-arrow:%dataFrameVersion%'
120
+ implementation 'org.jetbrains.kotlinx:dataframe-openapi:%dataFrameVersion%'
108
121
}
109
122
```
110
123
111
124
</tab >
112
125
113
126
</tabs >
114
127
115
- ### Data schema preprocessor
128
+ #### Linter configuration
116
129
117
130
We provide a Gradle plugin that generates interfaces by your data.
118
- To use it in your project, pick up the latest version from [ here] ( https://plugins.gradle.org/plugin/org.jetbrains.kotlinx.dataframe )
119
- and follow the configuration:
131
+ Use this configuration to prevent linter from complaining about formatting in the generated sources.
120
132
121
133
<tabs >
122
134
<tab title =" Kotlin DSL " >
123
135
124
136
``` kotlin
125
- plugins {
126
- id(" org.jetbrains.kotlinx.dataframe" ) version " <version>"
127
- }
128
-
129
- dependencies {
130
- implementation(" org.jetbrains.kotlinx:dataframe:<version>" )
131
- }
132
-
133
- // Make IDE aware of the generated code:
134
- kotlin.sourceSets.getByName(" main" ).kotlin.srcDir(" build/generated/ksp/main/kotlin/" )
135
-
136
137
// (Only if you use kotlint) Excludes for `kotlint`:
137
138
tasks.withType< org.jmailen.gradle.kotlinter.tasks.LintTask > {
138
139
exclude {
@@ -149,18 +150,6 @@ tasks.withType<org.jmailen.gradle.kotlinter.tasks.LintTask> {
149
150
<tab title =" Groovy DSL " >
150
151
151
152
``` groovy
152
- plugins {
153
- id("org.jetbrains.kotlinx.dataframe") version "<version>"
154
- }
155
-
156
- dependencies {
157
- implementation("org.jetbrains.kotlinx:dataframe:<version>")
158
- }
159
-
160
- // Make IDE aware of the generated code:
161
- kotlin.sourceSets.getByName("main").kotlin.srcDir("build/generated/ksp/main/kotlin/")
162
-
163
- // (Only if you use kotlint) Excludes for `kotlint`:
164
153
tasks.withType(org.jmailen.gradle.kotlinter.tasks.LintTask).all {
165
154
exclude {
166
155
it.name.endsWith(".Generated.kt")
@@ -173,50 +162,8 @@ tasks.withType(org.jmailen.gradle.kotlinter.tasks.LintTask).all {
173
162
174
163
</tab >
175
164
176
- <tab title =" Multiplatform (JVM target Only) " >
177
-
178
- ``` kotlin
179
- plugins {
180
- id(" org.jetbrains.kotlinx.dataframe" ) version " <version>"
181
- }
182
-
183
- kotlin {
184
- jvm()
185
- sourceSets {
186
- val jvmMain by getting {
187
- // Make IDE aware of the generated code:
188
- kotlin.srcDir(" build/generated/ksp/jvmMain/kotlin/" )
189
- dependencies {
190
- implementation(" org.jetbrains.kotlinx:dataframe:<version>" )
191
- }
192
- }
193
- }
194
- }
195
-
196
- // (Only if you use kotlint) Excludes for `kotlint`:
197
- tasks.withType< org.jmailen.gradle.kotlinter.tasks.LintTask > {
198
- exclude {
199
- it.name.endsWith(" .Generated.kt" )
200
- }
201
- exclude {
202
- it.name.endsWith(" \$ Extensions.kt" )
203
- }
204
- }
205
- ```
206
-
207
- </tab >
208
-
209
165
</tabs >
210
166
211
- <note >
212
-
213
- If the code generated by the plugin isn't resolved in IDE, make sure you've configured source sets according to the snippet above. More information in [ KSP documentation] ( https://github.com/google/ksp/blob/main/docs/quickstart.md#make-ide-aware-of-generated-code )
214
-
215
- </note >
216
-
217
- Note that it's better to use the same version for a library and plugin to avoid unpredictable errors.
218
- After plugin configuration you can try it out with [ example] ( gradle.md#annotation-processing ) .
219
-
220
167
## Other build systems
221
168
222
169
If you are using Maven, Ivy or Bazel to configure your build, you can still use the Kotlin DataFrame library in your project.
0 commit comments