diff --git a/compile/api/src/main/scala/sbt/ClassToAPI.scala b/compile/api/src/main/scala/sbt/ClassToAPI.scala index c2f47c231..71a10ed22 100644 --- a/compile/api/src/main/scala/sbt/ClassToAPI.scala +++ b/compile/api/src/main/scala/sbt/ClassToAPI.scala @@ -26,7 +26,7 @@ object ClassToAPI { } // Avoiding implicit allocation. - private def arrayMap[T <: AnyRef, U <: AnyRef: ClassManifest](xs: Array[T])(f: T => U): Array[U] = { + private def arrayMap[T <: AnyRef, U <: AnyRef: reflect.ClassTag](xs: Array[T])(f: T => U): Array[U] = { val len = xs.length var i = 0 val res = new Array[U](len) diff --git a/compile/integration/src/main/scala/sbt/compiler/MixedAnalyzingCompiler.scala b/compile/integration/src/main/scala/sbt/compiler/MixedAnalyzingCompiler.scala index 914c16bd5..ea599b993 100644 --- a/compile/integration/src/main/scala/sbt/compiler/MixedAnalyzingCompiler.scala +++ b/compile/integration/src/main/scala/sbt/compiler/MixedAnalyzingCompiler.scala @@ -5,7 +5,6 @@ import java.lang.ref.{ SoftReference, Reference } import sbt.classfile.Analyze import sbt.classpath.ClasspathUtilities -import sbt.compiler.CompileConfiguration import sbt.compiler.javac.AnalyzingJavaCompiler import sbt.inc.Locate.DefinesClass import sbt._ diff --git a/compile/src/main/scala/sbt/compiler/AnalyzingCompiler.scala b/compile/src/main/scala/sbt/compiler/AnalyzingCompiler.scala index f970b98d4..3501c3dfb 100644 --- a/compile/src/main/scala/sbt/compiler/AnalyzingCompiler.scala +++ b/compile/src/main/scala/sbt/compiler/AnalyzingCompiler.scala @@ -126,7 +126,7 @@ final class AnalyzingCompiler private (val scalaInstance: xsbti.compile.ScalaIns object AnalyzingCompiler { import sbt.IO.{ copy, createDirectory, zip, jars, unzip, withTemporaryDirectory } - // Note: The Scala build now depends on some details of this method: + // Note: The Scala build now depends on some details of this method: // https://github.com/jsuereth/scala/commit/3431860048df8d2a381fb85a526097e00154eae0 /** * Extract sources from source jars, compile them with the xsbti interfaces on the classpath, and package the compiled classes and @@ -147,7 +147,7 @@ object AnalyzingCompiler { log.info(" Compilation completed in " + (System.currentTimeMillis - start) / 1000.0 + " s") } catch { case e: xsbti.CompileFailed => throw new CompileFailed(e.arguments, "Error compiling sbt component '" + id + "'", e.problems) } import sbt.Path._ - copy(resources x rebase(dir, outputDirectory)) + copy(resources pair rebase(dir, outputDirectory)) zip((outputDirectory ***) x_! relativeTo(outputDirectory), targetJar) } } diff --git a/interface/src/main/java/xsbti/compile/JavaCompiler.java b/interface/src/main/java/xsbti/compile/JavaCompiler.java index 95f9fb992..18b3f5bea 100644 --- a/interface/src/main/java/xsbti/compile/JavaCompiler.java +++ b/interface/src/main/java/xsbti/compile/JavaCompiler.java @@ -4,7 +4,7 @@ import java.io.File; import xsbti.Logger; import xsbti.Reporter; -/** +/** * Interface to a Java compiler. */ public interface JavaCompiler @@ -14,6 +14,7 @@ public interface JavaCompiler * * @deprecated 0.13.8 - Use compileWithReporter instead */ + @Deprecated void compile(File[] sources, File[] classpath, Output output, String[] options, Logger log); /** @@ -23,4 +24,4 @@ public interface JavaCompiler * Failures should be passed to the provided Reporter. */ void compileWithReporter(File[] sources, File[] classpath, Output output, String[] options, Reporter reporter, Logger log); -} \ No newline at end of file +} diff --git a/ivy/src/main/scala/sbt/ivyint/MergeDescriptors.scala b/ivy/src/main/scala/sbt/ivyint/MergeDescriptors.scala index 486d8b7bd..4e2cb1fc2 100644 --- a/ivy/src/main/scala/sbt/ivyint/MergeDescriptors.scala +++ b/ivy/src/main/scala/sbt/ivyint/MergeDescriptors.scala @@ -109,7 +109,7 @@ private final class MergedDescriptors(a: DependencyDescriptor, b: DependencyDesc private[this] def addConfigurations(dd: DefaultDependencyArtifactDescriptor, confs: Seq[String]): Unit = confs foreach dd.addConfiguration - private[this] def concat[T: ClassManifest](a: Array[T], b: Array[T]): Array[T] = (a ++ b).distinct.toArray + private[this] def concat[T: reflect.ClassTag](a: Array[T], b: Array[T]): Array[T] = (a ++ b).distinct.toArray def getAllExcludeRules = concat(a.getAllExcludeRules, b.getAllExcludeRules) diff --git a/main/command/src/main/scala/sbt/BasicCommands.scala b/main/command/src/main/scala/sbt/BasicCommands.scala index caab8ea5c..95dbb383f 100644 --- a/main/command/src/main/scala/sbt/BasicCommands.scala +++ b/main/command/src/main/scala/sbt/BasicCommands.scala @@ -274,7 +274,7 @@ object BasicCommands { val aliasRemoved = removeAlias(state, name) // apply the alias value to the commands of `state` except for the alias to avoid recursion (#933) val partiallyApplied = Parser(Command.combine(aliasRemoved.definedCommands)(aliasRemoved))(value) - val arg = matched(partiallyApplied & (success() | (SpaceClass ~ any.*))) + val arg = matched(partiallyApplied & (success(()) | (SpaceClass ~ any.*))) // by scheduling the expanded alias instead of directly executing, we get errors on the expanded string (#598) arg.map(str => () => (value + str) :: state) } diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index cd05b9c77..58503ef41 100755 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -1853,7 +1853,7 @@ trait BuildExtra extends BuildCommon with DefExtra { def addArtifact(a: Artifact, taskDef: TaskKey[File]): SettingsDefinition = { val pkgd = packagedArtifacts := packagedArtifacts.value updated (a, taskDef.value) - seq(artifacts += a, pkgd) + Seq(artifacts += a, pkgd) } /** Constructs a setting that declares a new artifact `artifact` that is generated by `taskDef`. */ def addArtifact(artifact: Initialize[Artifact], taskDef: Initialize[Task[File]]): SettingsDefinition = @@ -1862,7 +1862,7 @@ trait BuildExtra extends BuildCommon with DefExtra { val taskLocal = TaskKey.local[File] val art = artifacts := artLocal.value +: artifacts.value val pkgd = packagedArtifacts := packagedArtifacts.value updated (artLocal.value, taskLocal.value) - seq(artLocal := artifact.value, taskLocal := taskDef.value, art, pkgd) + Seq(artLocal := artifact.value, taskLocal := taskDef.value, art, pkgd) } // because this was commonly used, this might need to be kept longer than usual diff --git a/main/src/main/scala/sbt/Load.scala b/main/src/main/scala/sbt/Load.scala index 764c8a73a..6c2d914c6 100755 --- a/main/src/main/scala/sbt/Load.scala +++ b/main/src/main/scala/sbt/Load.scala @@ -133,7 +133,7 @@ object Load { val settings = finalTransforms(buildConfigurations(loaded, getRootProject(projects), config.injectSettings)) val delegates = config.delegates(loaded) val data = Def.make(settings)(delegates, config.scopeLocal, Project.showLoadingKey(loaded)) - Project.checkTargets(data) foreach error + Project.checkTargets(data) foreach sys.error val index = structureIndex(data, settings, loaded.extra(data), projects) val streams = mkStreams(projects, loaded.root, data) (rootEval, new sbt.BuildStructure(projects, loaded.root, settings, data, index, streams, delegates, config.scopeLocal)) diff --git a/main/src/main/scala/sbt/PluginDiscovery.scala b/main/src/main/scala/sbt/PluginDiscovery.scala index 37cc29c3e..ad453d50c 100644 --- a/main/src/main/scala/sbt/PluginDiscovery.scala +++ b/main/src/main/scala/sbt/PluginDiscovery.scala @@ -24,7 +24,7 @@ object PluginDiscovery { /** Discovers and loads the sbt-plugin-related top-level modules from the classpath and source analysis in `data` and using the provided class `loader`. */ def discoverAll(data: PluginData, loader: ClassLoader): DetectedPlugins = { - def discover[T](resource: String)(implicit mf: reflect.ClassManifest[T]) = + def discover[T](resource: String)(implicit classTag: reflect.ClassTag[T]) = binarySourceModules[T](data, loader, resource) import Paths._ // TODO - Fix this once we can autodetect AutoPlugins defined by sbt itself. @@ -45,8 +45,8 @@ object PluginDiscovery { /** Discovers the sbt-plugin-related top-level modules from the provided source `analysis`. */ def discoverSourceAll(analysis: inc.Analysis): DiscoveredNames = { - def discover[T](implicit mf: reflect.ClassManifest[T]): Seq[String] = - sourceModuleNames(analysis, mf.erasure.getName) + def discover[T](implicit classTag: reflect.ClassTag[T]): Seq[String] = + sourceModuleNames(analysis, classTag.runtimeClass.getName) new DiscoveredNames(discover[Plugin], discover[AutoPlugin], discover[Build]) } @@ -115,17 +115,17 @@ object PluginDiscovery { def onClasspath(classpath: Seq[File])(url: URL): Boolean = IO.urlAsFile(url) exists (classpath.contains _) - private[sbt] def binarySourceModules[T](data: PluginData, loader: ClassLoader, resourceName: String)(implicit mf: reflect.ClassManifest[T]): DetectedModules[T] = + private[sbt] def binarySourceModules[T](data: PluginData, loader: ClassLoader, resourceName: String)(implicit classTag: reflect.ClassTag[T]): DetectedModules[T] = { val classpath = data.classpath val namesAndValues = if (classpath.isEmpty) Nil else { - val names = binarySourceModuleNames(classpath, loader, resourceName, mf.erasure.getName) + val names = binarySourceModuleNames(classpath, loader, resourceName, classTag.runtimeClass.getName) loadModules[T](data, names, loader) } new DetectedModules(namesAndValues) } - private[this] def loadModules[T: ClassManifest](data: PluginData, names: Seq[String], loader: ClassLoader): Seq[(String, T)] = + private[this] def loadModules[T: reflect.ClassTag](data: PluginData, names: Seq[String], loader: ClassLoader): Seq[(String, T)] = try ModuleUtilities.getCheckedObjects[T](names, loader) catch { case e: ExceptionInInitializerError => @@ -143,4 +143,4 @@ object PluginDiscovery { val msgExtra = if (evictedStrings.isEmpty) "" else "\nNote that conflicts were resolved for some dependencies:\n\t" + evictedStrings.mkString("\n\t") throw new IncompatiblePluginsException(msgBase + msgExtra, t) } -} \ No newline at end of file +} diff --git a/main/src/main/scala/sbt/Project.scala b/main/src/main/scala/sbt/Project.scala index 0fec408e9..c2d2bf39d 100755 --- a/main/src/main/scala/sbt/Project.scala +++ b/main/src/main/scala/sbt/Project.scala @@ -141,7 +141,7 @@ sealed trait Project extends ProjectDefinition[ProjectReference] { def aggregate(refs: ProjectReference*): Project = copy(aggregate = (aggregate: Seq[ProjectReference]) ++ refs) /** Appends settings to the current settings sequence for this project. */ - def settings(ss: SettingsDefinition*): Project = copy(settings = (settings: Seq[Setting[_]]) ++ ss.flatMap(_.settings)) + def settings(ss: SettingsDefinition*): Project = copy(settings = (settings: Seq[Def.Setting[_]]) ++ ss.flatMap(_.settings)) @deprecated("Use settingSets method.", "0.13.5") def autoSettings(select: AddSettings*): Project = settingSets(select.toSeq: _*) diff --git a/scripted/base/src/main/scala/xsbt/test/FileCommands.scala b/scripted/base/src/main/scala/xsbt/test/FileCommands.scala index d9b0ae395..b06cbac2c 100644 --- a/scripted/base/src/main/scala/xsbt/test/FileCommands.scala +++ b/scripted/base/src/main/scala/xsbt/test/FileCommands.scala @@ -112,7 +112,7 @@ class FileCommands(baseDirectory: File) extends BasicStatementHandler { case paths => val mapped = fromStrings(paths) val map = mapper(mapped.last) - IO.copy(mapped.init x map) + IO.copy(mapped.init pair map) } def wrongArguments(args: List[String]): Some[String] = scriptError("Command '" + commandName + "' does not accept arguments (found '" + spaced(args) + "').") diff --git a/util/classpath/src/main/scala/sbt/ModuleUtilities.scala b/util/classpath/src/main/scala/sbt/ModuleUtilities.scala index 4b2ff9dc1..9b3c8cbe2 100644 --- a/util/classpath/src/main/scala/sbt/ModuleUtilities.scala +++ b/util/classpath/src/main/scala/sbt/ModuleUtilities.scala @@ -17,8 +17,8 @@ object ModuleUtilities { } def getCheckedObject[T](className: String, loader: ClassLoader)(implicit mf: reflect.ClassManifest[T]): T = - mf.erasure.cast(getObject(className, loader)).asInstanceOf[T] + mf.runtimeClass.cast(getObject(className, loader)).asInstanceOf[T] def getCheckedObjects[T](classNames: Seq[String], loader: ClassLoader)(implicit mf: reflect.ClassManifest[T]): Seq[(String, T)] = classNames.map(name => (name, getCheckedObject(name, loader))) -} \ No newline at end of file +} diff --git a/util/io/src/main/scala/sbt/IO.scala b/util/io/src/main/scala/sbt/IO.scala index 4a4ca998b..b2d7e7111 100644 --- a/util/io/src/main/scala/sbt/IO.scala +++ b/util/io/src/main/scala/sbt/IO.scala @@ -571,7 +571,7 @@ object IO { * Any parent directories that do not exist are created. */ def copyDirectory(source: File, target: File, overwrite: Boolean = false, preserveLastModified: Boolean = false): Unit = - copy((PathFinder(source) ***) x Path.rebase(source, target), overwrite, preserveLastModified) + copy((PathFinder(source) ***) pair Path.rebase(source, target), overwrite, preserveLastModified) /** * Copies the contents of `sourceFile` to the location of `targetFile`, overwriting any existing content.