diff options
Diffstat (limited to 'stage2/Scaffold.scala')
-rw-r--r-- | stage2/Scaffold.scala | 67 |
1 files changed, 52 insertions, 15 deletions
diff --git a/stage2/Scaffold.scala b/stage2/Scaffold.scala index 407fee1..a9db667 100644 --- a/stage2/Scaffold.scala +++ b/stage2/Scaffold.scala @@ -13,7 +13,19 @@ trait Scaffold{ println( GREEN ++ "Created " ++ fileName ++ RESET ) } - def scaffoldBasicBuild( + def createMain( + projectDirectory: File + ): Unit = { + createFile(projectDirectory, "Main.scala", s"""object Main{ + def main( args: Array[String] ) = { + println( Console.GREEN ++ "Hello World" ++ Console.RESET ) + } +} +""" + ) + } + + def createBasicBuild( projectDirectory: File ): Unit = { createFile(projectDirectory, "build/build.scala", s"""import cbt._ @@ -21,22 +33,32 @@ import java.net.URL import java.io.File import scala.collection.immutable.Seq -class Build(context: Context) extends BasicBuild(context){ - override def dependencies = { // don't forget super.dependencies here - super.dependencies :+ MavenResolver(context.cbtHasChanged,context.paths.mavenCache,MavenResolver.central).resolve( - MavenDependency("net.incongru.watchservice","barbary-watchservice","1.0"), - MavenDependency("org.eclipse.jgit", "org.eclipse.jgit", "4.2.0.201601211800-r"), - MavenDependency("com.typesafe.zinc","zinc","0.3.9"), - ScalaDependency("org.scala-lang.modules","scala-xml","1.0.5") +class Build( context: Context ) extends BasicBuild( context ){ + /* + override def dependencies = ( + super.dependencies // don't forget super.dependencies here + ++ + Resolver( mavenCentral ).bind( + // automatically add Scala major version to artifact id + // CBT-style Scala dependency + ScalaDependency( "com.lihaoyi", "ammonite-ops", "0.5.5" ) + // or SBT-style Scala dependency + "com.lihaoyi" %% "ammonite-ops" % "0.5.5" + + // don't mess with the artifact id + // CBT-Style Java dependency + MavenDependency( "com.lihaoyi", "ammonite-ops_2.11", "0.5.5" ) + // or SBT-style Java dependency + "com.lihaoyi" % "ammonite-ops_2.11" % "0.5.5" ) - } + ) + */ } """ ) - } - def scaffoldBuildBuild( + def createBuildBuild( projectDirectory: File ): Unit = { createFile(projectDirectory, "build/build/build.scala", s"""import cbt._ @@ -44,14 +66,29 @@ 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" +class Build( context: Context ) extends BuildBuild( context ){ +/* + override def dependencies = ( + super.dependencies // don't forget super.dependencies here + ++ + Resolver( mavenCentral ).bind( + // automatically add Scala major version to artifact id + // CBT-style Scala dependency + ScalaDependency( "com.lihaoyi", "ammonite-ops", "0.5.5" ) + // or SBT-style Scala dependency + "com.lihaoyi" %% "ammonite-ops" % "0.5.5" + + // don't mess with the artifact id + // CBT-Style Java dependency + MavenDependency( "com.lihaoyi", "ammonite-ops_2.11", "0.5.5" ) + // or SBT-style Java dependency + "com.lihaoyi" % "ammonite-ops_2.11" % "0.5.5" + ) ) + */ } """ ) - } /*, |