Commit Graph

574 Commits

Author SHA1 Message Date
eugene yokota 2a4e955e77 Merge pull request #2782 from bantonsson/lazily-concatenate-failed-errors
Lazily concatenate failed errors for completion
2016-10-14 16:17:08 -04:00
Björn Antonsson 127c164f81 Lazily concatenate failed errors for completion
* Fixes [sbt/sbt#2781]
* When using `<TAB>` completion the failed errors were always
  computed for mathcing projects even if there was no failure,
  leading to excessive computation of Levenshtein distances
  and a large lag (seconds) on builds with many matching
  projects.
2016-10-13 16:20:18 +02:00
Jason Zaugg 5005abfef2 SD-232 Recycle classloaders to be anti-hostile to JIT.
The compiler interface subclasses `scala.tools.nsc.Global`,
and loading this new subclass before each `compile` task forces
HotSpot JIT to deoptimize larges swathes of compiled code. It's
a bit like SBT has rigged the dice to always descend the longest
ladder in a game of Snakes and Ladders.

The slowdown seems to be larger with Scala 2.12. There are a number
of variables at play, but I think the main factor here is that
we now rely on JIT to devirtualize calls to final methods in traits
whereas we used to emit static calls. JIT does a good job at this,
so long as classloading doesn't undo that good work.

This commit extends the existing `ClassLoaderCache` to encompass
the classloader that includes the compiler interface JAR. I've
resorted to adding a var to `AnalyzingCompiler` to inject the
dependency to get the cache to the spot I need it without binary
incompatible changes to the intervening method signatures.
2016-09-26 14:49:47 +10:00
eugene yokota 265cbd78b1 Fixes #2480. Workaround for Jline regression (#2570)
Workaround jline/jline2#205
2016-04-23 23:56:25 -04:00
Martin Duhem 1bda41fc31 Address problems reported by Codacy 2016-02-23 15:19:04 +01:00
Martin Duhem e35f9bb11e Completion for build-level keys
sbt's shell provided completion only for keys that were relative to a
defined project, but didn't provide completion for keys that belong to
the build definition only.

This commit fixes this issue by defining a new kind of `Parser` (from
which completions are generated) which runs its input simultaneously on
distinct parsers. We now define a parser for project-level keys and
another parser for build-level keys. These two parsers are eventually
combined, and we get the completions of both parsers.

Fixes sbt/sbt#2460
2016-02-23 15:11:15 +01:00
Guillaume Martres 10265efd9c Make sbt aware of Dotty
This small set of changes, together with the compiler-bridge I wrote
(https://github.com/smarter/dotty-bridge) enables us to compile code
using Dotty in sbt, see https://github.com/smarter/dotty-example-project
for an example.
2016-01-03 20:35:29 +01:00
Eugene Yokota 068cffa578 Reimplement fallback to system classloader to maintain the 0.13 semantics 2015-12-30 07:36:12 -05:00
Eugene Yokota db81fa2109 Fix bincompat issue introduced in #2268 2015-12-30 06:22:55 -05:00
Stu Hood 9fbbaab58e Add a test that we`re able to parse inner classes. 2015-11-10 14:45:04 -08:00
Stu Hood 5fbfa7aeb0 Move back to ClassLoader.getSystemClassloader 2015-09-20 09:28:43 -07:00
Stu Hood 9401d47e79 Remove copyright from IOSpecification, and use a simpler Resource lookup. 2015-09-20 08:42:10 -07:00
Stu Hood 198820bc53 Move io tests to subdirectory, and add a test for "System" class lookups. 2015-09-18 17:15:52 -07:00
Stu Hood 5a3b95cd6d Add support for parsing system classes. 2015-09-18 16:37:22 -07:00
Pierre DAL-PRA 8f1fb2d232 Fix additional warnings 2015-08-07 00:23:14 +02:00
Pierre DAL-PRA 54d54b9f4f Replace procedure syntax by explicit Unit annotation 2015-08-04 10:07:38 +02:00
Pierre DAL-PRA f0bd9001e6 Remove redundant collection conversions 2015-08-01 12:05:35 +02:00
Pierre DAL-PRA b9171e59ad Simplify operations on collections 2015-08-01 02:25:17 +02:00
Pierre DAL-PRA 13b37cc987 Fix several warnings 2015-07-17 09:17:42 +02:00
Josh Suereth 4abc8386f2 Merge pull request #2085 from twitter-forks/stuhood/java-static-final-fields-as-singletons
Encode static-final constant fields as Singletons
2015-07-14 12:35:56 -04:00
Stu Hood 7e7aca5f55 Mismatch APIs on type changes as well 2015-07-13 21:29:14 -07:00
Josh Suereth 0e861c9867 Merge pull request #2094 from pdalpra/public-null-logger
Make Logger.null public + minor clean up
2015-07-10 12:48:46 -04:00
Stu Hood a80c3e2bb8 Review feedback 2015-07-09 22:01:05 -07:00
Adriaan Moors a355012c2e Do not use `ListBuffer#readOnly`
It's dangerous, deprecated, and was removed in 2.12.0-M1.
See https://github.com/scala/scala/pull/4140.

`ListBuffer#toList` has equivalent performance,
except it actually returns an immutable copy(-on-write).
2015-07-09 14:49:08 -07:00
Pierre DAL-PRA 4e9626eb68 Minor clean up 2015-07-09 22:59:05 +02:00
Pierre DAL-PRA 771f08cb61 Make Logger.Null public 2015-07-09 22:58:47 +02:00
Stu Hood 6846bbd3ed Encode static-final constant fields as Singletons, so that when the api changes, they change. 2015-07-01 21:37:32 -07:00
Eugene Yokota 16b95a4d62 Add distinctPath 2015-06-28 14:41:32 -04:00
Eugene Yokota 4bae8b3acb Fixes #1973. Renames distinct to distinctName 2015-06-27 05:56:43 -04:00
David Perez d27c7f40c2 Merge remote-tracking branch 'upstream/0.13' into 0.13 2015-06-04 12:43:32 +02:00
Vitalii Voloshyn 54081fb4e4 Prevent history command(s) from going into an infinite loop [1562] 2015-05-18 13:33:31 +03:00
David Perez 40b647e599 Issue 2008: provide more diagnostic info for undefined setting 2015-05-08 09:29:41 +02:00
Josh Suereth 923f4261d0 Fix ANSI escape sequences.
Now we handle the CSI (ESC + [).

Fixes #1143
2015-02-28 08:30:59 -05:00
henry 6545deacc8 Fix #1368 - getResources should never return null 2015-02-11 13:33:40 +00:00
Eugene Yokota 69171f40b3 Auto style fix 2015-02-02 14:56:13 -05:00
Indrajit Raychaudhuri 1f90ef6b43 Fix params order in `@deprecated` 2015-01-17 08:25:57 +05:30
eugene yokota be78b7fc4c Merge pull request #1759 from jedesah/topic/minor_cleanup
Minor code cleanup
2015-01-14 16:13:06 -05:00
Derek Wickern b3cab0f2a0 Fix logger not overwriting the previous line in alternate shells
When running the 'update' task in bash, the output is all collapsed onto one line.
On Windows, even using an ANSI capable shell, running 'update' spams the console.

Tested with dash in Ubuntu; ANSICON, Console2 and ConsoleZ in Windows.
2014-12-11 11:21:23 -08:00
Jean-Rémi Desjardins ca736e55d3 Minor code cleanup 2014-12-03 09:56:34 -08:00
Grzegorz Kossakowski 015c61ad69 Merge pull request #1736 from Duhemm/dependency-kind-compile
Abstract over dependency kind in Compile
2014-12-02 16:00:22 +01:00
Eugene Yokota 416ffa76d1 merge 0.13.7 manually 2014-11-19 14:34:08 -05:00
Martin Duhem 98c789b826 Abstract over dependency context in Compile
This commit completes the abstraction over dependency kinds in the
incremental compiler, started with #1340.
2014-11-19 10:35:07 +01:00
Eugene Yokota c1fc84662f scalariform 2014-11-04 17:48:46 -05:00
eugene yokota b9964d5153 Merge pull request #1702 from jsuereth/wip/incremental-compiler-javac-cleanup
Create a new API for calling Java toolchains.
2014-10-31 15:31:14 -04:00
Josh Suereth 70cdce0830 Create a new API for calling Java toolchains.
* Create a new sbt.compiler.javac package
* Create new interfaces to control running `javac` and `javadoc` whether forked or local.
* Ensure new interfaces make use of `xsbti.Reporter`.
* Create new method on `xsbti.compiler.JavaCompiler` which takes a `xsbti.Reporter`
* Create a new mechanism to parse (more accurately) Warnings + Errors, to distinguish the two.
* Ensure older xsbti.Compiler implementations still succeed via catcing NoSuchMethodError.
* Feed new toolchain through sbt.actions.Compiler API via dirty hackery until we can break things in sbt 1.0
* Added a set of unit tests for parsing errors from Javac/Javadoc
* Added a new integration test for hidden compilerReporter key, including testing threading of javac reports.

Fixes #875, Fixes #1542,  Related #1178 could be looked into/cleaned up.
2014-10-29 20:06:08 -04:00
Josh Suereth fe712173f3 Fix BC issue discovered in #1696.
Def.derive has a new parameter, so we add an override which delegates down to the new method.
2014-10-28 10:21:41 -04:00
Eugene Yokota 3f958a5bce enable -deprecation for Scala 2.10
Enable -deprecation flag to catch old code being use when we migrate
things.
In this commit I moved error to sys.error.
2014-10-10 15:42:26 -04:00
Jean-Rémi Desjardins ff9baf5987 Merge branch 'refs/heads/0.13' into topic/remove-warnings 2014-09-10 23:24:53 -07:00
Jean-Rémi Desjardins ced5230289 Remove some compiler warnings 2014-09-10 22:55:43 -07:00
Josh Suereth da1fc33b52 Removing printlns and adding the test, DOH. 2014-09-09 09:16:10 -04:00