Created
July 30, 2013 12:13
-
-
Save arturaz/6112400 to your computer and use it in GitHub Desktop.
Scala project preparation for dist archive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val chiShape = RootProject(file("vendor/chi-shape")) | |
| val kdTree = RootProject(file("vendor/kdtree")) | |
| val messaging = RootProject(file("vendor/messaging")) | |
| val datadog = RootProject(file("vendor/datadog-metrics-client")) | |
| val logbackLayout = RootProject(file("vendor/logback-layout")) | |
| dist <<= ( | |
| dist, | |
| packageBin in Compile in chiShape, | |
| packageBin in Compile in kdTree, | |
| packageBin in Compile in datadog, | |
| packageBin in Compile in messaging, | |
| packageBin in Compile in logbackLayout, | |
| streams | |
| ) map { (out, chiPkg, kdPkg, datadog, messaging, logbackLayout, s) => | |
| val outLibDir = out / "lib" | |
| s.log.info( | |
| "Add subproject packages to %s.".format(outLibDir.getCanonicalPath) | |
| ) | |
| IO.copyFile(chiPkg, outLibDir / chiPkg.getName) | |
| IO.copyFile(kdPkg, outLibDir / kdPkg.getName) | |
| IO.copyFile(datadog, outLibDir / datadog.getName) | |
| IO.copyFile(messaging, outLibDir / messaging.getName) | |
| IO.copyFile(logbackLayout, outLibDir / logbackLayout.getName) | |
| s.log.info("Removing unneeded files.") | |
| IO.delete(Seq( | |
| out / "bin" / "start", | |
| out / "bin" / "start.bat", | |
| out / "config" / "application.conf" | |
| )) | |
| s.log.info("Copying custom data.") | |
| IO.copyDirectory(libDir / "deploy" / "data", out, overwrite = true) | |
| s.log.info("Setting executable bits.") | |
| Seq( | |
| out / "bin" / "start", out / "bin" / "cli", out / "daemon" | |
| ).foreach { file => | |
| Files.setPosixFilePermissions(file.toPath, Modes.m755) | |
| } | |
| out | |
| }, | |
| distArchiveTask(dist, format = FileFormat.Tar), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment