Commit Graph

1815 Commits

Author SHA1 Message Date
Eugene Yokota e4ee409cd5 Some changes due to cross publishing 2016-04-29 16:18:40 -04:00
Eugene Yokota 9e10f01363 Workaround for XML literal in build.sbt 2016-04-29 16:18:19 -04:00
eugene yokota b285cf114d Merge pull request #2575 from eed3si9n/wip/remove_plugin
[sbt 1.0] Rename sbt.Plugin => sbt.internal.OldPlugin
2016-04-29 03:54:00 -04:00
Eugene Yokota fddbf77877 Fix tests 2016-04-29 02:12:35 -04:00
eugene yokota d5fbe99bdd Merge pull request #2543 from eed3si9n/wip/project_dsl
[sbt 1.0] Reduce sbt.Project(...) params and make settings(...) lazy
2016-04-25 10:35:39 -04:00
Eugene Yokota f6ff1f916c Rename sbt.Plugin => sbt.internal.OldPlugin 2016-04-25 05:09:39 -04:00
Eugene Yokota a20da88a45 Reduce parameters from sbt.Project.apply 2016-04-25 04:26:30 -04:00
Dale Wijnand 60bc28829b Add Append & Remove instances for Option 2016-03-30 22:13:19 +01:00
Dale Wijnand f6c5be06b3 Drop sealed on Remove.Sequence 2016-03-30 22:13:19 +01:00
Eugene Yokota e57215e240 Fix test 2016-03-29 13:11:42 -04:00
Eugene Yokota d01f8d3c1b Port project/extra 2016-03-29 01:54:58 -04:00
Eugene Yokota 036e57c114 sbt.Build => sbt.internal.BuildDef
sbt.Load => sbt.internal.Load
2016-03-28 11:52:12 -04:00
Dan Sanduleac 6111156344 Fix CacheIvy as inclusions and exclusions were flipped :( 2016-03-07 13:45:17 +00:00
Dan Sanduleac 16f9ddba08 Add test for ModuleID format 2016-03-07 13:44:48 +00:00
Dan Sanduleac 3910d4d87a ModuleID's format should include the branch! otherwise we lose it... 2016-03-07 13:33:03 +00:00
Eugene Yokota e270d2bec1 Adjust to code reorganization. 2016-02-26 17:48:33 -05:00
Eugene Yokota 4d58714aa7 Adds CompatibilityWarningOptions. Fixes #2347
This addresses 0.13.10 regression, which currently warns users about
Maven incompatibility on a private configuration. This adds a config
class so the build user can control the level of the warning as well as
the target configuration to be monitored.
By default, we are only going to look at `Compile` and `Runtime`.
2016-02-26 17:46:12 -05:00
Eugene Yokota c1760fdc3c Move intransitive warning to update. Ref #2127 2016-02-26 17:40:07 -05:00
eugene yokota bdded0898d Merge pull request #2393 from dwijnand/fport/make-sbt-dotty-aware
FPORT: Make sbt aware of Dotty
2016-02-26 17:29:27 -05:00
Eugene Yokota b1b7430d9c Fixes #2464. Actually reorganize appResolvers
Fixes #2464 and Fixes #2465
appResolvers is a set of resolvers specified in the launcher
configuration.
This list fluctuates depending on the version of sbt, and sbt 0.13.10
meant to stabilize it by weeding out JCenter even when it includes it,
which failed when I applied the filter on the wrong list. This should
correct it.
2016-02-25 23:09:18 -05:00
Eugene Yokota cd373c99ad Add useJCenter setting, which is set to false. Fixes #2217
Adds a new setting `useJCenter`, which is set to `false` by default.
When set to `true`, JCenter will be placed as the first external
resolver to find library dependencies.

The implementation of `externalResolvers` is changed to incorporate the
setting by calling `Resolver.reorganizeAppResolvers`. These changes
were required because `externalResolvers` uses whatever that's in the
launchconfig, which the build user may not upgrade.
2016-02-25 23:02:16 -05:00
Martin Duhem 20d0c41473 Update to latest util, incrementalcompiler and librarymanagement 2016-02-24 16:54:03 +01:00
Dan Sanduleac abb53d4cb2 Fix for weird bug where sbt.librarymanagement's package object somehow conflicts with sbt.Keys.. Thanks Scala 2016-02-23 12:02:11 +00:00
Dan Sanduleac 978f2304e5 Stop deducing confs from classifier when delivering 2016-02-09 15:13:10 +00:00
Dan Sanduleac 63d657e9c0 [1/2] Add {source,doc}ArtifactTypes settings, use them in update* tasks in conjunction with ArtifactTypeFilter 2016-02-09 15:13:10 +00:00
Dan Sanduleac f11755e181 ModuleID + inclusions 2016-02-09 11:48:12 +00:00
Dan Sanduleac 7d2054f3ae ExclusionRule -> InclExclRule 2016-02-09 11:46:16 +00:00
Tim Harper 2eda2ebd46 bugfix - apply autoImports for global plugins at global configuration stage
Previously, the autoimports for globally defined plugins were not
imported for global configuration files, although they were imported for
project configuration files.

This patch causes an additional plugin discovery phase to happen during
global config evaluation, so that auto-plugins can be detected and their
imports subsequently included.
2016-01-18 21:43:32 -07:00
Guillaume Martres a05218f5ac 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.

Partial forward port of #2344.
2016-01-17 16:37:22 +00:00
Eugene Yokota 6c1b054249 Adds bootIvyConfiguration to grab compiler bridge source. Fixes #2336
Forward-port of #2337.

As described in #2336, I noticed that when using 0.13 nightly from
Bintray, sbt was unable to locate the compiler source.
Since `updateSbtClassifiers` is already set up to download sbt's own
sources, the `ivyConfiguration` should be reused. However, `compilers`
is a derived task, which is unable to depend on a scoped key.
To workaround this I had to create a new key called
`bootIvyConfiguration`. This should now use the metabuild's resolvers
to download the compiler bridge source.
2016-01-16 16:11:51 +00:00
Dale Wijnand c5949268ef Drop sealed from the typeclasses in Append
Forward port of #2322
2016-01-08 16:45:06 +01:00
eugene yokota a9d80cf38c Merge pull request #2281 from eamelink/bugfix-1982
Fix search result highlighting on Windows
2015-11-27 15:36:50 -05:00
xuwei-k 84e8f20080 fix typo 2015-11-25 20:01:22 +09:00
Erik Bakker 995ccf85a6 Fix search result highlighting on Windows
Use only ANSI color codes that are supported by Windows
2015-11-20 22:08:03 +01:00
Jesse Kinkead 0ecc2543ec Always export apiURL even if autoAPIMappings is false. 2015-11-04 10:51:54 -08:00
Eugene Yokota f14692f0b1 changes due to bumping up librarymangement to 0.1.0-M4 2015-10-02 00:25:45 -04:00
Eugene Yokota 814ceeab79 librarymanagement 0.1.0-M3 to use internal syntax 2015-10-01 23:28:27 -04:00
Eugene Yokota 9eb718ae45 Fixes actions/depends-on 2015-10-01 01:57:02 -04:00
Martin Duhem 72edbfa177 Create `object Import` for source compat 2015-09-29 19:16:45 -04:00
Eugene Yokota cda5ff84c7 Use the new Doc object from incrementalcompiler 2015-09-28 22:56:34 -04:00
Martin Duhem a2abb6eeb6 Update to latest version of incremental, fix imports 2015-09-16 10:16:03 +02:00
Eugene Yokota ba7ffa5d4d Fix compiler bridge name 2015-09-15 03:06:35 -04:00
Eugene Yokota bb8133eaba use incremental compiler version instead of sbt version 2015-09-14 23:43:32 -04:00
Eugene Yokota 21a027c487 Fix Compiler.compilers 2015-09-14 21:59:36 -04:00
Eugene Yokota 076ccd7b90 Merge 2015-09-14 10:54:22 -04:00
Martin Duhem c981abd295 Fix all imports 2015-09-14 14:28:09 +02:00
eugene yokota 57321bf6bc Merge pull request #2192 from DavidPerezIngeniero/0.13
More robustness when using the tasks and settings command
2015-09-10 21:14:57 -04:00
Martin Duhem 92ea782d94 Fix deprecation messages 2015-09-04 12:25:59 +02:00
Martin Duhem 1c4a900ff5 Retrieve compiler bridge sources in temp directory
Note that they won't be downloaded again, because the component compiler
will look for a previously-compiled version of the compiler bridge
before trying to fetch the sources again. If they've already been
downlaoded, then they have been compiled and a compiled version of the
compiler bridge already exists.
2015-09-04 12:00:44 +02:00
Martin Duhem dcad8a5527 Specify the compiler bridge module in a setting
In order to restore reproducibility of builds, we no longer cascade over
the possibly available versions of the compiler bridge sources (a
specific version of the bridge sources may not be available one day, but
exist on the next day), but rather let the build definition configure
which module to use.

Fixes sbt/sbt#2196
2015-09-04 11:17:27 +02:00
David Perez 1e2617a807 More robustness when using the tasks and settings command 2015-09-01 14:16:41 +02:00
Martin Duhem e31a9ba456 Download compiler interface sources in boot directory 2015-08-26 10:33:11 +02:00
Dale Wijnand 13c6729507 Extract Def.settings from Project#settings.
This allows for the same functionality that using SettingsDefinition in
Project#settings allows (specifying either bare Setting[_] or a Seq[Setting[_]])
to be available outside of the settings for a project, for instance when
defining a val.

In short, it allows:

    val modelSettings = Def.settings(
      sharedSettings,
      libraryDependencies += foo
    )
2015-08-20 18:45:41 +01: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
Josh Suereth 4464b13acd Remove reference to dead servers. 2015-07-24 13:58:39 -04:00
Josh Suereth d0e918d6d3 Merge pull request #2114 from pdalpra/add-append.sequence-list
Add an Append.Sequence instance for List
2015-07-18 07:05:59 -04:00
Pierre DAL-PRA 10c71b3f8a Add an Append.Sequence instance for List, fixes #2107 2015-07-18 10:51:31 +02:00
Pierre DAL-PRA f944ec98d2 Log javaOptions/fork interactions:
- When forking, log the javaOptions that are used
- When javaOptions are defined but fork := false, warn that javaOptions
	will be ignored
2015-07-18 00:37:35 +02:00
eugene yokota 5824ef6d7f Merge pull request #2106 from Duhemm/interface-specific-sources-clean
Find most specific version of compiler interface sources
2015-07-17 10:25:16 -04:00
Pierre DAL-PRA 13b37cc987 Fix several warnings 2015-07-17 09:17:42 +02:00
Martin Duhem cbd5cd5875 Fix inlined method 2015-07-16 15:34:04 +02:00
Martin Duhem 90a8423d8e Find most specific version of compiler interface sources
This commit introduces a mechanism that allows sbt to find the most
specific version of the compiler interface sources that exists using
Ivy.

For instance, when asked for a compiler interface for Scala 2.11.8-M2,
sbt will look for sources for:

 - 2.11.8-M2 ;
 - 2.11.8 ;
 - 2.11 ;
 - the default sources.

This commit also modifies the build definition by removing the
precompiled projects and configuring the compiler-interface project so
that it publishes its source artifacts in a Maven-friendly format.
2015-07-16 11:18:48 +02:00
Josh Suereth d2fdfb81a0 Merge pull request #2091 from Duhemm/hide-stacktrace
Don't show the stack trace on compilation error in build definition
2015-07-09 14:26:03 -04:00
Pierre DAL-PRA cf72c7cc0e Fix a few typos in keys descriptions 2015-07-09 17:00:48 +02:00
Martin Duhem 6c123f22ba Hide stacktrace on compilation error in build definition 2015-07-09 11:40:02 +02:00
Jonas Fonseca 54618ad55a Fix typos in annotations referring to EvaluateTaskConfig 2015-07-01 09:22:15 -04:00
Eugene Yokota 81f175ddbf Fixes #1666 2015-06-20 00:51:42 -04:00
James Roper 3625ce5943 Added Extracted.runInputTask
This provides a convenience function for running an input task from the
extracted state. This is particularly useful for commands, release steps
etc that may want to run input tasks, like scripted.
2015-06-10 16:09:09 +02:00
Andrew Johnson 7c0f455c79 Use FiniteDuration to represent time rather than a long 2015-05-13 14:18:27 -04:00
Andrew Johnson 4ec092617f Add forceUpdateMs 2015-05-13 08:02:48 -04:00
Josh Suereth b568565615 Merge pull request #1970 from matthewfarwell/test-exclude
Test exclude
2015-05-11 15:27:06 -04:00
eugene yokota c1952698e4 Merge pull request #2000 from dwijnand/command-to-string
Implement SimpleCommand.toString. Fixes #1998.
2015-05-07 10:45:16 -07:00
Eugene Yokota 66e07f6e83 use Duration to track minForcegcInterval 2015-05-05 19:29:22 -04:00
Dale Wijnand 97ed5822c7 Implement SimpleCommand.toString. Fixes #1998. 2015-05-05 09:11:52 +01:00
Eugene Yokota 8aca4e8fa6 Force GC on cross building 2015-05-04 23:49:36 -04:00
Eugene Yokota 2bbe872969 Use interval throttling
JMX doesn't seem to work in reporting

    memoryMxBean.getObjectPendingFinalizationCount

At least for the test build that I used it always reports zero.
2015-05-04 23:09:23 -04:00
Eugene Yokota d82fe46052 Fixes #1223. Uses JMX to find out when to force GC. 2015-04-30 14:53:50 -04:00
eugene yokota 1ebe3804b3 Merge pull request #1992 from dwijnand/cross-scala-versions-default
Fix crossScalaVersions default, derived from scalaVersion. Fixes #1828.
2015-04-29 05:08:40 -07:00
eugene yokota 27bd275343 Merge pull request #1989 from dwijnand/inThisBuild
Add inThisBuild, similar to inConfig. Fixes #1847
2015-04-26 18:58:12 -07:00
eugene yokota d0fbd10852 Merge pull request #1987 from ajsquared/0.13
Add configurationsToRetrieve
2015-04-26 18:54:32 -07:00
Dale Wijnand 116c1e1e8b Fix crossScalaVersions default, derived from scalaVersion.
Fixes #1828.
2015-04-26 17:06:59 +01:00
Dale Wijnand 1aff36d505 Add help message for `inspect actual`. Fixes #1651. 2015-04-26 03:18:29 +01:00
Dale Wijnand 348a28f761 Cleanup inspectDetailed. 2015-04-26 02:31:51 +01:00
Dale Wijnand 677c33611a Add inThisBuild, similar to inConfig. Fixes #1847 2015-04-25 20:39:59 +01:00
Andrew Johnson b617b41ae1 Support configuring a subset of configurations from which to retrieve dependencies when retrieveManaged is true 2015-04-23 12:49:45 -04:00
Matthew Farwell d4cffdddd9 corrected exclusion logic, added more unit tests & scripted tests 2015-04-17 09:28:58 +02:00
Matthew Farwell 0e56878534 Added unit tests for Defaults.selectedFilter 2015-04-14 06:31:27 +02:00
Matthew Farwell a9e06109a3 Added exclusions to testOnly and testQuick command line, indicated by a '-' prefix. 2015-04-13 16:31:22 +02:00
eugene yokota c879432b0f Merge pull request #1950 from ajsquared/0.13
Add retrieveManagedSync
2015-04-10 12:48:17 -07:00
Andrew Johnson e647234743 Add retrieveManagedSync 2015-03-31 10:59:41 -04:00
Dale Wijnand 5c2ec63fa6 Make use of the nicer Project settings syntax in 0.13.8. 2015-03-27 01:19:26 +00:00
David Perez 4b5a3b785e Merge remote-tracking branch 'upstream/0.13' into 0.13 2015-03-25 16:12:54 +01:00
David Perez ef6c5f7e55 Merge remote-tracking branch 'origin/0.13.7' into 0.13 2015-03-25 16:01:15 +01:00
David Perez 5ce11c67c5 Catch exceptions with NonFatal 2015-03-25 15:02:45 +01:00
David Perez 2c52efeca5 Removed unicode arrow 2015-03-25 13:14:48 +01:00
David Perez 79ef772219 Removed unicode arrow 2015-03-24 14:54:10 +01:00
Dale Wijnand a4d2e04532 Add explicit return type for implicit removeSeq. 2015-03-23 22:29:57 +00:00
Dale Wijnand 18c7a5c226 MAke Task's remove1/removeN final. 2015-03-20 16:34:13 +00:00
Dale Wijnand 1db6f7f316 s/remove/removed/ 2015-03-20 16:12:39 +00:00
Dale Wijnand 17a1179e5b Add -= & --= for setings & keys, dual of += & ++=. 2015-03-16 23:44:38 +00:00
Dale Wijnand 51e83e7ea4 Fix temp variable names for +=/++= macros. 2015-03-16 23:31:14 +00:00
David Perez 508fc1b5ec Issue 1900, more robustness in help system 2015-03-12 15:30:43 +01:00
Eugene Yokota 1891b52472 Roll back the use of sbt/serialization for update caching 2015-03-10 05:12:17 -04:00
Eugene Yokota ca9257c064 OOM handling. #1763 2015-03-09 21:22:58 -04:00
Eugene Yokota b70fa6e0c2 Use pickler to cache UpdateReport for update task. #1763 2015-03-09 21:22:58 -04:00
Dale Wijnand a058a38b7b Define Project.settings with SettingsDefinition.
This maintains old, existing ways of configurating project settings,
while adding the possibility to:
* Define add a sequence of settings, between other individual settings
* Pass a Seq[Setting[_]] to Project.settings without having to do
  "varargs expansion", ie. ": _*"
2015-03-06 17:33:54 +00:00
Eugene Yokota b40a9e79c8 Fixes per review 2015-02-25 00:54:03 -05:00
Eugene Yokota 30ca290a13 Add sbt.root.ivyplugin escape hatch 2015-02-25 00:22:26 -05:00
Eugene Yokota 162ed3f320 Fixes #1869, Ref #1871. Don't enable IvyPlugin for multi project generated root 2015-02-24 23:02:26 -05:00
Dale Wijnand d07cdb92ad Make sure bare build.sbt is published by default. 2015-02-24 23:02:26 -05:00
Dale Wijnand 58a2e634e2 Improve disabling publish artificial root.
Not only is this safer, it also disables delivering the ivy file.
2015-02-24 23:02:25 -05:00
Dale Wijnand 03dc3f6fd0 Disable publishing artificial root. 2015-02-24 23:02:25 -05:00
Simon Schäfer 9a51264c96 Fixes #1845. Reformat Scaladoc of `AutoPlugin`
Enumerations always need to start with the same number, otherwise
Scaladoc doesn't recognize them as enumeration (no idea why).

Code blocks need to be surrounded by {{{}}}. The indentation of the
larger code block is still not correctly displayed, but I couldn't find
out why.

A TODO comment is moved out of the Scaladoc comment.
2015-02-07 01:35:35 +01:00
eugene yokota 35214ba202 Merge pull request #1841 from sbt/wip/merge-notes
Merging notes
2015-02-03 17:00:09 -05:00
Eugene Yokota f42419bdd4 Adds addMavenResolverPlugin. #1808/#1793 2015-02-02 14:57:25 -05:00
eugene yokota 1a3062ed10 Merge pull request #1799 from indrajitr/cross-source
Enable cross-version support for Scala sources.
2015-02-02 13:09:54 -05:00
eugene yokota 58f90cd078 Merge pull request #1787 from xuwei-k/git-clone-depth
specify the "--depth" parameter for efficient when git clone
2015-02-02 10:46:35 -05:00
Eugene Yokota b0a10815a6 Implementes `Def.sequential`. Fixes #1001
Adds Def.sequential based on Mark's implementation provided in #1001.
2015-01-20 01:22:03 -05:00
Indrajit Raychaudhuri 1f90ef6b43 Fix params order in `@deprecated` 2015-01-17 08:25:57 +05:30
Indrajit Raychaudhuri 1b15653bcb Enable cross-version support for Scala sources.
This allows attaching unmanaged sources on `per-ScalaVersion` basis.

Sources from `src/{main,test}/scala-<scalaBinaryVersion>` is collected
in addition to `src/{main,test}/scala` by default.

Note that the treatment of `scalaBinaryVersion` would vary depending on
`scalaVersion` pre-2.10 and 2.10 onwards.

For example:
- with `scalaVersion` `2.9.3`, the `scalaBinaryVersion` is set to `2.9.3`
  thus the files in `src/{main,test}/scala-2.9.3` as well
 `src/{main,test}/scala` would be available in the `sources` list.

- with `scalaVersion` `2.10.1`, the `scalaBinaryVersion` is set to `2.10`
  thus the files in `src/{main,test}/scala-2.10` as well
 `src/{main,test}/scala` would be available in the `sources` list.
2015-01-16 14:07:42 +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
Josh Suereth 42424b4cdb Refactoring code.
* remove debugging statements
* Move each class so it's one name-per-file
* Migrate out of org.apache namespace into sbt.mavenint
2015-01-12 14:48:23 -05:00
Eugene Yokota 406c80ddd6 Adjust tests. 2015-01-10 22:55:50 -05:00
Josh Suereth 16a64d70ef Migrate pom extra attributes out of CustomPomParser for deprecation. 2015-01-09 14:14:40 -05:00
Josh Suereth e3931dbfec Create a new Ivy DependencyResolver which uses Aether.
* Here we wire Aether into the Ivy dependency chain
* Add hooks into Aether to use Ivy's http library (so credentials are configured the same)
* Create the actual Resolver which extracts metadata information from Aether
* Deprecate old Ivy-Maven integrations
* Create hooks in existing Resolver facilities to expose a flag to enable the new behavior.
* Create notes documenting the feature.
* Create a new resolver type `MavenCache` which denotes how to read/write local maven cache metadata
  correctly.  We use this type for publishM2 and mavenLocal.
* Update failing -SNAPSHOT related tests to use new Aether resolver
* Create specification for expected behavior from the new resolvers.

Known to fix #1322, #321, #647, #1616
2015-01-08 08:53:25 -05:00
xuwei-k ad9e71178a specify the "--depth" parameter for efficient when git clone 2014-12-24 01:39:02 +09:00
Josh Suereth c8fc6d0223 Merge pull request #1620 from sbt/fix/1620
sbt resolves dependencies every compile when using %% with dependencyOverrides
2014-12-15 16:04:18 -05:00
Josh Suereth 62658b5fd8 Merge pull request #1615 from sbt/fix/1615
0.13.6 eviction notices too noisy
2014-12-15 15:13:02 -05:00
Eugene Yokota 5199909be7 Fixes #1766. Removes "No main class detected" warning. 2014-12-13 00:05:55 -05:00
Eugene Yokota 46f56851d4 'evicted' task to display all evictions 2014-12-12 23:30:05 -05:00
Eugene Yokota 40e5f7538a Fixes #1615. Move the invocation of eviction warning.
This moves the invocation of eviction warning so it’s called only when
actual ivy update is being performed.
2014-12-12 17:46:19 -05:00
Eugene Yokota e17ab305ae Fixes minor mistake in #1748 2014-12-12 17:00:35 -05:00
eugene yokota 9fc174f5c5 Merge pull request #1765 from ajozwik/0.13
Rollback xml parsing work-around
2014-12-12 12:14:31 -05:00
andrzej.jozwik@gmail.com e8e0297967 Remove work-around for parsing xml by scala parser 2014-12-08 23:35:17 +01:00
Eugene Yokota 59121cddf7 Fixes #1620. Fixes Set[ModuleID] serialization that broke update cache. 2014-12-08 09:27:56 -05:00
Josh Suereth 71d5dc931e Merge pull request #1748 from sbt/wip/1748
excludeDependencies: excludeAll at the project level
2014-12-05 09:06:09 -05:00
eugene yokota 4aa44262c3 Merge pull request #1741 from ajozwik/0.13
Multi imports in one line
2014-12-05 05:28:28 -05:00
Eugene Yokota 07afc67c7a Adds excludeDependencies. Fixes #1748
Adds project-level dependency exclusions:

  excludeDependencies += "org.apache.logging.log4j"
  excludeDependencies += "com.example" %% "foo"

In the first example, all artifacts from the organization
`"org.apache.logging.log4j"` are excluded from the managed dependency.
In the second example, artifacts with the organization `"com.example"`
and the name `"foo"` cross versioned to the current `scalaVersion` are
excluded.
2014-12-04 17:35:30 -05:00
Josh Suereth fda9252250 Merge pull request #1752 from sbt/wip/1752
Cached resolution is too verbose
2014-12-04 17:09:34 -05:00
Eugene Yokota 607b686cb2 Fixes #1752. Fixes cached resolution too verbose.
- Fixes cached resolution being too verbose
- Adds new UpdateLogging named "Default"
- When global logLevel or logLevel in update is Debug, Default will
bump up to Full UpdateLogging.
2014-12-04 12:34:30 -05:00
Jean-Rémi Desjardins ca736e55d3 Minor code cleanup 2014-12-03 09:56:34 -08:00
Josh Suereth f0adf92345 Fixes @eed3s1gn's comments
* Use verbs.
* compile actually saves the analysis
* previousCompile loads previous anlaysis
* explicit task to override for bytecode manipulation folkel.
2014-12-01 15:20:17 -05:00
Josh Suereth 59ba35ce90 Finish rearchitecting.
* IncrementalCompiler IC object now holds the actual logic to start incremental compilation (rather than AggresiveCompiler or other)
* MixedAnalyzingCompiler ONLY does anlaysis of Java/Scala code
* Moved the AnalyzingJavaCompiler into the integration library so that necessary dependencies are visible.
2014-12-01 13:35:51 -05:00
Josh Suereth 067479f59e Debug issues with implicit usage for CompileSetup.
* Force CompileSetup Equiv typeclass to use Equiv relations defined locally.
* Add toString methods on many of the incremental compiler datatypes.
* Remove remaining binary compatibility issues in Defaults.scala.
2014-12-01 13:35:51 -05:00
Josh Suereth 045ac1d984 Tweak remaining binary compatibility issues with design. 2014-12-01 13:35:51 -05:00
Josh Suereth 40bf599f4a Deprecating old APIs and attempting to document behavior correctly.
* Removed as many binary incompatibilities as I could find.
* Deprecating old APIs
* Attempt to construct new nomenclature that fits the design of Incremental API.
* Add as much documentation as I was comfortable writing (from my understanding of things).
2014-12-01 13:35:51 -05:00
James Roper 0f784ab101 Allow bytecode enhancement to update analysis
This breaks the loading/saving of the incremental compiler analysis out
into separate task, thereby providing the necessary hooks for byte code
enhancement tasks to enhance bytecode and update the analysis before the
analysis gets stored to disk.
2014-12-01 13:35:50 -05:00
Josh Suereth e2942f167b Merge pull request #1740 from j-keck/0.13
fix typo
2014-12-01 10:09:01 -05:00
j-keck 2e8c98f1a4 filter out hidden files 2014-11-24 06:34:56 +01:00
j-keck f6c8faa992 fix typo 2014-11-23 13:59:42 +01:00
andrzej.jozwik@gmail.com ce75c5a9b0 For backward compatibility - do not used duplicated imports 2014-11-21 09:11:09 +01:00
andrzej.jozwik@gmail.com d9aadaf1e1 Multi import in one line 2014-11-20 23:10:03 +01:00
Peter Vlugter 5704e31256 Fix sbinary cache limit when caching doc inputs
Cache the classpath as Seq[File] rather than String in RawCompileLike.
2014-11-19 14:41:17 -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 75402b26f2 More fixes from review.
* Fix regex for end of line.
* Rename NewJavaTool and friends to remove the New.
2014-10-30 19:37:22 -04:00
eugene yokota 473fc8476d Merge pull request #1703 from sbt/wip/merge-0.13.7
Wip/merge 0.13.7
2014-10-29 21:36:36 -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
Tomasz Bartczak 96f57f9fcd Fix for sbt#1180 - discovered classes are now sorted 2014-10-27 21:31:03 +01:00
Josh Suereth 2d3f57ad51 Fix the run logic so the mainClass setting is actually used when set. 2014-10-25 14:25:30 -04:00
Josh Suereth b834be8bfa Merge pull request #1669 from kretes/1648-warn-about-main-classes
Fix for https://github.com/sbt/sbt/issues/1648 - warn about multiple or no main classes
2014-10-23 07:37:07 -04:00
Eugene Yokota 7827682f41 Remove DefDef and check rhs
- lhs pattern matching occurs only for vals.
- def also breaks due to proc notation.
- instead of pretty printing, we can just check rhs.
2014-10-22 19:14:47 -04:00
Tomasz Bartczak 7a1a21d8c8 Fix for sbt#1648 - warn when no or multiple main classes 2014-10-22 22:42:01 +02:00
Eugene Yokota 97584457fa merged #1662 2014-10-21 12:18:54 -04:00
andrzej.jozwik@gmail.com 6f9dfcce52 Revert brackets for backward compatibility (binary compatibility), addExplicitXmlContent use pattern matching, splitFile - does not return whitespace statements 2014-10-19 23:54:18 +02:00
andrzej.jozwik@gmail.com 8c0e400c11 Add ; instead of brackets to xml group 2014-10-17 22:23:20 +02:00
andrzej.jozwik@gmail.com ef74db7319 Revert to previous version. 2014-10-14 11:24:12 +02:00
andrzej.jozwik@gmail.com ddc80357dc Add scala-stm file for unit test. 2014-10-14 08:30:20 +02:00
andrzej.jozwik@gmail.com 50ed84b748 Use original function 2014-10-13 22:53:45 +02:00
andrzej.jozwik@gmail.com f1ab893f98 Fixed #1666 - check from last end of line. 2014-10-13 22:49:26 +02:00
Josh Suereth d7c76aabf1 Merge pull request #1663 from sbt/wip/avoid-deprecated
enable -deprecation for Scala 2.10
2014-10-12 12:31:08 -04:00
Josh Suereth 5599b53692 Merge pull request #1653 from sbt/wip/fix-1649
Fixes #1649. Exclusion rules and other cached resolution fixes
2014-10-12 12:01:22 -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
Josh Suereth ddf8a173b0 Disable pattern matching in val syntax in sbt 0.13.7.
Fixes #1661 or at least works around it for now.
2014-10-10 13:47:02 -04:00
Eugene Yokota 8ddff28a9e Fixes #1660
Provide overloads for transitiveScratch and updateClassifiers that work
with IvyActions.updateEither.
2014-10-10 00:34:05 -04:00
Eugene Yokota 09bca754b5 Fixes #1639. Fixes cached resolution interacting with force()
When conflicts are found for a given module, a forced one
is selected before conflict manager kicks in.
The problem is that DependencyDescriptor seems to mark transitive
forced dependency as forced as well,
so the actual forced dependency are sometimes not prioritized.
To work around this, I’ve introduced a mixin called
SbtDefaultDependencyDescriptor, which carries around ModuleID to detect
direct dependencies.
2014-10-09 13:11:13 -04:00
Josh Suereth 89a3e4982f Add escape hatch to old parser in case we run into problems.
Just make sure users have the means to still build in case there's any
issues we missed.  This code should be removed in sbt 1.0.
2014-10-08 15:00:48 -04:00
eugene yokota 0f2c6f89a1 Merge pull request #1645 from sbt/wip/no-blankies-rebased
Natural whitespace handling for SBT configuration parser AKA 'no more blankies'
2014-10-06 14:27:50 -04:00
Eugene Yokota 5afb9e1af7 Fixed json serialization turning license into {}. 2014-10-05 04:24:22 -04:00
Josh Suereth 009426d896 Documentation and renaming of "blankies" into somethign a bit easier to find.
* Rename SPlitExpression* to `SbtParser` denoting that is parses .sbt files
* Adds a few todos
* Document APIs for internal usage.
2014-10-03 14:22:52 -04:00
andrzej.jozwik@gmail.com e230a17d3b @deprecated("Removed from the public API", "2.11.0") def isDefined: Boolean 2014-10-03 14:22:52 -04:00
andrzej.jozwik@gmail.com a67c5fd187 Comments #1630 2014-10-03 14:22:52 -04:00
andrzej.jozwik@gmail.com 97a96d5bf8 Split to small methods 2014-10-03 14:22:52 -04:00
andrzej.jozwik@gmail.com dac3edb546 Split to small methods 2014-10-03 14:22:52 -04:00
andrzej.jozwik@gmail.com 963e75d182 Fixed #1630. Remove last line if last statement is being removed 2014-10-03 14:22:52 -04:00
andrzej.jozwik@gmail.com 2a603da0a8 Moved tests to internal package 2014-10-03 14:22:52 -04:00
andrzej.jozwik@gmail.com 9294351e24 #1628 2014-10-03 14:22:52 -04:00
Josh Suereth 48be806dd4 Adding scaladoc commnets for SessionSettings, and fixing type in check file. 2014-10-03 14:22:51 -04:00
Josh Suereth a8370880e0 Remove binary compatibility breakages and migrate new parser features into an internal package. 2014-10-03 14:22:51 -04:00
andrzej.jozwik@gmail.com 2019c6da62 findMissingText now searchs recursive 2014-10-03 14:22:51 -04:00
andrzej.jozwik@gmail.com 742188393b Cut valid text corrected 2014-10-03 14:22:51 -04:00
andrzej.jozwik@gmail.com 232c28ecd1 Handle xml content in session save 2014-10-03 14:22:51 -04:00
andrzej.jozwik@gmail.com c720a973a6 Corrections for "session save" 2014-10-03 14:22:51 -04:00
andrzej.jozwik@gmail.com 4a33fd2225 Extract method - for new implementation. Not completed yet. 2014-10-03 14:22:51 -04:00
andrzej.jozwik@gmail.com eab7049479 Comments fixed #1574 2014-10-03 14:22:51 -04:00
andrzej.jozwik@gmail.com 8da8fefc68 Natural whitespace handling for SBT configuration parser AKA 'no more blankies' 2014-10-03 14:22:51 -04:00
Eugene Yokota fe8d290c17 Implemented cached resolution (minigraph caching) 2014-09-29 17:33:37 -04:00
Jacek Laskowski 627956901b Small scaladoc fixes 2014-09-28 23:27:59 +02:00
Josh Suereth d865251686 Add workaround (and warning message) for when ChainResolver gets a null publication date while we investigate other issues.
* Attempt to set publication date to last modified time, if the stars align
* Issue warning about undefined resolution behavior otherwise
* Add scripted test which exercises the NPE issue in resolving -SNAPSHOTs.
* Commit scalariform style edit in Act.scala

* After parsing and transforming the pom, check for pub date.
* If we don't have a pub date, try to grab lastModified from the URL
* If we can't do anything, issue a warning about the problem artifact.
2014-09-24 18:23:15 -04:00
Josh Suereth d2a18926b0 Merge pull request #1613 from jedesah/topic/remove-warnings
Remove compiler warnings
2014-09-24 09:10:35 -04:00
Jean-Rémi Desjardins 2eb8fd1b8a Merge branch '0.13' of github.com:sbt/sbt into 0.13 2014-09-16 09:20:21 -07:00
Jean-Rémi Desjardins b754c04a30 Add missing default option 2014-09-15 10:02:08 -07:00
Antonio Cunei 9b94a16b73 Undone the revert on the optimization, and fixed setAll()
The optimization, and therefore the change in the behavior
of Relation, is now needed by the class Logic, and cannot
be reverted.

This patch (written by Josh) therefore changes the
implementation of setAll() so that _1s is no longer used.
2014-09-12 20:51:04 +02: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 3ea995225f Merge branch '0.13' of github.com:sbt/sbt into 0.13 2014-09-10 22:56:01 -07:00
Jean-Rémi Desjardins ced5230289 Remove some compiler warnings 2014-09-10 22:55:43 -07:00
Jean-Rémi Desjardins 183c2bcfe2 Add developers keySetting
The motivation for this is mainly to avoid having to define a pomExtra to publish to Maven central
2014-09-10 20:18:28 -07:00
Josh Suereth 0f88b7a4f3 Merge pull request #1584 from sbt/wip/fix-test-classloader-issues
Fix issues with specifying scalaHome/scalaInstance and running tests
2014-09-10 12:26:15 -04:00
Josh Suereth fa36d0e290 Add missing `configs` method from Project to the build.sbt DSL.
* Create `configs` method for the sbt DSL
* Add ProjectManipulation for this method to implement.
2014-09-09 08:54:43 -04:00
Josh Suereth 9a60ca7da9 Merge pull request #1579 from copumpkin/0.13
Support publishing to file repositories specified in ~/.sbt/repositories. Fixes #1570
2014-09-08 13:24:25 -04:00
Daniel Peebles a857ae2759 Fixes #1570 2014-09-08 00:55:58 -04:00
Josh Suereth bc421f0ac9 Fix issue where generated config-classes was not propogated.
Fixes #1568.

This is the fallout of attempting not to leak config-file classes. Since
we DO NOT have valid incremental compiler for config-classes, we've instituted
workaround to ensure that regular incremental compilation *AND* our own
sbt loader do not hose each other.   A full solution will eventually be
to find a way for .sbt files to participate in regular compilation of a
project.

For now, we fix the tracking of generated.class files throughout an sbt
"loadProjects" call, and then clean any .class files that were not
generated for a full reload.   This commit just fixes
a minor tracking issue.
2014-09-07 12:01:50 -04:00
Havoc Pennington b202bd6848 Merge pull request #1538 from sbt/fix/1439
Fixes #1439. Fixes metabuild downloading unused Scala 2.10.2
2014-08-20 14:26:02 -04:00
Eugene Yokota e2412740b2 Removes println when removing unused *.class files.
#1525 removes unused *.class files created by the metabuid.
The implementation currently prints out a long list of *.class files
it’s about to remove. Unless something bad happens, this information is
not very useful to the user, so I suggest we don’t display it.
2014-08-18 01:12:39 -04:00
Eugene Yokota 8a069d0fb2 Fixes #1439. Fixes metabuild downloading unused Scala 2.10.2
Scala instance is added to the Ivy graph via autoLibraryDependency.
For metabuilds, scala-library is scoped under “provided” configuration,
which does not seem to evict modules on “compiled” configuration.
This commit turns overrideScalaVersion flag to true for the metabuilds,
so override rules are added for the following modules:
- scala-library
- scala-compiler
- scala-reflect
2014-08-17 23:18:32 -04:00
Eugene Yokota 074fbdb9e6 ModuleDetailReport => OrganizationArtifactReport
ModuleDetailReport hasn’t been released yet, so this rename is safe.
2014-08-15 01:57:21 -04:00
Josh Suereth a1b3117a42 Track generated .class files and clean leftovers after project load.
Fixes #1524

* Track generated .class files from Eval
* While loading, join all classfiles throughout Load, lots of bookkeeping.
* When a given build URI is done loading, we can look at its
  project/target/config-classes directory and clean out any extra items
  that are lingering from previous build definitions.
* Add TODOs to handle the same thing in global directories.  Right now,
  given the shared nature of these projects, it's a bit too dangerous to
  do so.
2014-08-14 10:03:24 -04:00
Josh Suereth 0bfb5a4118 Ensure random file hash for .sbt DSL doesn't conflict across .sbt files.
Fixes #1465
2014-08-14 10:01:02 -04:00
Grzegorz Kossakowski 12b6bd148d Merge pull request #1531 from gkossakowski/positions-crash
Set currentRun and currentUnit in Eval
2014-08-14 15:52:01 +02:00
Grzegorz Kossakowski 3fa6b87319 Set currentRun and currentUnit in Eval
First of all, we revert changes to Eval made in
a9cdd96152. That was a work-around
for problem with broken positions set on some trees. The rest of
the commit describes a fix.

Scala compiler's Global has `currentRun` method which is supposed to
return an instance of Run currently in use. Sbt's Eval which wraps
Global would create an instance of Run but not register it in Global.
Similarly, Eval would create an instance of `CompilationUnit` but not
set it in Run.

This would result in some silent failures like assigning broken positions
to parsed trees even if parser *has* received an instance of compilation
unit. See https://issues.scala-lang.org/browse/SI-8794 for details.

We fix the issue by subclassing Global and making it possible to set
current Run instance externally. Then we use this capability to set a run
instance right before we call compiler phases. We also make sure that
current run has current compilation assigned to it.

Fixes #1181
Fixes #1501
Fixes #1523
2014-08-13 23:32:14 +02:00
Josh Suereth 86d0cd9aeb Remove printlns. 2014-08-11 09:04:26 -04:00
Eugene Yokota b8ab638b74 So apparently scalariform was unable to parse these files. 2014-08-11 09:03:35 -04:00
Josh Suereth 2d0aafc8b0 Allow root plugins to be disabled.
Fixes #1455

* Add a mechanism to detect if a plugin clause includes/excludes
  a particular plugin.
* Add a filter for our "enabling" clauses so that user-excluded
  root plugins do not show up.
* Add a test to ensure this succeed.
2014-08-11 09:01:18 -04:00
Josh Suereth f7c4898a97 Merge pull request #1491 from sbt/fix/528
Unresolved dependency warning includes source position. Fixes #528
2014-08-11 07:51:33 -04:00
Josh Suereth fbf9d72607 Merge pull request #1509 from sbt/fix/1501
Fixes #1181/#1501. Fixes ArrayIndexOutOfBoundsException: -1
2014-08-08 13:39:01 -04:00
eugene yokota d99d75408c Merge pull request #1505 from jaceklaskowski/initdetailed-help-fix
BuiltinCommands.initialize has load-commands commented out
2014-08-08 10:31:34 -04:00
Eugene Yokota 840acba087 Adds `dependencyPositions` task to explicitly track dependency positions. 2014-08-08 00:53:09 -04:00
Eugene Yokota a9cdd96152 Fixes #1181/#1501. Fixes ArrayIndexOutOfBoundsException: -1
When the compiler reports back the error to CompilationUnit created by Eval#mkUnit, it sometimes returns OffsetPosition whose `source` is set to `NoSourceFile`.

This causes ArrayIndexOutOfBoundsException. The current workaround is to pattern match on the passed in pos and create a new one when the incoming source looks suspicious.
I have not figured out whether this is caused by our macro code or compiler.
There are various build.sbt errors that would cause this behavior:

```scala
libraryDependencies ++= Seq(
  depA
  depB // missing comma
)

lazy val bob = scala.Console println

test ++

run+
```
2014-08-07 23:58:49 -04:00
Jacek Laskowski 8affccb42a BuiltinCommands.initialize has load-commands commented out 2014-08-06 23:56:59 +02:00
Jacek Laskowski 8c4f4a7182 Properly show reload help 2014-08-06 23:30:47 +02:00
Eugene Yokota f318436725 Deprecate parseScopedKey 2014-08-05 11:28:28 -04:00
Eugene Yokota ee01908369 Fixes #1384. Fixes Scope.parseScopedKey
Scope.parseScopedKey now supports full range of legal keys
described in the documentation including {.} and other
notation for ProjectRef, BuildRef, and ThisBuild.
2014-08-05 11:28:28 -04:00
eugene yokota cd40f05085 Merge pull request #1498 from sbt/wip/fix-broken-cross
Fix broken cross versioning semantics using +
2014-08-04 17:38:34 -04:00
eugene yokota e9b79c5956 Merge pull request #1490 from sbt/wip/1484
Fixes NullPointerException during update. Fixes #1484
2014-08-04 11:50:47 -04:00
Josh Suereth 19b91396a2 Fix broken cross versioning semantics using + 2014-08-04 10:44:40 -04:00
Eugene Yokota dc2ae51d73 Adds UnresolvedWarningConfiguration that caches ModuleID -> SourcePosition mapping.
UnresolvedWarning is moved back to IvyActions.scala where it belongs.
The mapping between ModuleID and SourcePosition is passed in as UnresolvedWarningConfiguration.
This is calculated once in Defaults using State and is cached to filesystem.
2014-08-03 02:31:56 -04:00
Eugene Yokota 58b7c63f84 Unresolved dependency warning includes source position. Fixes #528
Unresolved dependency warning is moved to UnresolvedDependencyWarning class including
the fail path that was added in #1467.
To display the source position, I need to access the State, so I had to move the
error processing out of IvyActions and add UnresolvedDependencyWarning, which is
aware of State.
2014-08-02 06:25:24 -04:00
Eugene Yokota 9124056440 Fixes NullPointerException during update. Fixes #1484 2014-08-01 21:00:41 -04:00
Josh Suereth cc7546b1eb Fixes #856 - Store ++ scala version changes on session.
* Ensure the ++ command stores its changes on the sbt session.
* Make sure `session clear-all` will clear out ++ changes
* Validate that `set` command doesn't undo `++` changes

Note: There is some autogenerated Setting[_] delegate optimisation
      work that could be done in the future.
2014-08-01 17:39:43 -04:00
Josh Suereth f4ff84db34 Fixes #1375 - Check for empty filenames.
Starting sbt in root isn't a great idea, but it shouldn't break.
2014-08-01 17:36:14 -04:00
Josh Suereth 49f1529c5a Fixes #1478 - Append new sLog when reloading in set command.
* Migrate weak reference into logger class so we can test clearing it.
* Ensure new state.log is propoagted into settings on `set` command.
* Fix set test so that it ensures the sLog is relatively stable when
  reloading on set command.
2014-08-01 15:04:32 -04:00
Eugene Yokota c8af32950d 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
Eugene Yokota f2ad294984 Fixing more NullPointerError by wrapping license URL with Option 2014-07-27 12:01:11 -04:00
Eugene Yokota bb6e3e34e6 Fixing NullPointerError caused by reading String from Ivy directly 2014-07-25 03:51:20 -04:00
Eugene Yokota d40733807f Implemented general eviction warning. #1200
a> update
    [info] Updating {file:/foo/}a...
    [info] Resolving org.fusesource.jansi#jansi;1.4 ...
    [info] Done updating.
    [warn] Some dependencies were evicted:
    [warn]  * org.scala-lang:scala-library (2.10.1) -> 2.10.3
2014-07-25 03:51:20 -04:00
Eugene Yokota 855e7f176b Expand ModuleReport into the full Ivy resolution report. #1200
Currently sbt's update task generates UpdateReport from
Ivy's resolution report.
For each configuration there's ConfigurationReport, which contains
just enough information on the resolved module/revision/artifact.

Speaking of module, in Ivy module means organization and name,
and organization, name, and version is called module revision.
In sbt, module revision is called Module.
This is relevant because to talk about evictions, we need
a terminology for organization and name combo.

In any case ConfigurationReport is expanded to have `details`
field, which contains Seq[ModuleDetailReport], which represents
organization and name combo plus all the modules
just like Ivy's resolution report XML.
Furthermore, ModuleReport is expanded to include licenses,
eviction, callers, etc.
2014-07-25 03:51:19 -04:00
Eugene Yokota e997769971 Consolidated resolution. Fixes #413
This adds a new setting key called updateOptions, which can enable
consolidated resolution for update task.
The consolidated resolution automatically generates an artificial
module descriptor based on the SHA-1 of all external dependencies.
This consolidates the Ivy resolution of identical Ivy dependency
graph across multiple subprojects.

This is how it's enabled:

    updateOptions := updateOptions.value.withConsolidatedResolution(true)
2014-07-24 02:12:46 -04:00
eugene yokota 9df5882766 Merge pull request #1456 from sbt/wip/build-sbt-vals-in-set-command
Export build.sbt values inside sbt.
2014-07-21 10:30:39 -04:00
Josh Suereth 50696398a1 Minor cleanups and fix Eval tests to work correctly. 2014-07-17 23:32:29 -04:00
Josh Suereth 31c9de8efd Fix the val extractor to only pull sbt types rather than all. 2014-07-17 19:54:52 -04:00
Josh Suereth 13fc1114de Export build.sbt values inside sbt.
* Expose the values PAST the Eval/sbt.compiler package.
* Find projects using the name API rather than finding htem and dropping all values immediately.
* Adds a test to make sure the .sbt values are discovered and set-able
* Expose .sbt values in Set command and inside BuildUnit methods.
* Ensure `consoleProject` can see build.sbt values.
* Add notes for where we can look in the build if we want to expose .sbt values between files.
2014-07-17 16:29:06 -04:00
Josh Suereth e2949222b3 Make it so we can disable all default plugins (except the core plugin). 2014-07-15 00:51:55 -04:00
Peter Vlugter f7fbdb0281 Select the first test fingerprint for a test name for forked tests
Move the 'distinct by name' filter to Tests.processOptions, which is used
by both in-process and forked tests.
2014-07-14 11:57:52 +12:00
Josh Suereth f2e805a0d8 Merge pull request #1367 from dansanduleac/issue/1366
Don't update classifiers of projectDependencies
2014-07-02 10:09:45 -04:00
Lukasz Piepiora 871ccb0ab9 Fixes #1416: Plugin command doesn't work
Fix `plugin` command not working with plugin names containing `.`
2014-06-29 23:55:23 +02:00
eugene yokota 79cbc5a744 Merge pull request #1424 from jaceklaskowski/deprecated-annotation-param-positions
Message and since parameters in @deprecated properly placed
2014-06-24 22:59:55 -04:00
eugene yokota 77384a8a05 Merge pull request #1425 from jaceklaskowski/typo-fixes
Typo fixes + removing unnecessary semicolons
2014-06-24 22:58:59 -04:00
Jacek Laskowski ebbb77e200 Typo fixes + removing unnecessary semicolons 2014-06-25 00:08:25 +02:00
Jacek Laskowski d1dbdfc816 Message and since parameters in @deprecated properly placed 2014-06-24 22:35:34 +02:00
Lukasz Piepiora 75a05dfcbf Fix AutoPlugins declared at top-level
Fixes exception occuring when loading auto plugins, which are declared
as top-level classes
2014-06-24 20:52:18 +02:00
Jacek Laskowski 54bc04dadb Place version and comment correctly in @deprecated 2014-06-18 00:18:05 +02:00
Dan Sanduleac b4cfd7ab76 Don't update classifiers of projectDependencies 2014-06-02 10:14:01 +01:00
eugene yokota baf78797d6 Merge pull request #1378 from sbt/wip/fix-default-generated-projects
Allow autogenerated projects to have overridden organization.
2014-05-29 14:32:17 -04:00
Josh Suereth 68a2f57da9 Allow autogenerated projects to have overridden organization.
* Change detection of "default project" to accurately see
  if someone has changed the organization.
* Add a flag to notify downstream consumers that a project
  was autogenerated and not user specified.

Fixes #1315
2014-05-28 12:55:05 -04:00
Dan Sanduleac c006692fc3 Make GlobalPluginData preserve compatibility wrt .unapply 2014-05-28 14:50:41 +01:00
Dan Sanduleac b382cf464d build projects' transitiveUpdate to depend on globalPluginUpdate 2014-05-28 14:50:40 +01:00
Dan Sanduleac 87e9250cb2 Revert "Load global plugins in their own class loader and replace the base loader with that. Fixes #272."
This reverts commit 8cb7e23011.

Conflicts:
	main/src/main/scala/sbt/Load.scala
2014-05-28 14:50:39 +01:00
Josh Suereth 2dc910ba0b Merge pull request #1358 from dansanduleac/issue/1194
Resolve ThisProject properly
2014-05-28 09:45:28 -04:00
cheeseng 83af01b88a Changed to combine SuiteResult with same name, instead of replacing with latest one. This solves the test result count problem when a Suite is executed more than 1 time due to being returned as nested suites (sub-task). 2014-05-22 17:28:26 +08:00
Dan Sanduleac 5deb103ef6 Fix resolving Select(ThisProject) 2014-05-21 01:16:15 +01:00
Paul Phillips e88d1436c5 Remove line of dead code.
Unmoored expression in constructor does nothing except pack
on a few micros.
2014-05-19 06:17:44 -07:00
Josh Suereth 7d0b517be2 Merge remote-tracking branch 'origin/0.13.5' into wip/merge-0.13.5
Conflicts:
	main/src/main/scala/sbt/Load.scala
2014-05-16 14:04:51 -04:00
Josh Suereth e95feccfca Fix pattern match on buildLoaders.
Fixes #1341
2014-05-16 07:41:29 -04:00
Josh Suereth abffc3e1bd 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
eugene yokota 1d67d42da3 Merge pull request #1334 from sbt/wip/merge-0.13.5
Wip/merge 0.13.5
2014-05-14 09:06:09 -04:00
eugene yokota d1b6410c02 Merge pull request #1333 from sbt/wip/fix-derived-setting-tests
Fixed project/derived test to pass
2014-05-14 09:05:59 -04:00
Josh Suereth 81ae2fa582 Merge remote-tracking branch 'origin/0.13.5' into wip/merge-0.13.5
Conflicts:
	main/src/main/scala/sbt/EvaluateTask.scala
2014-05-13 19:31:44 -04:00
Josh Suereth 148b578681 Fix project load ordering to match 0.13.5 and previous.
* root project needs to be discovered FIRST in the list.
* All other rpojects come in the order they were seen.
2014-05-13 18:27:04 -04:00
Josh Suereth 664d83ed0f Back out autogc fix to be optionally enabled.
Workaround for #1329
2014-05-13 13:14:39 -04:00
Peter Vlugter 7948fbafbc Use separate update caches when cross compiling scala 2014-05-13 16:14:30 +12:00
Eugene Yokota 2b621869fc Check for object autoImport in auto plugins. Fixes #1314 2014-05-08 21:54:04 -04:00
Josh Suereth af1c581cbb Rework sbt's loading mechanism to allow `ProjectManipulation` DSL entries to take effect.
This does the following:

* Fragments loading into two stages:  Discovery + Resolution
* Discovery just looks for .sbt files and Projects, while
  loading/compiling them.
* Resolution is responsible for taking discovered projects and
  loaded sbt files and globbing everything together.  This includes
  feeding the project through various manipulations, applying
  AutoPlugin settings/configurations and ordering all the settings.
* Add a bunch of docs
* Add direct DSL `enablePlugins` and test
* Add direct DSL `disablePlugins` and test.
2014-05-07 12:35:17 -04:00
Josh Suereth 746583e718 Alter the DSL slightly to use explicit DslEntry types for settings.
* Create new DSLEntry type for settings so we can categorize what we parse
* Use DSLEntry to help solve the Setting[_] vs. Seq[Setting[_]] implicit fun.
* Hack away any non-Setting[_] DSLEntry for now.
* Add test in build.sbt to make sure the new DSL works.
2014-05-07 12:35:17 -04:00
eugene yokota d198ea4099 Merge pull request #1316 from sbt/wip/fix-broken-build
This doesn't quite fix the build, but gets closer
2014-05-07 12:23:09 -04:00
Josh Suereth 244abd3b6f Scalariforming test code 2014-05-07 11:52:23 -04:00
Martynas Mickevicius f11d3dbce4 Sort setting key names in the inspect tree view. 2014-05-07 14:32:10 +02:00
Eugene Yokota 785b0274ee some more source getting formatted 2014-05-02 18:07:05 -04:00
Eugene Yokota adb41611cf added scalariform 2014-05-01 12:50:07 -04:00
Dan Sanduleac 512494cd04 Couple of fixes 2014-05-01 01:35:48 +01:00
Dan Sanduleac 0377a40cf8 Optimise scope intersection for GlobalScope 2014-05-01 01:35:48 +01:00
Dan Sanduleac f485270adf Put sbt's derived settings under GlobalScope 2014-05-01 01:35:48 +01:00
Dan Sanduleac 3161d75a41 Decouple DefaultSetting from Setting/DerivedSetting; BuildCommon.derive() produces default settings by default 2014-05-01 01:35:48 +01:00
Jacek Laskowski 95b976b6d4 Detailed help for the reload command (following project's) 2014-04-24 23:53:31 +02:00
eugene yokota 1819276bb8 Merge pull request #1278 from sbt/wip/junit-xml-reporter
Migrate JUnitXmlReporter into sbt as autoplugin
2014-04-22 16:53:02 -04:00
eugene yokota 9d86d56797 Merge pull request #1277 from sbt/fix/issue-1267
Separate location of analysis cache if we're cross compiling scala.
2014-04-22 13:45:49 -04:00
Josh Suereth fc3f6dd1d9 Remove enabling key for JunitXmlReportPlugin.
This migrates JunitXmlReportPlugin to work the way we desire
new sbt features/plugins to work:

* Enabling the feature is having the plugin available.
* Disabling the feature is disabling the plugin
* All code/settings for the feature are isolated to the plugin.
2014-04-22 11:23:15 -04:00
Josh Suereth f5dd022551 Separate location of analysis cache if we're cross compiling scala.
* Add task to determine file-name of analysis cache
* If crossPaths := true, then add scala binary version to the analysis cache name.

This makes it possible to leverage incremental compilation with the `+` command.

Fixes #1267
2014-04-22 11:12:59 -04:00
Josh Suereth 447ae8b1d8 Migrate JUnitXmlReport into an autoplugin. 2014-04-22 10:38:35 -04:00
Bruno Bieth b38b86add5 Added a test reporter for JUnit XML
Taken from https://github.com/chenkelmann/junit_xml_listener and slightly improved.
Activating is now just a matter of setting `testReportJUnitXml` to true.
This not only brings a very handy feature (hudson/jenkins support that syntax),
but gives more options for testing the SBT test infrastructure.
For instance checking that the test output is well segregated during a parallel
test run is just a matter of checking the report output.

Conflicts:
	main/src/main/scala/sbt/Keys.scala
2014-04-22 08:36:52 -04:00
Josh Suereth e076bfa970 Automatically run GC/finalization after each task execution.
Fixes #1223.

* Add a new key to disable forcing the garbage collector to run
  after each task-executioin
* Add a new flag to disable forcing the garbage collector to run
  after each task-exeuction
* Add a hook into EvalauteTask to run System.gc/System.runFinalization
  after each task execution

Review by @eed3si9n
2014-04-21 11:08:05 -04:00
eugene yokota 72d3c4e3eb Merge pull request #1255 from sbt/wip/remove-depreated-evaluate-task-call
Remove deprecated EvaluateTask usage for new, easier to update variant.
2014-04-16 14:33:10 -04:00
eugene yokota 583391a069 Merge pull request #1263 from sbt/wip/docs-and-cleanups
addPlugins => enablePlugins
2014-04-16 13:59:40 -04:00
Antonio Cunei 75f0438946 Use the correct state in buildPluginDefinition()
Within buildPluginDefinition(), the call to setProject() can
(and usually will) return a modified structure together with
the new state.

The subsequent call to evalPluginDef() should use the updated
structure, rather the old stucture that was present before
the setProject() ("pluginDef"); if that is not the case,
the code called by evalPluginDef() will find an inconsistent
structure/state combination, and behave in bizarre ways as
a result.

More in general, it is a bit dangerous to pass to routines
in parallel the two separate state and structure, as the
two may easily inadvertently fall out of alignment, as in this
case.

This patch should be applied to both the 0.13 branch as well
as to a future 0.12.5 release (the corresponding file there
is ./main/Load.scala).
2014-04-16 17:56:49 +02:00
Josh Suereth 51ee5048f0 Rename `addPlugins` to `enablePlugins` to better represent what it does.
This is to disambiguate between `addSbtPlugin` and `enablePlugins` for
autoplugins.
2014-04-15 14:38:11 -04:00
Josh Suereth 1c3231f017 Documentation for EvaluateConfigurations class. 2014-04-15 13:22:40 -04:00
Grzegorz Kossakowski b665b7ecee Merge pull request #1254 from gkossakowski/classFileManager-logging
Add debug logging in ClassfileManager
2014-04-13 16:05:18 +02:00
Grzegorz Kossakowski a7fb54e4df Add debug logging in ClassfileManager
Add logging of various operations the transactional class file manager is
doing. You can pass logger to be used by the transactional class file
manager by using overloaded definition of `ClassfileManager.transactional`
method. The old overload has been deprecated.

The factory methods for class file manager in IncOptions companion object
has been deprecated in favor of using ClassfileManager companion object
directly. The code in Defaults.scala has been updated to use non-deprecated
methods. The logging is turned off by default.

The canonical way of enabling transactional class file manager in sbt
project is:

```
incOptions := incOptions.value.withNewClassfileManager(
  sbt.inc.ClassfileManager.transactional(
    crossTarget.value / "classes.bak",
    (streams in (compile, Compile)).value.log
  )
)
```

It's a bit verbose which shows that the api for this is not the best.
However, I don't expect sbt users to need this code very often.

This patch should help debug the problem described in #1184
2014-04-11 13:42:21 +02:00
Josh Suereth 004d9c3f4a Remove deprecated EvaluateTask usage for new, easier to update variant. 2014-04-10 15:51:55 -04:00
Josh Suereth bc07810f7e Mark new method private[sbt] because no one else should use it. 2014-04-10 13:17:39 -04:00
Josh Suereth 22b99a9a1c Autoplugin confgiurations must be injected first into project.
Fixes #1247
2014-04-10 10:12:00 -04:00
Josh Suereth 10afd46785 Merge pull request #1252 from gkossakowski/hang-in-loading-global-plugins
Pick the right overload in EvaluateTask.runTask
2014-04-10 09:28:51 -04:00
Grzegorz Kossakowski 7fead66244 Pick the right overload in EvaluateTask.runTask
The deprecated method should forward to the other overloaded alternative
but it recursed instead.

This kind of mistake would be easily caught by linter warning about
unused `newConfig` local variable. I hope we'll get there some day.

Fixes #1251
2014-04-10 15:24:07 +02:00
Indrajit Raychaudhuri 7179912387 `DefaultOptions` for resolvers should not resets existing values.
`DefaultOptions.addResolvers` and `DefaultOptions.addPluginResolvers`
should not reset the existing value while adding the new ones. The
names are prefixed with _add_ afterall.
2014-04-10 03:25:54 -05:00
eugene yokota 59b834c679 Merge pull request #1225 from japgolly/shhh_tests
Added setting 'testResultLogger' which allows customisation of test reporting.
2014-04-09 10:37:44 -07:00
Josh Suereth 43c25beeed Fix infinite loop of death. 2014-04-09 10:11:21 -04:00
David Barri 195129a3e7 Added TestResultLogger for customising test feedback.
1) When `test` is run and there are no tests available, omit logging output.
   Especially useful for aggregate modules. `test-only` et al unaffected. (#1185)

2) Added a new setting `testResultLogger` to allow customisation of logging of test results.
2014-04-09 19:14:29 +10:00
Josh Suereth 3890c98115 Remove mutability from the task cancel api.
* Rename TaskCancel to RunningTaskEngine for clarity
* Explicitly pass a state value in TaskCancellationStrategy
* Update hooks to be immutable/safe.
2014-04-08 20:59:50 -04:00
Josh Suereth f42dee8090 Naming fixes to TaskCancellationStrategy to be clearer. 2014-04-08 12:08:30 -04:00
Josh Suereth 8f1ef5395d Improve scaladoc comments for the task cancellation api. 2014-04-08 11:09:23 -04:00
Josh Suereth 171eb19b96 Part #2 of task cancellation hooks.
* Expose new EvaluateTaskConfig throughout all the APIs
* Create a key for cancellation configuration
* Add default values for cancellation in GlobalPlugin
* Create a test to ensure that cancellation can cancel tasks.
* Deprecate all the existing mechanisms of evaluating tasks which
  use the EvaluateConfig API.
2014-04-08 09:23:49 -04:00
Josh Suereth 6e480fc2b6 Fix deprecated 'since' clauses to reflect our actual release versions. 2014-04-07 16:54:32 -04:00
Josh Suereth 2686acd993 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
Josh Suereth d8e2f594d1 Merge pull request #1065 from jaceklaskowski/string-interpolation-follow-deprecation
Use string interpolation and replace deprecated methods
2014-04-07 11:22:19 -04:00
Eugene Yokota 5f7e68c7dd Auto plugin names are imported with or without autoImport. Fixes #1217 2014-03-27 17:36:40 -04:00
eugene yokota 9dde1ac46e Merge pull request #1215 from eed3si9n/topic/renameaddsettings
Deprecate autoSettings, Rename ProjectSettings => BuildScalaFiles
2014-03-26 14:36:46 -04:00
Eugene Yokota 4f969491d0 Deprecate autoSettings, Rename ProjectSettings => BuildScalaFiles
* autoSettings is renamed to settingSets. Since this was part of 0.13.0
we need to deprecate it first.
2014-03-26 11:35:50 -04:00
Eugene Yokota 1debc48568 Rename GlobalModule -> CorePlugin 2014-03-25 15:49:07 -04:00
Eugene Yokota 3f2f12f5bb Fix PluginsTest 2014-03-25 01:49:08 -04:00
Eugene Yokota 575e657962 Default AutoPlugin to an empty root plugin 2014-03-25 00:20:11 -04:00
Eugene Yokota ff77d0b0f2 Remove def autoImport: Any from AutoPlugin. 2014-03-24 23:04:22 -04:00
Eugene Yokota cc80d216ab Adjusting to 0.13 changes 2014-03-24 20:03:01 -04:00
Eugene Yokota 2c654b2d90 Unifies AutoPlugin and AutoImport. Fixes #1188
* AutoImport trait is subsumed by def autoImport method under
AutoPlugin class.
* When def autoImport is overridden by a lazy val or a val, *.sbt
automatically imports autoImport._.
2014-03-24 19:10:35 -04:00
eugene yokota 4315049337 Merge pull request #1203 from eed3si9n/topic/requiredAutoPlugin
Unifies AutoPlugin and RootPlugin
2014-03-24 19:02:00 -04:00
Eugene Yokota d697c10950 Hide unary_! operator from API 2014-03-24 18:59:14 -04:00
Josh Suereth d03e2380b2 Merge pull request #1197 from sandreev/t_1196_empty_tests
fixes #1196
2014-03-24 16:19:11 -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
Sergey Andreev 910d39f3a9 fixes #1196 2014-03-20 17:46:42 -07: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 a8ab2f3db9 Merge pull request #1115 from metasim/Structure-docs
Added basic documentation for DefinableSetting, inferring behavior from implementation.
2014-03-03 14:16:21 -05:00
Jason Zaugg 8c4527317f SI-7788 Adapt to renamed implict Predef.conforms
In 2.11, the implicit version is named `$conforms` so as to avoid
accidental shadowing by user code, which renders methods using
views and subtype bounds inexplicable unusable.

But, SBT intentionally needs to hide it to make the implicits
in this file line up.

This commit opts-in the the required identifiers from Predef,
rather than opting out of conforms. This makes the same code
source compatible with 2.10 and 2.11.
2014-02-21 22:14:13 +01:00
Josh Suereth c9f83dde47 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 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
Jason Zaugg bd943b8e83 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
Simeon H.K. Fitch 9f43d0660d Revised documentation based on feedback from @jsuereth 2014-02-12 15:37:49 -05:00
Simeon H.K. Fitch 7f6abbaf35 Added basic documentation for DefinableSetting, inferring behavior from implementation. 2014-02-12 12:31:15 -05:00
Jason Zaugg 9b4564f0cd SI-8262 Fix compilation with 2.11 due to shadowing of Range
We now have `global.Range`, so our wildcard import of `global._`
shadows `scala.Range`.

This commit fully qualifies that type so as to be compatible with
Scala 2.10 and 2.11.
2014-02-12 13:11:28 +01: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
Josh Suereth b7c50d4269 Merge pull request #1089 from dansanduleac/overwritePublish
Expose overwrite flag in IvyActions.publish
2014-02-01 07:56:41 -08:00
Jason Zaugg 264e49a912 Avoid compiler crash for naked `key.value` calls.
Untyped trees underneath typed trees makes Jack and sad boy.
And they make superaccessors a sad phase.

The recent refactoring to retain original types in the trees
representing the argument to the task macro meant that the `value`
macro also was changed to try to avoid this untyped-under-typed
problem. However, it didn't go deep enough, and left the child
trees of the placeholder tree `InputWrapper.wrap[T](key)` untyped.

This commit uses `c.typeCheck` to locally typeheck that tree fully
instead.

Fixes #1031
2014-01-28 10:45:15 +01: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 fcb35f3b8f Add Initialize[Task[T]].taskValue: Task[T] to allow selecting the Task for use by *Generators. Fixes #866. 2013-11-24 18:24:15 -05:00
Mark Harrah 1d9b44d5d7 Expand aliases instead of evaluating directly.
This avoids an additional cause of recursion via the semicolon/multiple command, which fixes #933.
It also provides error messages on the expanded command.  This fixes #598.
2013-11-24 15:19:24 -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 1a3c88ef20 Log at the debug level the commands being executed by the command engine. 2013-11-23 19:18:54 -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