* Add logging for Scala dependency filtering/checking.

* Fix tab completion for javap
 * Fix archive generation code


git-svn-id: https://simple-build-tool.googlecode.com/svn/trunk@967 d89573ee-9141-11dd-94d4-bdf5e562f29c
This commit is contained in:
dmharrah 2009-08-24 01:23:41 +00:00
parent 89ccb9ec3f
commit 4687ecbf2c
5 changed files with 19 additions and 12 deletions

View File

@ -254,7 +254,7 @@ trait BasicManagedProject extends ManagedProject with ReflectiveManagedProject w
Configurations.removeDuplicates(Configurations.defaultMavenConfigurations ++ reflective ++ extra)
}
else
reflective ++ extraDefaultConfigurations
reflective ++ extra
}
def extraDefaultConfigurations: List[Configuration] = Nil
def useIntegrationTestConfiguration = false

View File

@ -148,12 +148,12 @@ object FileUtilities
nextEntry.setTime(sourceFile.lastModified)
output.putNextEntry(nextEntry)
transferAndClose(new FileInputStream(sourceFile), output, log)
output.closeEntry()
}
else
log.warn("\tSource " + source + " does not exist.")
}
sources.foreach(add)
output.closeEntry()
None
}

View File

@ -235,7 +235,10 @@ object ManageDependencies
val (module, conf) = moduleAndConf
val explicitCheck =
if(check.checkExplicit)
{
log.debug("Checking explicit Scala dependencies")
checkDependencies(module, check.scalaVersion, check.configurations)
}
else
None
explicitCheck match
@ -243,15 +246,18 @@ object ManageDependencies
case None =>
if(check.filterImplicit)
{
log.debug("Filtering transitive Scala dependencies")
val asDefault = toDefaultModuleDescriptor(module)
excludeScalaJars(asDefault, check.configurations)
excludeScalaJars(asDefault, check.configurations, config.log)
Right( (asDefault, conf) )
}
else
Right(moduleAndConf)
case Some(err) => Left(err)
}
case None => Right(moduleAndConf)
case None =>
log.debug("Not checking Scala dependencies")
Right(moduleAndConf)
}
this.synchronized // Ivy is not thread-safe. In particular, it uses a static DocumentBuilder, which is not thread-safe
@ -294,7 +300,7 @@ object ManageDependencies
/** Adds exclusions for the scala library and compiler jars so that they are not downloaded. This is
* done because normally these jars are already on the classpath and cannot/should not be overridden. The version
* of Scala to use is done by setting scala.version in the project definition. */
private def excludeScalaJars(module: DefaultModuleDescriptor, configurations: Iterable[Configuration])
private def excludeScalaJars(module: DefaultModuleDescriptor, configurations: Iterable[Configuration], log: Logger)
{
val configurationNames =
{
@ -310,7 +316,7 @@ object ManageDependencies
}
}
def excludeScalaJar(name: String): Unit =
module.addExcludeRule(excludeRule(ScalaArtifacts.Organization, name, configurationNames))
module.addExcludeRule(excludeRule(ScalaArtifacts.Organization, name, configurationNames, log))
excludeScalaJar(ScalaArtifacts.LibraryID)
excludeScalaJar(ScalaArtifacts.CompilerID)
}
@ -325,9 +331,10 @@ object ManageDependencies
}
/** Creates an ExcludeRule that excludes artifacts with the given module organization and name for
* the given configurations. */
private def excludeRule(organization: String, name: String, configurationNames: Iterable[String]): ExcludeRule =
private def excludeRule(organization: String, name: String, configurationNames: Iterable[String], log: Logger): ExcludeRule =
{
val artifact = new ArtifactId(ModuleId.newInstance(organization, name), "*", "*", "*")
log.debug("Excluding " + artifact + " in " + configurationNames.mkString(", "))
val rule = new DefaultExcludeRule(artifact, ExactPatternMatcher.INSTANCE, Collections.emptyMap[AnyRef,AnyRef])
configurationNames.foreach(rule.addConfiguration)
rule

View File

@ -214,10 +214,10 @@ trait Project extends TaskManager with Dag[Project] with BasicEnvironment
* version of Scala being used to build the project. ScalaVersion.current and ScalaVersion.cross should be used
* to read the version of Scala building the project. This should only be used to change the version of Scala used
* for normal development (not cross-building)*/
final val scalaVersion = propertyOptional[String]("")
final val sbtVersion = propertyOptional[String]("")
final val scalaVersion = propertyOptional[String]("", true)
final val sbtVersion = propertyOptional[String]("", true)
final val projectInitialize = propertyOptional[Boolean](false)
final val projectScratch = propertyOptional[Boolean](false)
final val projectScratch = propertyOptional[Boolean](false, true)
/** If this project is cross-building, returns `base` with an additional path component containing the scala version.
* Otherwise, this returns `base`.

View File

@ -120,8 +120,8 @@ trait ScalaProject extends SimpleScalaProject with FileTasks with MultiTaskProje
} completeWith(classNames(conditional, compilePath))
private def classNames(conditional: CompileConditional, compilePath: Path) =
{
val classes = conditional.analysis.allProducts.flatMap(Path.relativize(compilePath, _))
classes.map(_.relativePath.replace(java.io.File.separatorChar, '.').toList.dropRight(".class".length).mkString).toSeq
val classes = conditional.analysis.allProducts.flatMap(path => Path.relativize(compilePath.asFile, path.asFile))
classes.map(_.replace(java.io.File.separatorChar, '.').toList.dropRight(".class".length).mkString).toSeq
}
def consoleTask(classpath : PathFinder): Task =