scala - sbt-assembly does not pick up configuration specific settings -
i updating old 0.7.x build file tool sbt thankfully removed reference "simple" name in meantime.
something once worked, not longer. had different config entries platform specific assembly tasks. these include specific filters reason called assemblyexcludedjars instead of excludedjars, , specific jar names reason called assemblyjarname instead of jarname.
basically:
val foo = config("foo") extend compile lazy val assemblyfoo = taskkey[file]("assembly-foo") lazy val root = project(id = "root", base = file(".")) // .configs(foo) // needed? doesn't change .settings( inconfig(foo)(intask(assembly) { assemblyjarname := "wtf.jar" }), scalaversion := "2.11.7", assemblyfoo <<= assembly in foo ) now expect if run sbt assembly-foo or sbt foo:assembly, produce file wtf.jar. getting default root-assembly-0.1-snapshot.jar. same problem happens when try specify assemblyexcludedjars, ignored , still included.
if remove inconfig works:
lazy val root = project(id = "root", base = file(".")) .settings( intask(assembly) { assemblyjarname := "wtf.jar" }, scalaversion := "2.11.7", assemblyfoo <<= assembly in foo ) but cannot use different jar names different configurations (which whole point).
as described in blog post 1 of sbt's authors , author of sbt-assembly, should work. written in this stackoverflow question. example requires antique version of sbt-assembly (0.9.0 2013, before auto plugins etc.) , doesn't seem apply current versions.
if 1 defines new configuration, 1 has redefine (?) tasks 1 use. apparently sbt-assembly, means running baseassemblysettings:
val foo = config("foo") extend compile lazy val assemblyfoo = taskkey[file]("assembly-foo") lazy val root = project(id = "root", base = file(".")) .settings( inconfig(foo)(baseassemblysettings /* !!! */ ++ intask(assembly) { jarname := "wtf.jar" }), scalaversion := "2.11.7", assemblyfoo := (assembly in foo).value ) tested sbt 0.13.9 , sbt-assembly 0.14.1.
Comments
Post a Comment