mirror of https://github.com/sbt/sbt.git
Fixes for the build
This commit is contained in:
parent
85346bd9d8
commit
ac645c4387
|
|
@ -35,7 +35,7 @@ object Version
|
|||
|
||||
sealed abstract class RichEnum extends Enumeration
|
||||
{
|
||||
def fromString(s: String): Either[String, Value] = valueOf(s).toRight("Expected one of " + elements.mkString(",") + " (got: " + s + ")")
|
||||
def fromString(s: String): Either[String, Value] = elements.find(_.toString == s).toRight("Expected one of " + elements.mkString(",") + " (got: " + s + ")")
|
||||
def toValue(s: String): Value = fromString(s) match { case Left(msg) => error(msg); case Right(t) => t }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,10 +33,8 @@ trait ProguardProject extends BasicScalaProject
|
|||
"-dontwarn",
|
||||
"-ignorewarnings")
|
||||
def keepClasses: Seq[String] = Nil
|
||||
def mapInJars(inJars: Seq[File]): Seq[String] = inJars.map(_.getAbsolutePath)
|
||||
def mapLibraryJars(libJars: Seq[File]): Seq[String] = libJars.map(_.getAbsolutePath)
|
||||
|
||||
def template(inJars: Seq[String], libraryJars: Seq[String], outJars: String, options: Seq[String], mainClass: Option[String], keepClasses: Seq[String]) =
|
||||
def template(inJars: Seq[File], libraryJars: Seq[File], outJar: File, options: Seq[String], mainClass: Option[String], keepClasses: Seq[String]) =
|
||||
{
|
||||
val keepMain =
|
||||
"""-keep public class %s {
|
||||
|
|
@ -46,10 +44,10 @@ trait ProguardProject extends BasicScalaProject
|
|||
val lines =
|
||||
options ++
|
||||
keepClasses.map("-keep public class " + _ + " {\n public * ;\n}") ++
|
||||
inJars.map("-injars " + _) ++
|
||||
Seq("-injars " + rawJarPath.absolutePath,
|
||||
"-outjars " + outJars) ++
|
||||
libraryJars.map("-libraryjars " + _) ++
|
||||
inJars.map(f => "-injars " + mkpath(f)) ++
|
||||
Seq("-injars " + mkpath(rawJarPath.asFile),
|
||||
"-outjars " + mkpath(outJar)) ++
|
||||
libraryJars.map(f => "-libraryjars " + mkpath(f)) ++
|
||||
mainClass.map(main => keepMain.stripMargin.format(main)).toList
|
||||
lines.mkString("\n")
|
||||
}
|
||||
|
|
@ -73,7 +71,7 @@ trait ProguardProject extends BasicScalaProject
|
|||
val (externalJars, libraryJars) = externalDependencies.toList.partition(jar => Path.relativize(rootProjectDirectory, jar).isDefined)
|
||||
log.debug("proguard configuration library jars locations: " + libraryJars.mkString(", "))
|
||||
|
||||
val proguardConfiguration = template(mapInJars(externalJars), mapLibraryJars(libraryJars), outputJar.absolutePath, basicOptions, getMainClass(false), keepClasses)
|
||||
val proguardConfiguration = template(externalJars, libraryJars, outputJar.asFile, basicOptions, getMainClass(false), keepClasses)
|
||||
log.debug("Proguard configuration written to " + proguardConfigurationPath)
|
||||
FileUtilities.write(proguardConfigurationPath.asFile, proguardConfiguration, log)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ class XSbt(info: ProjectInfo) extends ParentProject(info)
|
|||
class IvyProject(info: ProjectInfo) extends Base(info) with TestWithIO with TestWithLog with TestWithLaunch
|
||||
{
|
||||
val ivy = "org.apache.ivy" % "ivy" % "2.0.0"
|
||||
override def deliverProjectDependencies = Set(super.deliverProjectDependencies.toSeq : _*) - launchInterfaceSub.projectID
|
||||
}
|
||||
class InterfaceProject(info: ProjectInfo) extends DefaultProject(info) with ManagedBase with TestWithLog with Component with JavaProject
|
||||
{
|
||||
|
|
@ -158,8 +159,8 @@ trait SourceProject extends BasicScalaProject
|
|||
}
|
||||
trait ManagedBase extends BasicScalaProject
|
||||
{
|
||||
override def deliverScalaDependencies = Nil
|
||||
override def crossScalaVersions = Set("2.7.5")
|
||||
override def deliverScalaDependencies = Nil
|
||||
override def crossScalaVersions = Set("2.7.2", "2.7.5")
|
||||
override def managedStyle = ManagedStyle.Ivy
|
||||
override def useDefaultConfigurations = false
|
||||
val defaultConf = Configurations.Default
|
||||
|
|
|
|||
Loading…
Reference in New Issue