mirror of https://github.com/sbt/sbt.git
cleanup
This commit is contained in:
parent
522b412d14
commit
7254885162
|
|
@ -29,6 +29,9 @@ trait ClasspathProject extends Project
|
||||||
}
|
}
|
||||||
set.toList
|
set.toList
|
||||||
}
|
}
|
||||||
|
/* Filter used to select dependencies for the classpath from managed and unmanaged directories.
|
||||||
|
* By default, it explicitly filters (x)sbt-launch(er)-<version>.jar, since it contains minified versions of various classes.*/
|
||||||
|
def classpathFilter: FileFilter = "*.jar" - "*sbt-launch*.jar"
|
||||||
}
|
}
|
||||||
trait BasicDependencyProject extends BasicManagedProject with UnmanagedClasspathProject
|
trait BasicDependencyProject extends BasicManagedProject with UnmanagedClasspathProject
|
||||||
{
|
{
|
||||||
|
|
@ -43,14 +46,12 @@ trait UnmanagedClasspathProject extends ClasspathProject
|
||||||
/** The classpath containing all jars in the unmanaged directory. */
|
/** The classpath containing all jars in the unmanaged directory. */
|
||||||
def unmanagedClasspath: PathFinder =
|
def unmanagedClasspath: PathFinder =
|
||||||
{
|
{
|
||||||
val base = descendents(dependencyPath, jarFilter)
|
val base = descendents(dependencyPath, classpathFilter)
|
||||||
if(scratch)
|
if(scratch)
|
||||||
base +++ (info.projectPath * jarFilter)
|
base +++ (info.projectPath * classpathFilter)
|
||||||
else
|
else
|
||||||
base
|
base
|
||||||
}
|
}
|
||||||
/* Explicitly filter (x)sbt-launch(er)-<version>.jar, since it contains minified versions of various classes.*/
|
|
||||||
private def jarFilter: NameFilter = "*.jar" - "*sbt-launch*.jar"
|
|
||||||
/** The classpath containing all unmanaged classpath elements for the given configuration. This typically includes
|
/** The classpath containing all unmanaged classpath elements for the given configuration. This typically includes
|
||||||
* at least 'unmanagedClasspath'.*/
|
* at least 'unmanagedClasspath'.*/
|
||||||
def fullUnmanagedClasspath(config: Configuration): PathFinder
|
def fullUnmanagedClasspath(config: Configuration): PathFinder
|
||||||
|
|
@ -123,7 +124,7 @@ trait ManagedProject extends ClasspathProject with IvyTasks
|
||||||
def managedClasspath(config: Configuration): PathFinder = configurationClasspath(config)
|
def managedClasspath(config: Configuration): PathFinder = configurationClasspath(config)
|
||||||
/** All dependencies in the given configuration. */
|
/** All dependencies in the given configuration. */
|
||||||
final def configurationClasspath(config: Configuration): PathFinder = descendents(configurationPath(config), classpathFilter)
|
final def configurationClasspath(config: Configuration): PathFinder = descendents(configurationPath(config), classpathFilter)
|
||||||
def classpathFilter: FileFilter = "*.jar"
|
|
||||||
/** The base path to which dependencies in configuration 'config' are downloaded.*/
|
/** The base path to which dependencies in configuration 'config' are downloaded.*/
|
||||||
def configurationPath(config: Configuration): Path = managedDependencyPath / config.toString
|
def configurationPath(config: Configuration): Path = managedDependencyPath / config.toString
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,10 @@ class xMain extends xsbti.AppMain
|
||||||
def rememberCurrent(newArgs: List[String]) = rememberProject(rememberFail(newArgs))
|
def rememberCurrent(newArgs: List[String]) = rememberProject(rememberFail(newArgs))
|
||||||
def rememberProject(newArgs: List[String]) = if(baseProject.name != project.name) (ProjectAction + " " + project.name) :: newArgs else newArgs
|
def rememberProject(newArgs: List[String]) = if(baseProject.name != project.name) (ProjectAction + " " + project.name) :: newArgs else newArgs
|
||||||
def rememberFail(newArgs: List[String]) = failAction.map(f => (FailureHandlerPrefix + f)).toList ::: newArgs
|
def rememberFail(newArgs: List[String]) = failAction.map(f => (FailureHandlerPrefix + f)).toList ::: newArgs
|
||||||
|
|
||||||
def tryOrFail(action: => Trampoline) = try { action } catch { case e: Exception => logCommandError(project.log, e); failed(BuildErrorExitCode) }
|
def tryOrFail(action: => Trampoline) = try { action } catch { case e: Exception => logCommandError(project.log, e); failed(BuildErrorExitCode) }
|
||||||
|
def reload(newID: ApplicationID, args: List[String]) =
|
||||||
|
result( new Reboot(project.defScalaVersion.value, rememberCurrent(args), newID, configuration.baseDirectory) )
|
||||||
def failed(code: Int) =
|
def failed(code: Int) =
|
||||||
failAction match
|
failAction match
|
||||||
{
|
{
|
||||||
|
|
@ -147,9 +150,7 @@ class xMain extends xsbti.AppMain
|
||||||
{
|
{
|
||||||
case "" :: tail => continue(project, tail, failAction)
|
case "" :: tail => continue(project, tail, failAction)
|
||||||
case (ExitCommand | QuitCommand) :: _ => result( Exit(NormalExitCode) )
|
case (ExitCommand | QuitCommand) :: _ => result( Exit(NormalExitCode) )
|
||||||
case RebootCommand :: tail =>
|
case RebootCommand :: tail => reload( new ApplicationID(configuration.provider.id, baseProject.sbtVersion.value), tail )
|
||||||
val newID = new ApplicationID(configuration.provider.id, baseProject.sbtVersion.value)
|
|
||||||
result( new Reboot(project.defScalaVersion.value, rememberCurrent(tail), newID, configuration.baseDirectory) )
|
|
||||||
case InteractiveCommand :: _ => continue(project, prompt(baseProject, project) :: arguments, interactiveContinue)
|
case InteractiveCommand :: _ => continue(project, prompt(baseProject, project) :: arguments, interactiveContinue)
|
||||||
case SpecificBuild(version, action) :: tail =>
|
case SpecificBuild(version, action) :: tail =>
|
||||||
if(Some(version) != baseProject.info.buildScalaVersion)
|
if(Some(version) != baseProject.info.buildScalaVersion)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue