mirror of https://github.com/sbt/sbt.git
Cleanup actionsProj
This commit is contained in:
parent
12d2b5a63b
commit
e48f6ade30
|
|
@ -44,12 +44,13 @@ object Doc {
|
|||
// def apply(maximumErrors: Int, compiler: sbt.compiler.Javadoc) = new Javadoc(maximumErrors, compiler)
|
||||
|
||||
private[sbt] final class Scaladoc(maximumErrors: Int, compiler: AnalyzingCompiler) extends Doc {
|
||||
def apply(label: String, sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String], log: Logger) {
|
||||
def apply(label: String, sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String], log: Logger): Unit = {
|
||||
generate("Scala", label, compiler.doc, sources, classpath, outputDirectory, options, maximumErrors, log)
|
||||
}
|
||||
}
|
||||
// TODO: trait Javadoc in package inc is deprecated: Please use the new set of compilers in sbt.compilers.javac
|
||||
private[sbt] final class Javadoc(maximumErrors: Int, doc: sbt.internal.inc.Javadoc) extends Doc {
|
||||
def apply(label: String, sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String], log: Logger) {
|
||||
def apply(label: String, sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String], log: Logger): Unit = {
|
||||
// javadoc doesn't handle *.scala properly, so we evict them from javadoc sources list.
|
||||
generate("Java", label, doc.doc, sources.filterNot(_.name.endsWith(".scala")), classpath, outputDirectory, options, maximumErrors, log)
|
||||
}
|
||||
|
|
@ -61,7 +62,7 @@ sealed trait Doc {
|
|||
|
||||
// def apply(label: String, sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String], log: Logger): Unit
|
||||
|
||||
private[sbt] final def generate(variant: String, label: String, docf: Gen, sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String], maxErrors: Int, log: Logger) {
|
||||
private[sbt] final def generate(variant: String, label: String, docf: Gen, sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String], maxErrors: Int, log: Logger): Unit = {
|
||||
val logSnip = variant + " API documentation"
|
||||
if (sources.isEmpty)
|
||||
log.info("No sources available, skipping " + logSnip + "...")
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ object DotGraph {
|
|||
def packages(relations: Relations, outputDirectory: File, sourceRoots: Iterable[File]): Unit = {
|
||||
val packageOnly = (path: String) =>
|
||||
{
|
||||
val last = path.lastIndexOf(File.separatorChar)
|
||||
val last = path.lastIndexOf(File.separatorChar.toInt)
|
||||
val packagePath = (if (last > 0) path.substring(0, last) else path).trim
|
||||
if (packagePath.isEmpty) "" else packagePath.replace(File.separatorChar, '.')
|
||||
}
|
||||
|
|
@ -34,8 +34,8 @@ object DotGraph {
|
|||
generateGraph(file("binary-dependencies"), "externalDependencies", relations.binaryDep, externalToString, sourceToString)
|
||||
}
|
||||
|
||||
def generateGraph[Key, Value](file: File, graphName: String, relation: Relation[Key, Value],
|
||||
keyToString: Key => String, valueToString: Value => String) {
|
||||
def generateGraph[K, V](file: File, graphName: String, relation: Relation[K, V],
|
||||
keyToString: K => String, valueToString: V => String): Unit = {
|
||||
import scala.collection.mutable.{ HashMap, HashSet }
|
||||
val mappedGraph = new HashMap[String, HashSet[String]]
|
||||
for ((key, values) <- relation.forwardMap; keyString = keyToString(key); value <- values)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ private[sbt] object ForkTests {
|
|||
val resultsAcc = mutable.Map.empty[String, SuiteResult]
|
||||
lazy val result = TestOutput(overall(resultsAcc.values.map(_.result)), resultsAcc.toMap, Iterable.empty)
|
||||
|
||||
def run() {
|
||||
def run(): Unit = {
|
||||
val socket =
|
||||
try {
|
||||
server.accept()
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ object Sync {
|
|||
IO.copyLastModified(source, target)
|
||||
}
|
||||
|
||||
def noDuplicateTargets(relation: Relation[File, File]) {
|
||||
def noDuplicateTargets(relation: Relation[File, File]): Unit = {
|
||||
val dups = relation.reverseMap.filter {
|
||||
case (target, srcs) =>
|
||||
srcs.size >= 2 && srcs.exists(!_.isDirectory)
|
||||
|
|
|
|||
|
|
@ -3,11 +3,10 @@ package compiler
|
|||
|
||||
import scala.reflect.Manifest
|
||||
import scala.tools.nsc.{ ast, interpreter, io, reporters, util, CompilerCommand, Global, Phase, Settings }
|
||||
import interpreter.AbstractFileClassLoader
|
||||
import io.{ AbstractFile, PlainFile, VirtualDirectory }
|
||||
import ast.parser.Tokens
|
||||
import reporters.{ ConsoleReporter, Reporter }
|
||||
import scala.reflect.internal.util.BatchSourceFile
|
||||
import scala.reflect.internal.util.{ AbstractFileClassLoader, BatchSourceFile }
|
||||
import Tokens.{ EOF, NEWLINE, NEWLINES, SEMI }
|
||||
import java.io.File
|
||||
import java.nio.ByteBuffer
|
||||
|
|
@ -90,7 +89,7 @@ final class Eval(optionsNoncp: Seq[String], classpath: Seq[File], mkReporter: Se
|
|||
val tpt: Tree = expectedType(tpeName)
|
||||
augment(parser, importTrees, tree, tpt, moduleName)
|
||||
}
|
||||
def extra(run: Run, unit: CompilationUnit) = atPhase(run.typerPhase.next) { (new TypeExtractor).getType(unit.body) }
|
||||
def extra(run: Run, unit: CompilationUnit) = enteringPhase(run.typerPhase.next) { (new TypeExtractor).getType(unit.body) }
|
||||
def read(file: File) = IO.read(file)
|
||||
def write(value: String, f: File) = IO.write(f, value)
|
||||
def extraHash = ""
|
||||
|
|
@ -112,7 +111,7 @@ final class Eval(optionsNoncp: Seq[String], classpath: Seq[File], mkReporter: Se
|
|||
syntheticModule(fullParser, importTrees, trees.toList, moduleName)
|
||||
}
|
||||
def extra(run: Run, unit: CompilationUnit) = {
|
||||
atPhase(run.typerPhase.next) { (new ValExtractor(valTypes.toSet)).getVals(unit.body) }
|
||||
enteringPhase(run.typerPhase.next) { (new ValExtractor(valTypes.toSet)).getVals(unit.body) }
|
||||
}
|
||||
def read(file: File) = IO.readLines(file)
|
||||
def write(value: Seq[String], file: File) = IO.writeLines(file, value)
|
||||
|
|
@ -176,7 +175,7 @@ final class Eval(optionsNoncp: Seq[String], classpath: Seq[File], mkReporter: Se
|
|||
if (phase == null || phase == phase.next || reporter.hasErrors)
|
||||
()
|
||||
else {
|
||||
atPhase(phase) { phase.run }
|
||||
enteringPhase(phase) { phase.run }
|
||||
compile(phase.next)
|
||||
}
|
||||
}
|
||||
|
|
@ -221,7 +220,7 @@ final class Eval(optionsNoncp: Seq[String], classpath: Seq[File], mkReporter: Se
|
|||
Block(List(Apply(Select(Super(This(emptyTypeName), emptyTypeName), nme.CONSTRUCTOR), Nil)), Literal(Constant(())))
|
||||
)
|
||||
|
||||
def moduleBody = Template(List(gen.scalaAnyRefConstr), emptyValDef, emptyInit :: definitions)
|
||||
def moduleBody = Template(List(gen.scalaAnyRefConstr), noSelfType, emptyInit :: definitions)
|
||||
def moduleDef = ModuleDef(NoMods, newTermName(objectName), moduleBody)
|
||||
parser.makePackaging(0, emptyPkg, (imports :+ moduleDef).toList)
|
||||
}
|
||||
|
|
@ -245,7 +244,7 @@ final class Eval(optionsNoncp: Seq[String], classpath: Seq[File], mkReporter: Se
|
|||
}
|
||||
override def traverse(tree: Tree): Unit = tree match {
|
||||
case ValDef(_, n, actualTpe, _) if isTopLevelModule(tree.symbol.owner) && isAcceptableType(actualTpe.tpe) =>
|
||||
vals ::= nme.localToGetter(n).encoded
|
||||
vals ::= n.dropLocal.encoded
|
||||
case _ => super.traverse(tree)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue