You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contribute/hacker-guide.md
+7-11Lines changed: 7 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -106,10 +106,10 @@ You need the following tools:
106
106
*`sbt`, an interactive build tool commonly used in Scala projects. Acquiring sbt manually is not necessary -- the recommended approach is to download the [sbt-extras runner script](https://github.com/paulp/sbt-extras/blob/master/sbt) and use it in place of `sbt`. The script will download and run the correct version of sbt when run from the Scala repository's root directory.
107
107
*`curl` -- the build uses `curl` in the `pull-binary-libs.sh` script to download bootstrap libs.
108
108
109
-
The majority of our team works on Linux and OS X, so these operating systems are guaranteed to work. Windows is supported, but it might have issues. Please report to [the issue tracker](https://issues.scala-lang.org/) if you encounter any.
109
+
OS X and Linux builds should work. Windows is supported, but it might have issues. Please report to [the issue tracker](https://issues.scala-lang.org/) if you encounter any.
110
110
111
111
Building Scala is as easy as running `sbt dist/mkPack` in the root of your cloned repository. Be prepared to wait for a while -- a full "clean" build
112
-
takes 8+ minutes depending on your machine (and up to 30 minutes on older machines with less memory). Incremental builds are usually within 30-120 seconds range (again, your mileage might vary
112
+
takes 5+ minutes depending on your machine (longer on older machines with less memory). Incremental builds are usually within 20-120 seconds range (again, your mileage might vary
113
113
with your hardware).
114
114
115
115
### IDE
@@ -155,12 +155,8 @@ Now, implement your bugfix or new feature!
155
155
156
156
Here are also some tips & tricks that have proven useful in Scala development:
157
157
158
-
* If after introducing changes or updating your clone, you get `AbstractMethodError` or other linkage exceptions,
159
-
try doing `sbt clean`. Due to the way Scala compiles traits, if a trait changes, then it's sometimes not enough to recompile
160
-
just that trait; it might also be necessary to recompile its users. The `sbt` tool is not smart enough to do that, which might lead to
161
-
very strange errors. Full rebuilds fix the problem. Fortunately that's rarely necessary, because full rebuilds take a lot of time -- the same 8-30 minutes as mentioned above.
162
-
* Even on solid state drives packaging Scala distribution (i.e. creating jars from class files) is a non-trivial task. To save time here,
163
-
some people in our team do `sbt compile` instead of `sbt dist/mkPack` and then create custom scripts using `sbt/mkBin` to launch Scala from `./build/quick/bin`. Also see [the Scala README](https://github.com/scala/scala#incremental-compilation) for tips on speeding up compile times.
158
+
* Even on solid state drives packaging Scala distribution (i.e. creating jars from class files) is a non-trivial task. To save time here, some people in our team do `sbt compile` instead of `sbt dist/mkPack` and then create custom scripts using `sbt/mkBin` to launch Scala from `./build/quick/bin/`. Also see [the Scala README](https://github.com/scala/scala#incremental-compilation) for tips on speeding up compile times.
159
+
* If after introducing changes or updating your clone, you get `AbstractMethodError` or other linkage exceptions, try doing `sbt clean` and building again.
164
160
* Don't underestimate the power of `print`. When starting with Scala, I spent a lot of time in the debugger trying to figure out how
165
161
things work. However later I found out that print-based debugging is often more effective than jumping around. While it might be obvious
166
162
to some, I'd like to explicitly mention that it's also useful to print stack traces to understand the flow of execution. When working with `Trees`, you might want to use the Scala `showRaw` to get the `AST` representation.
@@ -300,9 +296,9 @@ This means your change is backward or forward binary incompatible with the speci
300
296
301
297
### Verify
302
298
303
-
Now to make sure that my fix doesn't break anything I need to run the test suite using the `partest`tool we wrote to test Scala.
304
-
Read up [the partest guide](partest-guide.html) to learn the details about partest, but in a nutshell you can either
305
-
run `sbt test` to go through the entire test suite (30+ minutes) or use wildcards to limit the tests to something manageable:
299
+
Now to make sure that my fix doesn't break anything I need to run the test suite. The Scala test suite uses [JUnit](http://junit.org/junit4/) and [partest](partest-guide.html), a tool we wrote for testing Scala.
300
+
Run `sbt test` and `sbt partest` to run all of the JUnit and partest tests, respectively.
301
+
`partest` (not `sbt partest`) also allows you to run a subset of the tests using wildcards:
306
302
307
303
18:52 ~/Projects/scala/sandbox (ticket/6725)$ cd ../test
0 commit comments