Commit Graph

1850 Commits

Author SHA1 Message Date
Eugene Yokota d697c10950 Hide unary_! operator from API 2014-03-24 18:59:14 -04:00
Eugene Yokota 5b1c33dd6e Added conflict report and unit tests 2014-03-22 02:47:11 -04:00
Eugene Yokota e95935a7db Adds conflict check at the end to enforce exclusion requirements. 2014-03-21 01:06:00 -04:00
Eugene Yokota c7dc499fe4 Updated comments. Typo fix per @jozic 2014-03-20 21:47:49 -04:00
Eugene Yokota f8bedf4012 Unifies AutoPlugin and RootPlugin
* Separates def select into def trigger and def requires.
* Setting trigger = noTrigger and requires = empty makes a plugin a
root.
2014-03-20 07:08:33 -04:00
James Roper 9f20f04e16 Allow end users to add Plugins, not just AutoPlugins
This allows plugins to define a Plugins instance that captures both the
plugin and its required dependencies.

Also fixed up some scaladocs that were wrong.
2014-03-18 19:49:38 +11:00
Josh Suereth 7c15eb01f3 When fragmenting Defaults, we mixed back settings in the wrong order.
* packageArtifacts is not cleared by defautlSettings
* Added a test for this behavior (this one test should ensure the ordering for most settings is correct.)

Fixes #1176
2014-03-12 08:50:37 -04:00
Josh Suereth c2f61460c6 Merge pull request #1169 from sbt/wip/fix-override-default
Fix overwrite default to true in deprecated method calls.
2014-03-10 17:17:49 -04:00
Josh Suereth 7413fbe9c0 Doc fix ups from review.
* Fix plugin mispellings
* Clarify `select` behavior.
2014-03-10 16:12:05 -04:00
Josh Suereth 893794a8ba Fix overwrite default to true in deprecated method calls.
We cannot break existing users, but we can deprecate the improper usage.
This is part #2 of the workaround for #1156.  This ensures that
users will stop using the legacy methods after 0.13.2 is out.
2014-03-10 10:44:38 -04:00
Josh Suereth 548b38c7f8 Add note about not exposing fine-grained autoplugin inclusion controlls.
AddSettings should only expose coarse-grained features of AutoPlugins
or else the Logic we use to ensure safe addition completely breaks
down.  Leaving it in the code as an escape hatch if we get desparate,
but we need an alternative for controlling ordering later.
2014-03-10 09:45:25 -04:00
Josh Suereth 3576baa76c Split Defaults.scala into three plugins: Global,Ivy,Jvm.
* GlobalPlugin has defaults for controlling parallelism on tasks, basic command stuff.
* IvyModule has the configuration for resolving/publishing modules to ivy, assuming
  each project is a single module.
* JvmModule has the configuration for compiling/running/testing/packaging Java/Scala
  projects.
2014-03-10 09:45:25 -04:00
Josh Suereth a44a14f2c8 AutoPlugins appropriately participate in AddSettings.
* Add new AutoPlugins type to AddSettings.
* Ensure any Plugins filter doesn't just automatically always add
  autoplugins every time.
* Load.scala can now adjust AutoPlugins ordering

Note: Adjusting autoplugin ordering is dangerous BUT doing a glob
      of "put autoplugin settings here" is generally ok.
2014-03-10 09:45:25 -04:00
Josh Suereth ac9391066b Allow Build.scala project settings to be ordered via AddSettings.
* Create new AddSettings.ProjectSettings that can be used in the Addsettings order.
* Update Load.scala to correctly abide by AddSettings orderings.
2014-03-10 09:45:25 -04:00
Josh Suereth 7f8d21c2f1 Remove Natures from AutoPlugins feature.
* remove the notion of Natures from Autoplugins.
* Update tests to use AutoPlugins with no selection for inclusion.
* Rename exisitng Natures code to Plugins/PluginsDebug.
2014-03-10 09:45:25 -04:00
Josh Suereth dbb47b3ce8 Updates `last` and `export` commands to read from correct key.
Fixes #1155.

It seems that somehow during the 0.13.{1 -> 2 } transition, we
stopped pointing at the correct key for TaskKeys (either that or
task streams are now all associated with the `streams` key).  I
think this may have been inadvertently caused from several
refactorings to enable greater control over the execution of tasks.

This points the `last*` methods at the correct key for tasks,
fixing both `last <key>` and `export <key>` commands.
2014-03-08 14:09:44 -05:00
Josh Suereth a8acc11fb5 Merge pull request #1130 from sbt/wip/auto-plugins
AUTO PLUGIN FEATURE!!!!
2014-02-20 16:08:01 -05:00
Mark Harrah 90134b3af0 'plugins' and 'plugin <name>' commands to inspect plugins
* 'plugins' displays the list of plugins available for each build along with the project IDs each is enabled on
* 'plugin <name>' displays information about a specific plugin in the context of the current project
 - if the plugin is activated on the current project and if so, information about the keys/configurations it provides
 - how the plugin could be activated if possible
* tries to detect when it is run on an aggregating project and adjusts accordingly
 - indicates if an aggregated project has the plugin activated
 - indicates to change to the specific project to get the right context

This is a rough implementation and needs lots of polishing and deduplicating.
The help for the commands needs to be added/expanded.
2014-02-20 13:56:50 -05:00
Mark Harrah 2bf127aaf6 Make BuildDependencies construction a proper function outside of the settings sytem. 2014-02-20 13:28:02 -05:00
Mark Harrah a3d89dc865 Infrastructure for debugging natures and plugins.
* Can provide suggestions for how to define a plugin given a context (a loaded Project in practice).
* When a user requests an undefined key at the command line, can indicate whether any (deactivated) plugins provide the key.

TODO:
* Hook up to the key parser
* Implement 'help <plugin>'
* Determine how to best provide the context (the current project is often an aggregating root, which is not typically a useful context)
2014-02-19 23:04:10 -05:00
Mark Harrah 49bf842b3d Restructure Natures/AutoPlugin types
- remove AutoPlugin.provides
 * name comes from module name
 * AutoPlugin is Nature-like via Basic
- Project.addNatures only accepts varags of Nature values
 * enforces that a user cannot explicitly enable an AutoPlugin
 * drops need for && and - combinators
- Project.excludeNatures accepts varags of AutoPlugin values
 * enforces that only AutoPlugins can be excluded
 * drops need for && and - combinators
2014-02-08 10:23:31 -05:00
Mark Harrah e037731d81 TODO 2014-02-08 10:23:31 -05:00
Mark Harrah eb7da2f689 move Nature-related classes to Natures.scala 2014-02-08 10:23:31 -05:00
Mark Harrah 0fc5f1525e Generate error when multiple AutoPlugins provide the same Nature. 2014-02-08 10:23:31 -05:00
Mark Harrah 708a3b107b minor API updates 2014-02-08 10:23:31 -05:00
Mark Harrah 4feb7d3dc8 Fix typos in AutoPlugin API docs. 2014-02-08 10:23:31 -05:00
Josh Suereth 85753e4035 Merge pull request #1100 from dansanduleac/sessionSettings2
Fixed SessionSettings replacing existing setting
2014-02-02 04:24:49 -08:00
Dan Sanduleac 8bfab5313e Fixed SessionSettings replacing existing setting 2014-01-27 14:55:08 +00:00
Mark Harrah 9264099594 API docs, better terminology for negative cycle checking in logic system. 2014-01-24 14:36:46 -05:00
Mark Harrah 1afd1931c4 Translate errors from logic system to Natures system. 2014-01-24 14:36:46 -05:00
Mark Harrah 09c76f29a3 Discover all sbt-related modules (not just Plugin) and write names to resources for use from binaries. 2014-01-24 14:36:20 -05:00
Mark Harrah 7a38338509 logic system/auto-plugins: Provide deprecated methods for binary compatibility 2014-01-24 14:35:59 -05:00
Mark Harrah 30658f98bb API documentation and comments related to natures 2014-01-24 14:34:15 -05:00
Mark Harrah b8619f4aae Main part of integrating natures into project loading. 2014-01-24 14:34:15 -05:00
Mark Harrah 322f6de655 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
Dan Sanduleac ba4d57b120 Fix binary compatibility with 0.13 2014-01-23 12:07:37 +00:00
Dan Sanduleac 0199a93ffb Expose overwrite flag in IvyActions.publish, and by default only overwrite if it's a snapshot 2014-01-17 10:45:57 +00:00
Josh Suereth 2abe7574df Fixes to the internal API hooks for the sbt server.
* Alter the TaskProgress listener key to be `State => TaskProgress` so it
  can be instantiated from the current server/sbt state.
* Expose the xsbti.Reporter interface for compilation through to sbt builds.
2014-01-14 12:42:40 -05:00
Jacek Laskowski f49ed56c1f Use string interpolation and replace deprecated methods 2014-01-06 14:17:42 +01:00
xuwei-k b6e16f1e95 fix CommandStrings.settingsDetailed 2014-01-05 23:40:02 +09:00
Dan Sanduleac eb8077427e Fix saving session settings 2014-01-02 09:18:54 -05:00
Mark Harrah c669606999 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
Mark Harrah 5d49fcbe78 Include the key name in the streams backing file path to avoid collisions. 2013-12-06 20:43:48 -05:00
Mark Harrah 21a05978de Fix parsing and evaluation of 'all' and 'show'. See comment in evaluatingParser. 2013-12-06 20:43:48 -05:00
Mark Harrah ad60e6c794 Basic predicate combinators for Tags 2013-11-26 22:46:50 -05:00
Mark Harrah d38450b41f Command to run multiple tasks concurrently: 'all a b'. Fixes #628. 2013-11-26 22:46:49 -05:00
Mark Harrah 13041bfb9a Don't mark ExceptionInInitializerError as incompatible plugins: rethrow the cause instead. Fixes #1007. 2013-11-25 21:03:40 -05:00
Mark Harrah 5f7a327e5e 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 e268db3f80 Propagate argument to 'reload' to load failure handling command. Fixes #973. 2013-11-24 15:19:24 -05:00
Mark Harrah 3b213e59ca Remove the need for resetLocalAttrs. Fixes #994, #952.
The fix was made possible by the very helpful information provided by @retronym.

This commit does two key things:
 1. changes the owner when splicing original trees into new trees
 2. ensures the synthetic trees that get spliced into original trees do not need typechecking

Given this original source (from Defaults.scala):

  ...
  lazy val sourceConfigPaths = Seq(
    ...
    unmanagedSourceDirectories := Seq(scalaSource.value, javaSource.value),
    ...
  )
  ...

After expansion of .value, this looks something like:

    unmanagedSourceDirectories := Seq(
      InputWrapper.wrapInit[File](scalaSource),
      InputWrapper.wrapInit[File](javaSource)
    )

where wrapInit is something like:

    def wrapInit[T](a: Any): T

After expansion of := we have (approximately):

    unmanagedSourceDirectories <<=
      Instance.app( (scalaSource, javaSource) ) {
        $p1: (File, File) =>
          val $q4: File = $p1._1
          val $q3: File = $p1._2
          Seq($q3, $q4)
      }

So,

 a) `scalaSource` and `javaSource` are user trees that are spliced into a tuple constructor after being temporarily held in `InputWrapper.wrapInit`
 b) the constructed tuple `(scalaSource, javaSource)` is passed as an argument to another method call (without going through a val or anything) and shouldn't need owner changing
 c) the synthetic vals $q3 and $q4 need their owner properly set to the anonymous function
 d) the references (Idents) $q3 and $q4 are spliced into the user tree `Seq(..., ...)` and their symbols need to be the Symbol for the referenced vals
 e) generally, treeCopy needs to be used when substituting Trees in order to preserve attributes, like Types and Positions

changeOwner is called on the body `Seq($q3, $q4)` with the original owner sourceConfigPaths to be changed to the new anonymous function.
In this example, no owners are actually changed, but when the body contains vals or anonymous functions, they will.

An example of the compiler crash seen when the symbol of the references is not that of the vals:

symbol value $q3 does not exist in sbt.Defaults.sourceConfigPaths$lzycompute
	at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:49)
	at scala.tools.nsc.Global.abort(Global.scala:254)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIdent$1(GenICode.scala:1038)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1044)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1246)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1244)
   ...

Other problems with the synthetic tree when it is spliced under the original tree often result in type mismatches or some other compiler error that doesn't result in a crash.

If the owner is not changed correctly on the original tree that gets spliced under a synthetic tree, one way it can crash the compiler is:

java.lang.IllegalArgumentException: Could not find proxy for val $q23: java.io.File in List(value $q23, method apply, anonymous class $anonfun$globalCore$5, value globalCore, object Defaults, package sbt, package <root>) (currentOwner= value dir )
   ...
     while compiling: /home/mark/code/sbt/main/src/main/scala/sbt/Defaults.scala
        during phase: global=lambdalift, atPhase=constructors
   ...
  last tree to typer: term $outer
              symbol: value $outer (flags: <synthetic> <paramaccessor> <triedcooking> private[this])
   symbol definition: private[this] val $outer: sbt.BuildCommon
                 tpe: <notype>
       symbol owners: value $outer -> anonymous class $anonfun$87 -> value x$298 -> method derive -> class BuildCommon$class -> package sbt
      context owners: value dir -> value globalCore -> object Defaults -> package sbt
   ...

The problem here is the difference between context owners and the proxy search chain.
2013-11-22 13:08:10 -05:00
Bruno Bieth 5a88bd2302 Third draft to execute the forked tests in parallel.
This feature is not activated by default. To enable it set `testForkedParallel` to `true`.

The test-agent then executes the tests in a thread pool.
For now it has a fixed size set to the number of available processors.
The concurrent restrictions configuration should be used.
2013-11-21 08:20:43 -05:00
Heikki Vesalainen b2980b913f completions command
The completions command is meant for dump terminals that cannot use
the default tab completion. It has been built for use by the emacs
sbt-mode (see https://github.com/hvesalai/sbt-mode), but is equally
useful for other code editors that can integrate with sbt.
2013-11-21 08:20:37 -05:00
Mark Harrah c5120636e4 Continuation of previous commit's workaround for #937: close test streams early 2013-11-04 13:10:06 -05:00
Mark Harrah ca7e78d03d Explicitly, optimistically close export streams early: workaround for #937
This is a temporary workaround: it assumes nothing else uses these streams later.
This condition is ok for 'export' and test streams, since these are unlikely to
reuse these streams.  However, the proper fix is for the TaskStreams methods
to be smarter- they could open in append mode if the stream was closed.  The
streams associated with a task could be optimistically closed after it finishes executing.
(Any task can write to another task's streams, which is why it is an optimization only.)
2013-11-04 11:45:28 -05:00
Mark Harrah a92b883e23 update to ScalaCheck 1.11.0 2013-11-04 11:28:40 -05:00
Mark Harrah c2b319e977 error,warn,info,debug commands to set log level, useful in conjunction with early combinator --. Fixes #806. 2013-10-24 16:34:16 -04:00
Mark Harrah ecd3b8843d clean up show command description to use string interpolation 2013-10-24 16:34:16 -04:00
Mark Harrah e93c4450a1 early commands: anything prefixed with -- gets moved to the front of the command sequence on startup 2013-10-24 16:34:16 -04:00
Mark Harrah 86ae3c8c59 Deprecate -, --, and --- in favor of onFailure, sbtClearOnFailure, and resumeFromFailure. 2013-10-24 16:34:16 -04:00
Mark Harrah 4e7f30c893 provide Logger via Keys.sLog for use by settings during project initialization. Ref #806. 2013-10-24 16:34:16 -04:00
Mark Harrah eeb1ce8884 use global logging levels as the default for task logging levels 2013-10-24 16:34:16 -04:00
Mark Harrah 55832b3a03 set global logging levels from project settings if not already explicitly set 2013-10-24 16:34:16 -04:00
Mark Harrah 5498275ebd Track whether global logging levels were set explicitly by the user or not. 2013-10-24 16:34:16 -04:00
Mark Harrah 11b0c7b3ff Process settings once in SettingGraph for better performance.
Running 'inspect tree sbt/update' on sbt goes from 27 s to <1 s.
Review by @eed3si9n.
2013-10-18 19:56:43 -04:00
Mark Harrah 9dcb8727d8 New method `toTask` on `Initialize[InputTask[T]]` to apply the full input and get a plain task out. 2013-10-18 16:49:34 -04:00
Mark Harrah 136bb00698 Use scalacOptions from project/ for the build definition. 2013-10-14 19:59:28 -04:00
Mark Harrah 7d49bcdbf2 Add missed s interpolator, as pointed out by @xuwei-k 2013-10-08 13:38:33 -04:00
Mark Harrah 277813dd0a Improve forked test debugging by listing tests run by sbt. Fixes #868.
This helps diagnosing issues on the sbt/framework border by verifying
that sbt is properly collecting and invoking tests.
2013-10-03 10:57:00 -04:00
Mark Harrah 4958c98e52 Remove redundancy in excludeFilter default implementation. 2013-10-02 19:39:17 -04:00
Mark Harrah e62b5d7dbd Enable trapExit by default. 2013-10-02 09:13:50 -04:00
Mark Harrah 60426facba TrapExit support for multiple, concurrent managed applications. Fixes #831. 2013-10-02 09:13:45 -04:00
James Roper 743ce99315 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
Havoc Pennington 6ba517c19b Attempt to improve key collision error message 2013-09-13 10:13:18 -04:00
William Benton 2a3462ac12 Additional options for Ivy resolvers.
Specify an Ivy resolver with ", descriptorOptional" to make Ivy
descriptor files optional for that repository or with
", skipConsistencyCheck" to disable Ivy consistency checks for
that repository.
2013-08-26 14:06:21 -04:00
Eugene Yokota cce87fcf9a fixes scaladoc cache not detecting -doc-root-content. #837
adds fileInputOptions key to track options that may invalidate the
cache for doc task.
2013-08-17 01:31:53 -04:00
Mark Harrah f5c4c89d17 some additional API docs for Defaults.scala 2013-08-16 14:21:44 -04:00
Johannes Rudolph 701206b54d prevent another StringIndexOutOfBoundsException in Graph.toAscii 2013-07-31 15:31:04 +02:00
Eugene Yokota fd03ad67f2 refix #795
`math.min` should have been `math.max` here.
It's currently chopping off the output of inspect tree.
2013-07-29 16:33:53 -04:00
Mark Harrah 4ab037c5cd remove Process from base imports in .sbt files and eval
The implicits are already in the sbt package object.
2013-07-29 14:14:04 -04:00
Mark Harrah 7dadbf1fc6 Drop unneeded import that triggers SI-7690. 2013-07-23 15:20:45 -04:00
Mark Harrah 61509408c9 Deprecate seq. The implicits Seq[Setting[_]] <-> SettingsDefinition handle the typical plugin/build.sbt case. 2013-07-19 20:50:10 -04:00
Mark Harrah 2e0257f440 Alias from Project->Def for SettingsDefinition 2013-07-19 20:50:10 -04:00
Mark Harrah a4d0a0cb5a Provide implicits in consoleProject to add .eval to task and setting keys. Fixes #815. 2013-07-17 14:58:53 -04:00
Mark Harrah 4795799a15 Drop defaultConfigurationMapping, which wasn't used. Fixes #421. 2013-07-11 18:49:30 -04:00
Mark Harrah 32bdab68bd Fix remaining Global defaults to be added only once. 2013-07-11 18:49:30 -04:00
Mark Harrah 001bd6cb9f Provide a better error message when an older launcher is used with 0.13 and JLine classes are incompatible. 2013-07-08 18:42:00 -04:00
Mark Harrah 919d0ac63d Failed task execution should still preserve State changes. Fixes #804.
Candidate for inclusion in 0.13.0 if there is another RC, otherwise
scheduled for 0.13.1.
2013-07-03 17:16:00 -04:00
Mark Harrah 7992997ac1 refined auto project ID to prepend 'root-' if initial character is numeric 2013-06-28 14:31:45 -04:00
Mark Harrah a1a00526ff properly wrap unknown test data structures in serializable ones 2013-06-28 12:12:58 -04:00
cheeseng 5bb46359b5 Change to use test-interface-1.0-SNAP7, and use ScalaTest 2.0.M6-SNAP26 which implemented test-interface-1.0-SNAP7. 2013-06-28 17:18:38 +08:00
Mark Harrah 220886be80 fix plugin depth and project ID auto detection for external dependencies 2013-06-28 00:01:19 -04:00
Mark Harrah ca9f32c7d1 Include projects without defined settings in KeyIndex. 2013-06-28 00:01:19 -04:00
Mark Harrah 0e009b1480 Exclude class directories from plugin classpath used for updateSbtClassifiers: classified jars not available
Fixes #798.
2013-06-27 14:12:47 -04:00
Eugene Yokota b880c5bc16 Supply default terminal width to fix #795 2013-06-25 10:37:56 -04:00
Mark Harrah aef6df3e20 handle undefined target directory in unique target check 2013-06-23 19:57:31 -04:00
Mark Harrah 602c1759a1 Make ExecuteProgress listener configurable via executeProgress setting.
Experimental, so everything is private[sbt].
2013-06-23 19:57:30 -04:00
Mark Harrah 1cc2f57e15 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 ce1c8b0ebc Better auto project ID handling. Ref #776.
* Consolidate project ID validation and normalization into Project methods
* Provide an earlier and more detailed error message when the directory
  name can't be used for the project ID
2013-06-23 19:57:30 -04:00
Mark Harrah 6f0028e50d Use last path component of a URI in the staged path. 2013-06-23 19:57:30 -04:00
Mark Harrah 6091e60611 Show project version in 'about' 2013-06-19 19:18:40 -04:00
Mark Harrah 7796715e88 Move deprecated scala-tools conveniences to private[sbt] accessibility 2013-06-19 17:15:22 -04:00
Mark Harrah 464f093017 Handle newer predefined launcher types in boot overrides 2013-06-19 17:15:22 -04:00
Mark Harrah 2f9d68e869 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 800bd3698a Add syntax summary to 'set' and 'inspect' help. Follow-up to #776. 2013-06-17 12:06:13 -04:00
Mark Harrah 0780a6c08a Key parsing improvements. Ref #776.
* Explain context of expected ':' and '/' error messages
* Restore strict project ID parsing to get proper message about invalid project ID
2013-06-17 12:06:13 -04:00
Mark Harrah fb27f5558c Propagate taskDefinitionKey in Incompletes from flatMaps. Ref #784. 2013-06-15 23:55:05 -04:00
Mark Harrah 5a252fae3a ScopeFilter.debug to print accepted and rejected scopes 2013-06-10 17:05:11 -04:00
Mark Harrah 271b03550b Record artifact, module ID, and config for products 2013-06-01 10:56:30 -04:00
Mark Harrah cd2b1edf6c IncOptions class backup directory should be per-compilation, not shared.
Otherwise, one concurrent compilation will clean the directory out from under another.
2013-05-30 15:00:26 -04:00
Mark Harrah 431a0be42d Pull sbt dependency version from sbtVersion to facilitate cross-building plugins. 2013-05-30 15:00:26 -04:00
Mark Harrah 8d13043afa Only add automatically detected plugins to options once. Fixes #757. 2013-05-28 07:56:48 -04:00
Mark Harrah 0bb460c03e Derive testGrouping,compilers,scalaBinaryVersion. Don't go through compileInputs for doc. Fixes #539, #708, #391. 2013-05-09 17:28:50 -04:00
Mark Harrah e1acc12290 In 'set' command, handle keys in new scopes in the affected settings part 2013-05-09 17:28:50 -04:00
Mark Harrah 7ed56d3fcd Show defining locations when there are cycles between derived settings 2013-05-09 17:28:50 -04:00
Mark Harrah 6c0f47ef48 Default settings, which give internal sbt settings something like Plugin.globalSettings. 2013-05-09 17:28:40 -04:00
Mark Harrah 994886ee51 display derived settings information in 'inspect' 2013-05-09 17:28:39 -04:00
Mark Harrah dfe418b3c3 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
Mark Harrah 6b32aa661c use Option constructor instead of Some for potentially null file lock 2013-05-08 12:56:50 -04:00
Mark Harrah 51bd1e8ceb Include files with zip extension in unmanaged jars. Fixes #750. 2013-05-06 08:28:34 -04:00
Mark Harrah f7ce8334c3 Merge remote-tracking branch 'scalatest/new-framework-api-12' into 0.13 2013-05-01 08:34:01 -04:00
Mark Harrah 6a70b9f565 Proper support for stashing on-failure handlers. Fixes #732. 2013-04-30 18:55:02 -04:00
Mark Harrah 8813712c60 Versioned global sbt directory. Fixes #735. 2013-04-30 18:55:02 -04:00
Mark Harrah fb0a8c463b Scope packagedArtifacts for publish*Configuration to publish* to make it easier to filter artifacts for different publish targets. 2013-04-26 18:51:58 -04:00
cheeseng f862e64911 Added support of custom summary message returned from Runner.done method. 2013-04-25 00:06:51 +08:00
cheeseng 1ec2118219 -Moved code that count test results from TestLogger to SuiteResult.
-Print the results in Tests.showResult.
2013-04-25 00:06:41 +08:00
cheeseng f38a244d0f Added code to call Runner's done() method in both InProcess and SubProcess cases. 2013-04-23 12:00:03 +08:00
cheeseng 244e65cd79 -Changed behavior so that only a single Runner instance is used to run tests in multiple test groups.
-Added code to support remoteArgs in test-interface 1.0.
2013-04-23 11:09:50 +08:00
cheeseng 18bc8423b5 Initial version that uses new framework API in test-interface 1.0:
-Changed usages and implementations of interfaces in org.scalatools.testing._ to use/implement interfaces/classes in sbt.testing._ instead.
-Added sbt.testing to interfaceFilter in TestFramework.createTestLoader method to enable loading of classes in sbt.testing package.
-Added FrameworkWrapper.java to wrap old framework implementations.
-Added code in ForkMain.java to serialize Selectors.
2013-04-23 11:09:37 +08:00
Mark Harrah a4c059cb7e Better auto-generated IDs for default projects. Fixes #554.
For the global plugins project, the default ID is "global-plugins".
For a normal project, the default ID is the name of the build directory.
The ID of a build definition for one of the above appends -build.
2013-04-10 20:15:28 -04:00
Mark Harrah 96b2ca7ce4 Use a default root project aggregating all projects if no root is defined. Fixes #697.
Ref #554.
2013-04-10 20:15:27 -04:00
Mark Harrah 23be591c95 memoize .sbt file loading within a build and only add a Project once
This fixes an infinite loop when defining a Project in a .sbt file
with the build base directory as the project base directory.
This allows the standard behavior for interpreting settings from
.sbt files for both Projects defined in .sbt files as well as in
.scala files. That is, settings in .sbt files in "." go in all
projects with "." as their base directory.

Ref #554.
2013-04-10 20:15:27 -04:00
Mark Harrah b990a29c09 Undeprecate ScalaInstance.libraryJar, which will be reliable for modularized Scala. 2013-04-08 09:21:59 -04:00
Mark Harrah 382b55402b don't put Scala jars on forked boot classpath by default
Ideally, Scala jars on the normal classpath would be moved to the boot classpath,
but this is more involved.
2013-04-05 09:02:24 -04:00
Mark Harrah f18ddd2a88 make ScopeFilter accessible without a qualifier
Should be improved: ideally there would only be a single top-level alias.
2013-04-03 12:44:35 -04:00
Mark Harrah 322a49faba Make autoCompilerPlugins support compiler plugins defined in a internal dependency
requires the compiler plugin project to define exportJars := true
2013-04-03 12:44:35 -04:00
Mark Harrah 45155e2616 move to <key>.all inDefaults 2013-03-28 16:08:24 -04:00
Mark Harrah 7605818f04 workaround for ThisProject not being properly resolved by Scope.resolve* 2013-03-28 16:08:23 -04:00
Mark Harrah df5e79e3be API for evaluating a setting or task in multiple scopes 2013-03-27 09:17:53 -04:00
Mark Harrah 2f13b7a8c7 add publish-m2 task for publishing to ~/.m2/repository. Fixes #485. 2013-03-27 09:17:53 -04:00
Mark Harrah 5f41b06026 fix stray val 2013-03-12 15:29:27 -04:00
Mark Harrah fd2823e827 clean up 'inspect' command and limit Related section to 10 keys 2013-03-12 14:51:19 -04:00
Mark Harrah 718fa91772 Publish test artifacts in Test configuration and corrects classifier to 'tests'. Fixes #683 2013-03-08 20:11:53 -05:00
Mark Harrah ada663106d Further Scala handling refinements. fixes #690.
* No longer override the Scala version to force it to be scalaVersion.  Custom configurations might use an independent version.
* Only substitute the jars from scalaHome when the major.minor versions line up for the substituted artifact
* Allow the Scala version to use for dependency resolution to be specified when using ++ to change Scala home: ++ version=/path/to/scala/home
2013-03-05 17:22:21 -05:00
Mark Harrah 925ec98900 Restore class files after an unsuccessful compilation.
This is useful when an error occurs in a later incremental step that
requires a fix in the originally changed files.

CC @gkossakowski
2013-03-04 07:24:31 -05:00
Mark Harrah bf1831eb88 fix TagsTest test size generator and properly set Tags.All on tag maps 2013-03-03 19:43:37 -05:00
Mark Harrah 1fdf3fa38c support explicit types on lazy vals in definingValName
lazy val x: Project = project has a rather different enclosing tree
 than lazy val x = project.
2013-03-03 19:43:37 -05:00
Mark Harrah 9d82718897 disable printing of success for 'export' command 2013-02-28 17:59:39 -05:00
Mark Harrah a263b7e91f when exporting settings, send the output directly to the console 2013-02-28 17:59:38 -05:00
Mark Harrah dde24d5e5a make classpaths exported 2013-02-28 17:59:38 -05:00
Mark Harrah f2d29d8678 Export approximate command lines executed for 'doc', 'compile', and 'console' 2013-02-28 17:59:38 -05:00
Alex Dupre 92e99cfef0 Switch from JLine 1.0 to 2.10. 2013-02-26 07:39:33 -05:00
Mark Harrah 29a26a13ab Custom implementation of Streams can be bound to Keys.stateStreams in State. 2013-02-25 09:24:05 -05:00
Mark Harrah 0cf702efd5 Move GlobalLogBacking.newLogger to GlobalLogging to make the role of GlobalLogBacking clearer. 2013-02-25 09:24:05 -05:00
Mark Harrah f6d73128fc deprecations 2013-02-25 09:24:04 -05:00
Mark Harrah a61421dcb8 Split ConsoleOut into its own file, track the global ConsoleOut and use it instead of StandardMain.console 2013-02-25 09:24:04 -05:00
Mark Harrah 5b5577a187 Replace Scala jars in UpdateReport with ScalaProvider jars in more situations. Fixes #661.
Specifically, when the Scala version for sbt is the same as that for the project being built,
the jars in UpdateReport should be the same as those in ScalaProvider.  This is because the
loader will come from the ScalaProvider, which uses jars in the boot directory instead of the
cache.  The first part of the fix for #661 checks that loaded classes come from the classpath
and so they need to line up.
2013-02-21 20:44:26 -05:00
Mark Harrah bd0f208302 Class loader that restricts loading to a classpath. Ref #661.
It is now used for consoleProject, run, and test.  This loader verifies
that all classes loaded through it came from a particular classpath or
from the "root" loader.  Root loader here is the launcher loader so that
those classes with native bindings come from that shared loader.
2013-02-21 20:44:26 -05:00
Mark Harrah 98e2662bc4 Make full set of ForkOptions configurable for both run and test. Fixes #665.
Environment variables may be passed by configuring the envVars task.
2013-02-21 20:44:26 -05:00
Mark Harrah e06ada8fb7 Add help for ++ and + commands 2013-02-19 14:33:22 -05:00
Mark Harrah 2047849b50 remove deprecated command strings 2013-02-19 14:33:22 -05:00
Grzegorz Kossakowski 70036812ab Introduce incremental compiler options.
Introduce a way to configure incremental compiler itself instead
of underlying Java/Scala compiler.

Specific list of changes in this commit:
  * Add a method to `xsbti.compile.Setup` that returns incremental
    compiler options as a `java.util.Map<String, String>`. We considered
    statis interface instead of a `Map` but based on mailing
    list feedback we decided that it's not the best way to go because
    static interface is hard to evolve it by adding new options.
  * Since passing `java.util.Map<String, String>` not very convenient
    we convert it immediately to `sbt.inc.IncOptions`
  * Add options argument to various methods/classes that implement
    incremental compilation so in the end options reach
    `sbt.inc.IncOptions` object
  * Add `incOptions` task that allows users to configure incremental
    compiler options in their build files. Default implementation of
    that tasks returns just `IncOptions.DEFAULT`
  * Both system property `xsbt.inc.debug` and `IncOptions.relationsDebug`
    trigger debugging of relations now. In the near future, we should
    deprecate use of `xsbt.inc.debug`.
2013-02-19 12:23:07 -05:00
Grzegorz Kossakowski d6f4c5ae4f Strip down trailing whitespace.
I have Eclipse configured to do that automatically when saving file.
I decided to finally commit those changes to files I touch a lot.
2013-02-19 12:18:26 -05:00
Mark Harrah ae74fff88c When serially executing tests*, order tests by testOnly filter order
* parallelExecution in test := false

cc @bantonsson
2013-02-13 10:27:43 -05:00
Mark Harrah 4b61747dfc remove deprecated scaladocOptions 2013-02-13 08:12:51 -05:00
Mark Harrah 76e0a941ba Update to 2.10.1-RC1
Needed an explicit type in PMap to workaround an error.
Need to drop tuple assignment of parser.parsed in input task macro as a workaround
  for macro/resetAllAttrs/pattern matching/annotation issue in RC1.
2013-02-13 07:17:20 -05:00
Mark Harrah 8cb7e23011 Load global plugins in their own class loader and replace the base loader with that. Fixes #272.
Also, replace the base classpath with the global classpath.
2013-02-01 13:10:27 -05:00
Mark Harrah 52954b3ae7 skip duplicate entries in PluginClassLoader 2013-02-01 13:10:26 -05:00
Mark Harrah b2eb4661df Support 'reload plugins' after ignoring a failure to load a project.
This can be used to debug problems with dependencies or code.
It won't help with .sbt files, however.
2013-01-29 17:47:29 -05:00
Mark Harrah 6c5cafb55b Remove support for deprecated alternative to project/ directory name. 2013-01-29 17:47:29 -05:00
Mark Harrah e47b8ab578 Make 'eval' command work when project isn't loaded. 2013-01-29 08:47:04 -05:00
Mark Harrah 76a02c463f Temporarily use a Scala home with '++ /path/to/scala/home' 2013-01-28 17:14:53 -05:00
Mark Harrah 076480b50a Reduce InputTask to the ideal wrapper around 'State => Parser[Initialize[Task[T]]]'
Ref #407.
2013-01-28 17:14:53 -05:00
Mark Harrah 9013e00fdd Remove InputStatic and parsedResult.
This cleans up the InputTask implementation.  It no longer requires the hook
in setting loading (Load.finalTransforms) and has better types.
2013-01-18 18:49:26 -05:00
Mark Harrah a9ac6b3983 Configurable conflict manager and corresponding documentation on conflictManager, dependencyOverrides, and force(). Fixes #603. 2013-01-11 16:01:31 -05:00
Mark Harrah a48ee68d17 Additional convenience methods on Project for configuring the .sbt files processed.
The Project.setSbtFiles and addSbtFiles methods combined with the current sbt version
available from ComponentMangaer.version (suggestions for a better location are welcome),
should make it straightforward to load different .sbt files based on the sbt version.

Fixes #467.
2013-01-11 16:01:30 -05:00
Mark Harrah 36a3203226 API documentation for Project getters 2013-01-11 16:01:30 -05:00
Mark Harrah a152965933 Option to automatically manage API documentation mappings
Set autoAPIMappings := true to enable.

Then, set apiURL to the base URL of the API documentation for a project.
This will get stored in an extra attribute in the ivy.xml or as a property
a pom.xml.

When using managed dependencies that have set their apiURL, the -doc-external-doc
setting for scaladoc will be automatically configured.  Note that this option
will only be available in Scala 2.10.1 and so enabling autoAPIMappings for
earlier versions will result in an error from scaladoc.

For unmanaged dependencies or dependencies without an automatic apiURL, add the
(File,URL) mapping to apiMappings.  The File is the classpath entry and the URL
is the location of the API documentation.
2013-01-10 16:06:12 -05:00
Mark Harrah e5a9d31d6f Make exclude-classifiers per-user instead of per-build. Fixes #634. 2013-01-10 16:06:12 -05:00
Mark Harrah aff95baf0e Provide cacheDirectory via Streams instead of a separate setting
This is cleaner and makes it harder for the task author to have overlapping caches.
2013-01-10 16:06:12 -05:00
Mark Harrah 1ef258d88e Convenience method Project.configure(f,g) for g(f(proj)) to be used to apply plugin configuration provided as a Project=>Project transformation 2013-01-10 16:06:12 -05:00
Mark Harrah ae9b6d1e47 Support 'val p = project' via a 'project' macro 2013-01-10 16:06:12 -05:00
Mark Harrah a8b93dfed3 Project.in(File) for setting the base directory of a Project 2013-01-10 16:06:11 -05:00
Mark Harrah 87faa7191a API documentation for Project transforming methods 2013-01-10 16:06:11 -05:00
Mark Harrah aba717c0c5 cleanup imports in BuildStructure 2013-01-03 11:37:40 -05:00
Mark Harrah ea3e5c3548 Allow cleanKeepFiles to contain directories
The directory contents will be kept as will empty directories.
2012-12-19 10:17:56 -05:00
Mark Harrah f6317a5c75 remove deprecated Extracted.evalTask 2012-12-19 10:17:56 -05:00
Mark Harrah dd66d8b17a API documentation in Extracted 2012-12-19 10:17:56 -05:00
Mark Harrah d156ccfe4e Further refinements to Scala version handling
- override location of resolved Scala jars when scalaInstance is unmanaged
- document current behavior: scalaHome, update, scalaInstance, autoScalaLibrary, managedScalaInstance
2012-12-16 18:56:22 -05:00
Mark Harrah e3745540c9 More cleanup of Scala version handling, including managedScalaInstance to control automatic 'scala-tool' configuration and dependencies. 2012-12-09 20:40:41 -05:00
Mark Harrah d4fd136192 support defining Projects in .sbt files
vals of type Project are added to the Build
2012-12-09 20:40:41 -05:00
Grzegorz Kossakowski ef39aeb9c1 Follow source layout convention supported by Eclipse.
Moved source files so directory structure follow package
structure. That makes it possible to use Scala Eclipse plugin
with sbt's source code.
2012-12-07 10:27:08 -08:00
Josh Suereth 0c08c1169e Bumped the Scalatest/Specs versions for 2.10.0-RC3
* Modified tests to use mutable Specs API
* Fixed a few minor specs issues.
2012-12-04 13:10:09 -05:00
Mark Harrah 538f687208 Use and methods instead of mapR,mapFailure,flatFailure,flatMapR 2012-12-02 03:17:19 -05:00
Mark Harrah 8d6dd10798 2.10.0-M5, different arity generalization
1. KList[M[_]] now instead of KList[HL <: HList, M[_]]
  a. head, tail work properly in this variant
  b. disadvantage is that full type not easily transformed to new type constructor
2. AList abstracts on K[L[x]], a higher order type constructor.
 A. Instances written for:
  a. KList
  b. Seq[M[T]] for a fixed T
  c. TupleN
  d. single values
  e. operate on one type constructor when nested
 B. Main disadvantage is type inference.  It just doesn't happen for K[L[x]].
    This is mitigated by AList being used internally and rarely needing to construct a K.
2012-11-17 20:19:24 -05:00
Mark Harrah 795b924f46 reimplement lighter support for controlling aggregation 2012-01-09 08:01:24 -05:00
Mark Harrah 82326cc899 new aggregation approach, still need exclusion mechanism 2012-01-09 08:01:24 -05:00
Mark Harrah ec48779829 moved task axis before the key 2012-01-09 08:00:29 -05:00
Mark Harrah c9039a4d44 separate out generators for test builds 2011-10-01 14:40:14 -04:00
Mark Harrah 41667f9f49 test fix 2011-05-23 18:40:03 -04:00
Mark Harrah 19ed648de5 tests and fixes for delegation 2011-05-09 20:57:10 -04:00