Changing from scala 2.9.2 to 2.10.2.
--modified ivy dependencies --modified scala classpath in build.xml to include scala-reflect --changed imports to point to the new scala scala.reflect.internal.util --set the bootclasspath in QScriptManager as well as the classpath variable. --removing Set[File] <-> Set[String] conversions ----Set is invariant now and the conversions broke --removing unit tests for Set[File] <-> Set[String] conversions
This commit is contained in:
parent
5bbad75402
commit
b32ad99d3f
|
|
@ -526,6 +526,7 @@
|
||||||
<fileset dir="${lib.dir}">
|
<fileset dir="${lib.dir}">
|
||||||
<include name="scala-compiler-*.jar"/>
|
<include name="scala-compiler-*.jar"/>
|
||||||
<include name="scala-library-*.jar"/>
|
<include name="scala-library-*.jar"/>
|
||||||
|
<include name="scala-reflect-*.jar"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
</path>
|
</path>
|
||||||
<taskdef resource="scala/tools/ant/antlib.xml">
|
<taskdef resource="scala/tools/ant/antlib.xml">
|
||||||
|
|
|
||||||
4
ivy.xml
4
ivy.xml
|
|
@ -82,8 +82,8 @@
|
||||||
<dependency org="net.sf.gridscheduler" name="drmaa" rev="latest.integration"/>
|
<dependency org="net.sf.gridscheduler" name="drmaa" rev="latest.integration"/>
|
||||||
|
|
||||||
<!-- Scala dependancies -->
|
<!-- Scala dependancies -->
|
||||||
<dependency org="org.scala-lang" name="scala-compiler" rev="2.9.2"/>
|
<dependency org="org.scala-lang" name="scala-compiler" rev="2.10.2"/>
|
||||||
<dependency org="org.scala-lang" name="scala-library" rev="2.9.2"/>
|
<dependency org="org.scala-lang" name="scala-library" rev="2.10.2"/>
|
||||||
|
|
||||||
<!-- testing and evaluation dependencies -->
|
<!-- testing and evaluation dependencies -->
|
||||||
<dependency org="org.testng" name="testng" rev="6.8"/>
|
<dependency org="org.testng" name="testng" rev="6.8"/>
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,9 @@ import java.io.File
|
||||||
import scala.tools.nsc.reporters.AbstractReporter
|
import scala.tools.nsc.reporters.AbstractReporter
|
||||||
import java.lang.String
|
import java.lang.String
|
||||||
import org.apache.log4j.Level
|
import org.apache.log4j.Level
|
||||||
import scala.tools.nsc.util.{FakePos, NoPosition, Position}
|
|
||||||
import org.broadinstitute.sting.queue.util.TextFormatUtils._
|
import org.broadinstitute.sting.queue.util.TextFormatUtils._
|
||||||
import org.broadinstitute.sting.utils.classloader.JVMUtils
|
import org.broadinstitute.sting.utils.classloader.JVMUtils
|
||||||
import tools.util.StringOps
|
import scala.reflect.internal.util.{FakePos, NoPosition, Position, StringOps}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plugin manager for QScripts which loads QScripts into the current class loader.
|
* Plugin manager for QScripts which loads QScripts into the current class loader.
|
||||||
|
|
@ -53,7 +52,10 @@ class QScriptManager() extends Logging {
|
||||||
settings.outdir.value = tempDir.getPath
|
settings.outdir.value = tempDir.getPath
|
||||||
|
|
||||||
// Set the classpath to the current class path.
|
// Set the classpath to the current class path.
|
||||||
JVMUtils.getClasspathURLs.foreach(url => settings.classpath.append(url.getPath))
|
JVMUtils.getClasspathURLs.foreach(url => {
|
||||||
|
settings.bootclasspath.append(url.getPath)
|
||||||
|
settings.classpath.append(url.getPath)
|
||||||
|
})
|
||||||
|
|
||||||
val reporter = new QScriptManager.Log4JReporter(settings)
|
val reporter = new QScriptManager.Log4JReporter(settings)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,21 +77,6 @@ object StringFileConversions {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
implicit def stringsAsFiles(x: Set[Comparable[_ >: File with String <: Comparable[_ >: File with String <: Comparable[_ >: File with String <: Serializable] with Serializable] with Serializable] with Serializable]): Set[File] = {
|
|
||||||
x.map(_ match {
|
|
||||||
case string: String => stringAsFile(string)
|
|
||||||
case file: File => file
|
|
||||||
case null => null
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
implicit def filesAsStrings(x: Set[Comparable[_ >: String with File <: Comparable[_ >: String with File <: Comparable[_ >: String with File <: Serializable] with Serializable] with Serializable] with Serializable]): Set[String] = {
|
|
||||||
x.map(_ match {
|
|
||||||
case file: File => fileAsString(file)
|
|
||||||
case string: String => string
|
|
||||||
case null => null
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -124,11 +109,4 @@ trait StringFileConversions {
|
||||||
StringFileConversions.filesAsStringsList(x)
|
StringFileConversions.filesAsStringsList(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
implicit def stringsAsFiles(x: Set[Comparable[_ >: File with String <: Comparable[_ >: File with String <: Comparable[_ >: File with String <: Serializable] with Serializable] with Serializable] with Serializable]): Set[File] = {
|
|
||||||
StringFileConversions.stringsAsFiles(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
implicit def filesAsStrings(x: Set[Comparable[_ >: String with File <: Comparable[_ >: String with File <: Comparable[_ >: String with File <: Serializable] with Serializable] with Serializable] with Serializable]): Set[String] = {
|
|
||||||
StringFileConversions.filesAsStrings(x)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,44 +87,6 @@ class StringFileConversionsUnitTest {
|
||||||
Assert.assertEquals(strings, Seq(null, null))
|
Assert.assertEquals(strings, Seq(null, null))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
def testStringToFileSet() {
|
|
||||||
var files = Set(new File("foo"))
|
|
||||||
files += "bar"
|
|
||||||
Assert.assertEquals(files, Set(new File("foo"), new File("bar")))
|
|
||||||
|
|
||||||
files = Set(new File("foo"))
|
|
||||||
files += null.asInstanceOf[String]
|
|
||||||
Assert.assertEquals(files, Set(new File("foo"), null))
|
|
||||||
|
|
||||||
files = Set[File](null)
|
|
||||||
files += "foo"
|
|
||||||
Assert.assertEquals(files, Set(new File("foo"), null))
|
|
||||||
|
|
||||||
files = Set[File](null)
|
|
||||||
files += null.asInstanceOf[String]
|
|
||||||
Assert.assertEquals(files, Set(null))
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
def testFileToStringSet() {
|
|
||||||
var strings = Set("foo")
|
|
||||||
strings += new File("bar")
|
|
||||||
Assert.assertEquals(strings, Set("foo", "bar"))
|
|
||||||
|
|
||||||
strings = Set("foo")
|
|
||||||
strings += null.asInstanceOf[File]
|
|
||||||
Assert.assertEquals(strings, Set("foo", null))
|
|
||||||
|
|
||||||
strings = Set[String](null)
|
|
||||||
strings += new File("foo")
|
|
||||||
Assert.assertEquals(strings, Set("foo", null))
|
|
||||||
|
|
||||||
strings = Set[String](null)
|
|
||||||
strings += null.asInstanceOf[File]
|
|
||||||
Assert.assertEquals(strings, Set(null))
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
def testStringListToFileList() {
|
def testStringListToFileList() {
|
||||||
var files = Seq(new File("foo"))
|
var files = Seq(new File("foo"))
|
||||||
|
|
@ -163,41 +125,4 @@ class StringFileConversionsUnitTest {
|
||||||
Assert.assertEquals(strings, Seq(null, null))
|
Assert.assertEquals(strings, Seq(null, null))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
def testStringSetToFileSet() {
|
|
||||||
var files = Set(new File("foo"))
|
|
||||||
files ++= Set("bar")
|
|
||||||
Assert.assertEquals(files, Set(new File("foo"), new File("bar")))
|
|
||||||
|
|
||||||
files = Set(new File("foo"))
|
|
||||||
files ++= Set[String](null)
|
|
||||||
Assert.assertEquals(files, Set(new File("foo"), null))
|
|
||||||
|
|
||||||
files = Set[File](null)
|
|
||||||
files ++= Set("foo")
|
|
||||||
Assert.assertEquals(files, Set(new File("foo"), null))
|
|
||||||
|
|
||||||
files = Set[File](null)
|
|
||||||
files ++= Set[String](null)
|
|
||||||
Assert.assertEquals(files, Set(null))
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
def testFileSetToStringSet() {
|
|
||||||
var strings = Set("foo")
|
|
||||||
strings ++= Set(new File("bar"))
|
|
||||||
Assert.assertEquals(strings, Set("foo", "bar"))
|
|
||||||
|
|
||||||
strings = Set("foo")
|
|
||||||
strings ++= Set[File](null)
|
|
||||||
Assert.assertEquals(strings, Set("foo", null))
|
|
||||||
|
|
||||||
strings = Set[String](null)
|
|
||||||
strings ++= Set(new File("foo"))
|
|
||||||
Assert.assertEquals(strings, Set("foo", null))
|
|
||||||
|
|
||||||
strings = Set[String](null)
|
|
||||||
strings ++= Set[File](null)
|
|
||||||
Assert.assertEquals(strings, Set(null))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue