title: Scala SBT - sbt-native-packager, how to specify custom stage directory
body: <p>How can I specify custom staging directory for multi-project configuration? I'm using <code>sbt-native-packager</code></p>
  
  <p>Below is the sketch of my multi module configuration. When I stage this project (<code>sbt stage</code>) the files are written to </p>
  
  <pre><code>common/target/universal/stage
  app1/target/universal/stage
  app2/target/universal/stage
  </code></pre>
  
  <p>I wan to pass an env variable <code>stageSuffix</code> like this: <code>sbt stage -DstageSuffix=XYZ</code>. This variable should make it stage the project to the following directories:</p>
  
  <pre><code>common/target/universal/stage-XYZ
  app1/target/universal/stage-XYZ
  app2/target/universal/stage-XYZ
  </code></pre>
  
  <p>I've tried modifying <code>stagingDirectory</code> in <code>commonSettings</code>, but it doesn't quite work, I'm getting errors like "References to undefined settings". </p>
  
  <p>How can I make this work?</p>
  
  <pre><code>val stageSuffix = sys.props.getOrElse("stageSuffix", ".")
  
  val commonSettings = Seq(
    stagingDirectory := stagingDirectory.value / stageSuffix, // this makes it fail
    libraryDependencies ++= Seq(...))
  
  val common = project.in(file("common"))
    .enablePlugins(JavaAppPackaging)
    .settings(commonSettings: _*)
  
  val app1 = project.in(file("app1"))
    .enablePlugins(JavaAppPackaging)
    .settings(mainClass in Compile := Some("app1.Main"))
    .dependsOn(common)
    .settings(commonSettings: _*)
    .settings(libraryDependencies ++= Seq(...))
  
  val app2 = project.in(file("app2"))
    .enablePlugins(JavaAppPackaging)
    .settings(mainClass in Compile := Some("app2.Main"))
    .dependsOn(common)
    .settings(commonSettings: _*)
    .settings(libraryDependencies ++= Seq(...))
  
  val main = project.in(file("."))
    .dependsOn(common, app1, app2)
    .aggregate(common, app1, app2)
    .settings(commonSettings: _*)
  </code></pre>