diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 9c2aed6..0000000 --- a/build.gradle +++ /dev/null @@ -1,136 +0,0 @@ - -plugins { - id "org.jetbrains.kotlin.jvm" version "1.9.20" - id "java" - id "maven-publish" - id "signing" - id "io.github.gradle-nexus.publish-plugin" version "1.1.0" - id "org.jetbrains.kotlin.jupyter.api" version "0.12.0-82-1" -} - - - -repositories { - mavenCentral() - mavenLocal() - -// mavenLocal() //todo disable for release - // maven { url 'https://jitpack.io' } -} - - -dependencies { -// implementation "org.jetbrains.kotlin:kotlin-stdlib" - compileOnly "org.jetbrains.kotlin:kotlin-reflect:1.9.20" - - // note krangl is still needed for the example data - api 'com.github.holgerbrandl:krangl:0.18.4' - api 'com.github.holgerbrandl:kdfutils:1.3.3' - - api 'org.jetbrains.kotlinx:dataframe-core:0.12.0' - -// compile "com.github.holgerbrandl:krangl:0.17-SNAPSHOT" -// api "ml.dmlc:xgboost4j:0.80" - - implementation group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' - - implementation 'org.rosuda.REngine:REngine:2.1.0' - implementation 'org.rosuda.REngine:Rserve:1.8.1' - - // see https://github.com/codecentric/javafxsvg -// compile 'de.codecentric.centerdevice:javafxsvg:1.3.0' - - testImplementation group: 'junit', name: 'junit', version: '4.13.1' -// testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.9" - testImplementation 'io.kotest:kotest-assertions-core:5.0.3' - - - // needed to work around https://youtrack.jetbrains.com/issue/KT-15064 -// compileOnly "org.jetbrains.kotlin:kotlin-script-runtime:$kotlin_version" - testImplementation "org.jetbrains.kotlin:kotlin-script-runtime:1.9.20" -// testCompile "org.jetbrains.kotlin:kotlin-script-runtime:$kotlin_version" - - // testCompile group: 'com.github.javafaker', name: 'javafaker', version: '0.16' -} - - -processJupyterApiResources { - libraryProducers = ["kravis.device.jupyter.JupyterIntegration"] -} - -//task javadoc(type: Javadoc) { -javadoc { - exclude '**/PlotResultPanel.java' -} - -// http://stackoverflow.com/questions/11474729/how-to-build-sources-jar-with-gradle -//task sourcesJar(type: Jar, dependsOn: classes) { -// classifier = 'sources' -// from sourceSets.main.allSource -//} - -//task javadocJar(type: Jar, dependsOn: javadoc) { -// classifier = 'javadoc' -// from javadoc.destinationDir -//} - -//http://stackoverflow.com/questions/34377367/why-is-gradle-install-replacing-my-version-with-unspecified -group 'com.github.holgerbrandl' -version '0.9.97-SNAPSHOT' -//version '0.9.95' - - - -java { - withJavadocJar() - withSourcesJar() -} - - -publishing { - publications { - mavenJava(MavenPublication) { - from(components.java) - - pom { - name = 'kravis' - description = 'kravis is a Kotlin wrapper around ggplot2 to enable data visualization on the JVM' - url = 'https://github.com/holgerbrandl/kravis' - licenses { - license { - name = 'BSD-2' - url = 'https://github.com/holgerbrandl/kravis/blob/master/LICENSE.txt' - } - } - developers { - developer { - id = 'holgerbrandl' - name = 'Holger Brandl' - email = 'holgerbrandl@gmail.com' - } - } - scm { - connection = 'scm:git:github.com/holgerbrandl/kravis.git' - developerConnection = 'scm:git:ssh://github.com/holgerbrandl/kravis.git' - url = 'https://github.com/holgerbrandl/kravis.git' - } - } - } - } -} - - -nexusPublishing { - repositories { - sonatype { - snapshotRepositoryUrl = uri(project.findProperty("sonatypeStagingProfileId") ?: 'not_defined') - username = project.findProperty("ossrhUsername") ?: 'not_defined' - password = project.findProperty("ossrhPassword") ?: 'not_defined' - } - } -} - -signing { - sign publishing.publications.mavenJava -} - diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..8cf1034 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,92 @@ +plugins { + kotlin("jvm") version "2.0.21" + `maven-publish` + signing + + id("io.github.gradle-nexus.publish-plugin") version "1.2.0" + id("org.jetbrains.kotlin.jupyter.api") version "0.12.0-285" +} + + + +group = "com.github.holgerbrandl" +version = "1.0" + + +repositories { + mavenCentral() + mavenLocal() +} + +dependencies { + compileOnly("org.jetbrains.kotlin:kotlin-reflect:2.0.21") + + api("org.jetbrains.kotlinx:dataframe-core:0.14.1") + api("com.github.holgerbrandl:kdfutils:1.4.0") + api("org.apache.commons:commons-math3:3.6.1") + + implementation("org.rosuda.REngine:REngine:2.1.0") + implementation("org.rosuda.REngine:Rserve:1.8.1") + + testImplementation("junit:junit:4.13.1") + testImplementation("io.kotest:kotest-assertions-core:5.0.3") + testImplementation("org.jetbrains.kotlin:kotlin-script-runtime:2.0.21") +} + +tasks.processJupyterApiResources { + libraryProducers = listOf("kravis.device.jupyter.JupyterIntegration") +} + +tasks.javadoc { + exclude("**/PlotResultPanel.java") +} + +java { + withJavadocJar() + withSourcesJar() +} + +publishing { + publications { + create("mavenJava") { + from(components["java"]) + pom { + name.set("kravis") + description.set("kravis is a Kotlin wrapper around ggplot2 to enable data visualization on the JVM") + url.set("https://github.com/holgerbrandl/kravis") + licenses { + license { + name.set("BSD-2") + url.set("https://github.com/holgerbrandl/kravis/blob/master/LICENSE.txt") + } + } + developers { + developer { + id.set("holgerbrandl") + name.set("Holger Brandl") + email.set("holgerbrandl@gmail.com") + } + } + scm { + connection.set("scm:git:github.com/holgerbrandl/kravis.git") + developerConnection.set("scm:git:ssh://github.com/holgerbrandl/kravis.git") + url.set("https://github.com/holgerbrandl/kravis.git") + } + } + } + } +} + +nexusPublishing { + repositories { + sonatype { + snapshotRepositoryUrl.set(uri(project.findProperty("sonatypeStagingProfileId") ?: "not_defined")) + username.set(project.findProperty("ossrhUsername")?.toString() ?: "not_defined") + password.set(project.findProperty("ossrhPassword")?.toString() ?: "not_defined") + } + } +} + +signing { + sign(publishing.publications["mavenJava"]) +} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 84a0b92..d642e7f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/modules/kravis-javafx/build.gradle.kts b/modules/kravis-javafx/build.gradle.kts index d99d81c..6a7395c 100644 --- a/modules/kravis-javafx/build.gradle.kts +++ b/modules/kravis-javafx/build.gradle.kts @@ -18,6 +18,7 @@ version = "0.5-SNAPSHOT" repositories { mavenCentral() + mavenLocal() } dependencies { diff --git a/settings.gradle b/settings.gradle.kts similarity index 54% rename from settings.gradle rename to settings.gradle.kts index 8a61b57..f2d86b3 100644 --- a/settings.gradle +++ b/settings.gradle.kts @@ -1,3 +1,3 @@ -rootProject.name = 'kravis' +rootProject.name = "kravis" include(":modules:kravis-javafx") \ No newline at end of file diff --git a/src/main/kotlin/kravis/IteratorApi.kt b/src/main/kotlin/kravis/IteratorApi.kt index 109b839..3adc3ea 100644 --- a/src/main/kotlin/kravis/IteratorApi.kt +++ b/src/main/kotlin/kravis/IteratorApi.kt @@ -1,7 +1,6 @@ package kravis -import com.github.holgerbrandl.kdfutils.toKotlinDF -import krangl.deparseRecords +import kravis.util.deparseRecords import org.jetbrains.kotlinx.dataframe.datasets.sleepData import org.jetbrains.kotlinx.dataframe.datasets.sleepPatterns import skipNull @@ -33,7 +32,7 @@ inline fun Iterable.plot(vararg aes2data: Pair Iterable.plot( name to deparseFormula } - val deparsedReceiver = deparseRecords(*deparseFormulae.toTypedArray()).toKotlinDF() + val deparsedReceiver = deparseRecords(*deparseFormulae.toTypedArray()) // build new mapping diff --git a/src/test/kotlin/kravis/ggplot/AbstractSvgPlotRegression.kt b/src/test/kotlin/kravis/ggplot/AbstractSvgPlotRegression.kt index 3759508..53479d9 100644 --- a/src/test/kotlin/kravis/ggplot/AbstractSvgPlotRegression.kt +++ b/src/test/kotlin/kravis/ggplot/AbstractSvgPlotRegression.kt @@ -89,8 +89,8 @@ abstract class AbstractSvgPlotRegression { fun setup() { // SessionPrefs.RENDER_BACKEND = RserveEngine() // SessionPrefs.RENDER_BACKEND = Docker("holgerbrandl/kravis_core:3.5.1") -// SessionPrefs.RENDER_BACKEND = LocalR() - SessionPrefs.RENDER_BACKEND = Docker("kravis_test") + SessionPrefs.RENDER_BACKEND = LocalR() +// SessionPrefs.RENDER_BACKEND = Docker("kravis_test") } } diff --git a/src/test/kotlin/kravis/ggplot/CoreRegressions.kt b/src/test/kotlin/kravis/ggplot/CoreRegressions.kt index ce5eb0a..b144266 100644 --- a/src/test/kotlin/kravis/ggplot/CoreRegressions.kt +++ b/src/test/kotlin/kravis/ggplot/CoreRegressions.kt @@ -7,6 +7,7 @@ import kravis.demo.IrisData.SepalWidth import kravis.nshelper.plot import kravis.plot import org.jetbrains.kotlinx.dataframe.api.add +import org.jetbrains.kotlinx.dataframe.api.aggregate import org.jetbrains.kotlinx.dataframe.api.groupBy import org.jetbrains.kotlinx.dataframe.api.mean import org.jetbrains.kotlinx.dataframe.datasets.irisData diff --git a/src/test/kotlin/kravis/ggplot/GeomRegressions.kt b/src/test/kotlin/kravis/ggplot/GeomRegressions.kt index a37205c..b6825e8 100644 --- a/src/test/kotlin/kravis/ggplot/GeomRegressions.kt +++ b/src/test/kotlin/kravis/ggplot/GeomRegressions.kt @@ -16,7 +16,6 @@ import org.junit.Test import java.io.File -@Suppress("UNUSED_EXPRESSION") /** * @author Holger Brandl */ diff --git a/src/test/kotlin/kravis/samples/ExtractorPlots.kt b/src/test/kotlin/kravis/samples/ExtractorPlots.kt index c673aeb..9654795 100644 --- a/src/test/kotlin/kravis/samples/ExtractorPlots.kt +++ b/src/test/kotlin/kravis/samples/ExtractorPlots.kt @@ -1,11 +1,11 @@ package kravis.samples -import krangl.SleepPattern import kravis.plot import org.jetbrains.kotlinx.dataframe.api.head import org.jetbrains.kotlinx.dataframe.api.print import org.jetbrains.kotlinx.dataframe.api.toDataFrame import org.jetbrains.kotlinx.dataframe.api.toListOf +import org.jetbrains.kotlinx.dataframe.datasets.SleepPattern import org.jetbrains.kotlinx.dataframe.datasets.sleepData internal object ExtractorPlots { diff --git a/src/test/kotlin/kravis/samples/SleepPatternsExample.kt b/src/test/kotlin/kravis/samples/SleepPatternsExample.kt index b34984b..9320cc5 100644 --- a/src/test/kotlin/kravis/samples/SleepPatternsExample.kt +++ b/src/test/kotlin/kravis/samples/SleepPatternsExample.kt @@ -1,8 +1,10 @@ package kravis.samples import kravis.GGPlot +import kravis.SessionPrefs import kravis.geomPoint import kravis.plot +import kravis.render.LocalR import org.jetbrains.kotlinx.dataframe.datasets.SleepPattern import org.jetbrains.kotlinx.dataframe.datasets.sleepPatterns import kotlin.reflect.KProperty0 @@ -11,7 +13,7 @@ internal object SleepPatternsExample { @JvmStatic fun main(args: Array) { - + SessionPrefs.RENDER_BACKEND = LocalR() // extractor lambda sleepPatterns.plot(