Permalink
Browse files

updated to be more current

  • Loading branch information...
1 parent 6499ec2 commit d347439323cb923136f9b90c0f35654229e94eb3 @mgutz committed Feb 3, 2012
View
@@ -1,11 +1,12 @@
-lib_managed/*
-project/boot/*
-project/build/target/*
-project/plugins/lib_managed/*
-project/plugins/project/*
-project/plugins/src_managed/*
-project/plugins/target/
-target/
-*.swp
-*~
-! .gitkeep
+target
+*.iml
+*.ipr
+*.iws
+/.idea
+out
+lib_managed
+src_managed
+project/boot*
+project/plugins/project
+ctags
+idea.iml
View
@@ -1,5 +1,36 @@
# sbt-console-template
-Get started with Scala using this console based template.
+Get started with Scala and use Intellij IDEA (tested on 11)
+
+* Scala 2.9.1
+* ScalaTest 1.6.1
+
+## Using
+
+Run the app
+
+ sbt run
+
+Run tests
+
+ sbt test
+
+
+## Convert to IDEA project
+
+1. Start sbt
+
+ sbt
+
+2. Within sbt, generate IDEA project
+
+ > gen-idea
+ > exit
+
+3. Open the project in IDEAj from the menu, File -> Open Project ...
+
+
+
+
+
-For more info and a screencast for this template, go to [my blog](http://www.mgutz.com/2010/03/06/get_started_with_scala_sbt_and_eclipse.html)
View
@@ -0,0 +1,11 @@
+name := "A Project"
+
+version := "0.1"
+
+scalaVersion := "2.9.1"
+
+libraryDependencies ++= Seq(
+ "org.scalatest" %% "scalatest" % "1.6.1" % "test"
+)
+
+
View
No changes.
View
@@ -1,9 +0,0 @@
-#Project properties
-#Sat Mar 06 14:53:45 PST 2010
-project.organization=com.mgutz
-project.name=sbt-console-template
-sbt.version=0.7.1
-project.version=0.1
-def.scala.version=2.7.7
-build.scala.versions=2.8.0.Beta1
-project.initialize=false
@@ -1,7 +0,0 @@
-import sbt._
-import de.element34.sbteclipsify._
-
-class Project(info: ProjectInfo) extends DefaultProject(info) with SbtEclipsifyPlugin {
- val scalaToolsSnapshots = "Scala-Tools Maven2 Snapshots Repository" at "http://scala-tools.org/repo-snapshots"
- val scalatest = "org.scalatest" % "scalatest" % "1.0.1-for-scala-2.8.0.Beta1-with-test-interfaces-0.3-SNAPSHOT"
-}
View
@@ -0,0 +1,4 @@
+resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
+
+addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "0.11.1-SNAPSHOT")
+
@@ -1,5 +0,0 @@
-import sbt._
-
-class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
- lazy val eclipsify = "de.element34" % "sbt-eclipsify" % "0.5.0"
-}
@@ -1,14 +1,14 @@
-package example
+package com.example
class Bank {
var balance:Double = _
def deposit(amount: Double) = {
balance += amount
- }
+ }
def withdraw(amount: Double) = {
- if (balance - amount < 0) {
+ if (balance - amount < 0) {
throw new IllegalArgumentException("You are not Bill Gates!")
}
balance -= amount
@@ -0,0 +1,9 @@
+package com.example
+
+object Main {
+ def main(args: Array[String]) {
+ val bank = new Bank()
+ bank.deposit(42)
+ println("My balance is "+bank.balance)
+ }
+}
@@ -1,7 +0,0 @@
-package example
-
-object Hello {
- def main(args:Array[String]) {
- println("Hello world!")
- }
-}
@@ -1,7 +1,7 @@
import org.scalatest.Spec
import org.scalatest.matchers.MustMatchers
-import example.Bank
+import com.example.Bank
class BankSpec extends Spec with MustMatchers {
describe("simple bank") {
@@ -13,7 +13,7 @@ class BankSpec extends Spec with MustMatchers {
it("should allow deposits") {
bank.deposit(100.0)
- bank.balance must be (100.0)
+ bank.balance must be (100.0)
}
it("should allow withdrawals") {
@@ -26,4 +26,3 @@ class BankSpec extends Spec with MustMatchers {
}
}
}
-

0 comments on commit d347439

Please sign in to comment.