Skip to content

Commit 43e46f0

Browse files
Merge pull request #81 from alexarchambault/shade-argonaut
Shade argonaut-shapeless
2 parents 0bb92b6 + a6685e3 commit 43e46f0

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

build.sbt

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,28 @@ lazy val `joda-time` = project
3737
)
3838

3939
lazy val render = crossProject(JVMPlatform, JSPlatform)
40+
.jvmConfigure(_.enablePlugins(ShadingPlugin))
4041
.dependsOn(core)
42+
.jvmSettings(
43+
shading("plotly.internals.shaded")
44+
)
4145
.settings(
4246
shared,
43-
plotlyPrefix,
44-
libraryDependencies += Deps.argonautShapeless.value
47+
plotlyPrefix
4548
)
4649
.jvmSettings(
4750
libraryDependencies ++= Seq(
51+
Deps.argonautShapeless.value % "shaded",
52+
// depending on that one so that it doesn't get shaded
53+
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
4854
WebDeps.plotlyJs,
4955
Deps.scalaTest % "test"
5056
),
57+
shadeNamespaces ++= Set(
58+
"argonaut",
59+
"macrocompat",
60+
"shapeless"
61+
),
5162
resourceGenerators.in(Compile) += Def.task {
5263
import sys.process._
5364

@@ -73,7 +84,10 @@ lazy val render = crossProject(JVMPlatform, JSPlatform)
7384
}
7485
)
7586
.jsSettings(
76-
libraryDependencies += Deps.scalajsDom.value
87+
libraryDependencies ++= Seq(
88+
Deps.argonautShapeless.value,
89+
Deps.scalajsDom.value
90+
)
7791
)
7892

7993
lazy val renderJvm = render.jvm

project/Settings.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
import com.typesafe.sbt.pgp._
3+
import coursier.ShadingPlugin.autoImport._
24
import sbt._
35
import sbt.Keys._
46

@@ -150,4 +152,17 @@ object Settings {
150152
}
151153
}
152154

155+
def shading(namespace: String) =
156+
inConfig(_root_.coursier.ShadingPlugin.Shading)(PgpSettings.projectSettings) ++
157+
// Why does this have to be repeated here?
158+
// Can't figure out why configuration gets lost without this in particular...
159+
_root_.coursier.ShadingPlugin.projectSettings ++
160+
Seq(
161+
shadingNamespace := namespace,
162+
publish := publish.in(Shading).value,
163+
publishLocal := publishLocal.in(Shading).value,
164+
PgpKeys.publishSigned := PgpKeys.publishSigned.in(Shading).value,
165+
PgpKeys.publishLocalSigned := PgpKeys.publishLocalSigned.in(Shading).value
166+
)
167+
153168
}

project/plugins.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.27")
33
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
44
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2")
55
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.3.0")
6+
addSbtPlugin("io.get-coursier" % "sbt-shading" % sbtCoursierVersion)
67

78
addSbtCoursier

project/project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.1.0-M7")
1+
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.1.0-M14-2")

0 commit comments

Comments
 (0)