Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaned SBT Build file. Moved resources

  • Loading branch information...
commit 9dca5351ec7bedd5c5678051a77ee1c50e68f6f5 1 parent f5229ac
Mirco authored
Showing with 92 additions and 59 deletions.
  1. +3 −3 README.md
  2. 0  core/src/main/resources/{ → ssol/tools/mima/core/ui}/images/add.png
  3. 0  core/src/main/resources/{ → ssol/tools/mima/core/ui}/images/alert.png
  4. 0  core/src/main/resources/{ → ssol/tools/mima/core/ui}/images/broken.png
  5. 0  core/src/main/resources/{ → ssol/tools/mima/core/ui}/images/check.jpg
  6. 0  core/src/main/resources/{ → ssol/tools/mima/core/ui}/images/close.gif
  7. 0  core/src/main/resources/{ → ssol/tools/mima/core/ui}/images/down.png
  8. 0  core/src/main/resources/{ → ssol/tools/mima/core/ui}/images/exit.png
  9. 0  core/src/main/resources/{ → ssol/tools/mima/core/ui}/images/migration.jpg
  10. 0  core/src/main/resources/{ → ssol/tools/mima/core/ui}/images/remove.png
  11. 0  core/src/main/resources/{ → ssol/tools/mima/core/ui}/images/scala_logo.png
  12. 0  core/src/main/resources/{ → ssol/tools/mima/core/ui}/images/typesafe.png
  13. 0  core/src/main/resources/{ → ssol/tools/mima/core/ui}/images/up.png
  14. +18 −15 core/src/main/scala/{ → ssol/tools/mima/core/ui}/images/Icons.scala
  15. +2 −0  core/src/main/scala/ssol/tools/mima/core/ui/widget/ClassPathEditor.scala
  16. +2 −0  core/src/main/scala/ssol/tools/mima/core/ui/widget/CloseButton.scala
  17. +2 −0  core/src/main/scala/ssol/tools/mima/core/ui/widget/ListItemsPanel.scala
  18. +3 −2 core/src/main/scala/ssol/tools/mima/core/util/Browse.scala
  19. +0 −1  core/src/main/scala/ssol/tools/mima/core/util/EventQueueProxy.scala
  20. +52 −30 project/Build.scala
  21. +1 −1  reporter/{MiMaReporter.launch → Reporter.launch}
  22. 0  {core/src/main/resources → reporter/src/main/resources/ssol/tools/mima/lib}/license/LICENSE
  23. +3 −1 {core/src/main/scala → reporter/src/main/scala/ssol/tools/mima/lib}/license/License.scala
  24. +2 −1  reporter/src/main/scala/ssol/tools/mima/lib/ui/MimaLibApp.scala
  25. +4 −5 reporter/src/main/scala/ssol/tools/mima/lib/ui/widget/LicenseAgreementView.scala
View
6 README.md
@@ -11,8 +11,8 @@ MiMa's Modules
MiMa is split into three modules:
- Core: Classes that are used by both the Reporter and Migrator modules.
-- Reporter: Used to diagnose binary incompatibilities between two different versions of a same library. (formerly MiMa Lib)
-- Migrator: Used to fix binary incompatibilities of a client jar. (formerly MiMa Client)
+- Reporter: Used to diagnose binary incompatibilities between two different versions of a same library. (Formerly MiMa Lib)
+- Migrator: Used to fix binary incompatibilities of a client jar. (Formerly MiMa Client)
Eclipse
-------
@@ -79,7 +79,7 @@ Note: The `problems.txt` is the test oracle. Expected errors are declared using
FAQ
-------
-`Exception - java.lang.OutOfMemoryError`: Java heap space: If you are experiencing out of memory exception you may need to increase the VM arguments for the initial heap size and the maximum heap size. The default values are `-Xms64m` for for the initial heap size and `-Xmx256m` for the maximum heap size.
+`java.lang.OutOfMemoryError - Java heap space:` If you are experiencing out of memory exception you may need to increase the VM arguments for the initial heap size and the maximum heap size. The default values are `-Xms64m` for for the initial heap size and `-Xmx256m` for the maximum heap size.
Bugs and Feature requests
-------
View
0  core/src/main/resources/images/add.png → ...es/ssol/tools/mima/core/ui/images/add.png
File renamed without changes
View
0  core/src/main/resources/images/alert.png → .../ssol/tools/mima/core/ui/images/alert.png
File renamed without changes
View
0  core/src/main/resources/images/broken.png → ...ssol/tools/mima/core/ui/images/broken.png
File renamed without changes
View
0  core/src/main/resources/images/check.jpg → .../ssol/tools/mima/core/ui/images/check.jpg
File renamed without changes
View
0  core/src/main/resources/images/close.gif → .../ssol/tools/mima/core/ui/images/close.gif
File renamed without changes
View
0  core/src/main/resources/images/down.png → ...s/ssol/tools/mima/core/ui/images/down.png
File renamed without changes
View
0  core/src/main/resources/images/exit.png → ...s/ssol/tools/mima/core/ui/images/exit.png
File renamed without changes
View
0  core/src/main/resources/images/migration.jpg → ...l/tools/mima/core/ui/images/migration.jpg
File renamed without changes
View
0  core/src/main/resources/images/remove.png → ...ssol/tools/mima/core/ui/images/remove.png
File renamed without changes
View
0  .../src/main/resources/images/scala_logo.png → .../tools/mima/core/ui/images/scala_logo.png
File renamed without changes
View
0  core/src/main/resources/images/typesafe.png → ...ol/tools/mima/core/ui/images/typesafe.png
File renamed without changes
View
0  core/src/main/resources/images/up.png → ...ces/ssol/tools/mima/core/ui/images/up.png
File renamed without changes
View
33 core/src/main/scala/images/Icons.scala → ...sol/tools/mima/core/ui/images/Icons.scala
@@ -1,39 +1,42 @@
-package images
+package ssol.tools.mima.core.ui.images
+
+import java.io.File
+import java.net.URL
import scala.swing._
import Swing._
object Icons {
- private lazy val sep = java.io.File.separator
-
- private def getIcon = buildIcon _
-
+ private lazy val sep = File.separator
+
+ private def getIcon = buildIcon _
+
/** Load the icon from the given path, or EmptyIcon if not found. */
- private def buildIcon(filename: String) : javax.swing.Icon = {
+ private def buildIcon(filename: String): javax.swing.Icon = {
getClass.getResource(filename) match {
- case null => EmptyIcon
- case value =>
+ case null => EmptyIcon
+ case value =>
val resource = Swing.Icon(value)
- if(resource eq null) EmptyIcon else resource
+ if (resource eq null) EmptyIcon else resource
}
}
-
+
lazy val typesafe = getIcon("typesafe.png")
lazy val scalaLogo = getIcon("scala_logo.png")
-
+
lazy val exit = getIcon("exit.png")
lazy val broken = getIcon("broken.png")
lazy val alert = getIcon("alert.png")
-
+
lazy val migration = getIcon("migration.jpg")
lazy val check = getIcon("check.jpg")
-
+
lazy val add = getIcon("add.png")
lazy val remove = getIcon("remove.png")
lazy val up = getIcon("up.png")
lazy val down = getIcon("down.png")
-
+
lazy val close = getIcon("close.gif")
-
+
}
View
2  core/src/main/scala/ssol/tools/mima/core/ui/widget/ClassPathEditor.scala
@@ -8,6 +8,8 @@ import scala.swing._
import event._
import Swing._
import BorderPanel._
+
+import ssol.tools.mima.core.ui.images
import ssol.tools.mima.core.ui.WithConstraints
/** A simple interface for interacting with the classpath. Allows
View
2  core/src/main/scala/ssol/tools/mima/core/ui/widget/CloseButton.scala
@@ -3,6 +3,8 @@ package ssol.tools.mima.core.ui.widget
import scala.swing.Button
import scala.swing.Swing.EmptyBorder
+import ssol.tools.mima.core.ui.images
+
/** A close button displayed as an icon. When the mouse is over
* the image a hand cursor is shown.*/
class CloseButton extends Button {
View
2  core/src/main/scala/ssol/tools/mima/core/ui/widget/ListItemsPanel.scala
@@ -3,6 +3,8 @@ package ssol.tools.mima.core.ui.widget
import scala.swing._
import scala.swing.event.ButtonClicked
+import ssol.tools.mima.core.ui.images
+
abstract class ListItemsPanel extends Component {
private val MaxNumberOfItems = 10
View
5 core/src/main/scala/ssol/tools/mima/core/util/Browse.scala
@@ -4,7 +4,8 @@ import java.net.{ URL, URI, URISyntaxException }
import java.io.IOException
import scala.swing.Dialog
-import images.Icons
+
+import ssol.tools.mima.core.ui.images
object Browse {
@@ -51,6 +52,6 @@ object Browse {
private def cannotOpenBrowser(msg: String, e: Exception) {
//FIXME: Should log exception!
- Dialog.showMessage(message = msg, title = "Cannot open link", icon = Icons.broken)
+ Dialog.showMessage(message = msg, title = "Cannot open link", icon = images.Icons.broken)
}
}
View
1  core/src/main/scala/ssol/tools/mima/core/util/EventQueueProxy.scala
@@ -3,7 +3,6 @@ package ssol.tools.mima.core.util
import java.awt.{ EventQueue, AWTEvent }
import scala.swing.Dialog
-import images.Icons
trait WithEventQueueProxy {
import java.awt.Toolkit
View
82 project/Build.scala
@@ -7,46 +7,63 @@ import Configurations.config
import Build.data
import Path._
-object MimaBuild extends Build {
-
- // dependencies
- val compiler = "org.scala-lang" % "scala-compiler" % "2.9.0-1" % "compile"
- val swing = "org.scala-lang" % "scala-swing" % "2.9.0-1" % "compile"
+object BuildSettings {
+
+ val buildName = "mima"
+ val buildOrganization = "com.typesafe"
+ val buildScalaVer = "2.9.0-1"
+ val buildVersion = "0.1.1"
+
+ val commonSettings = Defaults.defaultSettings ++ Seq (
+ organization := buildOrganization,
+ scalaVersion := buildScalaVer,
+ version := buildVersion
+ )
+}
+object Dependencies {
+ import BuildSettings._
+
+ val compiler = "org.scala-lang" % "scala-compiler" % buildScalaVer
+ val swing = "org.scala-lang" % "scala-swing" % buildScalaVer
+}
- // Settings
- val commonSettings = Seq(
- organization := "com.typesafe",
- scalaVersion := "2.9.0-1",
- version := "0.1.1",
- libraryDependencies ++= Seq(swing))
+object MimaBuild extends Build {
+ import BuildSettings._
+ import Dependencies._
// here we list all projects that are defined.
override lazy val projects = Seq(root) ++ modules
lazy val modules = Seq(core, reporter, migrator, reporterFunctionalTests) ++ tests
- lazy val root: Project = Project("root", file("."), aggregate = modules.map(Reference.projectToRef(_)))
+ lazy val root = Project("root", file("."), aggregate = modules.map(Reference.projectToRef(_)))
- lazy val core: Project = Project("core", file("core"), settings = Defaults.defaultSettings ++ commonSettings ++ Seq(
- libraryDependencies ++= Seq(compiler)) :+ (name := "mima-core"))
+ lazy val core = Project("core", file("core"), settings = commonSettings ++
+ Seq(libraryDependencies ++= Seq(swing, compiler)) :+
+ (name := buildName + "-core"))
- lazy val reporter: Project = Project("reporter", file("reporter"), settings = Defaults.defaultSettings ++ commonSettings :+ (name := "mima-reporter"))
+ lazy val reporter = Project("reporter", file("reporter"),
+ settings = commonSettings ++ Seq(libraryDependencies ++= Seq(swing)) :+
+ (name := buildName + "-reporter") :+ (javaOptions += "-Xmx512m"))
.dependsOn(core)
.settings(
// add task functional-tests that depends on all functional tests
functionalTests <<= runAllTests,
- // make the main 'package' task depend on all functional tests passing
- packageBin in Compile <<= packageBin in Compile dependsOn functionalTests
+ // make the main 'package' task depend on all functional tests passing
+ packageBin in Compile <<= packageBin in Compile dependsOn functionalTests
)
- lazy val reporterFunctionalTests: Project = Project("reporter-functional-tests",
- file("reporter") / "functional-tests" ,
- settings = Defaults.defaultSettings ++ commonSettings)
- .dependsOn(core, reporter)
+ lazy val reporterFunctionalTests = Project("reporter-functional-tests",
+ file("reporter") / "functional-tests" ,
+ settings = commonSettings)
+ .dependsOn(core, reporter)
- lazy val migrator: Project = Project("migrator", file("migrator"), settings = Defaults.defaultSettings ++ commonSettings :+ (name := "mima-migrator"))
- .dependsOn(core, reporter)
+ lazy val migrator = Project("migrator", file("migrator"),
+ settings = commonSettings ++
+ Seq(libraryDependencies ++= Seq(swing, compiler)) :+
+ (name := buildName + "-migrator") :+ (javaOptions += "-Xmx512m"))
+ .dependsOn(core, reporter)
// select all testN directories.
val bases = (file("reporter") / "functional-tests" / "src" / "test") * (DirectoryFilter)
@@ -55,12 +72,12 @@ object MimaBuild extends Build {
lazy val tests = bases.getFiles map testProject
// defines a Project for the given base directory (for example, functional-tests/test1)
- // Its name is the directory name (test1) and it has compile+package tasks for sources in v1/ and v2/
- def testProject(base: File) =
- Project(base.name, base, settings = testProjectSettings).configs(v1Config, v2Config) dependsOn (reporterFunctionalTests)
+ // Its name is the directory name (test1) and it has compile+package tasks for sources in v1/ and v2/
+ def testProject(base: File) = Project(base.name, base, settings = testProjectSettings)
+ .configs(v1Config, v2Config) dependsOn (reporterFunctionalTests)
lazy val testProjectSettings =
- Defaults.defaultSettings ++ commonSettings ++ // normal project defaults; can be trimmed later- test and run aren't needed, for example.
+ commonSettings ++ // normal project defaults; can be trimmed later- test and run aren't needed, for example.
inConfig(v1Config)(perConfig) ++ // add compile/package for the v1 sources
inConfig(v2Config)(perConfig) :+ // add compile/package for the v2 sources
(functionalTests <<= runTest) // add the functional-tests task.
@@ -97,9 +114,14 @@ object MimaBuild extends Build {
val loader = new java.net.URLClassLoader(urls, si.loader)
val testClass = loader.loadClass("ssol.tools.mima.lib.CollectProblemsTest")
- val testRunner = testClass.newInstance().asInstanceOf[{ def runTest(testName: String, oldJarPath: String, newJarPath: String, oraclePath: String): Unit }]
-
- val projectPath = proj.build.getPath + "reporter" + "/" + "functional-tests" + "/" + "src" + "/" + "test" + "/" + proj.project
+ val testRunner = testClass.newInstance().asInstanceOf[
+ { def runTest(testName: String, oldJarPath: String, newJarPath: String,
+ oraclePath: String): Unit
+ }]
+
+ val projectPath = proj.build.getPath + "reporter" + "/" + "functional-tests" + "/" + "src" +
+ "/" + "test" + "/" + proj.project
+
val oraclePath = projectPath + "/problems.txt"
try {
View
2  reporter/MiMaReporter.launch → reporter/Reporter.launch
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="scala.application">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/mima-lib/src/main/scala/ssol/tools/mima/lib/ui/MimaLibApp.scala"/>
+<listEntry value="/mima-reporter/src/main/scala/ssol/tools/mima/lib/ui/MimaLibApp.scala"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
View
0  core/src/main/resources/license/LICENSE → ...urces/ssol/tools/mima/lib/license/LICENSE
File renamed without changes
View
4 core/src/main/scala/license/License.scala → ...ssol/tools/mima/lib/license/License.scala
@@ -1,4 +1,6 @@
-package license
+package ssol.tools.mima.lib.license
+
+import java.io.FileInputStream
object License {
val license: String = {
View
3  reporter/src/main/scala/ssol/tools/mima/lib/ui/MimaLibApp.scala
@@ -8,6 +8,7 @@ import ssol.tools.mima.core.ui.{Centered, MimaSwingApp}
import ssol.tools.mima.core.util.Prefs
import ssol.tools.mima.lib.ui.widget.LicenseAgreementView
+import ssol.tools.mima.lib.license.License
object MimaLibApp extends MimaSwingApp {
override protected def launcherClassName = "ssol.tools.mima.lib.ui.MimaLibApp"
@@ -19,7 +20,7 @@ object MimaLibApp extends MimaSwingApp {
location = center
resizable = false
- private val license = new LicenseAgreementView
+ private val license = new LicenseAgreementView(License.license)
private val continue = new Button("Continue") {
enabled = false
}
View
9 reporter/src/main/scala/ssol/tools/mima/lib/ui/widget/LicenseAgreementView.scala
@@ -7,9 +7,9 @@ import scala.swing.event.{ ButtonClicked, Event }
object LicenseAgreementView {
case class LicenseAccepted(status: Boolean) extends Event
}
-class LicenseAgreementView extends Component {
- //XXX: without the access modifier scalac can't compile the file...
- private[LicenseAgreementView] lazy val container = new BorderPanel {
+
+class LicenseAgreementView(licenseText: String) extends Component {
+ private lazy val container = new BorderPanel {
add(new FlowPanel(FlowPanel.Alignment.Left)(explanation) {hGap = 0; vGap = 3}, BorderPanel.Position.North)
add(new ScrollPane {
contents = licenseEditor
@@ -25,11 +25,10 @@ class LicenseAgreementView extends Component {
add(new FlowPanel(FlowPanel.Alignment.Right)(acceptLicense) {hGap = 0; vGap = 0}, BorderPanel.Position.South)
}
- override lazy val peer = container.peer
+ override lazy val peer: javax.swing.JComponent = container.peer
private lazy val explanation = new Label("Please read the following End User License Agreement.")
- private lazy val licenseText = license.License.license
private lazy val licenseEditor = new Component {
border = EmptyBorder(5)
private lazy val pane = new EditorPane("text/plain", licenseText) {
Please sign in to comment.
Something went wrong with that request. Please try again.