Skip to content

Commit ed9d686

Browse files
authored
Merge pull request #1426 from Kotlin/android-without-arrow
Android example: removing arrow from the examples
2 parents 8b60b8a + 07bbd99 commit ed9d686

File tree

3 files changed

+37
-76
lines changed

3 files changed

+37
-76
lines changed

docs/StardustDocs/topics/setup/SetupAndroid.md

Lines changed: 20 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,19 @@ but you can add the Kotlin DataFrame JVM dependency to your Android project with
2222

2323
```kotlin
2424
dependencies {
25-
implementation("org.jetbrains.kotlinx:dataframe:%dataFrameVersion%")
25+
// Core Kotlin DataFrame API, CSV and JSON IO.
26+
// See custom Gradle setup:
27+
// https://kotlin.github.io/dataframe/setupcustomgradle.html
28+
implementation("org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion%")
29+
implementation("org.jetbrains.kotlinx:dataframe-json:%dataFrameVersion%")
30+
implementation("org.jetbrains.kotlinx:dataframe-csv:%dataFrameVersion%")
31+
// You can add any additional IO modules you like, except for 'dataframe-arrow'.
32+
// Apache Arrow is not supported well on Android.
2633
}
2734

2835
android {
29-
// Requires Android 0+, i.e. SDK version 26 or higher.
3036
defaultConfig {
31-
minSdk = 26
37+
minSdk = 21
3238
}
3339
// Requires Java 8 or higher
3440
compileOptions {
@@ -38,25 +44,6 @@ android {
3844
kotlinOptions {
3945
jvmTarget = "1.8"
4046
}
41-
packaging {
42-
resources {
43-
pickFirsts += listOf(
44-
"META-INF/AL2.0",
45-
"META-INF/LGPL2.1",
46-
"META-INF/ASL-2.0.txt",
47-
"META-INF/LICENSE.md",
48-
"META-INF/NOTICE.md",
49-
"META-INF/LGPL-3.0.txt",
50-
"META-INF/thirdparty-LICENSE",
51-
)
52-
excludes += listOf(
53-
"META-INF/kotlin-jupyter-libraries/libraries.json",
54-
"META-INF/{INDEX.LIST,DEPENDENCIES}",
55-
"{draftv3,draftv4}/schema",
56-
"arrow-git.properties",
57-
)
58-
}
59-
}
6047
}
6148
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
6249
kotlinOptions.jvmTarget = "1.8"
@@ -69,13 +56,19 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
6956

7057
```groovy
7158
dependencies {
72-
implementation 'org.jetbrains.kotlinx:dataframe:%dataFrameVersion%'
59+
// Core Kotlin DataFrame API, CSV and JSON IO.
60+
// See custom Gradle setup:
61+
// https://kotlin.github.io/dataframe/setupcustomgradle.html
62+
implementation 'org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion%'
63+
implementation 'org.jetbrains.kotlinx:dataframe-json:%dataFrameVersion%'
64+
implementation 'org.jetbrains.kotlinx:dataframe-csv:%dataFrameVersion%'
65+
// You can add any additional IO modules you like, except for 'dataframe-arrow'.
66+
// Apache Arrow is not supported well on Android.
7367
}
7468
7569
android {
76-
// Requires Android 0+, i.e. SDK version 26 or higher.
7770
defaultConfig {
78-
minSdk 26
71+
minSdk 21
7972
}
8073
// Requires Java 8 or higher
8174
compileOptions {
@@ -85,25 +78,6 @@ android {
8578
kotlinOptions {
8679
jvmTarget = "1.8"
8780
}
88-
packaging {
89-
resources {
90-
pickFirsts += [
91-
"META-INF/AL2.0",
92-
"META-INF/LGPL2.1",
93-
"META-INF/ASL-2.0.txt",
94-
"META-INF/LICENSE.md",
95-
"META-INF/NOTICE.md",
96-
"META-INF/LGPL-3.0.txt",
97-
"META-INF/thirdparty-LICENSE",
98-
]
99-
excludes += [
100-
"META-INF/kotlin-jupyter-libraries/libraries.json",
101-
"META-INF/{INDEX.LIST,DEPENDENCIES}",
102-
"{draftv3,draftv4}/schema",
103-
"arrow-git.properties",
104-
]
105-
}
106-
}
10781
}
10882
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
10983
kotlinOptions.jvmTarget = "1.8"
@@ -113,9 +87,8 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
11387
</tab>
11488
</tabs>
11589

116-
This setup adds the [general Kotlin DataFrame dependency](Modules.md#dataframe-general),
117-
which includes the [core API and implementation](Modules.md#dataframe-core)
118-
as well as all [IO modules](Modules.md#io-modules)
90+
This setup adds the [Kotlin DataFrame core](Modules.md#dataframe-core)
91+
as well as a subset of the [IO modules](Modules.md#io-modules)
11992
(excluding [experimental ones](Modules.md#experimental-modules)).
12093
For flexible configuration, see [Custom configuration](SetupCustomGradle.md).
12194

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
13
plugins {
24
alias(libs.plugins.android.application)
35
alias(libs.plugins.kotlin.android)
46
alias(libs.plugins.kotlin.compose)
5-
kotlin("plugin.dataframe") version "2.2.20-Beta1"
7+
kotlin("plugin.dataframe") version "2.2.20-Beta2"
68
}
79

810
android {
@@ -11,7 +13,7 @@ android {
1113

1214
defaultConfig {
1315
applicationId = "com.example.myapplication"
14-
minSdk = 26
16+
minSdk = 21
1517
targetSdk = 36
1618
versionCode = 1
1719
versionName = "1.0"
@@ -21,42 +23,25 @@ android {
2123

2224
buildTypes {
2325
release {
24-
isMinifyEnabled = false
26+
isMinifyEnabled = true
2527
proguardFiles(
2628
getDefaultProguardFile("proguard-android-optimize.txt"),
27-
"proguard-rules.pro"
29+
"proguard-rules.pro",
2830
)
2931
}
3032
}
3133
compileOptions {
3234
sourceCompatibility = JavaVersion.VERSION_1_8
3335
targetCompatibility = JavaVersion.VERSION_1_8
3436
}
35-
kotlinOptions {
36-
jvmTarget = "1.8"
37+
kotlin {
38+
compilerOptions {
39+
jvmTarget = JvmTarget.JVM_1_8
40+
}
3741
}
3842
buildFeatures {
3943
compose = true
4044
}
41-
packaging {
42-
resources {
43-
pickFirsts += listOf(
44-
"META-INF/AL2.0",
45-
"META-INF/LGPL2.1",
46-
"META-INF/ASL-2.0.txt",
47-
"META-INF/LICENSE.md",
48-
"META-INF/NOTICE.md",
49-
"META-INF/LGPL-3.0.txt",
50-
"META-INF/thirdparty-LICENSE",
51-
)
52-
excludes += listOf(
53-
"META-INF/kotlin-jupyter-libraries/libraries.json",
54-
"META-INF/{INDEX.LIST,DEPENDENCIES}",
55-
"{draftv3,draftv4}/schema",
56-
"arrow-git.properties",
57-
)
58-
}
59-
}
6045
}
6146

6247
dependencies {
@@ -78,9 +63,12 @@ dependencies {
7863
debugImplementation(libs.androidx.ui.test.manifest)
7964

8065
// TODO update version
81-
// Core Kotlin DataFrame API & JSON IO.
66+
// Core Kotlin DataFrame API, JSON and CSV IO.
8267
// See custom Gradle setup:
8368
// https://kotlin.github.io/dataframe/setupcustomgradle.html
84-
implementation("org.jetbrains.kotlinx:dataframe-core:1.0.0-dev-7831")
85-
implementation("org.jetbrains.kotlinx:dataframe-json:1.0.0-dev-7831")
69+
implementation("org.jetbrains.kotlinx:dataframe-core:1.0.0-dev-8314")
70+
implementation("org.jetbrains.kotlinx:dataframe-json:1.0.0-dev-8314")
71+
implementation("org.jetbrains.kotlinx:dataframe-csv:1.0.0-dev-8314")
72+
// You can add any additional IO modules you like, except for 'dataframe-arrow'.
73+
// Apache Arrow is not supported well on Android.
8674
}

examples/android-example/gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22
agp = "8.11.1"
3-
kotlin = "2.2.20-Beta1"
3+
kotlin = "2.2.20-Beta2"
44
coreKtx = "1.10.1"
55
junit = "4.13.2"
66
junitVersion = "1.1.5"

0 commit comments

Comments
 (0)