Skip to content

Commit

Permalink
gradlify jupyter build, default to mavenLocal
Browse files Browse the repository at this point in the history
  • Loading branch information
breandan committed Sep 3, 2020
1 parent f47bc99 commit b4835db
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
4 changes: 3 additions & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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"))
Expand All @@ -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)
}
Expand Down
3 changes: 2 additions & 1 deletion core/kotlingrad.json
Original file line number Diff line number Diff line change
@@ -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.*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fun main(args: Array<String>) =
"""{
"link": "https://github.com/breandan/kotlingrad",
"repositories": [
"*mavenLocal",
"https://jitpack.io"
],
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion kaliningraph
8 changes: 7 additions & 1 deletion samples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ graal {
}

dependencies {
implementation(project(":core"))
implementation(project(":kotlingrad"))
implementation(kotlin("stdlib-jdk8"))

// Graphical libraries
Expand All @@ -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")
}
Expand Down
13 changes: 3 additions & 10 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
//import de.fayard.dependencies.bootstrapRefreshVersionsAndDependencies

include("core", "samples")
includeBuild("kaliningraph") {
dependencySubstitution {
substitute(module("com.github.breandan:kaliningraph")).with(project(":"))
}
}

project(":core").name = "kotlingrad"

pluginManagement.repositories {
mavenCentral()
gradlePluginPortal()
}

//buildscript {
// repositories { gradlePluginPortal() }
// dependencies.classpath("de.fayard:dependencies:0.5.8")
//}
//
//bootstrapRefreshVersionsAndDependencies()
}

0 comments on commit b4835db

Please sign in to comment.