From b4835db7010d03398620e39038a7f0b2293d6950 Mon Sep 17 00:00:00 2001 From: breandan Date: Wed, 2 Sep 2020 22:59:05 -0400 Subject: [PATCH] gradlify jupyter build, default to mavenLocal --- README.md | 2 +- build.gradle.kts | 4 ++-- core/build.gradle.kts | 4 +++- core/kotlingrad.json | 3 ++- .../kotlingrad/utils/codegen/NotebookGen.kt | 1 + kaliningraph | 2 +- samples/build.gradle.kts | 8 +++++++- settings.gradle.kts | 13 +++---------- 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 98c7010e..71bc7448 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ dependencies { [First install](https://github.com/kotlin/kotlin-jupyter#installation) the Kotlin Jupyter kernel, then run the `jupyterInstall` task to install the library descriptor: ``` -./gradlew jupyterInstall [-Path=~/.jupyter_kotlin/libraries] +./gradlew jupyterRun ``` To access Kotlin∇'s notebook support, use the following line magic: diff --git a/build.gradle.kts b/build.gradle.kts index e0b3fc65..bc1c39f8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,8 +28,8 @@ idea.module { } subprojects { - group = "edu.umontreal" - version = "0.3.4" + group = "com.github.breandan" + version = "0.3.5" apply(plugin = "org.jetbrains.kotlin.jvm") diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 8a9e9c12..728d5302 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -6,7 +6,7 @@ dependencies { implementation(kotlin("stdlib")) implementation(kotlin("stdlib-jdk8")) // implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.0") - api("com.github.breandan:kaliningraph:0.1.0") + api("com.github.breandan:kaliningraph") // Mathematical libraries implementation("ch.obermuhlner:big-math:2.3.0") @@ -48,6 +48,7 @@ tasks { val jupyterInstall by registering(Copy::class) { dependsOn(genNotebookJSON) + dependsOn("publishToMavenLocal") val installPath = findProperty("ath") ?: installPathLocal doFirst { mkdir(installPath) } from(file("kotlingrad.json")) @@ -62,6 +63,7 @@ val fatJar by tasks.creating(Jar::class) { attributes["Implementation-Title"] = "kotlingrad" attributes["Implementation-Version"] = archiveVersion } + setExcludes(listOf("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")) from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) with(tasks.jar.get() as CopySpec) } diff --git a/core/kotlingrad.json b/core/kotlingrad.json index f12b2978..1aa4dc5b 100644 --- a/core/kotlingrad.json +++ b/core/kotlingrad.json @@ -1,10 +1,11 @@ { "link": "https://github.com/breandan/kotlingrad", "repositories": [ + "*mavenLocal", "https://jitpack.io" ], "dependencies": [ - "com.github.breandan:kotlingrad:0.3.4" + "com.github.breandan:kotlingrad:0.3.5" ], "imports": [ "edu.umontreal.kotlingrad.experimental.*", diff --git a/core/src/main/kotlin/edu/umontreal/kotlingrad/utils/codegen/NotebookGen.kt b/core/src/main/kotlin/edu/umontreal/kotlingrad/utils/codegen/NotebookGen.kt index c9884810..4f89e4cc 100644 --- a/core/src/main/kotlin/edu/umontreal/kotlingrad/utils/codegen/NotebookGen.kt +++ b/core/src/main/kotlin/edu/umontreal/kotlingrad/utils/codegen/NotebookGen.kt @@ -8,6 +8,7 @@ fun main(args: Array) = """{ "link": "https://github.com/breandan/kotlingrad", "repositories": [ + "*mavenLocal", "https://jitpack.io" ], "dependencies": [ diff --git a/kaliningraph b/kaliningraph index 063d1872..73e840ec 160000 --- a/kaliningraph +++ b/kaliningraph @@ -1 +1 @@ -Subproject commit 063d18721558da9b12871cd579b0a37d1168699f +Subproject commit 73e840ec0a80da660db8b9493ecf2886ee367bb6 diff --git a/samples/build.gradle.kts b/samples/build.gradle.kts index 0357f28e..1fca729c 100644 --- a/samples/build.gradle.kts +++ b/samples/build.gradle.kts @@ -13,7 +13,7 @@ graal { } dependencies { - implementation(project(":core")) + implementation(project(":kotlingrad")) implementation(kotlin("stdlib-jdk8")) // Graphical libraries @@ -36,6 +36,12 @@ tasks { } } + val jupyterRun by creating(Exec::class) { + dependsOn(":kotlingrad:jupyterInstall") + dependsOn(gradle.includedBuild("kaliningraph").task(":jupyterInstall")) + commandLine("jupyter", "notebook", "--notebook-dir=notebooks") + } + test { dependsOn("ScalarDemo", "MatrixDemo", "VectorDemo", "VariableCapture") } diff --git a/settings.gradle.kts b/settings.gradle.kts index a7240274..20590525 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,3 @@ -//import de.fayard.dependencies.bootstrapRefreshVersionsAndDependencies - include("core", "samples") includeBuild("kaliningraph") { dependencySubstitution { @@ -7,14 +5,9 @@ includeBuild("kaliningraph") { } } +project(":core").name = "kotlingrad" + pluginManagement.repositories { mavenCentral() gradlePluginPortal() -} - -//buildscript { -// repositories { gradlePluginPortal() } -// dependencies.classpath("de.fayard:dependencies:0.5.8") -//} -// -//bootstrapRefreshVersionsAndDependencies() +} \ No newline at end of file