1
0

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.
This commit is contained in:
Stephen Twigg 2014-09-18 21:22:13 -07:00 committed by Yunsup Lee
parent 69d765744c
commit fefa560017
4 changed files with 7 additions and 11 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ target/
project/target project/target
*.swp *.swp
*~ *~
.addons-dont-touch

2
addons/.gitignore vendored
View File

@ -1,2 +0,0 @@
src
target

View File

@ -1,3 +0,0 @@
ANY FILES ADDED HERE WILL BE DELETED
The src directory is dynamically refreshed by the rocketchip project as part of the addons/prepare task.

View File

@ -34,8 +34,8 @@ object BuildSettings extends Build {
val baselist = Vector("chisel", "uncore", "rocket", "hardfloat") val baselist = Vector("chisel", "uncore", "rocket", "hardfloat")
def getsubdirs = { def getsubdirs = {
val blacklist = (baselist ++ Vector("target", "project", "addons")) val blacklist = (baselist ++ Vector("target", "project"))
IO.listFiles(file(".")) map (_.toString.split("/").last) filter (f=> !blacklist.contains(f)) filter (f=> !IO.listFiles(file(f+"/src/main/scala")).isEmpty) 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)) 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)) 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") val prepareTask = TaskKey[Unit]("prepare","Remove old sources and copy over new ones to addon/src")
def prepareTaskImpl = { def prepareTaskImpl = {
import IO._ import IO._
delete(file("addons/src")) delete(file(".addons-dont-touch/src"))
createDirectory(file("addons/src/main/scala")) createDirectory(file(".addons-dont-touch/src/main/scala"))
addonsources.foreach(as => { addonsources.foreach(as => {
val addonname = as.toString.split("/").head 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, prepareTask := prepareTaskImpl,
(compile in Compile) <<= (compile in Compile) dependsOn (prepareTask) (compile in Compile) <<= (compile in Compile) dependsOn (prepareTask)
)) dependsOn(chisel, hardfloat, uncore, rocket) )) dependsOn(chisel, hardfloat, uncore, rocket)