|
Akka/Scala example source code file (ActivatorDist.scala)
The ActivatorDist.scala Akka example source codepackage akka import sbt._ import sbt.Keys._ import sbt.Def.Initialize import java.io.File import sbt.Task object ActivatorDist { val activatorDistDirectory = SettingKey[File]("activator-dist-directory") val activatorDist = TaskKey[File]("activator-dist", "Create a zipped distribution of each activator sample.") lazy val settings: Seq[Setting[_]] = Seq( activatorDistDirectory <<= crossTarget / "activator-dist", activatorDist <<= activatorDistTask ) def activatorDistTask: Initialize[Task[File]] = { (thisProjectRef, baseDirectory, activatorDistDirectory, version, buildStructure, streams) map { (project, projectBase, activatorDistDirectory, version, structure, s) => { val directories = projectBase.listFiles(DirectoryFilter).filter(dir => (dir / "activator.properties").exists) val rootGitignoreLines = IO.readLines(AkkaBuild.root.base / ".gitignore") for (dir <- directories) { val localGitignoreLines = if ((dir / ".gitignore").exists) IO.readLines(dir / ".gitignore") else Nil val gitignoreFileFilter = (".gitignore" :: localGitignoreLines ::: rootGitignoreLines). foldLeft[FileFilter](NothingFilter)((acc, x) => acc || x) val filteredPathFinder = PathFinder(dir) descendantsExcept("*", gitignoreFileFilter) filter(_.isFile) filteredPathFinder pair Path.rebase(dir, activatorDistDirectory / dir.name) map { case (source, target) => s.log.info(s"copying: $source -> $target") IO.copyFile(source, target, preserveLastModified = true) } val targetDir = activatorDistDirectory / dir.name val targetFile = activatorDistDirectory / (dir.name + "-" + version + ".zip") s.log.info(s"zipping: $targetDir -> $targetFile") Dist.zip(targetDir, targetFile) } activatorDistDirectory } } } } Other Akka source code examplesHere is a short list of links related to this Akka ActivatorDist.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.