Skip to content
This repository
Browse code

set organization at higher scope for default project

  • Loading branch information...
commit e8fcdc07e8e52a6176fc3bb7c4a406f72bae34d7 1 parent 1488bf2
Mark Harrah authored

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. +5 2 main/Build.scala
7 main/Build.scala
@@ -10,8 +10,8 @@ package sbt
10 10 import complete.DefaultParsers.validID
11 11 import Compiler.Compilers
12 12 import Keys.{globalBaseDirectory, globalPluginsDirectory, globalSettingsDirectory, stagingDirectory, Streams}
  13 + import Keys.{name, organization, thisProject}
13 14 import Project.{ScopedKey, Setting}
14   - import Keys.{globalBaseDirectory, Streams}
15 15 import Scope.GlobalScope
16 16 import scala.annotation.tailrec
17 17
@@ -39,7 +39,10 @@ object Build
39 39 {
40 40 val default: Build = new Build { override def projectDefinitions(base: File) = defaultProject(base) :: Nil }
41 41 def defaultID(base: File): String = "default-" + Hash.trimHashString(base.getAbsolutePath, 6)
42   - def defaultProject(base: File): Project = Project(defaultID(base), base).settings(Keys.organization := "default")
  42 + def defaultProject(base: File): Project = Project(defaultID(base), base).settings(
  43 + // if the user has overridden the name, use the normal organization that is derived from the name.
  44 + organization <<= (thisProject, organization, name) { (p, o, n) => if(p.id == n) "default" else o }
  45 + )
43 46
44 47 def data[T](in: Seq[Attributed[T]]): Seq[T] = in.map(_.data)
45 48 def analyzed(in: Seq[Attributed[_]]): Seq[inc.Analysis] = in.flatMap{ _.metadata.get(Keys.analysis) }

0 comments on commit e8fcdc0

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