Skip to content

Commit

Permalink
Fixup running scripted locally & add additional scala targets
Browse files Browse the repository at this point in the history
  • Loading branch information
ericdotdata committed Aug 23, 2021
1 parent 05924ba commit 859cf45
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ThisBuild / version := "0.15.1-SNAPSHOT"
ThisBuild / version := "1.0.1-SNAPSHOT"
ThisBuild / organization := "com.eed3si9n"

def scala212 = "2.12.8"
Expand Down
6 changes: 4 additions & 2 deletions src/sbt-test/caching/caching/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ lazy val root = (project in file(".")).
scalaVersion := "2.11.12",
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test",
libraryDependencies += "ch.qos.logback" % "logback-classic" % "0.9.29" % "runtime",
assemblyOption in assembly := (assemblyOption in assembly).value.copy(cacheOutput = true),
assemblyOption in assembly := (assemblyOption in assembly).value.copy(cacheUnzip = true),
assemblyOption in assembly ~= {
_.withCacheOutput(true)
.withCacheUnzip(true)
},
assemblyJarName in assembly := "foo.jar",
TaskKey[Seq[File]]("genresource") := {
val dirs = (unmanagedResourceDirectories in Compile).value
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/merging/mergefail/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ lazy val testmerge = (project in file(".")).
settings(
version := "0.1",
assemblyJarName in assembly := "foo.jar",
mergeStrategy in assembly := {
val old = (mergeStrategy in assembly).value
assemblyMergeStrategy in assembly := {
val old = (assemblyMergeStrategy in assembly).value

{
case _ => MergeStrategy.singleOrError
Expand Down
1 change: 1 addition & 0 deletions src/sbt-test/sbt-assembly/piecemeal/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ assembleArtifact in (ThisBuild, assemblyPackageDependency) := false
lazy val root = (project in file("."))
.settings(
name := "foo",
mainClass in assembly := Some("Main"),

// assembly / assemblyOption ~= {
// _.withIncludeScala(false)
Expand Down
6 changes: 6 additions & 0 deletions src/sbt-test/shading/jdk11/build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
scalaVersion := "2.12.7"

lazy val scala211 = "2.11.12"
lazy val scala212 = "2.12.14"
lazy val scala213 = "2.13.6"

crossScalaVersions in ThisBuild := List(scalaVersion.value, scala211, scala212, scala213)

assemblyShadeRules in assembly := Seq(
ShadeRule.rename("example.A" -> "example.C").inProject
)
2 changes: 1 addition & 1 deletion src/sbt-test/shading/jdk11/test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
> assembly
> +assembly
8 changes: 7 additions & 1 deletion src/sbt-test/shading/keeponly/build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
lazy val scala211 = "2.11.12"
lazy val scala212 = "2.12.14"
lazy val scala213 = "2.13.6"

scalaVersion := scala211
crossScalaVersions := List(scala211, scala212, scala213)

lazy val testkeep = (project in file(".")).
settings(
version := "0.1",
assemblyJarName in assembly := "foo.jar",
scalaVersion := "2.11.12",
assemblyShadeRules in assembly := Seq(
ShadeRule.keep("keep.**").inProject
),
Expand Down
6 changes: 4 additions & 2 deletions src/sbt-test/shading/keeponly/test
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# check if the file gets created
> assembly
> +assembly
$ exists target/scala-2.11/foo.jar
$ exists target/scala-2.12/foo.jar
$ exists target/scala-2.13/foo.jar

# check if it says hello
> check
> +check
11 changes: 9 additions & 2 deletions src/sbt-test/shading/scalasigannot/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ version in ThisBuild := "1.0-SNAPSHOT"
organization in ThisBuild := "scalasigannottest"
scalaVersion in ThisBuild := "2.13.1"

lazy val scala211 = "2.11.12"
lazy val scala212 = "2.12.14"
lazy val scala213 = "2.13.6"

crossScalaVersions in ThisBuild := List(scalaVersion.value, scala211, scala212, scala213)


val shadingSettings: Seq[Def.Setting[_]] = Seq(
assemblyShadeRules in assembly := Seq(
ShadeRule.rename(
"to.be.shaded.**" -> "shade.@1"
).inAll
),

assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false),
assemblyOption in assembly ~= { _.withIncludeScala(false) },
assemblyExcludedJars in assembly := {
val cp = (fullClasspath in assembly).value
cp.filterNot {p =>
Expand Down Expand Up @@ -48,6 +54,7 @@ lazy val root = project.in(file("."))
.settings(
Seq(
name := "scalasiggannottest",
mainClass in assembly := Some("scalasigannot.Main"),
libraryDependencies := Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value
),
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/shading/scalasigannot/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Run the main project

> run
> +root/run

0 comments on commit 859cf45

Please sign in to comment.