Commit Graph

356 Commits

Author SHA1 Message Date
eugene yokota ff4d371bc2 Merge pull request #1759 from jedesah/topic/minor_cleanup
Minor code cleanup
2015-01-14 16:13:06 -05:00
Derek Wickern 25a91c161c 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 07c3d51a0c Minor code cleanup 2014-12-03 09:56:34 -08:00
Eugene Yokota 208ceb09f6 merge 0.13.7 manually 2014-11-19 14:34:08 -05:00
Eugene Yokota 7f8bbe0193 scalariform 2014-11-04 17:48:46 -05:00
eugene yokota aca3130dea 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 f0a8f5d44f 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 9c36fa7508 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 a39e105b1f 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 f65f30d152 Remove some compiler warnings 2014-09-10 22:55:43 -07:00
Eugene Yokota f6c43b917d Fixes #1530. Fixes NPE by using IO.listFiles 2014-08-15 03:52:54 -04:00
Josh Suereth dbc8b2643f Ok, this is actually the flaky issue with the test.
We use the ch key for testing, so it can't be part of the autogenerated set.
2014-08-11 16:13:26 -04:00
Josh Suereth 515ec1f2e2 Fixes flaky no-such-element exception from bad generation of random tests. 2014-08-11 14:54:33 -04:00
Eugene Yokota a398e7d78f Implements eviction warning stories. #1200
This implements all stories from https://github.com/sbt/sbt/wiki/User-Stories%3A-Conflict-Warning.
When scalaVersion is no longer effective an eviction warning will display.

    Scala version was updated by one of library dependencies:
        * org.scala-lang:scala-library:2.10.2 -> 2.10.3

When there're suspected incompatibility in directly depended Java libraries,
eviction warnings will display.

   There may be incompatibilities among your library dependencies.
   Here are some of the libraries that were evicted:
      * commons-io:commons-io:1.4 -> 2.4

When there's suspected incompatiblity in directly depended Scala libraries,
eviction warnings will display.

  There may be incompatibilities among your library dependencies.
  Here are some of the libraries that were evicted:
      * com.typesafe.akka:akka-actor_2.10:2.1.4 -> 2.3.4

This also adds 'evicted' task, which displays more detailed eviction warnings.
2014-07-27 12:26:12 -04:00
Dan Sanduleac 4119bcf936 Don't allow generated strings (key names) to be empty 2014-05-20 09:02:10 +01:00
Josh Suereth 629a8ca6eb Bump expected 2.11 module versions so we can compile with 2.11
Add scala 2.11 test/build verification.

* Add 2.11 build configuratoin to travis ci
* Create command which runs `safe` unit tests
* Create command to test the scala 2.11 build
* Update scalacheck to 1.11.4
* Update specs2 to 2.3.11
* Fix various 2.11/deprecation removals
  and other changes.

Fix eval test failure in scala 2.11 with XML not existing.
2014-05-14 19:08:05 -04:00
Josh Suereth 9f9de600ee Scalariforming test code 2014-05-07 11:52:23 -04:00
Eugene Yokota 40fae635c6 some more source getting formatted 2014-05-02 18:07:05 -04:00
Eugene Yokota 4258189951 added scalariform 2014-05-01 12:50:07 -04:00
Dan Sanduleac 1e9dee900a Add 2 derived settings tests:
1) non-default derived settings, if they produce anything, the settings
   they produce must supersede previous assignents (in the settings seq)
   to the same key.

2) even if a derived setting is scoped at a higher scope (e.g.
   ThisBuild) the settings it produces are scoped at the intersection of
   that (the defining) scope and the scope of the triggering dependency.

2 is particularly nice as it enables this behaviour:
    derive(b in ThisBuild := a.value + 1)
    a in project1 := 0
    // a could be defined in all projects
    ==>
    Now (b in project1).value == (a in project1).value + 1 == 1
    and similarly in all other projects
    all with a single derived setting
2014-05-01 03:11:22 +01:00
Dan Sanduleac eb93fdd7a6 Improve SettingsExample to allow orthogonal scopes (like projects/tasks) at a certain nestIndex 2014-05-01 03:09:50 +01:00
Dan Sanduleac 767e2487d0 Couple of fixes 2014-05-01 01:35:48 +01:00
Dan Sanduleac 962f0bad76 Optimise scope intersection for GlobalScope 2014-05-01 01:35:48 +01:00
Dan Sanduleac decd323b64 Decouple DefaultSetting from Setting/DerivedSetting; BuildCommon.derive() produces default settings by default 2014-05-01 01:35:48 +01:00
Dan Sanduleac 6f5242d812 Derive settings only under the scope of the DerivedSetting 2014-05-01 01:35:48 +01:00
Dan Sanduleac 431c61775c Derived settings to replace their DerivedSetting, not go at the beginning 2014-05-01 01:35:48 +01:00
Dan Sanduleac 89d2aa291c DerivedSetting not a DefaultSetting anymore 2014-05-01 01:35:48 +01:00
Matej Urbas 0ed9eb17aa Reintroduced the `examples` method. Reintroduced and deprecated the `checkMatches` method. 2014-04-18 16:44:26 +01:00
Matej Urbas 150236900a Merge remote-tracking branch 'remotesbt/0.13' into 0.13 2014-04-18 13:48:19 +01:00
Matej Urbas cbfd3f1c08 Added tests for FileExamples. Improved the file-searching in FileExamples. 2014-04-16 08:36:27 +01:00
Matej Urbas 757fe4228d Improved the description of ParserWithExamples tests. 2014-04-14 08:24:02 +01:00
Matej Urbas f6aaf9ad67 Created unit tests for ParserWithExamples and FixedSetExampleSource. 2014-04-12 20:16:58 +01:00
Matej Urbas d8ef5af533 Now using ExampleSource in collection-based completion parsers. Removed the Examples parser. Renamed DynamicExamples to ParserWithExamples. 2014-04-08 21:31:04 +01:00
Matej Urbas 6f80efade2 Documented the DynamicExamples and FixedSetExamples classes. 2014-04-08 20:40:51 +01:00
Josh Suereth 35aad2b95b Part #1 of cancel-task-hooks - Hooks EvaluateTask.
* Create a new EvaluateTaskConfig which gives us a bit more freedom
  over changign config options to EvaluateTask in the future.
* Create adapted from old EvaluateTask to new EvaluateTask
* Add hooks into signals class to register/remote  a signal listener
  directly, rather than in an "arm" block.
* Create TaskEvaluationCancelHandler to control the strategy of
  who/whom can cancel (sbt-server vs. sbt-terminal).
* Create a null-object for the "can't cancel" scenario so the
  code path is exactly the same.

This commit does not wire settings into the build yet, nor does it
fix the config extractio methods.
2014-04-07 16:42:08 -04:00
Matej Urbas 6a4eb92ee5 Documented the new Parsers API a bit. Prepared the new API so that we can port the old ones to the new. Added support for filtering erroneous examples. 2014-04-06 23:49:15 +01:00
Matej Urbas b9e37107b2 Moved ExampleSource into a separate file. 2014-04-06 22:48:22 +01:00
Matej Urbas ab6a730168 Overloaded the the fileParser method. Renamed SourceOfExamples to ExampleSource. Documented fileParser, FileExamples, and ExampleSource. 2014-04-06 22:39:10 +01:00
Matej Urbas c1c52d4802 Ported the file search with pre-Java 7 API. 2014-04-06 00:01:30 +01:00
Matej Urbas fdfbaf99d4 Implemented a file parser. Added SourceOfExamples for lazy example listing (especially useful when lazily searching for files that match a certain prefix). 2014-04-05 22:11:00 +01:00
Jason Zaugg 13a40b1456 Fix NPE in task macro accessing q"{...}".symbol.pos
We shouldn't assume that the qualifier of a `Select` is a
`SymTree`; it may be a `Block`. One place that happens
is after the transformation of named/defaults applications.
That causes the reported `NullPointerException'.

In any case, using `qual.symbol.pos` sense here; it yields the
position of the defintions *referred to* by `qual`, not the
position of `qual` itself.

Both problems are easily fixed: use `qual.pos` instead.

Fixes #1107
2014-03-10 10:28:19 +01:00
Jason Zaugg ba2d12a46d Fix task macro's handling of Symbol owners in <qual>.value
The qualifier of the `.value` call may contain `DefTree`s (e.g.
vals, defs) or `Function` trees. When we snip them out of the
tree and graft them into a new context, we must also call
`changeOwner`, so that the symbol owner structure and the tree
structure are coherent.

Failure to do so resulted in a crash in the compiler backend.

Fixes #1150
2014-03-09 12:20:24 +01:00
Josh Suereth 44c3e27eb7 Revert "Fix task macro's handling of Symbol owners in <qual>.value"
This reverts commit 3017bfcd07.

This was causing sbt to be unable to compile.  Reverting temporarily until
we have a shot at a full fix.
2014-03-07 22:25:29 -05:00
Jason Zaugg f2d6528c5c Fix task macro's handling of Symbol owners in <qual>.value
The qualifier of the `.value` call may contain `DefTree`s (e.g.
vals, defs) or `Function` trees. When we snip them out of the
tree and graft them into a new context, we must also call
`changeOwner`, so that the symbol owner structure and the tree
structure are coherent.

Failure to do so resulted in a crash in the compiler backend.

Fixes #1150
2014-03-07 17:53:14 +01:00
Josh Suereth ff2553f49f Merge pull request #1127 from retronym/topic/2.11-2.10-source-compat
using compat._ to plug source compatibility breakages
2014-02-20 16:09:48 -05:00
Josh Suereth 2835ff9784 Merge pull request #1130 from sbt/wip/auto-plugins
AUTO PLUGIN FEATURE!!!!
2014-02-20 16:08:01 -05:00
Jason Zaugg 3b24308396 using compat._ to plug source compatibility breakages
This commit makes the code source compatible across Scala 2.10.3
and https://github.com/scala/scala/pull/3452, which is proposed
for inclusion in Scala 2.11.0-RC1.

We only strictly need the incremental compiler to build on Scala
2.11, as that is integrated into the IDE. But we gain valuable
insight into compiler regressions by building *all* of SBT with
2.11.

We only got there recently (the 0.13 branch of SBT now fully cross
compiles with 2.10.3 and 2.11.0-SNAPSHOT), and this aims to keep
things that way.

Once 2.10 support is dropped, SBT macros will be able to exploit
the new reflection APIs in 2.11 to avoid the need for casting
to compiler internals, which aren't governed by binary compatibility.
This has been prototyped by @xeno-by: https://github.com/sbt/sbt/pull/1121
2014-02-17 14:53:59 +01:00
Jason Zaugg 489b48f736 SI-8263 Avoid SOE in Symbol#logicallyEnclosingMember under Scala 2.11
Since the fix for SI-2066, Scala 2.11 calls logicallyEnclosingMember on the
`x` in the expansion of the task macro:

    InitializeInstance.app[[T0[x]](T0[java.io.File], T0[java.io.File]), Seq[java.io.File]]

This exposed the fact that SBT has created `T0` with `NoSymbol` as
the owner. This led to the a SOE.

I will also change the compiler to be more tolerant of this, but we
can observe good discipline in the macro and pick a sensible owner.
2014-02-12 13:30:46 +01:00
Mark Harrah 01708c572e Convert logic system test cases into unit tests.
Still TODO for auto-plugins/logic:

 * property-based tests for logic system
 * user documentation
 * (optional) 'about plugins' or similar to show more information about the auto-plugins for a project
 * (deferred) allow AutoPlugin to inject Commands directly?
 * (deferred) provide AutoPlugin functionality to arbitrary scopes instead of just at the Project level?
2014-01-24 14:37:04 -05:00
Mark Harrah 7d03a9da99 API docs, better terminology for negative cycle checking in logic system. 2014-01-24 14:36:46 -05:00