-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Misc cleanups
- Loading branch information
Showing
8 changed files
with
100 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ inThisBuild(Seq( | |
developers := List( | ||
Developer("mdotta", "Mirco Dotta", "@dotta", url("https://github.com/dotta")), | ||
Developer("jsuereth", "Josh Suereth", "@jsuereth", url("https://github.com/jsuereth")), | ||
Developer("dwijnand", "Dale Wijnand", "@dwijnand", url("https://github.com/dwijnand")), | ||
), | ||
scmInfo := Some(ScmInfo(url("https://github.com/lightbend/mima"), "scm:git:[email protected]:lightbend/mima.git")), | ||
git.gitTagToVersionNumber := (tag => if (tag matches "[0.9]+\\..*") Some(tag) else None), | ||
|
@@ -26,9 +27,10 @@ aggregateProjects(core, sbtplugin, functionalTests) | |
|
||
val core = project.disablePlugins(BintrayPlugin).settings( | ||
name := "mima-core", | ||
libraryDependencies += "com.typesafe" % "config" % "1.3.4", | ||
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value, | ||
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.0-SNAP13" % Test, | ||
libraryDependencies ++= Seq( | ||
"org.scala-lang" % "scala-compiler" % scalaVersion.value, | ||
"org.scalatest" %% "scalatest" % "3.1.0-SNAP13" % Test, | ||
), | ||
MimaSettings.mimaSettings, | ||
) | ||
|
||
|
@@ -47,7 +49,10 @@ val functionalTests = Project("functional-tests", file("functional-tests")) | |
.enablePlugins(TestsPlugin) | ||
.disablePlugins(BintrayPlugin) | ||
.settings( | ||
libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "2.1.1", | ||
libraryDependencies ++= Seq( | ||
"com.typesafe" % "config" % "1.3.4", | ||
"org.scala-lang.modules" %% "scala-collection-compat" % "2.1.1", | ||
), | ||
mimaFailOnNoPrevious := false, | ||
skip in publish := true, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 19 additions & 33 deletions
52
core/src/main/scala/com/typesafe/tools/mima/core/Type.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,29 @@ | ||
package com.typesafe.tools.mima.core | ||
|
||
object Type { | ||
|
||
val byteType = ValueType("Byte") | ||
val shortType = ValueType("Short") | ||
val charType = ValueType("Char") | ||
val intType = ValueType("Int") | ||
val longType = ValueType("Long") | ||
val floatType = ValueType("Float") | ||
val doubleType = ValueType("Double") | ||
val byteType = ValueType("Byte") | ||
val shortType = ValueType("Short") | ||
val charType = ValueType("Char") | ||
val intType = ValueType("Int") | ||
val longType = ValueType("Long") | ||
val floatType = ValueType("Float") | ||
val doubleType = ValueType("Double") | ||
val booleanType = ValueType("Boolean") | ||
val unitType = ValueType("Unit") | ||
|
||
val abbrevToValueType = Map( | ||
'B' -> byteType, | ||
'S' -> shortType, | ||
'C' -> charType, | ||
'I' -> intType, | ||
'J' -> longType, | ||
'F' -> floatType, | ||
'D' -> doubleType, | ||
'Z' -> booleanType, | ||
'V' -> unitType) | ||
val unitType = ValueType("Unit") | ||
} | ||
|
||
abstract class Type { | ||
sealed abstract class Type { | ||
def resultType: Type = throw new UnsupportedOperationException | ||
} | ||
|
||
case class ValueType(name: String) extends Type { | ||
override def toString = name | ||
} | ||
case class ClassType(private val clazz: ClassInfo) extends Type { | ||
override def toString = ClassInfo.formatClassName(clazz.fullName) | ||
} | ||
case class ArrayType(elemType: Type) extends Type { | ||
override def toString = "Array["+elemType+"]" | ||
} | ||
case class MethodType(paramTypes: List[Type], override val resultType: Type) extends Type { | ||
override def toString = paramTypes.mkString("(", ",", ")"+resultType) | ||
override def toString = this match { | ||
case ValueType(name) => name | ||
case ClassType(clazz) => ClassInfo.formatClassName(clazz.fullName) // formattedFullName? | ||
case ArrayType(elemType) => s"Array[$elemType]" | ||
case MethodType(paramTypes, resTpe) => paramTypes.mkString("(", ",", s")$resTpe") | ||
} | ||
} | ||
|
||
final case class ValueType(name: String) extends Type | ||
final case class ClassType(private val clazz: ClassInfo) extends Type | ||
final case class ArrayType(elemType: Type) extends Type | ||
final case class MethodType(paramTypes: List[Type], override val resultType: Type) extends Type |
11 changes: 5 additions & 6 deletions
11
core/src/test/scala/com/typesafe/tools/mima/core/ProblemFiltersSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
core/src/test/scala/com/typesafe/tools/mima/core/ProblemReportingSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters