Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 61 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,65 @@
# use glob syntax.
syntax: glob
*.ser
*.class
*.log
*~
*.bak
*.off
*.old
.DS_Store

# sbt specific
dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/
# logs
derby.log

# Scala-IDE specific
# eclipse conf file
.settings
.classpath
.project
.manager
.externalToolBuilders
/.cache

# ensime/emacs conf files
.ensime
.scala_dependencies

# building
target
null
tmp*
dist
test-output

# sbt
target
lib_managed
src_managed
project/boot
project/plugins/project
project/plugins/target/
project/plugins/lib_managed/
project/plugins/src_managed/
project/project/target
project/target

# other scm
.svn
.CVS
.hg*

# switch to regexp syntax.
# syntax: regexp
# ^\.pc/

# IntelliJ
*.eml
*.iml
*.ipr
*.iws
.idea

# Pax Runner (for easy OSGi launching)
runner

#DB files
*.db
9 changes: 0 additions & 9 deletions Scala Dojo/.classpath

This file was deleted.

1 change: 1 addition & 0 deletions Scala Dojo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/bin
/.cache
/.target
18 changes: 0 additions & 18 deletions Scala Dojo/.project

This file was deleted.

17 changes: 16 additions & 1 deletion Scala Dojo/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ name := "Scala Dojo"

version := "1.0"

scalaVersion := "2.10.2"
scalaVersion := "2.10.3"

libraryDependencies ++= Seq(
"junit" % "junit" % "4.11" % "test",
"org.scalatest" %% "scalatest" % "2.0" % "test->default"
)

// Use Java 7 (change to JavaSE16 if you don't have Java 7 installed)
EclipseKeys.executionEnvironment := Some(EclipseExecutionEnvironment.JavaSE17)

// Adding src/main/resources etc. to the source entries, so Eclipse "compiles" them, i.e. copies them to the target
EclipseKeys.createSrc := EclipseCreateSrc.Default + EclipseCreateSrc.Resource

// In order to avoid Eclipse and sbt working on the same files: At least in theory there could be race conditions and such
EclipseKeys.eclipseOutput := Some(".target")

// Add source entries to library dependencies
EclipseKeys.withSource := true
1 change: 1 addition & 0 deletions Scala Dojo/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=0.13.0
3 changes: 3 additions & 0 deletions Scala Dojo/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.2")

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.4.0")
7 changes: 6 additions & 1 deletion Scala Dojo/src/test/scala/dojo/EulerProblem1Suite.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package dojo

import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner

import org.scalatest.FunSuite

@RunWith(classOf[JUnitRunner])
class EulerProblem1Suite extends FunSuite{

test("The sum of all the multiples of 3 or 5 below 10 should be 23") {
assert(EulerProblem1.sumOfMultiplesBelow(10) === 3 + 5 + 6 + 9)
}

}
}
10 changes: 0 additions & 10 deletions Scala Intro/.classpath

This file was deleted.

1 change: 1 addition & 0 deletions Scala Intro/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/bin
/.cache
/.target
18 changes: 0 additions & 18 deletions Scala Intro/.project

This file was deleted.

18 changes: 17 additions & 1 deletion Scala Intro/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,23 @@ name := "Scala Intro"

version := "1.0"

scalaVersion := "2.10.2"
scalaVersion := "2.10.3"

libraryDependencies += "junit" % "junit" % "4.11" % "test"

libraryDependencies ++= Seq(
"junit" % "junit" % "4.11" % "test",
"org.scalatest" %% "scalatest" % "2.0" % "test->default"
)

// Use Java 7 (change to JavaSE16 if you don't have Java 7 installed)
EclipseKeys.executionEnvironment := Some(EclipseExecutionEnvironment.JavaSE17)

// Adding src/main/resources etc. to the source entries, so Eclipse "compiles" them, i.e. copies them to the target
EclipseKeys.createSrc := EclipseCreateSrc.Default + EclipseCreateSrc.Resource

// In order to avoid Eclipse and sbt working on the same files: At least in theory there could be race conditions and such
EclipseKeys.eclipseOutput := Some(".target")

// Add source entries to library dependencies
EclipseKeys.withSource := true
1 change: 1 addition & 0 deletions Scala Intro/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=0.13.0
3 changes: 3 additions & 0 deletions Scala Intro/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.2")

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.4.0")
5 changes: 5 additions & 0 deletions Scala Intro/src/test/scala/intro/ClassPatternSuite.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package intro

import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner

import org.scalatest.FunSuite

/**
* Workshop exercise showing classes and objects
*/
@RunWith(classOf[JUnitRunner])
class ClassPatternSuite extends FunSuite {

//Traits are ALMOST like 'interfaces', they can't be instantiated directly
Expand Down
7 changes: 6 additions & 1 deletion Scala Intro/src/test/scala/intro/CollectionsSuite.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package intro

import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner

import org.scalatest.FunSuite

@RunWith(classOf[JUnitRunner])
class CollectionsSuite extends FunSuite {

example {
Expand Down Expand Up @@ -395,4 +400,4 @@ class CollectionsSuite extends FunSuite {
* introduction to it.
*/

}
}
7 changes: 6 additions & 1 deletion Scala Intro/src/test/scala/intro/HelloFunSuite.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package intro

import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner

import org.scalatest.FunSuite

@RunWith(classOf[JUnitRunner])
class HelloFunSuite extends FunSuite{
/**
* This is our first exercise. We will use ScalaTest library
Expand Down Expand Up @@ -34,4 +39,4 @@ class HelloFunSuite extends FunSuite{
assert(i === 5)
}

}
}