Skip to content

Commit ddb42b9

Browse files
committed
Merge pull request #4 from phaller/topic/sbt-build
Topic/sbt build
2 parents d5409fd + 14ca71d commit ddb42b9

39 files changed

+651
-1320
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
classes
2+
target
3+
.idea
4+
.idea_modules

README.md

+3-36
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,10 @@ Scala Async Project
44
Building
55
--------
66

7-
The async macro can be built using the `build.sh` script.
8-
It requires either Scala 2.10.0-RC1 or a nightly build of Scala 2.10.x.
7+
The async macro and its test suite can be built and run with SBT.
98

10-
Running the test suite
11-
----------------------
12-
13-
Currently, the tests can be run using `partest` the testing tool used
14-
to test the Scala compiler and standard library. At the moment,
15-
running `partest` requires a working copy of the Scala compiler.
16-
17-
In the following it is assumed that the build of the Scala compiler is
18-
located at `../scala` (root of the "scala" project when cloned using
19-
git) relative to the root directory of the async project.
20-
21-
Moreover, in the Scala build it's necessary to copy the directory
22-
"build/asm/classes/scala/tools/asm" into
23-
"build/quick/classes/compiler/scala/tools".
24-
25-
Finally, it's necessary to set the following environment variables:
26-
27-
```
28-
SCALAC_OPTS='-cp classes'
29-
JAVA_OPTS='-cp classes'
30-
```
31-
32-
After this setup, we can run `partest` as follows:
33-
34-
```
35-
$ ../scala/test/partest --classpath ../scala/build/quick/classes --run
36-
```
37-
38-
This runs all tests in the directory `test/files/run`.
39-
It is also possible to run only a single test:
40-
41-
```
42-
$ ../scala/test/partest --classpath ../scala/build/quick/classes test/files/run/await0
43-
```
9+
Contributing
10+
------------
4411

4512
If you are interested in contributing code, we ask you to complete and submit
4613
to us the Scala Contributor License Agreement, which allows us to ensure that

build.sbt

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
scalaVersion := "2.10.0-RC1"
2+
3+
organization := "org.typesafe.async"
4+
5+
name := "scala-async"
6+
7+
version := "0.1-SNAPSHOT"
8+
9+
libraryDependencies <++= (scalaVersion) {
10+
sv => Seq(
11+
"org.scala-lang" % "scala-reflect" % sv,
12+
"org.scala-lang" % "scala-compiler" % sv % "test"
13+
)
14+
}
15+
16+
libraryDependencies += "junit" % "junit-dep" % "4.10" % "test"
17+
18+
libraryDependencies += "com.novocode" % "junit-interface" % "0.10-M2" % "test"
19+
20+
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v", "-s")
21+
22+
autoCompilerPlugins := true
23+
24+
libraryDependencies <<= (scalaVersion, libraryDependencies) {
25+
(ver, deps) =>
26+
deps :+ compilerPlugin("org.scala-lang.plugins" % "continuations" % ver)
27+
}
28+
29+
scalacOptions += "-P:continuations:enable"
30+
31+
scalacOptions ++= Seq("-deprecation", "-unchecked", "-Xlint")
32+
33+
description := "An asynchronous programminig facility for Scala, in the spirit of C# await/async"
34+
35+
homepage := Some(url("http://github.com/phaller/scala-async"))
36+
37+
startYear := Some(2012)
38+
39+
licenses +=("Scala license", url("http://github.com/phaller/scala-async/LICENCE"))
40+
41+
pomExtra := (
42+
<developers>
43+
<developer>
44+
<id>phaller</id>
45+
<name>Philipp Haller</name>
46+
<timezone>+1</timezone>
47+
<url>http://github.com/phaller</url>
48+
</developer>
49+
<developer>
50+
<id>retronym</id>
51+
<name>Jason Zaugg</name>
52+
<timezone>+1</timezone>
53+
<url>http://github.com/retronym</url>
54+
</developer>
55+
</developers>
56+
<scm>
57+
<url>git@github.com:phaller/scala-async.git/</url>
58+
<connection>scm:git:git@github.com:phaller/scala-async.git</connection>
59+
</scm>
60+
)

pending/run/fallback0/MinimalScalaTest.scala

Whitespace-only changes.

project/build.properties

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=0.12.1

src/async/library/scala/async/Async.scala renamed to src/main/scala/scala/async/Async.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ object Async extends AsyncUtils {
7474
}
7575
}
7676
*/
77+
val nonFatalModule = c.mirror.staticModule("scala.util.control.NonFatal")
7778
val resumeFunTree: c.Tree = DefDef(Modifiers(), newTermName("resume"), List(), List(List()), Ident(definitions.UnitClass),
7879
Try(Apply(Select(
7980
Apply(Select(handlerExpr.tree, newTermName("orElse")), List(handlerForLastState.tree)),
8081
newTermName("apply")), List(Ident(newTermName("state")))),
8182
List(
8283
CaseDef(
83-
Apply(Select(Select(Select(Ident(newTermName("scala")), newTermName("util")), newTermName("control")), newTermName("NonFatal")), List(Bind(newTermName("t"), Ident(nme.WILDCARD)))),
84+
Apply(Ident(nonFatalModule), List(Bind(newTermName("t"), Ident(nme.WILDCARD)))),
8485
EmptyTree,
8586
Block(List(
8687
Apply(Select(Ident(newTermName("result")), newTermName("failure")), List(Ident(newTermName("t"))))),

0 commit comments

Comments
 (0)