Make sure bare build.sbt is published by default.

This commit is contained in:
Dale Wijnand 2015-02-22 14:30:09 +00:00 committed by Eugene Yokota
parent f0732a8bd6
commit d07cdb92ad
4 changed files with 13 additions and 5 deletions

View File

@ -58,10 +58,7 @@ object Build {
autoGeneratedProject := true
)
def defaultAggregatedProject(id: String, base: File, agg: Seq[ProjectRef]): Project =
defaultProject(id, base).aggregate(agg: _*).settings(
Keys.publish := (),
Keys.publishLocal := ()
)
defaultProject(id, base).aggregate(agg: _*)
@deprecated("Use Attributed.data", "0.13.0")
def data[T](in: Seq[Attributed[T]]): Seq[T] = Attributed.data(in)

View File

@ -585,7 +585,9 @@ object Load {
val existingIds = otherProjects.projects map (_.id)
val refs = existingIds map (id => ProjectRef(buildUri, id))
val defaultID = autoID(buildBase, context, existingIds)
val root = finalizeProject(Build.defaultAggregatedProject(defaultID, buildBase, refs), files)
val root1 = Build.defaultAggregatedProject(defaultID, buildBase, refs)
val root2 = if (discovered.isEmpty) root1 else root1.settings(Keys.publish := (()), Keys.publishLocal := (()))
val root = finalizeProject(root2, files)
val result = root +: (acc ++ otherProjects.projects)
log.debug(s"[Loading] Done in ${buildBase}, returning: ${result.map(_.id).mkString("(", ", ", ")")}")
LoadedProjects(result, generated ++ otherGenerated ++ generatedConfigClassFiles)

View File

@ -0,0 +1,3 @@
organization := "com.example"
version := "0.1.0"
ivyPaths := new IvyPaths((baseDirectory in LocalRootProject).value, Some((target in LocalRootProject).value / "ivy-cache"))

View File

@ -2,3 +2,9 @@
$ exists target/ivy-cache/local/com.example/app_2.10/0.1.0/poms/app_2.10.pom
$ exists target/ivy-cache/local/com.example/app_2.10/0.1.0/jars/app_2.10.jar
$ absent target/ivy-cache/local/com.example/default-root_2.10/0.1.0/ivys/ivy.xml
$ copy-file changes/bare.sbt build.sbt
> reload
> publishLocal
$ exists target/ivy-cache/local/com.example/artificial-root-no-publish_2.10/0.1.0/poms/artificial-root-no-publish_2.10.pom
$ exists target/ivy-cache/local/com.example/artificial-root-no-publish_2.10/0.1.0/jars/artificial-root-no-publish_2.10.jar