Commit Graph

1767 Commits

Author SHA1 Message Date
Eugene Yokota 170685f4e1 Fixes dependency-management/update-sbt-classifiers 2017-07-16 15:12:47 -04:00
Eugene Yokota 99be5b25f4 Roll back Vector changes in Keys.scala
Keys should Seq type since it's fairly common to use List in build.sbt, and it would cause annoying build changes.
Fixes actions/cross
2017-07-16 13:58:51 -04:00
Eugene Yokota f0ac6ae11c Adjust to upstream changes 2017-07-16 00:51:49 -04:00
Martin Duhem 347914191a Adapt to new library management API 2017-07-15 18:09:40 -04:00
Eugene Yokota 3cc49e49f4 Merge branch 'pr/3321' into wip/integration 2017-07-15 17:53:21 -04:00
Eugene Yokota c909de01b8 Merge branch 'pr/3317' into wip/integration 2017-07-15 17:52:41 -04:00
Eugene Yokota c2c1d0ff12 Merge branch 'pr/3316' into wip/integration 2017-07-15 17:52:15 -04:00
Martin Duhem 3fe068a4c1 Adapt to changes in ConsoleAppender 2017-07-15 17:15:42 +02:00
jvican 2da90fee03
Sync up with changes to `AnalysisContents` 2017-07-15 10:08:08 +02:00
jvican 32d8f47248
Add setting to switch to text analysis
As per suggestions in https://github.com/sbt/zinc/pull/351.
2017-07-15 09:54:21 +02:00
jvican 26cfe0cb7b
Remove any reference to `F0` and `F1`
Syncs with https://github.com/sbt/zinc/pull/359 and
https://github.com/sbt/util/pull/84.
2017-07-14 17:29:06 +02:00
jvican 0cc3cfb364
Synchronize with changes to Zinc logger API
https://github.com/sbt/zinc/pull/325
2017-07-14 14:32:53 +02:00
Eugene Yokota 42a1e2a291 Improve the default prompt
Fixes #3313

This changes the default prompt to include "sbt:" + current project name.
See https://twitter.com/eed3si9n/status/884914670351659009
2017-07-13 14:58:10 -04:00
Guillaume Martres cfc8a85fdf Use the new Zinc main class detection
See https://github.com/sbt/zinc/pull/287 for details.
2017-07-10 23:15:08 +02:00
Dale Wijnand 9494967e05
Upgrade util/lm/zinc & config build for util modules
Welcome back home!
2017-07-07 12:11:59 +01:00
Eugene Yokota efa3b1d340
Bump to latest io, scalajson, sjsonnew, contraband, util, lm, zinc 2017-07-06 11:05:24 +01:00
Martin Duhem 0daca42c29 Adapt to use the new `WatchService`
This commit adapts `Watched` so that it supports the new `WatchService`
infrastructure introduced in sbt/io. The goal of this infrastructure is
to provide and API for and several implementations of services that
monitor changes to the file system.

The service to use to monitor the file system can be configured with the
key `watchService`.
2017-07-02 00:28:04 -04:00
eugene yokota 25d393bd8b Merge pull request #3281 from dwijnand/no-eval
Get rid of Eval
2017-06-28 16:32:31 -04:00
eugene yokota 249c1299a4 Merge pull request #3291 from dwijnand/import-tuple-enrichments
Move the tuple enrichments to sbt.TupleSyntax
2017-06-27 15:17:39 -04:00
eugene yokota 9d8bba31f8 Merge pull request #3293 from dwijnand/scala212FromSbtVersion1xx
Use Scala 2.12 for all sbt 1.x, not just 1.0.x
2017-06-27 15:15:06 -04:00
Dale Wijnand 27615b8fa8
Use Scala 2.12 for all sbt 1.x, not just 1.0.x 2017-06-27 14:13:16 +01:00
Dale Wijnand 0fe0de5fb3
Move the tuple enrichments into sbt.TupleSyntax
This undeprecates the syntax, but at the same times moves it out of
implicit scope, therefore requiring a 'import TupleSyntax._' to opt-in
to the old syntax.
2017-06-27 12:42:46 +01:00
Dale Wijnand 1193a48542
Get rid of Eval 2017-06-21 13:16:36 +01:00
Dale Wijnand 68b47a9dd1
Finish getting rid of delegates 2017-06-20 16:27:15 +01:00
Dale Wijnand 1247431a71
Format Eval-related code 2017-06-20 16:22:32 +01:00
Dale Wijnand 53f1e2a4da
Fixes due to universal equality and the introduction of the Exec wrapper 2017-06-20 14:03:56 +01:00
Dale Wijnand 73b45f6d30
Cleanup code paths related to "last" 2017-06-20 14:03:56 +01:00
Eugene Yokota f81598c6e9 Fixes test content logger dropping out, or displaying twice
Fixes #3117
2017-06-20 03:04:53 -04:00
kenji yoshida 260f6ee740 fix typo (#3246) 2017-06-04 00:28:22 +02:00
Eugene Yokota 03c9b648fb Adjust to Zinc and lm changes 2017-05-30 00:59:43 -04:00
Eugene Yokota 3690ff193c Fix cached update task
Fixes sbt/sbt#3226

One of the checks that the cached update task performs is called `depsUpdated`, which checks if the subproject dependencies have been thawed out of cache of now.
For this to function correctly, when we thaw the `UpdateReport` from JSON, we need to mark the report as cached. This was done subtley in sbt 0.13 for sbinary (https://github.com/sbt/sbt-zero-thirteen/blob/v0.13.15/main/actions/src/main/scala/sbt/CacheIvy.scala#L66-L67).
2017-05-29 17:14:52 -04:00
jvican b017eaee39
Support DSL detection for nested ifs and anons
Before, we were not preserving the value `insideXXX`. This commit makes
sure that we handle much more complex scenarios and we report them
successfully. Have a look at the tests.
2017-05-28 18:31:44 +02:00
eugene yokota 9fc9304638 Merge pull request #3223 from eed3si9n/fport/3153
[fport] Remove the "hit [ENTER] to switch to interactive mode" feature
2017-05-27 01:12:15 -04:00
eugene yokota 4d3b910a19 Merge pull request #3221 from eed3si9n/fport/3133
[fport] Port sbt-cross-building's ^ and ^^ commands
2017-05-27 01:12:00 -04:00
Eugene Yokota 0e979b4a3a Port sbt-cross-building's ^ and ^^ commands
This ports sbt-cross-building's cross (`^`) and switch (`^^`) commands.
Instead of making it a plugin, the default settings are now changed
to use `sbtVersion in pluginCrossBuild` for the sbt dependency.
2017-05-27 00:15:03 -04:00
Dale Wijnand e4be5f4a09 Remove the "hit [ENTER] to switch to interactive mode" feature
In sbt 0.13.15, in addition to notifying the user about the existence of
sbt's shell, a feature was added to allow the user to switch to sbt's
shell - a more pro-active approach to just displaying a message.

Unfortunately sbt is often unintentionally invoked in shell scripts in
"interactive mode" when no interaction is expected by, for exmaple,
invoking `sbt package` instead of `sbt package < /dev/null`. In that
case hitting [ENTER] would silently trigger sbt to run its shell,
easily wrecking the script. In addition to that I was unhappy with the
implementation as it created a tight coupling between sbt's command
processing abstraction to sbt's shell command.

If you want to stay in sbt's shell after running a task like `package`
then invoke sbt like so:

    sbt package shell

Fixes #3091
2017-05-26 21:42:41 -04:00
Dale Wijnand b54c0ff059 Notify users about shell only if compile is present
This is a change in strategy.

The motivation is the need to find a good balance between:

  + informing the uninformed that would benefit from this information, &
  + not spamming the already informed

Making it dependent on "compile" being present in remainingCommands will
probably make it trigger for, for example, Maven users who are used to
running "mvn compile" and always run "sbt compile", and who therefore
are unneccesarily suffering terribly slow compile speeds by starting up
the jvm and sbt every time.

Fixes #3091
Fixes #3097
2017-05-26 21:33:49 -04:00
jvican 7b8e8cadf4
Execute macro tests in Travis 2017-05-25 18:39:24 +02:00
jvican ca3acc4e52
Improve if check and prohibit value inside anon
This commit does the following things:

* Removes the boolean from the instance context passes to the linter.
* Prohibits the use of value inside anonymous functions.
* Improves the previous check of `value` inside if.

The improvements have occurred thanks to the fix of an oversight in the
traverser. As a result, several implementation of tasks have been
rewritten because of new compilation failures by both checks.

Note that the new check that prohibits the use of value inside anonymous
functions ignores all the functions whose parameters have been
synthesized by scalac (that can happen in a number of different
scenarios, like for comprehensions). Other scripted tests have also been
fixed.

Running `.value` inside an anonymous function yields the following
error:

```
[error] /data/rw/code/scala/sbt/main-settings/src/test/scala/sbt/std/TaskPosSpec.scala:50:24: The evaluation of `foo` inside an anonymous function is prohibited.
[error]
[error] Problem: Task invocations inside anonymous functions are evaluated independently of whether the anonymous function is invoked or not.
[error]
[error] Solution:
[error]   1. Make `foo` evaluation explicit outside of the function body if you don't care about its evaluation.
[error]   2. Use a dynamic task to evaluate `foo` and pass that value as a parameter to an anonymous function.
[error]
[error]       val anon = () => foo.value + " "
[error]                        ^
```
2017-05-25 17:21:29 +02:00
jvican 2b12721a68
Add fully-fledged macro check for value inside if
`.value` inside the if of a regular task is unsafe. The wrapping task
will always execute the value, no matter what the if predicate yields.

This commit adds the infrastructure to lint code for every sbt DSL
macro. It also adds example of neg tests that check that the DSL checks
are in place.

The sbt checks yield error for this specific case because we may want to
explore changing this behaviour in the future. The solutions to this are
straightforward and explained in the error message, that looks like
this:

```
EXPECTED: The evaluation of `fooNeg` happens always inside a regular task.

PROBLEM: `fooNeg` is inside the if expression of a regular task.
  Regular tasks always evaluate task inside the bodies of if expressions.

SOLUTION:
  1. If you only want to evaluate it when the if predicate is true, use a dynamic task.
  2. Otherwise, make the static evaluation explicit by evaluating `fooNeg` outside the if expression.
```

Aside from those solutions, this commit also adds a way to disable any
DSL check by using the new `sbt.unchecked` annotation. This annotation,
similar to `scala.annotation.unchecked` disables compiler output. In our
case, it will disable any task dsl check, making it silent.

Examples of positive checks have also been added.

There have been only two places in `Defaults.scala` where this check has
made compilation fail.

The first one is inside `allDependencies`. To ensure that we still have
static dependencies for `allDependencies`, I have hoisted up the value
invocation outside the if expression. We may want to explore adding a
dynamic task in the future, though. We are doing unnecessary work there.

The second one is inside `update` and is not important because it's not
exposed to the user. We use a `taskDyn`.
2017-05-25 15:33:00 +02:00
jvican 2692bec21d
Reformat sbt source (minor changes) 2017-05-24 11:17:45 +02:00
Eugene Yokota 2b5637270a update TestFramework
- update reset.sh for debugging
- use Vector around TestFramework
- unbind existing appdenders from newLog
- register string codec for TestStringEvent
2017-05-19 00:16:19 -04:00
eugene yokota d3ff3fb63a migrate PluginTrigger and ProjectOrigin to Contraband (#3191)
and move TestFramework to a non case class.
2017-05-13 13:01:51 +01:00
Eugene Yokota 3724277704 migrate ForkOptions to Contraband 2017-05-12 05:22:08 -04:00
eugene yokota b1a1d03009 Merge pull request #3180 from eed3si9n/wip/zero2
[sbt 1.0] Rename scope component Global to Zero (`in Global` stays the same)
2017-05-10 16:48:40 -04:00
jvican 9d260f68c7
Use `ConsoleReporter` if no reporter is found
This change is necessary in the cases where we have global
initialization issues that have no position, like:

```
[info] [error] scala.reflect.internal.MissingRequirementError: object scala in compiler mirror not found.
```

Before, it was failing with a `sys.error` exception. Now we will report
these issues with a console reporter that is not meant to be
thread-safe.
2017-05-10 21:40:01 +02:00
Eugene Yokota 4182249526 Add InteractionService from sbt-core-next
Fixes sbt/sbt#3167
2017-05-08 21:54:58 -04:00
Eugene Yokota 2082f37e2a Rename Global as scope component to Zero
Fixes #3178

While working on the Scopes and Scope Delegation document, I noticed that the term Global in sbt is used for two different meaning.

1. Universal fallback scope component `*`
2. An alias for GlobalScope

This disambiguates the two by renaming ScopeAxis instance to Zero.
Since this is mostly internal to sbt code, the impact to the user should be minimal.
2017-05-08 11:41:48 -04:00
eugene yokota 6cd3cd2323 Merge pull request #3149 from scalacenter/clean-update
Clean up `update` in `Defaults`
2017-05-05 11:03:18 -04:00
jvican 1252db6b4a
Address Eugene's feedback 2017-05-04 13:33:21 +02:00