File tree Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 11target /
2+ .bsp /
Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ lazy val interface = project
8585 proguardInputs.in(Proguard ) := proguardInputs.in(Proguard ).value.filter(f => ! f.isDirectory || f.getName != " classes" ),
8686 proguardInputs.in(Proguard ) += packageBin.in(Compile ).value,
8787
88+ proguardBinaryDeps.in(Proguard ) := Settings .getAllBinaryDeps.value,
89+ proguardBinaryDeps.in(Proguard ) ++= Settings .rtJarOpt.toSeq, // seems needed with sbt 1.4.0
90+
8891 proguardInputFilter.in(Proguard ) := { file =>
8992 file.name match {
9093 case n if n.startsWith(" interface" ) => None // keep META-INF from main JAR
Original file line number Diff line number Diff line change @@ -35,4 +35,22 @@ object Settings {
3535 }
3636 )
3737
38+ // https://github.com/sbt/sbt-proguard/blob/2c502f961245a18677ef2af4220a39e7edf2f996/src/main/scala-sbt-1.0/com/typesafe/sbt/proguard/Sbt10Compat.scala#L8-L13
39+ // but sbt 1.4-compatible
40+ val getAllBinaryDeps : Def .Initialize [Task [Seq [java.io.File ]]] = Def .task {
41+ import sbt .internal .inc .Analysis
42+ val converter = fileConverter.value
43+ compile.in(Compile ).value match {
44+ case analysis : Analysis =>
45+ analysis.relations.allLibraryDeps.toSeq.map(converter.toPath(_).toFile)
46+ }
47+ }
48+
49+ lazy val rtJarOpt = sys.props.get(" sun.boot.class.path" )
50+ .toSeq
51+ .flatMap(_.split(java.io.File .pathSeparator).toSeq)
52+ .map(java.nio.file.Paths .get(_))
53+ .find(_.endsWith(" rt.jar" ))
54+ .map(_.toFile)
55+
3856}
Original file line number Diff line number Diff line change 1- sbt.version =1.3.13
1+ sbt.version =1.4.1
You can’t perform that action at this time.
0 commit comments