Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 20 additions & 47 deletions docs/StardustDocs/topics/setup/SetupAndroid.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ but you can add the Kotlin DataFrame JVM dependency to your Android project with

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

android {
// Requires Android 0+, i.e. SDK version 26 or higher.
defaultConfig {
minSdk = 26
minSdk = 21
}
// Requires Java 8 or higher
compileOptions {
Expand All @@ -38,25 +44,6 @@ android {
kotlinOptions {
jvmTarget = "1.8"
}
packaging {
resources {
pickFirsts += listOf(
"META-INF/AL2.0",
"META-INF/LGPL2.1",
"META-INF/ASL-2.0.txt",
"META-INF/LICENSE.md",
"META-INF/NOTICE.md",
"META-INF/LGPL-3.0.txt",
"META-INF/thirdparty-LICENSE",
)
excludes += listOf(
"META-INF/kotlin-jupyter-libraries/libraries.json",
"META-INF/{INDEX.LIST,DEPENDENCIES}",
"{draftv3,draftv4}/schema",
"arrow-git.properties",
)
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
Expand All @@ -69,13 +56,19 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {

```groovy
dependencies {
implementation 'org.jetbrains.kotlinx:dataframe:%dataFrameVersion%'
// Core Kotlin DataFrame API, CSV and JSON IO.
// See custom Gradle setup:
// https://kotlin.github.io/dataframe/setupcustomgradle.html
implementation 'org.jetbrains.kotlinx:dataframe-core:%dataFrameVersion%'
implementation 'org.jetbrains.kotlinx:dataframe-json:%dataFrameVersion%'
implementation 'org.jetbrains.kotlinx:dataframe-csv:%dataFrameVersion%'
// You can add any additional IO modules you like, except for 'dataframe-arrow'.
// Apache Arrow is not supported well on Android.
}

android {
// Requires Android 0+, i.e. SDK version 26 or higher.
defaultConfig {
minSdk 26
minSdk 21
}
// Requires Java 8 or higher
compileOptions {
Expand All @@ -85,25 +78,6 @@ android {
kotlinOptions {
jvmTarget = "1.8"
}
packaging {
resources {
pickFirsts += [
"META-INF/AL2.0",
"META-INF/LGPL2.1",
"META-INF/ASL-2.0.txt",
"META-INF/LICENSE.md",
"META-INF/NOTICE.md",
"META-INF/LGPL-3.0.txt",
"META-INF/thirdparty-LICENSE",
]
excludes += [
"META-INF/kotlin-jupyter-libraries/libraries.json",
"META-INF/{INDEX.LIST,DEPENDENCIES}",
"{draftv3,draftv4}/schema",
"arrow-git.properties",
]
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions.jvmTarget = "1.8"
Expand All @@ -113,9 +87,8 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
</tab>
</tabs>

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

Expand Down
44 changes: 16 additions & 28 deletions examples/android-example/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
kotlin("plugin.dataframe") version "2.2.20-Beta1"
kotlin("plugin.dataframe") version "2.2.20-Beta2"
}

android {
Expand All @@ -11,7 +13,7 @@ android {

defaultConfig {
applicationId = "com.example.myapplication"
minSdk = 26
minSdk = 21
targetSdk = 36
versionCode = 1
versionName = "1.0"
Expand All @@ -21,42 +23,25 @@ android {

buildTypes {
release {
isMinifyEnabled = false
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
buildFeatures {
compose = true
}
packaging {
resources {
pickFirsts += listOf(
"META-INF/AL2.0",
"META-INF/LGPL2.1",
"META-INF/ASL-2.0.txt",
"META-INF/LICENSE.md",
"META-INF/NOTICE.md",
"META-INF/LGPL-3.0.txt",
"META-INF/thirdparty-LICENSE",
)
excludes += listOf(
"META-INF/kotlin-jupyter-libraries/libraries.json",
"META-INF/{INDEX.LIST,DEPENDENCIES}",
"{draftv3,draftv4}/schema",
"arrow-git.properties",
)
}
}
}

dependencies {
Expand All @@ -78,9 +63,12 @@ dependencies {
debugImplementation(libs.androidx.ui.test.manifest)

// TODO update version
// Core Kotlin DataFrame API & JSON IO.
// Core Kotlin DataFrame API, JSON and CSV IO.
// See custom Gradle setup:
// https://kotlin.github.io/dataframe/setupcustomgradle.html
implementation("org.jetbrains.kotlinx:dataframe-core:1.0.0-dev-7831")
implementation("org.jetbrains.kotlinx:dataframe-json:1.0.0-dev-7831")
implementation("org.jetbrains.kotlinx:dataframe-core:1.0.0-dev-8314")
implementation("org.jetbrains.kotlinx:dataframe-json:1.0.0-dev-8314")
implementation("org.jetbrains.kotlinx:dataframe-csv:1.0.0-dev-8314")
// You can add any additional IO modules you like, except for 'dataframe-arrow'.
// Apache Arrow is not supported well on Android.
}
2 changes: 1 addition & 1 deletion examples/android-example/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
agp = "8.11.1"
kotlin = "2.2.20-Beta1"
kotlin = "2.2.20-Beta2"
coreKtx = "1.10.1"
junit = "4.13.2"
junitVersion = "1.1.5"
Expand Down