diff options
-rw-r--r-- | stage1/resolver.scala | 3 | ||||
-rw-r--r-- | stage2/BasicBuild.scala | 2 | ||||
-rw-r--r-- | stage2/Lib.scala | 11 | ||||
-rw-r--r-- | stage2/Scaffold.scala | 5 |
4 files changed, 7 insertions, 14 deletions
diff --git a/stage1/resolver.scala b/stage1/resolver.scala index 87bab66..87135c8 100644 --- a/stage1/resolver.scala +++ b/stage1/resolver.scala @@ -229,9 +229,6 @@ case class CbtDependency()(implicit val logger: Logger) extends Dependency{ JavaDependency("net.incongru.watchservice","barbary-watchservice","1.0"), JavaDependency("org.eclipse.jgit", "org.eclipse.jgit", "4.2.0.201601211800-r"), lib.ScalaDependency( - "com.lihaoyi","ammonite-ops","0.5.5", scalaVersion = constants.scalaMajorVersion - ), - lib.ScalaDependency( "org.scala-lang.modules","scala-xml","1.0.5", scalaVersion = constants.scalaMajorVersion ) ) diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala index a906b06..acd49af 100644 --- a/stage2/BasicBuild.scala +++ b/stage2/BasicBuild.scala @@ -13,8 +13,6 @@ import scala.collection.immutable.Seq import scala.reflect.runtime.{universe => ru} import scala.util._ -import ammonite.ops.{cwd => _,_} - class BasicBuild( context: Context ) extends Build( context ) class Build(val context: Context) extends Dependency with TriggerLoop{ // library available to builds diff --git a/stage2/Lib.scala b/stage2/Lib.scala index 218208d..99f578a 100644 --- a/stage2/Lib.scala +++ b/stage2/Lib.scala @@ -13,8 +13,6 @@ import scala.collection.immutable.Seq import scala.reflect.runtime.{universe => ru} import scala.util._ -import ammonite.ops.{cwd => _,_} - // pom model case class Developer(id: String, name: String, timezone: String, url: URL) case class License(name: String, url: URL) @@ -90,7 +88,7 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ compileArgs: Seq[String], classLoaderCache: ClassLoaderCache ): File = { - mkdir(Path(apiTarget)) + apiTarget.mkdirs if(sourceFiles.nonEmpty){ val args = Seq( // FIXME: can we use compiler dependency here? @@ -320,8 +318,9 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ </dependencies> </project> val path = jarTarget.toString ++ ( "/" ++ artifactId ++ "-" ++ version ++ ".pom" ) - write.over(Path(path), "<?xml version='1.0' encoding='UTF-8'?>\n" ++ xml.toString) - new File(path) + val file = new File(path) + Files.write(file.toPath, ("<?xml version='1.0' encoding='UTF-8'?>\n" ++ xml.toString).getBytes) + file } def concurrently[T,R]( concurrencyEnabled: Boolean )( items: Seq[T] )( projection: T => R ): Seq[R] = { @@ -363,7 +362,7 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ val httpCon = url.openConnection.asInstanceOf[HttpURLConnection] httpCon.setDoOutput(true) httpCon.setRequestMethod("PUT") - val userPassword = read(Path(sonatypeLogin)).trim + val userPassword = new String(readAllBytes(sonatypeLogin.toPath)).trim val encoding = new sun.misc.BASE64Encoder().encode(userPassword.getBytes) httpCon.setRequestProperty("Authorization", "Basic " ++ encoding) httpCon.setRequestProperty("Content-Type", "application/binary") diff --git a/stage2/Scaffold.scala b/stage2/Scaffold.scala index e181ebf..620d4fb 100644 --- a/stage2/Scaffold.scala +++ b/stage2/Scaffold.scala @@ -1,13 +1,12 @@ package cbt import java.io._ +import java.nio.file._ import java.net._ -import ammonite.ops.{cwd => _,_} - trait Scaffold{ def logger: Logger private def createFile( projectDirectory: File, fileName: String, code: String ){ - write( Path( projectDirectory.string ++ "/" ++ fileName ), code ) + Files.write( ( projectDirectory ++ ("/" ++ fileName) ).toPath, code.getBytes, StandardOpenOption.CREATE_NEW ) import scala.Console._ println( GREEN ++ "Created " ++ fileName ++ RESET ) } |