diff options
author | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-29 00:26:36 -0400 |
---|---|---|
committer | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-29 00:26:36 -0400 |
commit | 5488ec69c4c4bdc0e4321a051bababcac960e92f (patch) | |
tree | d0e17c0883f7f449b5e46bc12de119046d3aa2de | |
parent | a6150a65d4638e737a8e70b9fea768a0745cec60 (diff) | |
parent | 56655b67fa94c223935da9a4532d08bf88c12071 (diff) | |
download | cbt-5488ec69c4c4bdc0e4321a051bababcac960e92f.tar.gz cbt-5488ec69c4c4bdc0e4321a051bababcac960e92f.tar.bz2 cbt-5488ec69c4c4bdc0e4321a051bababcac960e92f.zip |
Merge pull request #113 from cvogt/fix-cbt-build
Fix cbt build
-rw-r--r-- | DEVELOPER_GUIDE.txt | 5 | ||||
-rw-r--r-- | build/build.scala | 4 | ||||
-rw-r--r-- | stage1/CbtPaths.scala (renamed from stage1/paths.scala) | 2 | ||||
-rw-r--r-- | stage1/Stage1.scala | 4 | ||||
-rw-r--r-- | stage1/cbt.scala | 2 | ||||
-rw-r--r-- | stage2/AdminTasks.scala | 2 | ||||
-rw-r--r-- | stage2/Scaffold.scala | 11 | ||||
-rw-r--r-- | stage2/Stage2.scala | 2 |
8 files changed, 20 insertions, 12 deletions
diff --git a/DEVELOPER_GUIDE.txt b/DEVELOPER_GUIDE.txt index a26d760..5869257 100644 --- a/DEVELOPER_GUIDE.txt +++ b/DEVELOPER_GUIDE.txt @@ -18,6 +18,9 @@ Or try `cbt direct <taskname>` to circumvent nailgun. It can also help to delete all target folders `find .|grep target\$|xargs rm -rf` inside of CBT. Or (almost never) the `cache/` directory. +To edit/debug CBT in IntelliJ, add the whole directory as a new scala project. +Add the source folders manually and exclude the nested target folders. + CBT's directory structure cbt Shell script launching cbt. Can be symlinked. @@ -25,7 +28,7 @@ compatibility/ Java interfaces that all CBT versions are source compatible between composed builds of different versions. nailgun_launcher/ Self-contained helper that allows using Nailgun with minimal permanent classpath. (Is this actually needed?) realpath/ Self-contained realpath source code to correctly figure our CBTs home directory. (Open for replacement ideas.) -stage1/ CBT's code that only relies only on Scala/Java built-ins. Contains a Maven resolver to download libs for stage2. +stage1/ CBT's code that only relies only on Scala/Java built-ins. Contains a Maven resolver to download libs for stage2. stage2/ CBT's code that requires additional libs, e.g. barbary watchservice. test/ Unit tests that can serve as example builds sonatype.login Sonatype credentials for deployment. Not in git obviously. diff --git a/build/build.scala b/build/build.scala index 1622f01..0f9efe5 100644 --- a/build/build.scala +++ b/build/build.scala @@ -11,9 +11,9 @@ class Build(context: Context) extends BasicBuild(context){ 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") - ) :+ BinaryDependency(new File(System.getenv("CBT_HOME")+"/compatibility"), Seq()) + ) } override def sources = Seq( - "nailgun_launcher", "stage1", "stage2" + "nailgun_launcher", "stage1", "stage2", "compatibility" ).map(d => projectDirectory ++ ("/" + d)) } diff --git a/stage1/paths.scala b/stage1/CbtPaths.scala index c16c614..aa24d4e 100644 --- a/stage1/paths.scala +++ b/stage1/CbtPaths.scala @@ -1,6 +1,6 @@ package cbt import java.io._ -case class Paths(private val cbtHome: File, private val cache: File){ +case class CbtPaths(private val cbtHome: File, private val cache: File){ val userHome: File = new File(Option(System.getProperty("user.home")).get) val nailgun: File = cbtHome ++ "/nailgun_launcher" val stage1: File = cbtHome ++ "/stage1" diff --git a/stage1/Stage1.scala b/stage1/Stage1.scala index bf2c272..1bb0dd0 100644 --- a/stage1/Stage1.scala +++ b/stage1/Stage1.scala @@ -84,7 +84,7 @@ object Stage1{ val lib = new Stage1Lib(logger) import lib._ - val paths = Paths(cbtHome, cache) + val paths = CbtPaths(cbtHome, cache) import paths._ val stage2sourceFiles = stage2.listFiles.toVector.filter(_.isFile).filter(_.toString.endsWith(".scala")) @@ -162,7 +162,7 @@ object Stage1{ ) - val (cbtHasChanged, classLoader) = buildStage2( Paths(cbtHome, cache).compatibilityTarget, classLoaderCache, _cbtChanged, cbtHome, cache ) + val (cbtHasChanged, classLoader) = buildStage2( CbtPaths(cbtHome, cache).compatibilityTarget, classLoaderCache, _cbtChanged, cbtHome, cache ) val stage2Args = Stage2Args( new File( args.args(0) ), diff --git a/stage1/cbt.scala b/stage1/cbt.scala index 4594135..33422cc 100644 --- a/stage1/cbt.scala +++ b/stage1/cbt.scala @@ -41,7 +41,7 @@ object `package`{ } implicit class ContextExtensions(subject: Context){ import subject._ - val paths = Paths(cbtHome, cache) + val paths = CbtPaths(cbtHome, cache) implicit def logger: Logger = new Logger(enabledLoggers, start) def classLoaderCache: ClassLoaderCache = new ClassLoaderCache( logger, diff --git a/stage2/AdminTasks.scala b/stage2/AdminTasks.scala index 9086470..56d6ddf 100644 --- a/stage2/AdminTasks.scala +++ b/stage2/AdminTasks.scala @@ -11,7 +11,7 @@ class AdminTasks( cbtHome: File, cbtHasChanged: Boolean ){ - private val paths = Paths(cbtHome, cache) + private val paths = CbtPaths(cbtHome, cache) import paths._ private val mavenCentral = MavenResolver(cbtHasChanged,mavenCache,MavenResolver.central) implicit val logger: Logger = lib.logger diff --git a/stage2/Scaffold.scala b/stage2/Scaffold.scala index 7806b8c..407fee1 100644 --- a/stage2/Scaffold.scala +++ b/stage2/Scaffold.scala @@ -22,9 +22,14 @@ import java.io.File import scala.collection.immutable.Seq class Build(context: Context) extends BasicBuild(context){ - override def dependencies = super.dependencies ++ Seq( // don't forget super.dependencies here - // "org.cvogt" %% "scala-extensions" % "0.4.1" - ) + 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") + ) + } } """ ) diff --git a/stage2/Stage2.scala b/stage2/Stage2.scala index 5316e78..9639380 100644 --- a/stage2/Stage2.scala +++ b/stage2/Stage2.scala @@ -19,7 +19,7 @@ object Stage2 extends Stage2Base{ def run( args: Stage2Args ): Unit = { import args.logger - val paths = Paths(args.cbtHome,args.cache) + val paths = CbtPaths(args.cbtHome,args.cache) import paths._ val lib = new Lib(args.logger) |