Skip to content
Browse files

scala 2.8.0 cross-compile working

  • Loading branch information...
1 parent 1118f08 commit 6b087323a89d698e1a031588a821655b68f91f82 mmcbride committed with szegedi Oct 9, 2010
View
4 project/build.properties
@@ -3,6 +3,6 @@
project.organization=com.twitter
project.name=twitterActors
sbt.version=0.7.4
-project.version=1.1.0
-build.scala.versions=2.7.7
+project.version=2.0.0-SNAPSHOT
+build.scala.versions=2.8.0 2.7.7
project.initialize=false
View
6 project/build/TwitterActorsProject.scala
@@ -4,7 +4,11 @@ import com.twitter.sbt.{SubversionPublisher, StandardProject}
class TwitterActorsProject(info: ProjectInfo) extends StandardProject(info) with SubversionPublisher {
- val specs = "org.scala-tools.testing" % "specs" % "1.6.2.1"
+ val specs = buildScalaVersion match {
+ case "2.7.7" => "org.scala-tools.testing" % "specs" % "1.6.2.1"
+ case _ => "org.scala-tools.testing" %% "specs" % "1.6.5"
+ }
+ override def disableCrossPaths = false
override def subversionRepository = Some("http://svn.local.twitter.com/maven-public")
}
View
4 project/plugins/Plugins.scala
@@ -1,6 +1,6 @@
import sbt._
class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
- val twitterNest = "com.twitter" at "http://www.lag.net/nest"
- val defaultProject = "com.twitter" % "standard-project" % "0.7.1"
+ val twitterRepo = "com.twitter" at "http://maven.twttr.com/"
+ val defaultProject = "com.twitter" % "standard-project" % "0.7.9"
}
View
2 project/plugins/project/build.properties
@@ -1,3 +1,3 @@
#Project properties
-#Wed Jul 28 22:34:54 CEST 2010
+#Fri Oct 08 11:43:32 PDT 2010
plugin.uptodate=true
View
1 src/main/scala/com/twitter/actors/remote/NetKernel.scala
@@ -10,6 +10,7 @@
package com.twitter.actors.remote
+import com.twitter.actors._
import scala.collection.mutable.{HashMap, HashSet}
private[remote] case class NamedSend(senderLoc: Locator, receiverLoc: Locator, data: Array[Byte], session: Symbol)
View
1 src/main/scala/com/twitter/actors/remote/Proxy.scala
@@ -10,6 +10,7 @@
package com.twitter.actors.remote
+import com.twitter.actors._
import scala.collection.mutable.HashMap
/**
View
25 src/main/scala/com/twitter/actors/remote/RemoteActor.scala
@@ -11,6 +11,7 @@
package com.twitter.actors.remote
+import com.twitter.actors._
/** <p>
* This object provides methods for creating, registering, and
@@ -50,7 +51,7 @@ object RemoteActor {
* objects sent as messages.
*/
private var cl: ClassLoader = null
-
+ private var nextKernel: Int = 0
def classLoader: ClassLoader = cl
def classLoader_=(x: ClassLoader) { cl = x }
@@ -74,10 +75,13 @@ object RemoteActor {
kernels -= s
// terminate `kern` when it does
// not appear as value any more
- if (!kernels.values.contains(kern)) {
- Debug.info("terminating "+kern)
- // terminate NetKernel
- kern.terminate()
+ kernels.find(_ == kern) match {
+ case None => {
+ Debug.info("terminating "+kern)
+ // terminate NetKernel
+ kern.terminate()
+ }
+ case Some(k) => // noop
}
}
@@ -117,8 +121,15 @@ object RemoteActor {
selfKernel.getOrCreateProxy(node, sym)
}
- private[remote] def someKernel: NetKernel =
- kernels.values.next
+ // this is super jank
+ // but the only way I could see to get 2.7.7/2.8.0 cross build working
+ private[remote] def someKernel: NetKernel = {
+ val kernVals = kernels.values.toList
+ if (nextKernel >= kernVals.size) nextKernel = 0
+ val rv = kernVals(nextKernel)
+ nextKernel += 1
+ rv
+ }
}
View
1 src/main/scala/com/twitter/actors/remote/TcpService.scala
@@ -11,6 +11,7 @@
package com.twitter.actors.remote
+import com.twitter.actors._
import java.io.{DataInputStream, DataOutputStream, IOException}
import java.lang.{Thread, SecurityException}
View
1 src/main/scala/com/twitter/actors/scheduler/TerminationMonitor.scala
@@ -10,6 +10,7 @@
package com.twitter.actors.scheduler
+import com.twitter.actors.Actor
import scala.collection.mutable.HashMap
private[actors] trait TerminationMonitor {

0 comments on commit 6b08732

Please sign in to comment.
Something went wrong with that request. Please try again.