Commit Graph

171 Commits

Author SHA1 Message Date
Jean-Rémi Desjardins 07c3d51a0c Minor code cleanup 2014-12-03 09:56:34 -08:00
Eugene Yokota 7f8bbe0193 scalariform 2014-11-04 17:48:46 -05: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
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 9f9de600ee Scalariforming test code 2014-05-07 11:52:23 -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
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
Mark Harrah 7d03a9da99 API docs, better terminology for negative cycle checking in logic system. 2014-01-24 14:36:46 -05:00
Mark Harrah 3e1142843e Translate errors from logic system to Natures system. 2014-01-24 14:36:46 -05:00
Mark Harrah 6a2e8947bb Acyclic negation checking in logic system that backs auto-plugins. 2014-01-24 14:36:36 -05:00
Mark Harrah ca3877e138 Logic system supporting auto plugins and initial outline of AutoPlugin and Natures types.
* Not integrated into project loading
 * Doesn't yet check that negation is acyclic before execution
2014-01-24 14:30:12 -05:00
Mark Harrah 5dcd8bd913 TaskKey[T].previous: Option[T], which returns the value of the task the last time it executed.
This requires a Format[T] to be implicitly available at the call site and requires the task
to be referenced statically (not in a settingDyn call).  References to previous task values
in the form of a ScopedKey[Task[T]] + Format[T] are collected at setting load time in the
'references' setting.  These are used to know which tasks should be persisted (the ScopedKey)
and how to persist them (the Format).

When checking/delegating previous references, rules are slightly different.

A normal reference from a task t in scope s cannot refer to t in s unless
there is an earlier definition of t in s.  However, a previous reference
does not have this restriction.  This commit modifies validateReferenced
to allow this.

TODO: user documentation
TODO: stable selection of the Format when there are multiple .previous calls on the same task
TODO: make it usable in InputTasks, specifically Parsers
2013-12-06 20:45:01 -05:00
Dan Sanduleac ee8089f4a9 Removed unnecessary catch for exception 2013-11-28 11:04:46 -05:00
Dan Sanduleac 9b1727889b Added test case for derived settings 2013-11-28 11:04:46 -05:00
Dan Sanduleac d1678e7cac Fix deriveAndLocal bug 2013-11-28 11:04:46 -05:00
Mark Harrah 8857a4fb9a Add -Dsbt.cli.nodelegation option to experiment with no delegation for running/showing tasks/settings from the command line.
With this set to true, the following is no longer allowed for example:

> compile:update
2013-11-25 21:03:40 -05:00
Mark Harrah cfe5f3cebc update to ScalaCheck 1.11.0 2013-11-04 11:28:40 -05:00
Mark Harrah 8dc24826d3 shortcut heterogeneous AList to KList.toList 2013-10-23 09:46:43 -04:00
Mark Harrah a0540f5ce9 cleanups in Settings 2013-10-23 09:46:43 -04:00
Mark Harrah d30a3f3bfd drop view for iterator in IMap 2013-10-23 09:46:43 -04:00
James Roper a3a3dc1226 String upper/lower case no longer locale dependent
Fixed many instances of the Turkish i bug.

Spare a thought for the poor Turks!
2013-09-24 08:14:15 -04:00
Mark Harrah 62137f708f Show source position of undefined setting. 2013-08-30 18:34:54 -04:00
Mark Harrah b71af2150e API docs for Attributes.scala 2013-08-16 14:22:14 -04:00
Mark Harrah f47ad3fb72 Experimental task progress interface. Fixes #592.
Set sbt.task.timings=true to print timings for tasks.
This sample progress handler shows how to get names for tasks and
deal with flatMapped tasks.  There are still some tasks that make
it through as anonymous, which needs to be investigated.

A setting to provide a custom handler should come in a subsequent commit.
2013-06-23 19:57:30 -04:00
Mark Harrah 169a88dd30 Require projects to have unique target directories.
Configuring projects so that target directories overlap is usually
unintentional and the error message that results is usually unrelated
to the cause.
2013-06-18 18:43:50 -04:00
Mark Harrah aa2bd76e5e Support dynamic evaluations of optional settings (Initialize.evaluate). 2013-06-18 18:29:01 -04:00
Mark Harrah 3dd714b1fa Fully implement StaticScopes subclass of Initialize in order to support use in Task flatMap. Fixes #784. 2013-06-15 23:55:05 -04:00
Mark Harrah 61decef972 Derived settings: handle scopeLocal in derive and allow triggering dependencies to be filtered 2013-05-09 17:28:50 -04:00
Mark Harrah 19c78ac413 Show defining locations when there are cycles between derived settings 2013-05-09 17:28:50 -04:00
Mark Harrah ed11008126 only derive settings when all dependencies are defined 2013-05-09 17:28:49 -04:00
Mark Harrah 7a10aeca37 Default settings, which give internal sbt settings something like Plugin.globalSettings. 2013-05-09 17:28:40 -04:00
Mark Harrah 6ffff6fb35 support filtering the Scopes that a derived setting is applied in 2013-05-09 17:28:39 -04:00
Mark Harrah 08e4e3786f more specific error when dependencies of a derived setting are undefined 2013-05-09 17:28:39 -04:00
Mark Harrah 68ca419a7c require dynamic initialization to be explicitly enabled for derived settings 2013-05-09 17:28:39 -04:00
Mark Harrah 962a163f33 ensure a derived setting is only injected into a scope once 2013-05-09 17:28:39 -04:00
Mark Harrah 94f4d4e8c0 display derived settings information in 'inspect' 2013-05-09 17:28:39 -04:00
Mark Harrah 1c741a2e06 Derived settings, which allows injecting settings wherever their dependencies are defined.
This is an advanced feature initially intended for internal sbt use.
2013-05-09 17:27:43 -04:00