Skip to content

Commit 7fb4bc5

Browse files
committed
rework installation
1 parent 4a89cc9 commit 7fb4bc5

File tree

1 file changed

+28
-81
lines changed

1 file changed

+28
-81
lines changed

docs/StardustDocs/topics/installation.md

Lines changed: 28 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If you want to always use the latest version, add another magic before `%use dat
3030
If you want to use specific version of the Kotlin DataFrame library, you can specify it in brackets:
3131

3232
```text
33-
%use dataframe(0.8.1)
33+
%use dataframe(%dataFrameVersion%)
3434
```
3535

3636
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:
5252
The Kotlin DataFrame library is published to Maven Central, so you can simply add the following line to your Kotlin DSL
5353
buildscript to depend on it:
5454

55-
### All-in-one artifact
55+
### General configuration
5656

5757
<tabs>
5858
<tab title="Kotlin DSL">
5959

6060
```kotlin
61+
plugins {
62+
id("org.jetbrains.kotlinx.dataframe") version "%dataFrameVersion%"
63+
}
64+
6165
dependencies {
62-
implementation("org.jetbrains.kotlinx:dataframe:<version>")
66+
implementation("org.jetbrains.kotlinx:dataframe:%dataFrameVersion%")
6367
}
6468
```
6569

6670
</tab>
6771

6872
<tab title="Groovy DSL">
6973

70-
```kotlin
74+
```groovy
75+
plugins {
76+
id("org.jetbrains.kotlinx.dataframe") version "%dataFrameVersion%"
77+
}
78+
7179
dependencies {
72-
implementation 'org.jetbrains.kotlinx:dataframe:<version>'
80+
implementation 'org.jetbrains.kotlinx:dataframe:%dataFrameVersion%'
7381
}
7482
```
7583

7684
</tab>
7785

7886
</tabs>
7987

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
8192

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:
8394

8495
<tabs>
8596
<tab title="Kotlin DSL">
8697

8798
```kotlin
8899
dependencies {
89100
// Artifact containing all APIs and implementations
90-
implementation("org.jetbrains.kotlinx:dataframe-core:<version>")
101+
implementation("org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion%")
91102
// 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%")
94106
}
95107
```
96108

@@ -101,38 +113,27 @@ dependencies {
101113
```groovy
102114
dependencies {
103115
// Artifact containing all APIs and implementations
104-
implementation 'org.jetbrains.kotlinx:dataframe-core:<version>'
116+
implementation 'org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion%'
105117
// 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%'
108121
}
109122
```
110123

111124
</tab>
112125

113126
</tabs>
114127

115-
### Data schema preprocessor
128+
#### Linter configuration
116129

117130
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.
120132

121133
<tabs>
122134
<tab title="Kotlin DSL">
123135

124136
```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-
136137
// (Only if you use kotlint) Excludes for `kotlint`:
137138
tasks.withType<org.jmailen.gradle.kotlinter.tasks.LintTask> {
138139
exclude {
@@ -149,18 +150,6 @@ tasks.withType<org.jmailen.gradle.kotlinter.tasks.LintTask> {
149150
<tab title="Groovy DSL">
150151

151152
```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`:
164153
tasks.withType(org.jmailen.gradle.kotlinter.tasks.LintTask).all {
165154
exclude {
166155
it.name.endsWith(".Generated.kt")
@@ -173,50 +162,8 @@ tasks.withType(org.jmailen.gradle.kotlinter.tasks.LintTask).all {
173162

174163
</tab>
175164

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-
209165
</tabs>
210166

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-
220167
## Other build systems
221168

222169
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

Comments
 (0)