Skip to content

Commit d13b26a

Browse files
authored
Merge pull request #365 from Kotlin/gradle-plugin-references-fix
Gradle plugin references fix
2 parents 5c4188d + c820aeb commit d13b26a

File tree

3 files changed

+51
-14
lines changed

3 files changed

+51
-14
lines changed

docs/StardustDocs/topics/extensionPropertiesApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ df.add("lastName") { name.split(",").last() }
2828
<dataFrame src="org.jetbrains.kotlinx.dataframe.samples.api.ApiLevels.extensionProperties2.html"/>
2929
<!---END-->
3030

31-
Extension properties are generated for [`DataSchema`](schemas.md) that is extracted from [`DataFrame`](DataFrame.md)
31+
In notebooks, extension properties are generated for [`DataSchema`](schemas.md) that is extracted from [`DataFrame`](DataFrame.md)
3232
instance after REPL line execution.
3333
After that [`DataFrame`](DataFrame.md) variable is typed with its own [`DataSchema`](schemas.md), so only valid extension properties corresponding to actual columns in DataFrame will be allowed by the compiler and suggested by completion.
3434

35-
Also, extension properties [can be generated in IntelliJ IDEA](gradle.md) using the [Kotlin Dataframe Gradle plugin](installation.md#data-schema-preprocessor).
35+
Extension properties can be generated in IntelliJ IDEA using the [Kotlin Dataframe Gradle plugin](gradle.md#configuration).
3636

3737
<warning>
3838
In notebooks generated properties won't appear and be updated until the cell has been executed. It often means that you have to introduce new variable frequently to sync extension properties with actual schema

docs/StardustDocs/topics/gradle.md

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,46 @@
22

33
<!---IMPORT org.jetbrains.kotlinx.dataframe.samples.api.Schemas-->
44

5-
In Gradle project the Kotlin DataFrame library provides
5+
In Gradle projects, the Kotlin DataFrame library provides
66

77
1. Annotation processing for generation of extension properties
88
2. Annotation processing for [`DataSchema`](schemas.md) inference from datasets.
99
3. Gradle task for [`DataSchema`](schemas.md) inference from datasets.
1010

1111
### Configuration
1212

13-
To use [extension properties API](extensionPropertiesApi.md) in Gradle project you
14-
should [configure the Kotlin DataFrame plugin](installation.md#data-schema-preprocessor).
13+
To use the [extension properties API](extensionPropertiesApi.md) in Gradle project add the `dataframe` plugin as follows:
14+
15+
<tabs>
16+
<tab title="Kotlin DSL">
17+
18+
```kotlin
19+
plugins {
20+
id("org.jetbrains.kotlinx.dataframe") version "%dataFrameVersion%"
21+
}
22+
23+
dependencies {
24+
implementation("org.jetbrains.kotlinx:dataframe:%dataFrameVersion%")
25+
}
26+
```
27+
28+
</tab>
29+
30+
<tab title="Groovy DSL">
31+
32+
```groovy
33+
plugins {
34+
id("org.jetbrains.kotlinx.dataframe") version "%dataFrameVersion%"
35+
}
36+
37+
dependencies {
38+
implementation 'org.jetbrains.kotlinx:dataframe:%dataFrameVersion%'
39+
}
40+
```
41+
42+
</tab>
43+
44+
</tabs>
1545

1646
### Annotation processing
1747

@@ -52,14 +82,21 @@ Specify schema with preferred method and execute the `assemble` task.
5282
<tabs>
5383
<tab title="Method 1. Annotation processing">
5484

55-
`@ImportDataSchema` annotation must be above package directive. You can put this annotation in the same file as data
56-
processing code. You can import schema from URL or relative path of the file. Relative path by default is resolved to
57-
project root directory. You can configure it
58-
by [passing](https://kotlinlang.org/docs/ksp-quickstart.html#pass-options-to-processors) `dataframe.resolutionDir`
59-
option to preprocessor
85+
`@ImportDataSchema` annotation must be above package directive.
86+
You can import schemas from a URL or from the relative path of a file.
87+
Relative path by default is resolved to the project root directory.
88+
You can configure it by [passing](https://kotlinlang.org/docs/ksp-quickstart.html#pass-options-to-processors) `dataframe.resolutionDir`
89+
option to preprocessor.
90+
For example:
91+
92+
```kotlin
93+
ksp {
94+
arg("dataframe.resolutionDir", file("data").absolutePath)
95+
}
96+
```
6097

6198
**Note that due to incremental processing, imported schema will be re-generated only if some source code has changed
62-
from previous invocation, at least one character**
99+
from the previous invocation, at least one character.**
63100

64101
For the following configuration, file `Repository.Generated.kt` will be generated to `build/generated/ksp/` folder in
65102
the same package as file containing the annotation.
@@ -75,8 +112,8 @@ import org.jetbrains.kotlinx.dataframe.api.*
75112
```
76113

77114
See KDocs for `@ImportDataSchema` in IDE
78-
or [github](https://github.com/Kotlin/dataframe/blob/master/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/annotations/ImportDataSchema.kt)
79-
for more details
115+
or [GitHub](https://github.com/Kotlin/dataframe/blob/master/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/annotations/ImportDataSchema.kt)
116+
for more details.
80117

81118
</tab>
82119

docs/StardustDocs/topics/schemas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It ignores order of columns in [`DataFrame`](DataFrame.md), but tracks column hi
1111

1212
In Jupyter environment compile-time [`DataFrame`](DataFrame.md) schema is synchronized with real-time data after every cell execution.
1313

14-
In IDEA projects you can use [gradle plugin](installation.md#data-schema-preprocessor) to extract schema from dataset
14+
In IDEA projects, you can use the [Gradle plugin](gradle.md#configuration) to extract schema from the dataset
1515
and generate extension properties.
1616

1717
## DataSchema workflow in Jupyter

0 commit comments

Comments
 (0)