diff options
-rw-r--r-- | circle.yml | 12 | ||||
-rw-r--r-- | compatibility/BuildInterface.java | 1 | ||||
-rw-r--r-- | stage1/Stage1Lib.scala | 2 | ||||
-rw-r--r-- | stage2/Lib.scala | 28 | ||||
-rw-r--r-- | stage2/ToolsTasks.scala | 12 | ||||
-rw-r--r-- | test/simple-fixed/build/build.scala | 42 | ||||
-rw-r--r-- | test/simple/build/build.scala | 2 | ||||
-rw-r--r-- | test/test.scala | 1 |
8 files changed, 51 insertions, 49 deletions
@@ -6,13 +6,13 @@ dependencies: cache_directories: - "cache" override: - - ./cbt compile -Dlog=all - - ./cbt direct -Dlog=all + - ./cbt compile + - ./cbt direct - ./cbt -Dlog=all - - cd plugins/scalatest/ && ../../cbt compile -Dlog=all && cd ../../ + - cd plugins/scalatest/ && ../../cbt compile && cd ../../ test: override: - - ./cbt direct test -Dlog=all - - ./cbt test -Dlog=all - - cd examples/build-scalatest && ../../cbt test -Dlog=all && cd ../.. + - ./cbt direct test + - ./cbt test + - cd examples/build-scalatest && ../../cbt test && cd ../.. diff --git a/compatibility/BuildInterface.java b/compatibility/BuildInterface.java index fea43be..636ded9 100644 --- a/compatibility/BuildInterface.java +++ b/compatibility/BuildInterface.java @@ -3,7 +3,6 @@ import java.io.*; public interface BuildInterface extends Dependency{ public abstract BuildInterface copy(Context context); // needed to configure builds - public abstract String show(); // needed for debugging public abstract String scalaVersion(); // needed to propagate scalaVersion to dependent builds public abstract String[] crossScalaVersionsArray(); // FIXME: this probably can't use Scala classes public abstract BuildInterface finalBuild(); // needed to propagage through build builds. Maybe we can get rid of this. diff --git a/stage1/Stage1Lib.scala b/stage1/Stage1Lib.scala index 027818c..d0d22d2 100644 --- a/stage1/Stage1Lib.scala +++ b/stage1/Stage1Lib.scala @@ -65,7 +65,7 @@ class Stage1Lib( val logger: Logger ) extends BaseLib{ logger.resolver(blue("not found: ") ++ url.string) false } else { - logger.resolver(blue("downloading ") ++ url.string) + System.err.println(blue("downloading ") ++ url.string) logger.resolver(blue("to ") ++ target.string) target.getParentFile.mkdirs val stream = connection.getInputStream diff --git a/stage2/Lib.scala b/stage2/Lib.scala index acd62c8..ac7b45c 100644 --- a/stage2/Lib.scala +++ b/stage2/Lib.scala @@ -371,35 +371,37 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ def publishUnsigned( sourceFiles: Seq[File], artifacts: Seq[File], url: URL, credentials: String ): Unit = { if(sourceFiles.nonEmpty){ - val files = artifacts.map(nameAndContents) - uploadAll(url, files, credentials) + publish( artifacts, url, credentials ) } } def publishSigned( sourceFiles: Seq[File], artifacts: Seq[File], url: URL, credentials: String ): Unit = { // TODO: make concurrency configurable here if(sourceFiles.nonEmpty){ - val files = (artifacts ++ artifacts.map(sign)).map(nameAndContents) - lazy val checksums = files.flatMap{ - case (name, content) => Seq( - name++".md5" -> md5(content).toArray.map(_.toByte), - name++".sha1" -> sha1(content).toArray.map(_.toByte) - ) - } - val all = (files ++ checksums) - uploadAll(url, all, credentials) + publish( artifacts ++ artifacts.map(sign), url, credentials ) } } + private def publish(artifacts: Seq[File], url: URL, credentials: String): Unit = { + val files = artifacts.map(nameAndContents) + lazy val checksums = files.flatMap{ + case (name, content) => Seq( + name++".md5" -> md5(content).toArray.map(_.toByte), + name++".sha1" -> sha1(content).toArray.map(_.toByte) + ) + } + val all = (files ++ checksums) + uploadAll(url, all, credentials) + } def uploadAll(url: URL, nameAndContents: Seq[(String, Array[Byte])], credentials: String ): Unit = - nameAndContents.map{ case(name, content) => upload(name, content, url, credentials: String ) } + nameAndContents.map{ case(name, content) => upload(name, content, url, credentials ) } def upload(fileName: String, fileContents: Array[Byte], baseUrl: URL, credentials: String): Unit = { import java.net._ import java.io._ - logger.task("uploading "++fileName) val url = baseUrl ++ fileName + System.err.println(blue("uploading ") ++ url.toString) val httpCon = url.openConnection.asInstanceOf[HttpURLConnection] httpCon.setDoOutput(true) httpCon.setRequestMethod("PUT") diff --git a/stage2/ToolsTasks.scala b/stage2/ToolsTasks.scala index c39c373..df33b5d 100644 --- a/stage2/ToolsTasks.scala +++ b/stage2/ToolsTasks.scala @@ -38,22 +38,22 @@ class ToolsTasks( def amm = ammonite def ammonite = { val version = args.lift(1).getOrElse(constants.scalaVersion) - val scalac = new ScalaCompilerDependency( cbtHasChanged,mavenCache, version ) - val d = Resolver(mavenCentral).bindOne( + val classLoader = Resolver(mavenCentral).bindOne( MavenDependency( - "com.lihaoyi","ammonite-repl_2.11.7",args.lift(1).getOrElse("0.5.7") + "com.lihaoyi","ammonite-repl_2.11.8",args.lift(1).getOrElse("0.5.8") ) - ) + ).classLoader(classLoaderCache) // FIXME: this does not work quite yet, throws NoSuchFileException: /ammonite/repl/frontend/ReplBridge$.class lib.runMain( - "ammonite.repl.Main", Seq(), d.classLoader(classLoaderCache) + "ammonite.repl.Main", args.drop(2), classLoader ) } def scala = { val version = args.lift(1).getOrElse(constants.scalaVersion) val scalac = new ScalaCompilerDependency( cbtHasChanged, mavenCache, version ) + val _args = Seq("-cp", scalac.classpath.string) ++ args.drop(2) lib.runMain( - "scala.tools.nsc.MainGenericRunner", Seq("-cp", scalac.classpath.string), scalac.classLoader(classLoaderCache) + "scala.tools.nsc.MainGenericRunner", _args, scalac.classLoader(classLoaderCache) ) } def cbtEarlyDependencies = { diff --git a/test/simple-fixed/build/build.scala b/test/simple-fixed/build/build.scala index b72393c..e30b376 100644 --- a/test/simple-fixed/build/build.scala +++ b/test/simple-fixed/build/build.scala @@ -2,32 +2,32 @@ import cbt._ import scala.collection.immutable.Seq import java.io.File -// cbt:https://github.com/cvogt/cbt.git#bdd6d905807a8cee7655d436401e76196ec4fe67 +// cbt:https://github.com/cvogt/cbt.git#ca412e26d70a6615153136019b7966acb9939446 class Build(context: cbt.Context) extends BasicBuild(context){ override def dependencies = ( super.dependencies ++ Seq( - GitDependency("https://github.com/xdotai/diff.git", "698717469b8dd86e8570b86354892be9c0654caf"), - MavenResolver(context.cbtHasChanged,context.paths.mavenCache,MavenResolver.central).resolve( - ScalaDependency("com.typesafe.play", "play-json", "2.4.4"), - MavenDependency("joda-time", "joda-time", "2.9.2"), - // the below tests pom inheritance with dependencyManagement and variable substitution for pom properties - MavenDependency("org.eclipse.jgit", "org.eclipse.jgit", "4.2.0.201601211800-r"), - // the below tests pom inheritance with variable substitution for pom xml tag contents - MavenDependency("com.spotify", "missinglink-core", "0.1.1") - ), - MavenResolver( - context.cbtHasChanged, - context.paths.mavenCache, - MavenResolver.central, - MavenResolver.bintray("tpolecat"), - MavenResolver.sonatypeSnapshots - ).resolve( - "org.cvogt" %% "play-json-extensions" % "0.8.0", - "org.tpolecat" %% "tut-core" % "0.4.2", - "ai.x" %% "lens" % "1.0.0-SNAPSHOT" - ) + GitDependency("https://github.com/xdotai/diff.git", "7ad3920158828d72b9ecb1ba9746fe83e2643824") + ) + ++ + Resolver(mavenCentral).bind( + ScalaDependency("com.typesafe.play", "play-json", "2.4.4"), + MavenDependency("joda-time", "joda-time", "2.9.2"), + // the below tests pom inheritance with dependencyManagement and variable substitution for pom properties + MavenDependency("org.eclipse.jgit", "org.eclipse.jgit", "4.2.0.201601211800-r"), + // the below tests pom inheritance with variable substitution for pom xml tag contents + MavenDependency("com.spotify", "missinglink-core", "0.1.1") + ) + ++ + Resolver( + mavenCentral, + bintray("tpolecat"), + sonatypeSnapshots + ).bind( + "org.cvogt" %% "play-json-extensions" % "0.8.0", + "org.tpolecat" %% "tut-core" % "0.4.2", + "ai.x" %% "lens" % "1.0.0-SNAPSHOT" ) ) } diff --git a/test/simple/build/build.scala b/test/simple/build/build.scala index afd4f4f..c7eab6a 100644 --- a/test/simple/build/build.scala +++ b/test/simple/build/build.scala @@ -7,7 +7,7 @@ class Build(context: cbt.Context) extends BasicBuild(context){ super.dependencies ++ Seq( - GitDependency("https://github.com/xdotai/diff.git", "698717469b8dd86e8570b86354892be9c0654caf") + GitDependency("https://github.com/xdotai/diff.git", "05fdac13a177f74952b54171733be01c258594a8") ) ++ // FIXME: make the below less verbose Resolver( mavenCentral ).bind( diff --git a/test/test.scala b/test/test.scala index b425cfa..13fd44f 100644 --- a/test/test.scala +++ b/test/test.scala @@ -93,6 +93,7 @@ object Main{ new ConcurrentHashMap[AnyRef,ClassLoader], cache, cbtHome, + cbtHome, cbtHome ++ "/compatibilityTarget", null ) |