2017-12-06 23:23:30 +00:00
|
|
|
name := "millfork"
|
|
|
|
|
2020-04-26 19:17:13 +00:00
|
|
|
version := "0.3.17-SNAPSHOT"
|
2017-12-06 23:23:30 +00:00
|
|
|
|
2020-03-25 22:54:23 +00:00
|
|
|
scalaVersion := "2.12.11"
|
2017-12-06 23:23:30 +00:00
|
|
|
|
|
|
|
resolvers += Resolver.mavenLocal
|
|
|
|
|
|
|
|
libraryDependencies += "com.lihaoyi" %% "fastparse" % "1.0.0"
|
|
|
|
|
|
|
|
libraryDependencies += "org.apache.commons" % "commons-configuration2" % "2.2"
|
|
|
|
|
2019-06-28 15:58:21 +00:00
|
|
|
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % "test"
|
2017-12-06 23:23:30 +00:00
|
|
|
|
2018-07-01 20:28:27 +00:00
|
|
|
libraryDependencies += "com.codingrodent.microprocessor" % "Z80Processor" % "2.0.2" % "test"
|
|
|
|
|
2019-05-31 15:03:35 +00:00
|
|
|
// see: https://github.com/NeatMonster/Intel8086
|
|
|
|
libraryDependencies += "NeatMonster" % "Intel8086" % "1.0" % "test" from "https://github.com/NeatMonster/Intel8086/raw/master/IBMPC.jar"
|
|
|
|
|
2018-07-24 21:44:00 +00:00
|
|
|
// these three are not in Maven Central or any other public repo
|
2017-12-06 23:23:30 +00:00
|
|
|
// get them from the following links or just build millfork without tests:
|
2018-03-17 17:21:50 +00:00
|
|
|
// https://github.com/sethm/symon/tree/71905fdb1998ee4f142260879504bc46cf27648f
|
2017-12-06 23:23:30 +00:00
|
|
|
// https://github.com/andrew-hoffman/halfnes/tree/061
|
2018-07-24 21:44:00 +00:00
|
|
|
// https://github.com/trekawek/coffee-gb/tree/coffee-gb-1.0.0
|
2020-06-21 23:17:42 +00:00
|
|
|
// https://github.com/sorenroug/osnine-java/tree/b77349a6c314e1362e69b7158c385ac6f89b7ab8
|
2017-12-06 23:23:30 +00:00
|
|
|
|
|
|
|
libraryDependencies += "com.loomcom.symon" % "symon" % "1.3.0-SNAPSHOT" % "test"
|
|
|
|
|
|
|
|
libraryDependencies += "com.grapeshot" % "halfnes" % "061" % "test"
|
|
|
|
|
2018-07-24 21:44:00 +00:00
|
|
|
libraryDependencies += "eu.rekawek.coffeegb" % "coffee-gb" % "1.0.0" % "test"
|
|
|
|
|
2020-06-21 23:17:42 +00:00
|
|
|
libraryDependencies += "roug.org.osnine" % "osnine-core" % "2.0-SNAPSHOT" % "test"
|
2019-07-28 22:55:24 +00:00
|
|
|
|
2017-12-06 23:23:30 +00:00
|
|
|
mainClass in Compile := Some("millfork.Main")
|
|
|
|
|
|
|
|
assemblyJarName := "millfork.jar"
|
|
|
|
|
2017-12-06 23:29:10 +00:00
|
|
|
lazy val root = (project in file(".")).
|
|
|
|
enablePlugins(BuildInfoPlugin).
|
|
|
|
settings(
|
|
|
|
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
|
|
|
|
buildInfoPackage := "millfork.buildinfo"
|
2018-01-20 22:32:34 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
import sbtassembly.AssemblyKeys
|
|
|
|
|
|
|
|
val releaseDist = TaskKey[File]("release-dist", "Creates a distributable zip file.")
|
|
|
|
|
|
|
|
releaseDist := {
|
|
|
|
val jar = AssemblyKeys.assembly.value
|
|
|
|
val base = Keys.baseDirectory.value
|
|
|
|
val target = Keys.target.value
|
|
|
|
val name = Keys.name.value
|
|
|
|
val version = Keys.version.value
|
|
|
|
val distDir = target / (name + "-" + version)
|
|
|
|
val releasesDir = base / "releases"
|
|
|
|
val zipFile = releasesDir / (name + "-" + version + ".zip")
|
|
|
|
IO.delete(zipFile)
|
|
|
|
IO.delete(distDir)
|
|
|
|
IO.createDirectory(releasesDir)
|
|
|
|
IO.createDirectory(distDir)
|
|
|
|
IO.copyFile(jar, distDir / jar.name)
|
2018-01-20 22:50:08 +00:00
|
|
|
IO.copyFile(base / "LICENSE", distDir / "LICENSE")
|
2018-06-25 20:42:12 +00:00
|
|
|
IO.copyFile(base / "src/3rd-party-licenses.txt", distDir / "3rd-party-licenses.txt")
|
|
|
|
IO.copyFile(base / "CHANGELOG.md", distDir / "CHANGELOG.md")
|
2018-01-20 22:50:08 +00:00
|
|
|
IO.copyFile(base / "README.md", distDir / "README.md")
|
2019-06-28 16:43:24 +00:00
|
|
|
IO.copyFile(base / "COMPILING.md", distDir / "COMPILING.md")
|
2018-01-20 22:32:34 +00:00
|
|
|
def copyDir(name: String): Unit = {
|
|
|
|
IO.createDirectory(distDir / name)
|
|
|
|
IO.copyDirectory(base / name, distDir / name)
|
|
|
|
}
|
|
|
|
copyDir("include")
|
2018-03-28 17:31:10 +00:00
|
|
|
copyDir("docs")
|
2018-01-20 22:32:34 +00:00
|
|
|
def entries(f: File): List[File] = f :: (if (f.isDirectory) IO.listFiles(f).toList.flatMap(entries) else Nil)
|
|
|
|
IO.zip(entries(distDir).map(d => (d, d.getAbsolutePath.substring(distDir.getParent.length + 1))), zipFile)
|
|
|
|
IO.delete(distDir)
|
|
|
|
zipFile
|
|
|
|
}
|