Skip to content
This repository
Browse code

Fixes #594. Global plugin products weren't being included on Compile …

…classpath of build definition project.
  • Loading branch information...
commit 9bf54056215bd12ef445d79301b81b87c855bc0f 1 parent 52b7dcc
Mark Harrah authored

Showing 1 changed file with 7 additions and 3 deletions. Show diff stats Hide diff stats

  1. +7 3 main/GlobalPlugin.scala
10 main/GlobalPlugin.scala
@@ -4,7 +4,7 @@ package sbt
4 4 import Project._
5 5 import Scoped._
6 6 import Keys._
7   - import Configurations.Runtime
  7 + import Configurations.{Compile,Runtime}
8 8 import java.io.File
9 9 import org.apache.ivy.core.module.{descriptor, id}
10 10 import descriptor.ModuleDescriptor, id.ModuleRevisionId
@@ -19,8 +19,12 @@ object GlobalPlugin
19 19 projectDescriptors ~= { _ ++ gp.descriptors },
20 20 projectDependencies ++= gp.projectID +: gp.dependencies,
21 21 resolvers <<= resolvers { rs => (rs ++ gp.resolvers).distinct },
22   - internalDependencyClasspath in Runtime ~= { prev => (prev ++ gp.internalClasspath).distinct }
  22 + // TODO: these shouldn't be required (but are): the project* settings above should take care of this
  23 + injectInternalClasspath(Runtime, gp.internalClasspath),
  24 + injectInternalClasspath(Compile, gp.internalClasspath)
23 25 )
  26 + private[this] def injectInternalClasspath(config: Configuration, cp: Seq[Attributed[File]]): Setting[_] =
  27 + internalDependencyClasspath in config ~= { prev => (prev ++ cp).distinct }
24 28
25 29 def build(base: File, s: State, config: LoadBuildConfiguration): (BuildStructure, State) =
26 30 {
@@ -43,7 +47,7 @@ object GlobalPlugin
43 47 val taskInit = (projectID, projectDependencies, projectDescriptors, resolvers, fullClasspath in Runtime, internalDependencyClasspath in Runtime, exportedProducts in Runtime, ivyModule) map {
44 48 (pid, pdeps, pdescs, rs, cp, intcp, prods, mod) =>
45 49 val depMap = pdescs + mod.dependencyMapping(state.log)
46   - GlobalPluginData(pid, pdeps, depMap, rs, cp, prods ++ intcp)
  50 + GlobalPluginData(pid, pdeps, depMap, rs, cp, (prods ++ intcp).distinct)
47 51 }
48 52 val resolvedTaskInit = taskInit mapReferenced Project.mapScope(Scope replaceThis p)
49 53 val task = resolvedTaskInit evaluate data

0 comments on commit 9bf5405

Please sign in to comment.
Something went wrong with that request. Please try again.