diff --git a/main/Keys.scala b/main/Keys.scala index e5612bbf6..1a195a303 100644 --- a/main/Keys.scala +++ b/main/Keys.scala @@ -139,6 +139,7 @@ object Keys val artifactClassifier = SettingKey[Option[String]]("artifact-classifier", "Sets the classifier used by the default artifact definition.") val artifactName = SettingKey[(String, ModuleID, Artifact) => String]("artifact-name", "Function that produces the artifact name from its definition.") val mappings = TaskKey[Seq[(File,String)]]("mappings", "Defines the mappings from a file to a path, used by packaging, for example.") + val fileMappings = TaskKey[Seq[(File,File)]]("file-mappings", "Defines the mappings from a file to a file, used for copying files, for example.") // Run Keys val selectMainClass = TaskKey[Option[String]]("select-main-class", "Selects the main class to run.") diff --git a/main/Project.scala b/main/Project.scala index 196810d24..36ce12f8c 100644 --- a/main/Project.scala +++ b/main/Project.scala @@ -83,6 +83,13 @@ final case class Extracted(structure: BuildStructure, session: SessionSettings, value getOrElse error(Project.display(ScopedKey(scope, key)) + " is undefined.") private def getOrError[T](scope: Scope, key: AttributeKey[T]): T = structure.data.get(scope, key) getOrElse error(Project.display(ScopedKey(scope, key)) + " is undefined.") + + def append(settings: Seq[Setting[_]], state: State): State = + { + val appendSettings = Load.transformSettings(Load.projectScope(currentRef), currentRef.build, rootProject, settings) + val newStructure = Load.reapply(session.original ++ appendSettings, structure) + Project.setProject(session, newStructure, state) + } } sealed trait ClasspathDep[PR <: ProjectReference] { def project: PR; def configuration: Option[String] }