From 36d2394208db0fb9dd9571779ff60837d134000d Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Fri, 10 Jun 2011 07:48:54 -0400 Subject: [PATCH] implements #41 --- main/Defaults.scala | 10 ++++++---- main/Keys.scala | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/main/Defaults.scala b/main/Defaults.scala index 9c27b88ae..e494a74ee 100644 --- a/main/Defaults.scala +++ b/main/Defaults.scala @@ -573,7 +573,7 @@ object Classpaths if(isPlugin) sr +: base else base }, offline in GlobalScope :== false, - moduleID <<= normalizedName.identity, + moduleName <<= normalizedName.identity, defaultConfiguration in GlobalScope :== Some(Configurations.Compile), defaultConfigurationMapping in GlobalScope <<= defaultConfiguration{ case Some(d) => "*->" + d.name; case None => "*->*" }, ivyPaths <<= (baseDirectory, appConfiguration) { (base, app) => new IvyPaths(base, bootIvyHome(app)) }, @@ -594,8 +594,8 @@ object Classpaths publishTo in GlobalScope :== None, artifactPath in makePom <<= artifactPathSetting(artifact in makePom), publishArtifact in makePom <<= publishMavenStyle.identity, - artifact in makePom <<= moduleID( name => Artifact(name, "pom", "pom") ), - projectID <<= (organization,moduleID,version,artifacts,crossPaths){ (org,module,version,as,crossEnabled) => + artifact in makePom <<= moduleName( name => Artifact(name, "pom", "pom") ), + projectID <<= (organization,moduleName,version,artifacts,crossPaths){ (org,module,version,as,crossEnabled) => ModuleID(org, module, version).cross(crossEnabled).artifacts(as : _*) }, resolvers in GlobalScope :== Nil, @@ -833,7 +833,9 @@ object Classpaths import DependencyFilter._ def managedJars(config: Configuration, jarTypes: Set[String], up: UpdateReport): Classpath = - up.select( configuration = configurationFilter(config.name), artifact = artifactFilter(`type` = jarTypes) ) classpath; + up.filter( configurationFilter(config.name) && artifactFilter(`type` = jarTypes) ).toSeq.map { case (conf, module, art, file) => + Attributed(file)(AttributeMap.empty.put(artifact.key, art).put(moduleID.key, module).put(configuration.key, config)) + } distinct; def autoPlugins(report: UpdateReport): Seq[String] = { diff --git a/main/Keys.scala b/main/Keys.scala index f4a00c258..1efc528e8 100644 --- a/main/Keys.scala +++ b/main/Keys.scala @@ -217,8 +217,9 @@ object Keys val pomPostProcess = SettingKey[XNode => XNode]("pom-post-process", "Transforms the generated POM.") val pomIncludeRepository = SettingKey[MavenRepository => Boolean]("pom-include-repository", "Selects repositories to include in the generated POM.") - val moduleID = SettingKey[String]("module-id", "The name of the current module, used for dependency management.") + val moduleName = SettingKey[String]("module-name", "The name of the current module, used for dependency management.") val version = SettingKey[String]("version", "The version/revision of the current module.") + val moduleID = SettingKey[ModuleID]("module", "A dependency management descriptor. This is currently used for associating a ModuleID with a classpath entry.") val projectID = SettingKey[ModuleID]("project-id", "The dependency management descriptor for the current module.") val externalResolvers = TaskKey[Seq[Resolver]]("external-resolvers", "The external resolvers for automatically managed dependencies.") val resolvers = SettingKey[Seq[Resolver]]("resolvers", "The user-defined additional resolvers for automatically managed dependencies.")