diff options
author | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-02 16:33:46 -0400 |
---|---|---|
committer | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-02 16:33:46 -0400 |
commit | e18bae3a01d3a557e750ffe6b4c62fc3a80a800f (patch) | |
tree | abf43b2bf6ae178c0a760e75e8d61a46782bacbd | |
parent | 63b54f79c10854e38b2a4a43ee39f508458e280f (diff) | |
parent | 9d6ad3d86c72ac70188097a0f90fa5c4d4e75f98 (diff) | |
download | cbt-e18bae3a01d3a557e750ffe6b4c62fc3a80a800f.tar.gz cbt-e18bae3a01d3a557e750ffe6b4c62fc3a80a800f.tar.bz2 cbt-e18bae3a01d3a557e750ffe6b4c62fc3a80a800f.zip |
Merge pull request #95 from cvogt/scaffold-BuildBuild
support for scaffolding BuildBuild file
-rw-r--r-- | stage2/AdminTasks.scala | 1 | ||||
-rw-r--r-- | stage2/Scaffold.scala | 35 |
2 files changed, 25 insertions, 11 deletions
diff --git a/stage2/AdminTasks.scala b/stage2/AdminTasks.scala index 069b712..a61e767 100644 --- a/stage2/AdminTasks.scala +++ b/stage2/AdminTasks.scala @@ -40,6 +40,7 @@ class AdminTasks(lib: Lib, args: Seq[String], cwd: File){ ) } def scaffoldBasicBuild: Unit = lib.scaffoldBasicBuild( cwd ) + def scaffoldBuildBuild: Unit = lib.scaffoldBuildBuild( cwd ) def cbtEarlyDependencies = { val scalaVersion = args.lift(1).getOrElse(constants.scalaVersion) val scalaMajorVersion = scalaVersion.split("\\.").take(2).mkString(".") diff --git a/stage2/Scaffold.scala b/stage2/Scaffold.scala index 3dcb9ae..7806b8c 100644 --- a/stage2/Scaffold.scala +++ b/stage2/Scaffold.scala @@ -16,13 +16,6 @@ trait Scaffold{ def scaffoldBasicBuild( projectDirectory: File ): Unit = { - /** - TODO: - - make behavior more user friendly: - - not generate half and then throw exception for one thing already existing - - maybe not generate all of this, e.g. offer different variants - */ - createFile(projectDirectory, "build/build.scala", s"""import cbt._ import java.net.URL import java.io.File @@ -33,7 +26,30 @@ class Build(context: Context) extends BasicBuild(context){ // "org.cvogt" %% "scala-extensions" % "0.4.1" ) } -"""/*, +""" + ) + + } + + def scaffoldBuildBuild( + projectDirectory: File + ): Unit = { + createFile(projectDirectory, "build/build/build.scala", s"""import cbt._ +import java.net.URL +import java.io.File +import scala.collection.immutable.Seq + +class Build(context: Context) extends BuildBuild(context){ + override def dependencies = super.dependencies ++ Seq( + // , "com.lihaoyi" %% "ammonite-ops" % "0.5.5" + ) +} +""" + ) + + } + +/*, "build/build/build.scala" -> s"""import cbt._ import java.net.URL @@ -120,8 +136,5 @@ trait BuildShared extends BasicBuild{ override def pomExtra: Seq[scala.xml.Node] = Seq() } """*/ - ) - - } }
\ No newline at end of file |