Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reproduce issue 475 #511

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/sbt-test/sbt-assembly/large-dep/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import sbtassembly.AssemblyPlugin.autoImport._


lazy val root = (project in file(".")).
settings(
version := "0.1.0",
scalaVersion := "2.12.18",
libraryDependencies ++= Seq(
"org.apache.calcite" % "calcite-core" % "1.36.0"
),
assembly / assemblyShadeRules := Seq(
// shade guava for calcite
ShadeRule.rename("com.google.guava.**" -> s"new_guava.com.google.guava.@1").inAll,
),
assembly / mainClass := Some("foo.Hello"),
assembly / assemblyJarName := "foo.jar",
TaskKey[Unit]("check") := {
val outputJar = (crossTarget.value / "foo.jar").toString

val process = sys.process.Process("java", Seq("-jar", outputJar))
val out = (process!!)
if (out.trim != "hello") sys.error("unexpected output: " + out)


val process2 = sys.process.Process("ls", Seq("-lh", outputJar))
println(process2!!)

()
}
)
7 changes: 7 additions & 0 deletions src/sbt-test/sbt-assembly/large-dep/project/assembly.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
val pluginVersion = System.getProperty("plugin.version")
if(pluginVersion == null)
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
else addSbtPlugin("com.eed3si9n" % "sbt-assembly" % pluginVersion)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.7.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package foo

object Hello extends App {
println("hello")
}
3 changes: 3 additions & 0 deletions src/sbt-test/sbt-assembly/large-dep/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> assembly

> check
Loading