From ed9fc68716b47de626c3f1f0b5fa1d86a2068498 Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Wed, 28 Sep 2016 10:13:40 -0400 Subject: include dependencyClasspath in compileClasspath and let docs use it too this prevents from forgetting the dependencyClasspath when compileClasspath is used and probably fixes the cp for docs --- stage2/BasicBuild.scala | 5 +++-- stage2/PackageJars.scala | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala index b2bb72b..6d1f010 100644 --- a/stage2/BasicBuild.scala +++ b/stage2/BasicBuild.scala @@ -104,7 +104,8 @@ trait BaseBuild extends DependencyImplementation with BuildInterface with Trigge override def dependencyClasspath : ClassPath = ClassPath(localJars) ++ super.dependencyClasspath protected def compileDependencies: Seq[Dependency] = Nil - final def compileClasspath : ClassPath = ClassPath( compileDependencies.flatMap(_.exportedClasspath.files).distinct ) + final def compileClasspath : ClassPath = + dependencyClasspath ++ ClassPath( compileDependencies.flatMap(_.exportedClasspath.files).distinct ) def exportedClasspath : ClassPath = ClassPath(compile.toSeq) def targetClasspath = ClassPath(Seq(compileTarget)) @@ -129,7 +130,7 @@ trait BaseBuild extends DependencyImplementation with BuildInterface with Trigge lib.compile( context.cbtHasChanged, needsUpdate || context.parentBuild.map(_.needsUpdate).getOrElse(false), - sourceFiles, compileTarget, compileStatusFile, dependencyClasspath ++ compileClasspath, + sourceFiles, compileTarget, compileStatusFile, compileClasspath, context.paths.mavenCache, scalacOptions, context.classLoaderCache, zincVersion = zincVersion, scalaVersion = scalaVersion ) diff --git a/stage2/PackageJars.scala b/stage2/PackageJars.scala index 05e625b..10e4c3a 100644 --- a/stage2/PackageJars.scala +++ b/stage2/PackageJars.scala @@ -24,7 +24,7 @@ trait PackageJars extends BaseBuild with ArtifactInfo{ def docJar: Option[File] = cacheDocBasicBuild{ lib.docJar( context.cbtHasChanged, - scalaVersion, sourceFiles, dependencyClasspath, apiTarget, + scalaVersion, sourceFiles, compileClasspath, docTarget, jarTarget, artifactId, scalaMajorVersion, version, scalacOptions, context.classLoaderCache, context.paths.mavenCache ) -- cgit v1.2.3 From d0cbd2c5afe092c85da7099ab052f700cfc24541 Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Wed, 28 Sep 2016 10:14:00 -0400 Subject: rename apiTarget to more appropriate name docTarget as the task is called docJar --- stage2/BasicBuild.scala | 2 +- stage2/Lib.scala | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala index 6d1f010..bcc3646 100644 --- a/stage2/BasicBuild.scala +++ b/stage2/BasicBuild.scala @@ -57,7 +57,7 @@ trait BaseBuild extends DependencyImplementation with BuildInterface with Trigge /** directory where jars (and the pom file) should be put */ def jarTarget: File = scalaTarget /** directory where the scaladoc should be put */ - def apiTarget: File = scalaTarget ++ "/api" + def docTarget: File = scalaTarget ++ "/api" /** directory where the class files should be put (in package directories) */ def compileTarget: File = scalaTarget ++ "/classes" /** diff --git a/stage2/Lib.scala b/stage2/Lib.scala index e983a97..46fecf7 100644 --- a/stage2/Lib.scala +++ b/stage2/Lib.scala @@ -74,7 +74,7 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ scalaVersion: String, sourceFiles: Seq[File], dependencyClasspath: ClassPath, - apiTarget: File, + docTarget: File, jarTarget: File, artifactId: String, scalaMajorVersion: String, @@ -86,11 +86,11 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ if(sourceFiles.isEmpty){ None } else { - apiTarget.mkdirs + docTarget.mkdirs val args = Seq( // FIXME: can we use compiler dependency here? "-cp", dependencyClasspath.string, // FIXME: does this break for builds that don't have scalac dependencies? - "-d", apiTarget.toString + "-d", docTarget.toString ) ++ compileArgs ++ sourceFiles.map(_.toString) logger.lib("creating docs for source files "+args.mkString(", ")) redirectOutToErr{ @@ -102,7 +102,7 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{ } lib.jarFile( jarTarget ++ ("/"++artifactId++"_"++scalaMajorVersion++"-"++version++"-javadoc.jar"), - Vector(apiTarget) + Vector(docTarget) ) } } -- cgit v1.2.3