diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-27 23:35:58 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-28 15:03:57 -0400 |
commit | 53247b5610b0168a3dd93d3d8f1224b78995ecde (patch) | |
tree | cc2b25cc8e842de565c03ae1192a460e66652fbb /test/simple/build | |
parent | 9951f3f3e65337d2ca567ffb1760a6545fe14998 (diff) | |
download | cbt-53247b5610b0168a3dd93d3d8f1224b78995ecde.tar.gz cbt-53247b5610b0168a3dd93d3d8f1224b78995ecde.tar.bz2 cbt-53247b5610b0168a3dd93d3d8f1224b78995ecde.zip |
Reproducible builds, composing different CBT version and various improvements
One large commit, because it is was hard to do these things in isolation or to separate them now.
CBT now knows how to load other versions of itself
- Support for reproducible builds (!), by providing a CBT git URL and hash to tie build to
- Support for composing builds using different CBT versions (!)
- introduce (in compatibility/) Java interfaces all CBT versions need to stay compatible with, so they can talk to each other. And put extension methods to these interfaces in cbt package object
Class loading
- add some sanity checks for class loading
- improve class loader invalidation to fix bugs
- implement caching in Java land class loaders. In particular to prevent the system class loader to repeatedly generate ClassNotFound exceptions in each sink of the class loader DAG for non JDK classes (meaning major speed up for projects with many classes).
- getting rid of transient class loader cache unifying into "persistent" one instead (which is still wrong as invalidation eventually needs to invalidate entire sub graphs of the class loading DAG, not single class loaders. Seems like we'll have to abandon the hashmap based approach and tie caching to dependency objects)
Other Caching
- cache dependencies extracted from xml files, which was one major time killer, but invalidate cache when cbt changed (maven dependency user facing api needs simplification now!)
- memorize last successful compile time in the file system rather than memory, to guard against unnecessary recompiling even across launches (or when using cbt direct)
Structural improvements
- Factor out ClassLoaderCache on Java land into its own class.
- Port MultiClassLoader to Java land, to better compose classloaders in NailgunLauncher.
- Remove many global constants and variables (in object paths and in NailgunLauncher) and pass them through instead. Needed for composing of builds.
- move more code from resolver into Lib for less entanglement with classes (needed to compatibility interfaces) and better re-usability
- remove canBeCached. Everything can be cached now, but we need to be careful about correct invalidation.
- remove build announcing produced jars. We can add if ever needed.
- change callNullary to return exit code instead of Unit as preparation for next commit introducing "recursive"
ScalaTest
- Makes ScalaTest support work (still a bit too inflexible, but mostly works well)
Diffstat (limited to 'test/simple/build')
-rw-r--r-- | test/simple/build/build.scala | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/simple/build/build.scala b/test/simple/build/build.scala index 5782c2d..f54c3dc 100644 --- a/test/simple/build/build.scala +++ b/test/simple/build/build.scala @@ -7,8 +7,9 @@ class Build(context: cbt.Context) extends BasicBuild(context){ super.dependencies ++ Seq( - GitDependency("https://github.com/xdotai/diff.git", "666bbbf4dbff6fadc81c011ade7b83e91d3f9256"), - MavenRepository.central.resolve( + GitDependency("https://github.com/xdotai/diff.git", "698717469b8dd86e8570b86354892be9c0654caf"), + // FIXME: make the below less verbose + 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 @@ -21,10 +22,12 @@ class Build(context: cbt.Context) extends BasicBuild(context){ // TODO: put in a proper error message for version range not supported //MavenDependency("com.github.nikita-volkov", "sext", "0.2.4") ), - MavenRepository.combine( - MavenRepository.central, - MavenRepository.bintray("tpolecat"), - MavenRepository.sonatypeSnapshots + 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", |