Skip to content

Commit c3a2a33

Browse files
Merge pull request #1643 from Kotlin/maven_example
Added Maven project example + Maven setup instructions
2 parents 33c6f21 + cfd05a1 commit c3a2a33

File tree

26 files changed

+515
-44
lines changed

26 files changed

+515
-44
lines changed

.github/workflows/archive-examples.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
- master
77
paths:
88
- 'examples/android-example/**'
9-
- 'examples/kotlin-dataframe-plugin-example/**'
9+
- 'examples/kotlin-dataframe-plugin-gradle-example/**'
10+
- 'examples/kotlin-dataframe-plugin-maven-example/**'
1011
workflow_dispatch:
1112

1213
jobs:
@@ -22,10 +23,16 @@
2223
cd examples/android-example
2324
zip -r ../../android-example.zip . -x "*.git*" "build/*" ".gradle/*" "*/build/*"
2425
25-
- name: Create kotlin-dataframe-plugin-example archive
26+
- name: Create kotlin-dataframe-plugin-gradle-example archive
2627
run: |
27-
cd examples/kotlin-dataframe-plugin-example
28-
zip -r ../../kotlin-dataframe-plugin-example.zip . -x "*.git*" "build/*" ".gradle/*" "*/build/*"
28+
cd examples/kotlin-dataframe-plugin-gradle-example
29+
zip -r ../../kotlin-dataframe-plugin-gradle-example.zip . -x "*.git*" "build/*" ".gradle/*" "*/build/*" ".idea/*"
30+
31+
- name: Create kotlin-dataframe-plugin-maven-example archive
32+
run: |
33+
cd examples/kotlin-dataframe-plugin-maven-example
34+
zip -r ../../kotlin-dataframe-plugin-maven-example.zip . -x "*.git*" "target/*" ".idea/*"
35+
2936
3037
- name: Checkout example-projects-archives branch
3138
run: |
@@ -58,10 +65,15 @@
5865
5966
**Download:** [android-example.zip](https://github.com/Kotlin/dataframe/raw/example-projects-archives/android-example.zip)
6067
61-
### Kotlin DataFrame Plugin Example
62-
Example of using the compiler plugin for Kotlin DataFrame.
68+
### Kotlin DataFrame Plugin Gradle Example
69+
Example of using the compiler plugin for Kotlin DataFrame in Gradle project.
70+
71+
**Download:** [kotlin-dataframe-plugin-gradle-example.zip](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-gradle-example.zip)
72+
73+
### Kotlin DataFrame Plugin Maven Example
74+
Example of using the compiler plugin for Kotlin DataFrame in Gradle project.
6375
64-
**Download:** [kotlin-dataframe-plugin-example.zip](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-example.zip)
76+
**Download:** [kotlin-dataframe-plugin-maven-example.zip](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-maven-example.zip)
6577
6678
---
6779

README.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ Or manually specify the version:
114114
> ```
115115
116116
Refer to the
117-
[Get started with Kotlin DataFrame in Kotlin Notebook](https://kotlin.github.io/dataframe/gettingstartedkotlinnotebook.html)
117+
[Setup Kotlin DataFrame in Kotlin Notebook](https://kotlin.github.io/dataframe/setupkotlinnotebook.html)
118118
for details.
119119
120120
### Gradle
121121
122-
Add dependencies in the build.gradle.kts script:
122+
Add dependencies in the `build.gradle.kts` script:
123123
124124
```kotlin
125125
dependencies {
@@ -135,18 +135,53 @@ repositories {
135135
}
136136
```
137137
138+
Refer to
139+
[Get started with Kotlin DataFrame on Gradle](https://kotlin.github.io/dataframe/setupgradle.html)
140+
for detailed setup instructions (including Groovy DSL).
141+
142+
* You can also check the [Custom Gradle Configuration](https://kotlin.github.io/dataframe/setupcustomgradle.html) if you don't need certain formats as dependencies.
143+
* For Android projects, see [Setup Kotlin DataFrame on Android](https://kotlin.github.io/dataframe/setupandroid.html).
144+
* See [IDEA Gradle example projects](examples/idea-examples)
145+
and [the Gradle project with the Kotlin DataFrame Compiler plugin](examples/kotlin-dataframe-plugin-gradle-example).
146+
138147
Refer to the
139-
[Get started with Kotlin DataFrame on Gradle](https://kotlin.github.io/dataframe/gettingstartedgradle.html)
148+
[Setup Kotlin DataFrame in Kotlin Notebook](https://kotlin.github.io/dataframe/setupkotlinnotebook.html)
140149
for details.
141-
Also, check out the [custom setup page](https://kotlin.github.io/dataframe/gettingstartedgradleadvanced.html)
142-
if you don't need some formats as dependencies,
143-
for Groovy, and for configurations specific to Android projects.
150+
151+
### Maven
152+
153+
Add dependencies in the `pom.xml` configuration file:
154+
155+
```xml
156+
<dependency>
157+
<groupId>org.jetbrains.kotlinx</groupId>
158+
<artifactId>dataframe</artifactId>
159+
<version>1.0.0-Beta4</version>
160+
</dependency>
161+
```
162+
163+
Make sure that you have `mavenCentral` in the list of repositories:
164+
165+
```xml
166+
<repositories>
167+
<repository>
168+
<id>mavenCentral</id>
169+
<url>https://repo1.maven.org/maven2/</url>
170+
</repository>
171+
</repositories>
172+
```
173+
174+
Refer to
175+
[Get started with Kotlin DataFrame on Maven](https://kotlin.github.io/dataframe/setupmaven.html).
176+
177+
* See [the Maven project with the Kotlin DataFrame Compiler plugin](examples/kotlin-dataframe-plugin-gradle-example).
178+
144179
145180
## Code example
146181
147182
This example of Kotlin DataFrame code with
148183
the [Compiler Plugin](https://kotlin.github.io/dataframe/compiler-plugin.html) enabled.
149-
See [the full project](https://github.com/Kotlin/dataframe/tree/master/examples/kotlin-dataframe-plugin-example).
184+
See [the full project](https://github.com/Kotlin/dataframe/tree/master/examples/kotlin-dataframe-plugin-gradle-example).
150185
See also
151186
[this example in Kotlin Notebook](https://github.com/Kotlin/dataframe/tree/master/examples/notebooks/readme_example.ipynb).
152187

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ tasks.assemble {
324324
// subprojects use the Gradle version from the root project, so let's sync them to ensure standalone version will build as well.
325325
doLast {
326326
val source = file("gradle/wrapper/gradle-wrapper.properties")
327-
listOf("examples/android-example", "examples/kotlin-dataframe-plugin-example").forEach { sub ->
327+
listOf("examples/android-example", "examples/kotlin-dataframe-plugin-gradle-example").forEach { sub ->
328328
val target = file("$sub/gradle/wrapper/gradle-wrapper.properties")
329329
if (source.readText() != target.readText()) {
330330
source.copyTo(target, overwrite = true)

docs/StardustDocs/d.tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<toc-element topic="Setup.md" accepts-web-file-names="gettingstarted">
1919
<toc-element topic="SetupKotlinNotebook.md" accepts-web-file-names="gettingstartedkotlinnotebook.html"/>
2020
<toc-element topic="SetupGradle.md" accepts-web-file-names="gettingstartedgradle.html"/>
21+
<toc-element topic="SetupMaven.md"/>
2122
<toc-element topic="SetupJupyter.md" accepts-web-file-names="gettingstartedjupyternotebook.html"/>
2223
<toc-element topic="SetupDatalore.md" accepts-web-file-names="gettingstarteddatalore.html"/>
2324
<toc-element topic="SetupAndroid.md"/>

docs/StardustDocs/topics/Compiler-Plugin.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,15 @@ Setup library dependency:
5555
implementation("org.jetbrains.kotlinx:dataframe:%dataFrameVersion%")
5656
```
5757

58-
Add this line to `gradle.properties`:
58+
Due to the [known issue](https://youtrack.jetbrains.com/issue/KT-66735), incremental compilation must be disabled for now.
59+
Add the following line to your `gradle.properties` file:
60+
5961
```properties
6062
kotlin.incremental=false
6163
```
6264

6365
Sync the project.
6466

65-
Disabling incremental compilation will no longer be necessary
66-
when https://youtrack.jetbrains.com/issue/KT-66735 is resolved.
67-
6867
</tab>
6968

7069
<tab title="Maven">
@@ -164,6 +163,8 @@ fun main() {
164163

165164
## Examples
166165

167-
* [Kotlin DataFrame in the IntelliJ IDEA project example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-example)
168-
— an IntelliJ IDEA project showcasing simple DataFrame expressions using the Compiler Plugin.
166+
* [Kotlin DataFrame in the IntelliJ IDEA Gradle project example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-gradle-example)
167+
— an IntelliJ IDEA Gradle project showcasing simple DataFrame expressions using the Compiler Plugin.
168+
* [Kotlin DataFrame in the IntelliJ IDEA Maven project example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-maven-example)
169+
— an IntelliJ IDEA Maven project showcasing simple DataFrame expressions using the Compiler Plugin.
169170
* [](compilerPluginExamples.md) — few examples of Compiler Plugin usages.

docs/StardustDocs/topics/compilerPluginExamples.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
This page provides a few examples that you can copy directly to your project.
44
[Schema info](staticInterpretation.md#schema-info) will be a convenient way to observe the result of different operations.
55

6-
> See also an [IntelliJ IDEA project example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-example),
6+
> See also an
7+
> [IntelliJ IDEA project example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-gradle-example),
78
> showcasing simple DataFrame expressions using the Compiler Plugin.
89
910
### Example 1

docs/StardustDocs/topics/extensionPropertiesApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ df.rename { name }.into("firstName")
159159
.filter { firstName == "Nikita" }
160160
```
161161

162-
See [Compiler Plugin Example](https://github.com/Kotlin/dataframe/tree/plugin_example/examples/kotlin-dataframe-plugin-example)
162+
See [Compiler Plugin Example](https://github.com/Kotlin/dataframe/tree/plugin_example/examples/kotlin-dataframe-plugin-gradle-example)
163163
IDEA project with basic Extension Properties API examples.
164164
</tab>
165165
</tabs>

docs/StardustDocs/topics/guides/Guides-And-Examples.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,13 @@ and make working with your data both convenient and type-safe.
7070

7171
Explore our extensive collection of practical examples and real-world analytics workflows.
7272

73-
* [Kotlin DataFrame Compiler Plugin Example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-example)
74-
— a simple project demonstrating the usage of the [compiler plugin](Compiler-Plugin.md),
73+
* [Kotlin DataFrame Compiler Plugin Gradle Example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-gradle-example)
74+
— a simple Gradle project demonstrating the usage of the [compiler plugin](Compiler-Plugin.md),
75+
showcasing DataFrame expressions with [extension properties](extensionPropertiesApi.md)
76+
that are generated on-the-fly in the IDEA project.
77+
78+
* [Kotlin DataFrame Compiler Plugin Maven Example](https://github.com/Kotlin/dataframe/blob/master/examples/kotlin-dataframe-plugin-gradle-example)
79+
— a simple Maven project demonstrating the usage of the [compiler plugin](Compiler-Plugin.md),
7580
showcasing DataFrame expressions with [extension properties](extensionPropertiesApi.md)
7681
that are generated on-the-fly in the IDEA project.
7782

docs/StardustDocs/topics/setup/Setup.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ for [data analysis](https://kotlinlang.org/docs/data-analysis-overview.html).
2525
- [**Setup in Gradle**](SetupGradle.md) — add Kotlin DataFrame to your Gradle project for convenient data handling
2626
in your Kotlin applications.
2727

28+
- [**Setup in Maven**](SetupMaven.md) — add Kotlin DataFrame to your Maven project for convenient data handling
29+
in your Kotlin applications.
30+
2831
- [**Setup on Android**](SetupAndroid.md) — use Kotlin DataFrame in your Android apps to simplify local data processing
2932
and transformation.
3033

docs/StardustDocs/topics/setup/SetupGradle.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,21 @@ plugins {
121121
</tab>
122122
</tabs>
123123

124-
Due to [this issue](https://youtrack.jetbrains.com/issue/KT-66735), incremental compilation must be disabled for now.
124+
Due to the [known issue](https://youtrack.jetbrains.com/issue/KT-66735), incremental compilation must be disabled for now.
125125
Add the following line to your `gradle.properties` file:
126126

127127
```properties
128128
kotlin.incremental=false
129129
```
130130

131+
## Project Example
132+
133+
See [the Gradle example project with the Kotlin DataFrame Compiler Plugin enabled on GitHub](https://github.com/Kotlin/dataframe/tree/master/examples/kotlin-dataframe-plugin-gradle-example).
134+
135+
You can also
136+
[download this project](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-gradle-example.zip).
137+
138+
131139
## Next Steps
132140

133141
* Once you’ve set up Kotlin DataFrame in your Gradle project, continue with the [](quickstart.md)

0 commit comments

Comments
 (0)