Publish akka-osgi but do not include it in dist #20548 (#20549)

This commit is contained in:
Johan Andrén 2016-05-19 12:41:38 +02:00
parent e0c64f59d8
commit 83c60cb034
3 changed files with 7 additions and 4 deletions

View file

@ -1,7 +1,7 @@
import akka.{ AkkaBuild, Dependencies, Formatting, OSGi }
import akka.{ AkkaBuild, Dependencies, Formatting, OSGi, Dist }
AkkaBuild.defaultSettings
AkkaBuild.dontPublishSettings
Dist.includeInDist := false
Formatting.formatSettings
OSGi.osgi
Dependencies.osgi

View file

@ -434,7 +434,8 @@ object AkkaBuild extends Build {
val dontPublishSettings = Seq(
publishSigned := (),
publish := (),
publishArtifact in Compile := false
publishArtifact in Compile := false,
Dist.includeInDist := false
)
val dontPublishDocsSettings = Seq(

View file

@ -24,8 +24,10 @@ object Dist {
val distDocJars = TaskKey[Seq[File]]("dist-doc-jars")
val distSources = TaskKey[DistSources]("dist-sources")
val dist = TaskKey[File]("dist", "Create a zipped distribution of everything.")
val includeInDist = SettingKey[Boolean]("include-in-dist", "Include the artifact of this project in the standalone dist zip-file")
lazy val settings: Seq[Setting[_]] = Seq(
includeInDist := true,
distAllClasspaths <<= (thisProjectRef, buildStructure) flatMap aggregated(dependencyClasspath in Compile),
distDependencies <<= distAllClasspaths map { _.flatten.map(_.data).filter(ClasspathUtilities.isArchive).distinct },
distLibJars <<= (thisProjectRef, buildStructure) flatMap aggregated(packageBin in Compile),
@ -49,7 +51,7 @@ object Dist {
def aggregatedProjects(projectRef: ProjectRef, structure: BuildStructure, scope: Scope): Seq[ProjectRef] = {
val aggregate = Project.getProject(projectRef, structure).toSeq.flatMap(_.aggregate)
aggregate flatMap { ref =>
if (!(publishArtifact in ref in scope get structure.data getOrElse false)) Nil
if (!(includeInDist in ref in scope get structure.data getOrElse false)) Nil
else ref +: aggregatedProjects(ref, structure, scope)
}
}