Skip to content

Commit

Permalink
Clean-up published artifacts (exclude slf4j and others). See #374.
Browse files Browse the repository at this point in the history
  • Loading branch information
alshan committed May 21, 2021
1 parent 1cbf283 commit 9f74be2
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 18 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -12,7 +12,7 @@ idea_ext_version=0.7

kotlinx_html_version=0.7.2

slf4j_version=1.7.28
slf4j_version=1.7.29

assertj_version=3.12.2
hamcrest_version=1.3
Expand Down
20 changes: 18 additions & 2 deletions jvm-package/jvm-publish-batik/build.gradle
Expand Up @@ -18,7 +18,6 @@ kotlin {
jvmMain {
dependencies {
compileOnly kotlin('stdlib-jdk8')
compileOnly "org.slf4j:slf4j-simple:$slf4j_version"

compileOnly project(':jvm-package:jvm-publish-common')
api project(':vis-svg-mapper-batik')
Expand Down Expand Up @@ -58,7 +57,21 @@ task jarLetsPlotJvmBatikClasses(type: ShadowJar) {
exclude '**/*.kotlin_module'
exclude '**/*.kotlin_builtins'

// exclude classes that duplicates `lets-plot-common.jar`
// Exclude classes that duplicates `lets-plot-common.jar`
// This jar should contain only packages:
// - jetbrains.datalore.vis.svgMapper.batik (:vis-svg-mapper-batik)
// - jetbrains.datalore.vis.swing (:vis-svg-mapper-batik, :vis-swing-common, :vis-swing-batik)
// - jetbrains.datalore.vis.demoUtils (:vis-demo-common, :vis-demo-common-batik)
exclude 'jetbrains/datalore/base/**/*'
exclude 'jetbrains/datalore/mapper/**/*'
exclude 'jetbrains/datalore/plot/**/*'
exclude 'jetbrains/datalore/vis/canvas/**/*'
exclude 'jetbrains/datalore/vis/canvasFigure/**/*'
exclude 'jetbrains/datalore/vis/svg/**/*'
exclude 'jetbrains/datalore/vis/svgToScene/**/*'
exclude 'jetbrains/datalore/vis/svgToString/**/*'

// Exclude other classes: either not needed or present in `lets-plot-common.jar`
exclude 'com/google/**/*'
exclude 'kotlin/**/*'
exclude 'kotlinx/**/*'
Expand All @@ -78,6 +91,9 @@ task jarLetsPlotJvmBatikClasses(type: ShadowJar) {
// exclude something java (?)
exclude 'java_cup/**/*' // Construction of Useful Parsers and is an LALR parser generator for Java.
exclude 'javax/**/*'

// lets-plot JavaFX renderer resource.
exclude 'svgMapper/**/*'
}

task jarLetsPlotJvmBatikSources(type: ShadowJar) {
Expand Down
18 changes: 7 additions & 11 deletions jvm-package/jvm-publish-common/build.gradle
Expand Up @@ -30,8 +30,6 @@ kotlin {
jvmMain {
dependencies {
implementation kotlin('stdlib-jdk8')
// Enable logging to console (make sure it is jared)
implementation "org.slf4j:slf4j-simple:$slf4j_version"
}
}
}
Expand Down Expand Up @@ -70,10 +68,8 @@ task jarLetsPlotJvmCommonClasses(type: ShadowJar) {
exclude 'org/intellij/lang/annotations/**/*'
exclude 'org/jetbrains/annotations/**/*'

// relocate 'com', 'shade.com'
// relocate 'org', 'shade.org'
// relocate 'kotlin', 'shade.kotlin'
// relocate 'mu', 'shade.mu'
// lets-plot JavaFX renderer resource.
exclude 'svgMapper/**/*'
}

task jarLetsPlotJvmCommonSources(type: ShadowJar) {
Expand Down Expand Up @@ -142,11 +138,11 @@ publishing {
dep.appendNode('groupId', 'io.github.microutils')
dep.appendNode('artifactId', 'kotlin-logging')
dep.appendNode('version', kotlinLogging_version)
// Console logging
dep = deps.appendNode('dependency')
dep.appendNode('groupId', 'org.slf4j')
dep.appendNode('artifactId', 'slf4j-simple')
dep.appendNode('version', slf4j_version)
// // Console logging
// dep = deps.appendNode('dependency')
// dep.appendNode('groupId', 'org.slf4j')
// dep.appendNode('artifactId', 'slf4j-simple')
// dep.appendNode('version', slf4j_version)
}
}
}
Expand Down
14 changes: 13 additions & 1 deletion jvm-package/jvm-publish-gis/build.gradle
Expand Up @@ -23,7 +23,6 @@ kotlin {
jvmMain {
dependencies {
compileOnly kotlin('stdlib-jdk8')
compileOnly "org.slf4j:slf4j-simple:$slf4j_version"

compileOnly project(':jvm-package:jvm-publish-common')
api project(':vis-canvas')
Expand Down Expand Up @@ -62,6 +61,19 @@ task jarLetsPlotGISClasses(type: ShadowJar) {
exclude 'org/intellij/lang/annotations/**/*'
exclude 'org/jetbrains/annotations/**/*'

// Exclude everything `jetbrains/datalore` except 'livemap'.
// All 'jetbrains/datalore' is already in 'common'.
exclude 'jetbrains/datalore/base/**/*'
exclude 'jetbrains/datalore/plot/base/**/*'
exclude 'jetbrains/datalore/plot/builder/**/*'
exclude 'jetbrains/datalore/plot/common/**/*'
exclude 'jetbrains/datalore/plot/config/**/*'
exclude 'jetbrains/datalore/plot/server/**/*'
exclude 'jetbrains/datalore/plot/testing/**/*'
exclude 'jetbrains/datalore/plot/*.class'
exclude 'jetbrains/datalore/vis/**/*'
exclude 'jetbrains/datalore/vis/**/*'

// lets-plot JavaFX renderer resource.
exclude 'svgMapper/**/*'

Expand Down
17 changes: 15 additions & 2 deletions jvm-package/jvm-publish-jfx/build.gradle
Expand Up @@ -18,7 +18,6 @@ kotlin {
jvmMain {
dependencies {
compileOnly kotlin('stdlib-jdk8')
compileOnly "org.slf4j:slf4j-simple:$slf4j_version"

compileOnly project(':jvm-package:jvm-publish-common')
api project(':vis-svg-mapper-jfx')
Expand Down Expand Up @@ -58,7 +57,21 @@ task jarLetsPlotJvmJfxClasses(type: ShadowJar) {
exclude '**/*.kotlin_module'
exclude '**/*.kotlin_builtins'

// exclude classes that duplicates `lets-plot-common.jar`
// Exclude classes that duplicates `lets-plot-common.jar`
// This jar should contain only packages:
// - jetbrains.datalore.vis.svgMapper.jfx (:vis-svg-mapper-jfx)
// - jetbrains.datalore.vis.swing (:vis-svg-mapper-jfx, :vis-swing-common, :vis-swing-jfx)
// - jetbrains.datalore.vis.demoUtils (:vis-demo-common, :vis-demo-common-jfx)
exclude 'jetbrains/datalore/base/**/*'
exclude 'jetbrains/datalore/mapper/**/*'
exclude 'jetbrains/datalore/plot/**/*'
exclude 'jetbrains/datalore/vis/canvas/**/*'
exclude 'jetbrains/datalore/vis/canvasFigure/**/*'
exclude 'jetbrains/datalore/vis/svg/**/*'
exclude 'jetbrains/datalore/vis/svgToScene/**/*'
exclude 'jetbrains/datalore/vis/svgToString/**/*'

// Exclude other classes: either not needed or present in `lets-plot-common.jar`
exclude 'com/google/**/*'
exclude 'kotlin/**/*'
exclude 'kotlinx/**/*'
Expand Down
1 change: 1 addition & 0 deletions livemap-demo/build.gradle
Expand Up @@ -73,6 +73,7 @@ kotlin {
compileOnly "io.github.microutils:kotlin-logging-jvm:$kotlinLogging_version"
implementation "org.jetbrains.kotlinx:kotlinx-html-jvm:${kotlinx_html_version}"
implementation "io.ktor:ktor-client-cio:$ktor_version"
implementation "org.slf4j:slf4j-simple:$slf4j_version" // Enable logging to console
}
}
// jvmMain {
Expand Down
2 changes: 1 addition & 1 deletion plot-demo-common/build.gradle
Expand Up @@ -37,7 +37,7 @@ kotlin {
dependencies {
implementation kotlin('stdlib-jdk8')
compileOnly "io.github.microutils:kotlin-logging-jvm:$kotlinLogging_version"
implementation "org.slf4j:slf4j-simple:$slf4j_version" // Enable logging to console
// implementation "org.slf4j:slf4j-simple:$slf4j_version" // Enable logging to console
}
}
jvmMain {
Expand Down

0 comments on commit 9f74be2

Please sign in to comment.