Skip to content

Commit

Permalink
Removed unneeded dependencies from the MANIFEST
Browse files Browse the repository at this point in the history
Improved the manifest and made getSbtInfo return a SbtInfo case class
instead of a "dumb" Tuple3.
  • Loading branch information
Sandro Gržičić committed Aug 9, 2012
1 parent 9b738ef commit 7f69c95
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 0 additions & 3 deletions org.scala-ide.sdt.sbtconsole/META-INF/MANIFEST.MF
Expand Up @@ -41,9 +41,6 @@ Require-Bundle:
org.eclipse.pde.ui;resolution:=optional,
org.scala-ide.scala.library,
org.scala-ide.scala.compiler,
org.scala-refactoring.library,
org.scala-ide.sbt.full.library;bundle-version="[0.11.2,0.14)",
scalariform,
org.junit4;bundle-version="4.5.0",
org.eclipse.ui.browser;bundle-version="3.3.0",
org.scala-ide.sdt.core;bundle-version="[2.1.0, 2.2.0)"
Expand Down
Expand Up @@ -8,6 +8,8 @@ import org.eclipse.jdt.core.IClasspathEntry
import java.io.File
import java.io.FilenameFilter

case class SbtInfo(path: String, version: String, scalaVersion: String)

/** Useful SBT utility methods. */
object SbtUtils {

Expand All @@ -25,12 +27,12 @@ object SbtUtils {
* Uses empty strings in case of unknown information or exceptions.
* Use the specific methods in order to get specific information.
*/
def getSbtInfo(): Tuple3[String, String, String] = {
def getSbtInfo(): SbtInfo = {
val path = getSbtPath()
val version = path map getSbtVersion getOrElse Left() fold(_ => "", identity)
val scalaVersion = sbtToScalaVersion(version)

(path getOrElse "", version, scalaVersion)
SbtInfo(path getOrElse "", version, scalaVersion)
}

/** Fetch the SBT version from the manifest file of the specified sbt-launch.jar. */
Expand Down
Expand Up @@ -225,11 +225,11 @@ class PreferenceInitializer extends AbstractPreferenceInitializer {
override def initializeDefaultPreferences() {
val store = SbtConsolePlugin.plugin.getPreferenceStore

val (path, version, scalaVersion) = SbtUtils.getSbtInfo()
val sbtInfo = SbtUtils.getSbtInfo()

store.setDefault(P_SBT_PATH, path)
store.setDefault(P_SBT_VERSION, version)
store.setDefault(P_SBT_SCALA_VERSION, scalaVersion)
store.setDefault(P_SBT_PATH, sbtInfo.path)
store.setDefault(P_SBT_VERSION, sbtInfo.version)
store.setDefault(P_SBT_SCALA_VERSION, sbtInfo.scalaVersion)
store.setDefault(P_SBT_JAVA_ARGS, "-Xmx1000M")
store.setDefault(P_PROJECT_DIRECTORY, "")
}
Expand Down

0 comments on commit 7f69c95

Please sign in to comment.