Commit fefa5600 authored by Stephen Twigg's avatar Stephen Twigg Committed by Yunsup Lee
Browse files

Change addons subproject to use .addons-dont-touch directory instead of addons

This hides the directory name under standard invocations of ls and thus avoids confusing the user with extra directory names.
parent 69d76574
......@@ -2,3 +2,4 @@ target/
project/target
*.swp
*~
.addons-dont-touch
ANY FILES ADDED HERE WILL BE DELETED
The src directory is dynamically refreshed by the rocketchip project as part of the addons/prepare task.
......@@ -34,8 +34,8 @@ object BuildSettings extends Build {
val baselist = Vector("chisel", "uncore", "rocket", "hardfloat")
def getsubdirs = {
val blacklist = (baselist ++ Vector("target", "project", "addons"))
IO.listFiles(file(".")) map (_.toString.split("/").last) filter (f=> !blacklist.contains(f)) filter (f=> !IO.listFiles(file(f+"/src/main/scala")).isEmpty)
val blacklist = (baselist ++ Vector("target", "project"))
IO.listFiles(file(".")) map (_.toString.split("/").last) filter (f=> !blacklist.contains(f) && (f(0)!='.')) filter (f=> !IO.listFiles(file(f+"/src/main/scala")).isEmpty)
}
val addonsources = getsubdirs map (f=>s"${f}/src/main/scala") map (f=>file(f))
addonsources.foreach(a => println(s"[info] Found addon: " + a.toString.split("/").head))
......@@ -43,15 +43,15 @@ object BuildSettings extends Build {
val prepareTask = TaskKey[Unit]("prepare","Remove old sources and copy over new ones to addon/src")
def prepareTaskImpl = {
import IO._
delete(file("addons/src"))
createDirectory(file("addons/src/main/scala"))
delete(file(".addons-dont-touch/src"))
createDirectory(file(".addons-dont-touch/src/main/scala"))
addonsources.foreach(as => {
val addonname = as.toString.split("/").head
copyDirectory(as, file("addons/src/main/scala/"+addonname))
copyDirectory(as, file(".addons-dont-touch/src/main/scala/"+addonname))
})
}
lazy val addons = Project("addons", file("addons"), settings = buildSettings ++ Seq(
lazy val addons = Project("addons", file(".addons-dont-touch"), settings = buildSettings ++ Seq(
prepareTask := prepareTaskImpl,
(compile in Compile) <<= (compile in Compile) dependsOn (prepareTask)
)) dependsOn(chisel, hardfloat, uncore, rocket)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment