From 2a1c59d0fb8574e025495f7bdf40cb0629f6474e Mon Sep 17 00:00:00 2001 From: "breandan.considine" Date: Tue, 25 Aug 2020 07:01:24 -0400 Subject: [PATCH] bundle transitive deps in a fatJar --- build.gradle.kts | 56 ++++++++++++++++++++++++++++++++++++++--------- kaliningraph.json | 22 +++---------------- 2 files changed, 49 insertions(+), 29 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8a9f6864..84ddacc0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,13 +1,12 @@ import org.gradle.api.JavaVersion.VERSION_1_8 plugins { - java - maven + `maven-publish` kotlin("jvm") version "1.4.0" } group = "edu.mcgill" -version = "0.0.8" +version = "0.0.9" repositories { mavenCentral() @@ -19,27 +18,26 @@ repositories { dependencies { implementation(kotlin("stdlib-jdk8")) - testImplementation("junit", "junit", "4.13") val ejmlVersion = "0.39" - implementation("org.ejml:ejml-kotlin:$ejmlVersion") - implementation("org.ejml:ejml-all:$ejmlVersion") - implementation("guru.nidi:graphviz-kotlin:0.17.0") + api("org.ejml:ejml-kotlin:$ejmlVersion") + api("org.ejml:ejml-all:$ejmlVersion") + api("guru.nidi:graphviz-kotlin:0.17.0") + api("io.github.vovak.astminer:astminer:0.5") + implementation("org.apache.commons:commons-rng-examples-sampling:1.3") implementation("com.github.kwebio:kweb-core:0.7.20") implementation("org.slf4j:slf4j-simple:1.7.30") implementation("com.github.breandan:tensor:master-SNAPSHOT") - implementation("io.github.vovak.astminer:astminer:0.5") // val kmathVersion by extra { "0.1.4-dev-8" } // implementation("scientifik:kmath-core:$kmathVersion") // implementation("scientifik:kmath-ast:$kmathVersion") // implementation("scientifik:kmath-prob:$kmathVersion") + testImplementation("junit", "junit", "4.13") testImplementation("com.github.ajalt:clikt:2.6.0") - testImplementation("com.redislabs:jredisgraph:2.0.2") testImplementation("io.lacuna:bifurcan:0.2.0-alpha1") - testImplementation("org.junit.jupiter:junit-jupiter:5.6.2") val jgraphtVersion by extra { "1.5.0" } testImplementation("org.jgrapht:jgrapht-core:$jgraphtVersion") @@ -89,4 +87,42 @@ tasks { into(installPath) doLast { logger.info("Kaliningraph notebook support was installed in: $installPath") } } +} + +val fatJar by tasks.creating(Jar::class) { + archiveBaseName.set("${project.name}-fat") + manifest { + attributes["Implementation-Title"] = "kaliningraph" + attributes["Implementation-Version"] = archiveVersion + } + from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) + with(tasks.jar.get() as CopySpec) +} + +publishing { + publications.create("default") { + artifact(fatJar) + pom { + name.set("Kaliningraph") + url.set("https://github.com/breandan/kaliningraph") + licenses { + license { + name.set("The Apache Software License, Version 1.0") + url.set("http://www.apache.org/licenses/LICENSE-3.0.txt") + distribution.set("repo") + } + } + developers { + developer { + id.set("Breandan Considine") + name.set("Breandan Considine") + email.set("bre@ndan.co") + organization.set("McGill University") + } + } + scm { + url.set("https://github.com/breandan/kaliningraph") + } + } + } } \ No newline at end of file diff --git a/kaliningraph.json b/kaliningraph.json index f75a72d0..d24773a5 100644 --- a/kaliningraph.json +++ b/kaliningraph.json @@ -1,29 +1,13 @@ { "properties": { - "kaliningraphVersion": "0.0.8", - "graphvizVersion": "0.16.0", - "jgraphtVersion": "1.4.0", - "ejmlVersion": "0.39", - "mathVersion": "3.6.1", - "tinkerpopVersion": "3.4.6", - "astminerVersion": "0.5" + "kaliningraphVersion": "0.0.9" }, "link": "https://github.com/breandan/kaliningraph", "repositories": [ - "https://jitpack.io", - "https://dl.bintray.com/egor-bogomolov/astminer" + "https://jitpack.io" ], "dependencies": [ - "com.github.breandan:kaliningraph:$kaliningraphVersion", - "guru.nidi:graphviz-kotlin:$graphvizVersion", - "org.ejml:ejml-kotlin:$ejmlVersion", - "org.ejml:ejml-all:$ejmlVersion", - "org.apache.commons:commons-math3:$mathVersion", - "org.jgrapht:jgrapht-core:$jgraphtVersion", - "org.jgrapht:jgrapht-ext:$jgraphtVersion", - "org.apache.tinkerpop:gremlin-core:$tinkerpopVersion", - "org.apache.tinkerpop:tinkergraph-gremlin:$tinkerpopVersion", - "io.github.vovak.astminer:astminer:$astminerVersion" + "com.github.breandan:kaliningraph:$kaliningraphVersion" ], "imports": [ "edu.mcgill.kaliningraph.*",