Skip to content

Commit

Permalink
Move code from root to a new 'core' module so that 'dataframe' was th…
Browse files Browse the repository at this point in the history
…e default artifact including all existing modules. And if you don't want some dependency, you can fall back to manually declaring needed modules yourself
  • Loading branch information
koperagen committed Jun 3, 2022
1 parent 6ebd2a0 commit 704200c
Show file tree
Hide file tree
Showing 331 changed files with 128 additions and 93 deletions.
81 changes: 3 additions & 78 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ plugins {
kotlin("jvm") version libs.versions.kotlin
kotlin("libs.publisher") version libs.versions.libsPublisher
kotlin("plugin.serialization") version libs.versions.kotlin
kotlin("jupyter.api") version libs.versions.kotlinJupyter
kotlin("plugin.dataframe") version libs.versions.dataframe apply false

id("org.jetbrains.dokka") version libs.versions.dokka
id("org.jetbrains.dataframe.generator")

id("org.jmailen.kotlinter") version libs.versions.ktlint

}

val jupyterApiTCRepo: String by project
Expand All @@ -33,40 +30,11 @@ configurations {
}

dependencies {
implementation(libs.kotlin.stdlib)
implementation(libs.kotlin.stdlib.jdk8)
implementation(libs.kotlin.reflect)

api(libs.commonsCsv)
implementation(libs.klaxon)
implementation(libs.fuel)

implementation(libs.kotlin.datetimeJvm)
implementation("com.squareup:kotlinpoet:1.11.0")

testImplementation(libs.junit)
testImplementation(libs.kotestAssertions) {
exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk8")
}
testImplementation(libs.kotlin.scriptingJvm)
testImplementation(libs.jsoup)
}

kotlin {
explicitApi()
api(project(":core"))
api(project(":dataframe-arrow"))
api(project(":dataframe-excel"))
}

tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}

tasks.withType<KotlinCompile> {
dependsOn(tasks.lintKotlin)
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-Xinline-classes", "-Xopt-in=kotlin.RequiresOptIn")
}
}

allprojects {
tasks.withType<KotlinCompile> {
Expand Down Expand Up @@ -147,46 +115,3 @@ kotlinPublications {
}
}
}

tasks.lintKotlinMain {
exclude("**/*keywords*/**")
}

tasks.lintKotlinTest {
enabled = true
}

kotlinter {
ignoreFailures = false
reporters = arrayOf("checkstyle", "plain")
experimentalRules = true
disabledRules = arrayOf(
"no-wildcard-imports",
"experimental:spacing-between-declarations-with-annotations",
"experimental:enum-entry-name-case",
"experimental:argument-list-wrapping",
"experimental:annotation",
"max-line-length",
"filename"
)
}

val instrumentedJars: Configuration by configurations.creating {
isCanBeConsumed = true
isCanBeResolved = false
}

artifacts {
add("instrumentedJars", tasks.jar.get().archiveFile) {
builtBy(tasks.jar)
}
}

tasks.test {
maxHeapSize = "2048m"
}

tasks.processJupyterApiResources {
libraryProducers = listOf("org.jetbrains.kotlinx.dataframe.jupyter.Integration")
}

110 changes: 110 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@

@Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage")
plugins {
kotlin("jvm")
kotlin("libs.publisher")
kotlin("plugin.serialization")
kotlin("jupyter.api") version libs.versions.kotlinJupyter

id("org.jetbrains.dataframe.generator")

id("org.jmailen.kotlinter")
}

group = "org.jetbrains.kotlinx"

val jupyterApiTCRepo: String by project

repositories {
mavenLocal()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
maven(jupyterApiTCRepo)
}

dependencies {
implementation(libs.kotlin.stdlib)
implementation(libs.kotlin.stdlib.jdk8)
implementation(libs.kotlin.reflect)

api(libs.commonsCsv)
implementation(libs.klaxon)
implementation(libs.fuel)

implementation(libs.kotlin.datetimeJvm)
implementation("com.squareup:kotlinpoet:1.11.0")

testImplementation(libs.junit)
testImplementation(libs.kotestAssertions) {
exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk8")
}
testImplementation(libs.kotlin.scriptingJvm)
testImplementation(libs.jsoup)
}

tasks.lintKotlinMain {
exclude("**/*keywords*/**")
}

tasks.lintKotlinTest {
enabled = true
}

kotlinter {
ignoreFailures = false
reporters = arrayOf("checkstyle", "plain")
experimentalRules = true
disabledRules = arrayOf(
"no-wildcard-imports",
"experimental:spacing-between-declarations-with-annotations",
"experimental:enum-entry-name-case",
"experimental:argument-list-wrapping",
"experimental:annotation",
"max-line-length",
"filename"
)
}

kotlin {
explicitApi()
}

tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
dependsOn(tasks.lintKotlin)
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-Xinline-classes", "-Xopt-in=kotlin.RequiresOptIn")
}
}

tasks.test {
maxHeapSize = "2048m"
}

tasks.processJupyterApiResources {
libraryProducers = listOf("org.jetbrains.kotlinx.dataframe.jupyter.Integration")
}

kotlinPublications {
publication {
publicationName.set("core")
artifactId.set("dataframe-core")
description.set("Dataframe core API")
packageName.set(artifactId)
}
}

val instrumentedJars: Configuration by configurations.creating {
isCanBeConsumed = true
isCanBeResolved = false
}

artifacts {
add("instrumentedJars", tasks.jar.get().archiveFile) {
builtBy(tasks.jar)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import org.jetbrains.kotlinx.dataframe.api.rows
import org.jetbrains.kotlinx.dataframe.columns.ColumnPath
import org.jetbrains.kotlinx.dataframe.columns.ColumnSet
import org.jetbrains.kotlinx.dataframe.columns.UnresolvedColumnsPolicy
import org.jetbrains.kotlinx.dataframe.columns.values
import org.jetbrains.kotlinx.dataframe.impl.DataFrameReceiver
import org.jetbrains.kotlinx.dataframe.impl.aggregation.receivers.AggregateInternalDsl
import org.jetbrains.kotlinx.dataframe.impl.columns.toColumns
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ class SampleNotebooksTests : DataFrameJupyterTest() {
)

companion object {
const val ideaExamplesPath = "examples/idea-examples"
const val jupyterExamplesPath = "examples/jupyter-notebooks"
const val ideaExamplesPath = "../examples/idea-examples"
const val jupyterExamplesPath = "../examples/jupyter-notebooks"

fun testFile(folder: String, fileName: String) = fileName to "$jupyterExamplesPath/$folder/$fileName"
}
Expand Down
Loading

0 comments on commit 704200c

Please sign in to comment.