Included akka-sbt-plugin in build, since I need timestamped version to be published
This commit is contained in:
parent
10fc175c09
commit
550ed58bf7
3 changed files with 23 additions and 27 deletions
|
|
@ -1,11 +0,0 @@
|
||||||
|
|
||||||
sbtPlugin := true
|
|
||||||
|
|
||||||
organization := "se.scalablesolutions.akka"
|
|
||||||
|
|
||||||
name := "akka-sbt-plugin"
|
|
||||||
|
|
||||||
version := "2.0-SNAPSHOT"
|
|
||||||
|
|
||||||
publishMavenStyle := true
|
|
||||||
|
|
||||||
|
|
@ -11,7 +11,7 @@ import sbt.classpath.ClasspathUtilities
|
||||||
import sbt.Project.Initialize
|
import sbt.Project.Initialize
|
||||||
import sbt.CommandSupport._
|
import sbt.CommandSupport._
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import scala.collection.mutable.{ Set => MutableSet }
|
import scala.collection.mutable.{ Set ⇒ MutableSet }
|
||||||
|
|
||||||
object AkkaKernelPlugin extends Plugin {
|
object AkkaKernelPlugin extends Plugin {
|
||||||
|
|
||||||
|
|
@ -58,8 +58,7 @@ object AkkaKernelPlugin extends Plugin {
|
||||||
dist <<= (dist in Dist).identity, distNeedsPackageBin)
|
dist <<= (dist in Dist).identity, distNeedsPackageBin)
|
||||||
|
|
||||||
private def distTask: Initialize[Task[File]] =
|
private def distTask: Initialize[Task[File]] =
|
||||||
(distConfig, sourceDirectory, crossTarget, dependencyClasspath, projectDependencies, allDependencies, buildStructure, state) map {
|
(distConfig, sourceDirectory, crossTarget, dependencyClasspath, projectDependencies, allDependencies, buildStructure, state) map { (conf, src, tgt, cp, projDeps, allDeps, buildStruct, st) ⇒
|
||||||
(conf, src, tgt, cp, projDeps, allDeps, buildStruct, st) ⇒
|
|
||||||
|
|
||||||
if (isKernelProject(allDeps)) {
|
if (isKernelProject(allDeps)) {
|
||||||
val log = logger(st)
|
val log = logger(st)
|
||||||
|
|
@ -78,7 +77,7 @@ object AkkaKernelPlugin extends Plugin {
|
||||||
|
|
||||||
copyFiles(libFiles(cp, conf.libFilter), distLibPath)
|
copyFiles(libFiles(cp, conf.libFilter), distLibPath)
|
||||||
copyFiles(conf.additionalLibs, distLibPath)
|
copyFiles(conf.additionalLibs, distLibPath)
|
||||||
for (subTarget <- subProjectDependencies.map(_.target)) {
|
for (subTarget ← subProjectDependencies.map(_.target)) {
|
||||||
copyJars(subTarget, distLibPath)
|
copyJars(subTarget, distLibPath)
|
||||||
}
|
}
|
||||||
log.info("Distribution created.")
|
log.info("Distribution created.")
|
||||||
|
|
@ -97,7 +96,7 @@ object AkkaKernelPlugin extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
def isKernelProject(dependencies: Seq[ModuleID]): Boolean = {
|
def isKernelProject(dependencies: Seq[ModuleID]): Boolean = {
|
||||||
dependencies.exists(moduleId => moduleId.organization == "se.scalablesolutions.akka" && moduleId.name == "akka-kernel")
|
dependencies.exists(moduleId ⇒ moduleId.organization == "se.scalablesolutions.akka" && moduleId.name == "akka-kernel")
|
||||||
}
|
}
|
||||||
|
|
||||||
private def defaultConfigSourceDirs = (sourceDirectory, unmanagedResourceDirectories) map { (src, resources) ⇒
|
private def defaultConfigSourceDirs = (sourceDirectory, unmanagedResourceDirectories) map { (src, resources) ⇒
|
||||||
|
|
@ -180,25 +179,25 @@ object AkkaKernelPlugin extends Plugin {
|
||||||
val buildUnit = buildStruct.units(buildStruct.root)
|
val buildUnit = buildStruct.units(buildStruct.root)
|
||||||
val uri = buildStruct.root
|
val uri = buildStruct.root
|
||||||
val allProjects = buildUnit.defined.map {
|
val allProjects = buildUnit.defined.map {
|
||||||
case (id, proj) => (ProjectRef(uri, id) -> proj)
|
case (id, proj) ⇒ (ProjectRef(uri, id) -> proj)
|
||||||
}
|
}
|
||||||
|
|
||||||
val projDepsNames = projDeps.map(_.name)
|
val projDepsNames = projDeps.map(_.name)
|
||||||
def include(project: ResolvedProject): Boolean = projDepsNames.exists(_ == project.id)
|
def include(project: ResolvedProject): Boolean = projDepsNames.exists(_ == project.id)
|
||||||
val subProjects: Seq[SubProjectInfo] = allProjects.collect {
|
val subProjects: Seq[SubProjectInfo] = allProjects.collect {
|
||||||
case (projRef, project) if include(project) => projectInfo(projRef, project, buildStruct, state, allProjects)
|
case (projRef, project) if include(project) ⇒ projectInfo(projRef, project, buildStruct, state, allProjects)
|
||||||
}.toList
|
}.toList
|
||||||
|
|
||||||
val allSubProjects = subProjects.map(_.recursiveSubProjects).flatten.toSet
|
val allSubProjects = subProjects.map(_.recursiveSubProjects).flatten.toSet
|
||||||
allSubProjects
|
allSubProjects
|
||||||
}
|
}
|
||||||
|
|
||||||
private def projectInfo(projectRef: ProjectRef, project: ResolvedProject, buildStruct: BuildStructure, state: State,
|
private def projectInfo(projectRef: ProjectRef, project: ResolvedProject, buildStruct: BuildStructure, state: State,
|
||||||
allProjects: Map[ProjectRef, ResolvedProject]): SubProjectInfo = {
|
allProjects: Map[ProjectRef, ResolvedProject]): SubProjectInfo = {
|
||||||
|
|
||||||
def optionalSetting[A](key: ScopedSetting[A]) = key in projectRef get buildStruct.data
|
def optionalSetting[A](key: ScopedSetting[A]) = key in projectRef get buildStruct.data
|
||||||
|
|
||||||
def setting[A](key: ScopedSetting[A], errorMessage: => String) = {
|
def setting[A](key: ScopedSetting[A], errorMessage: ⇒ String) = {
|
||||||
optionalSetting(key) getOrElse {
|
optionalSetting(key) getOrElse {
|
||||||
logger(state).error(errorMessage);
|
logger(state).error(errorMessage);
|
||||||
throw new IllegalArgumentException()
|
throw new IllegalArgumentException()
|
||||||
|
|
@ -210,14 +209,14 @@ object AkkaKernelPlugin extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
val projDeps: Seq[ModuleID] = evaluateTask(Keys.projectDependencies) match {
|
val projDeps: Seq[ModuleID] = evaluateTask(Keys.projectDependencies) match {
|
||||||
case Some(Value(moduleIds)) => moduleIds
|
case Some(Value(moduleIds)) ⇒ moduleIds
|
||||||
case _ => Seq.empty
|
case _ ⇒ Seq.empty
|
||||||
}
|
}
|
||||||
|
|
||||||
val projDepsNames = projDeps.map(_.name)
|
val projDepsNames = projDeps.map(_.name)
|
||||||
def include(project: ResolvedProject): Boolean = projDepsNames.exists(_ == project.id)
|
def include(project: ResolvedProject): Boolean = projDepsNames.exists(_ == project.id)
|
||||||
val subProjects = allProjects.collect {
|
val subProjects = allProjects.collect {
|
||||||
case (projRef, proj) if include(proj) => projectInfo(projRef, proj, buildStruct, state, allProjects)
|
case (projRef, proj) if include(proj) ⇒ projectInfo(projRef, proj, buildStruct, state, allProjects)
|
||||||
}.toList
|
}.toList
|
||||||
|
|
||||||
val target = setting(Keys.crossTarget, "Missing crossTarget directory")
|
val target = setting(Keys.crossTarget, "Missing crossTarget directory")
|
||||||
|
|
@ -228,8 +227,8 @@ object AkkaKernelPlugin extends Plugin {
|
||||||
|
|
||||||
def recursiveSubProjects: Set[SubProjectInfo] = {
|
def recursiveSubProjects: Set[SubProjectInfo] = {
|
||||||
val flatSubProjects = for {
|
val flatSubProjects = for {
|
||||||
x <- subProjects
|
x ← subProjects
|
||||||
y <- x.recursiveSubProjects
|
y ← x.recursiveSubProjects
|
||||||
} yield y
|
} yield y
|
||||||
|
|
||||||
flatSubProjects.toSet + this
|
flatSubProjects.toSet + this
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ object AkkaBuild extends Build {
|
||||||
Unidoc.unidocExclude := Seq(samples.id, tutorials.id),
|
Unidoc.unidocExclude := Seq(samples.id, tutorials.id),
|
||||||
rstdocDirectory <<= baseDirectory / "akka-docs"
|
rstdocDirectory <<= baseDirectory / "akka-docs"
|
||||||
),
|
),
|
||||||
aggregate = Seq(actor, testkit, actorTests, stm, http, remote, slf4j, samples, tutorials, docs)
|
aggregate = Seq(actor, testkit, actorTests, stm, http, remote, slf4j, akkaSbtPlugin, samples, tutorials, docs)
|
||||||
//aggregate = Seq(actor, testkit, actorTests, stm, http, slf4j, cluster, mailboxes, camel, camelTyped, samples, tutorials)
|
//aggregate = Seq(actor, testkit, actorTests, stm, http, slf4j, cluster, mailboxes, camel, camelTyped, samples, tutorials)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -228,6 +228,14 @@ object AkkaBuild extends Build {
|
||||||
// )
|
// )
|
||||||
// )
|
// )
|
||||||
|
|
||||||
|
lazy val akkaSbtPlugin = Project(
|
||||||
|
id = "akka-sbt-plugin",
|
||||||
|
base = file("akka-sbt-plugin"),
|
||||||
|
settings = defaultSettings ++ Seq(
|
||||||
|
sbtPlugin := true
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
lazy val samples = Project(
|
lazy val samples = Project(
|
||||||
id = "akka-samples",
|
id = "akka-samples",
|
||||||
base = file("akka-samples"),
|
base = file("akka-samples"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue