aboutsummaryrefslogtreecommitdiff
path: root/stage2
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2016-03-15 03:05:09 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2016-03-19 21:17:08 -0400
commitc359862021c187e680c9b3f687ab149f7ef6b7b0 (patch)
treef6c056a87d7921e8c6cbca0b63de4ae2ddcdee15 /stage2
parent27ff278767edf5972782ec7568c1da7fb3019ed6 (diff)
downloadcbt-c359862021c187e680c9b3f687ab149f7ef6b7b0.tar.gz
cbt-c359862021c187e680c9b3f687ab149f7ef6b7b0.tar.bz2
cbt-c359862021c187e680c9b3f687ab149f7ef6b7b0.zip
get rid of ammonite dependency
Diffstat (limited to 'stage2')
-rw-r--r--stage2/BasicBuild.scala2
-rw-r--r--stage2/Lib.scala11
-rw-r--r--stage2/Scaffold.scala5
3 files changed, 7 insertions, 11 deletions
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 )
}