From 11a90efc4e557df56cb14a9db06bbe45af07bf21 Mon Sep 17 00:00:00 2001 From: Colin Marc Date: Fri, 13 Feb 2015 22:32:40 +0100 Subject: [PATCH] Make brushfire buildable in both 2.10 and 2.11 --- brushfire-core/pom.xml | 9 ++++----- .../scala/com/stripe/brushfire/Errors.scala | 2 +- .../com/stripe/brushfire/Evaluators.scala | 2 +- .../com/stripe/brushfire/Splitters.scala | 2 +- .../scala/com/stripe/brushfire/Voters.scala | 4 ++-- brushfire-finatra/pom.xml | 6 +++--- brushfire-parent/pom.xml | 20 ++++++++++--------- brushfire-scalding/pom.xml | 14 ++++++------- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/brushfire-core/pom.xml b/brushfire-core/pom.xml index 1c3dc5a..35e04a0 100644 --- a/brushfire-core/pom.xml +++ b/brushfire-core/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.stripe - brushfire-core + brushfire-core_${scala.binary.version} jar @@ -19,15 +19,15 @@ com.twitter - algebird-core_2.10 + algebird-core_${scala.binary.version} com.twitter - chill-bijection_2.10 + chill-bijection_${scala.binary.version} com.twitter - bijection-json_2.10 + bijection-json_${scala.binary.version} org.codehaus.jackson @@ -42,5 +42,4 @@ jackson-jaxrs - diff --git a/brushfire-core/src/main/scala/com/stripe/brushfire/Errors.scala b/brushfire-core/src/main/scala/com/stripe/brushfire/Errors.scala index e13d118..88a417c 100644 --- a/brushfire-core/src/main/scala/com/stripe/brushfire/Errors.scala +++ b/brushfire-core/src/main/scala/com/stripe/brushfire/Errors.scala @@ -36,7 +36,7 @@ case class BrierScoreError[L, M](implicit num: Numeric[M]) } } -case class BinnedBinaryError[M: Monoid] +case class BinnedBinaryError[M: Monoid]() extends FrequencyError[Boolean, M, Map[Int, (M, M)]] { lazy val monoid = implicitly[Monoid[Map[Int, (M, M)]]] diff --git a/brushfire-core/src/main/scala/com/stripe/brushfire/Evaluators.scala b/brushfire-core/src/main/scala/com/stripe/brushfire/Evaluators.scala index 5277192..3b7c4ca 100644 --- a/brushfire-core/src/main/scala/com/stripe/brushfire/Evaluators.scala +++ b/brushfire-core/src/main/scala/com/stripe/brushfire/Evaluators.scala @@ -41,7 +41,7 @@ case class MinWeightEvaluator[V, L, W: Monoid](minWeight: W => Boolean, wrapped: } } -case class EmptySplit[V, P] extends Split[V, P] { +case class EmptySplit[V, P]() extends Split[V, P] { val predicates = Nil } diff --git a/brushfire-core/src/main/scala/com/stripe/brushfire/Splitters.scala b/brushfire-core/src/main/scala/com/stripe/brushfire/Splitters.scala index 670c45e..0dcdc4e 100644 --- a/brushfire-core/src/main/scala/com/stripe/brushfire/Splitters.scala +++ b/brushfire-core/src/main/scala/com/stripe/brushfire/Splitters.scala @@ -65,7 +65,7 @@ case class QTreeSplitter[T: Monoid](k: Int) } } -case class SparseBooleanSplitter[T: Group] +case class SparseBooleanSplitter[T: Group]() extends Splitter[Boolean, T] { type S = T diff --git a/brushfire-core/src/main/scala/com/stripe/brushfire/Voters.scala b/brushfire-core/src/main/scala/com/stripe/brushfire/Voters.scala index 27796a3..923dfcd 100644 --- a/brushfire-core/src/main/scala/com/stripe/brushfire/Voters.scala +++ b/brushfire-core/src/main/scala/com/stripe/brushfire/Voters.scala @@ -10,7 +10,7 @@ trait FrequencyVoter[L, M] extends Voter[Map[L, M], Map[L, Double]] { } } -case class SoftVoter[L, M: Numeric] extends FrequencyVoter[L, M] { +case class SoftVoter[L, M: Numeric]() extends FrequencyVoter[L, M] { def combine(targets: Iterable[Map[L, M]]) = if (targets.isEmpty) Map.empty[L, Double] @@ -18,7 +18,7 @@ case class SoftVoter[L, M: Numeric] extends FrequencyVoter[L, M] { Monoid.sum(targets.map { m => normalize(m) }).mapValues { _ / targets.size } } -case class ModeVoter[L, M: Ordering] extends FrequencyVoter[L, M] { +case class ModeVoter[L, M: Ordering]() extends FrequencyVoter[L, M] { def mode(m: Map[L, M]): L = m.maxBy { _._2 }._1 def combine(targets: Iterable[Map[L, M]]) = diff --git a/brushfire-finatra/pom.xml b/brushfire-finatra/pom.xml index 4e0fbf1..2b77767 100644 --- a/brushfire-finatra/pom.xml +++ b/brushfire-finatra/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.stripe - brushfire-finatra + brushfire-finatra_${scala.binary.version} jar @@ -19,11 +19,11 @@ com.twitter - finatra_2.10 + finatra_${scala.binary.version} com.stripe - brushfire-core + brushfire-core_${scala.binary.version} ${project.version} diff --git a/brushfire-parent/pom.xml b/brushfire-parent/pom.xml index 5055f8c..3f42f87 100644 --- a/brushfire-parent/pom.xml +++ b/brushfire-parent/pom.xml @@ -11,6 +11,8 @@ UTF-8 + 2.11.4 + 2.11 @@ -18,16 +20,16 @@ org.scala-lang scala-library - 2.10.4 + ${scala.version} com.twitter - scalding-core_2.10 - 0.12.0 + scalding-core_${scala.binary.version} + 0.13.1 com.twitter - algebird-core_2.10 + algebird-core_${scala.binary.version} 0.9.0 @@ -37,12 +39,12 @@ com.twitter - chill-bijection_2.10 - 0.4.0 + chill-bijection_${scala.binary.version} + 0.5.2 com.twitter - bijection-json_2.10 + bijection-json_${scala.binary.version} 0.7.0 @@ -62,7 +64,7 @@ com.twitter - finatra_2.10 + finatra_${scala.binary.version} 1.6.0 @@ -144,7 +146,7 @@ net.alchim31.maven scala-maven-plugin - 3.1.5 + 3.2.0 incremental true diff --git a/brushfire-scalding/pom.xml b/brushfire-scalding/pom.xml index a5ff452..e1be130 100644 --- a/brushfire-scalding/pom.xml +++ b/brushfire-scalding/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.stripe - brushfire-scalding + brushfire-scalding_${scala.binary.version} jar @@ -19,15 +19,15 @@ com.twitter - scalding-core_2.10 + scalding-core_${scala.binary.version} + + + org.apache.hadoop + hadoop-client - - org.apache.hadoop - hadoop-client - com.stripe - brushfire-core + brushfire-core_${scala.binary.version} ${project.version}