Commit Graph

1815 Commits

Author SHA1 Message Date
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
Heikki Vesalainen 9989e5631f Completion command: support quoted strings 2013-11-21 08:20:37 -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
James Roper 191737d35b Log socket accept errors when forking tests
If an exception is thrown when accepting a connection from a forked test
agent, currently I'm seeing that all that happens is SBT hangs with no
output.  Thread dumps show that the main process is waiting for the
agent to return, while the agent is waiting for the server to send it
something.

This change logs the exception, so that at least the error can be
googled.  It also cleans up the server socket.
2013-11-04 09:39:30 -05:00
James Roper b337f3d9ac Flush ObjectOutputStreams after construction
This protects against deadlocks between the writing and reading end,
since the ObjectOutputStream constructor writes a header, but does not
flush, and the ObjectInputStream constructor reads the header, and
blocks until it's read.
2013-11-01 13:26:07 -04:00
Benjy 655e2e5c91 Fix serialization in Sync.
The serialized structures there aren't part of an Analysis,
so they aren't interned.

TODO: Refactor InternedAnalysisFormats so that this is more
straightforward and less error-prone.  This commit is
a first-pass fix of the broken test.
2013-10-28 15:00:17 -04:00
Mark Harrah 0a2bb3a958 Merge remote-tracking branch 'benjy/interned_files' into 0.13 2013-10-24 16:55:16 -04: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 f461b94e73 Fix API comment for State.{+,++} 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 fb1437cf36 Transfer logging,trace levels from old to new global loggers. 2013-10-24 16:34:16 -04:00
Benjy c66eefcec9 Switch to using the interned serialization format. 2013-10-23 10:41:13 -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 9d1d18cd71 remove duplicate relativize implementation from Path 2013-08-16 14:22:14 -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
James Roper 1eaf548bcd Added shutdown hook for restoring the terminal 2013-07-30 19:02:10 +10: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 4123769214 inline implementation of Symbol.isTopLevelModule, which no longer exists in 2.11 2013-07-23 11:35:34 -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 0a77a47f41 Revert "Don't import the Global.Range in 2.11, which shadows the collection Range"
This reverts commit 5d7d9c4cef.  Can't do it this way
since Global.Range doesn't exist in 2.10.
2013-07-19 07:20:12 -04:00
Mark Harrah 5d7d9c4cef Don't import the Global.Range in 2.11, which shadows the collection Range 2013-07-18 22:41:52 -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 c0e06a14fe Apply setup and cleanup hooks to forked tests.
The actual class loader for test classes cannot be provided because it
is in another jvm.
2013-07-16 13:55:10 -04:00
Mark Harrah c2df1e8d68 Deduplicate options processing for forked/non-forked tests.
This in particular fixes testOnly/testQuick when forking.
2013-07-16 13:55:10 -04:00
Mark Harrah 45677de789 test arguments no longer need to be passed throughout- they are now only used in Runner construction 2013-07-11 21:13:06 -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 0507a2a1a9 Deprecate implicit RootProject/LocalProject calls on URI/File/String
Builds are using explicit calls anyway, so reduce the implicits.
2013-07-10 18:15: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 ccff43ce8c API docs and cleanup for test configuration data structures 2013-07-08 09:14:19 -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 3e7bedd11b Properly filter test results and decode test names in printed output.
Initial report by @viktorklang, based on his patch.
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
Mark Harrah 851451a90a shouldn't need to deserialize user classes when forking tests, only sbt+test-interface 2013-06-28 11:02:49 -04:00
Mark Harrah 53191cb787 Only print extra test status counts if nonzero 2013-06-28 09:48:27 -04:00
Mark Harrah 301c11f9e0 Drop ForkTestDefinition in favor of TaskDef 2013-06-28 09:24:47 -04:00
cheeseng 86f47bd67d Added explicitlySpecified and selectors field to ForkTestDefinition, and change ForkMain to use explicitlySpecified and selectors value sent from ForkTests. 2013-06-28 17:45:13 +08:00
cheeseng 0c66d1a5d3 Added support of Ignore, Canceled and Pending added in the latest framework API. 2013-06-28 17:19:27 +08: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 b1cba90332 Promote new State methods to public 2013-06-19 12:01:45 -04:00
Mark Harrah 284cddff70 set position on parameter references in task/setting macros 2013-06-19 11:53:11 -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 53f75a85cc Basic named commands now print usage if the argument parser fails on empty input. Fixes #776.
The Help for these commands now needs to be cleaned up, since they were not written with
this feature in mind.  In particular,

* consider adding syntax summaries in the short help strings
* alternatively, add the syntax summary data elsewhere for use specifically by this feature
* display a better message when there is no short help string, such as
   "See 'help <command>' for usage." or just displaying the lower level error message, such as
   "Expected whitespace"
2013-06-17 12:06:13 -04:00
Mark Harrah 53e7960976 separate out help message functions 2013-06-17 12:06:13 -04:00
Mark Harrah 74438d0c72 handle empty help list in aligned printing 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 598b6209e3 Put summary not available message at the debug level. Review by @cheeseng. 2013-05-14 09:09:20 -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 60b714e8de require dynamic initialization to be explicitly enabled for derived settings 2013-05-09 17:28:39 -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 48fb0c4ed6 Initial working version of makeParallel that support nested tasks. 2013-04-25 00:06:52 +08:00
cheeseng 3109912d00 Added support of nested test tasks when tests are executed InProcess and sequentially. 2013-04-25 00:06:52 +08:00
cheeseng ad18b4f3ae Added code to tag test task using Array[String] returned from Task.tags method. 2013-04-25 00:06:51 +08: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 a76523a5f6 Added >1 framework class per framework support, this enables sbt to support both old and new framework API at the same time. 2013-04-23 12:00:05 +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 b83d378cd0 Changed ForkTests to call acceptorThread.join(), to make sure that acceptorThread is finished before Acceptor.result is called. 2013-04-23 11:09:48 +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 8d0c1408c0 Allow -cp argument to 'apply' command to be quoted. Fixes #724. 2013-04-12 12:47:45 -04: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 6327e11a59 Object->AnyRef change in EvalTest 2013-03-18 09:52:57 -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 5b80e8c941 use .evaluated instead of .value for InputTasks 2013-03-08 14:23:31 -05:00
Mark Harrah 387f06e73a partialInput/fullInput methods on InputTask to apply input programmatically. ref #407. 2013-03-08 14:23:31 -05:00
Mark Harrah d6f78db0c9 Construct input tasks in multiple steps to allow input task reuse. Fixes #407. 2013-03-08 14:23:30 -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 54b103f4c7 Tag the actual test task and not a later task. Fixes #692. 2013-03-03 19:43:36 -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 1870edfd27 more deprecations 2013-02-26 07:39:23 -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 68443fc047 minor improvement to use stripSuffix in DotGraph 2013-02-22 16:31:32 -05:00
Mark Harrah 76ebc3a01d force test definition sequences to fix tests/order 2013-02-21 20:45:07 -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
Mark Harrah 824f10aa9a better error message when help search syntax isn't a valid java.util.regex 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 4fe0c02536 Break long argument list into multiple lines.
Some methods take a lot of arguments and I'm about to add one more
which will make them too long for easy reading.

This change is changes code formatting only. That's done on purpose
to make it easier to review other changes.
2013-02-19 12:18:26 -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 9ab1b98d2a Use @compileTimeOnly for .value and .parsed methods.
Needed to set position on wrapper method for correct error message position.
2013-02-19 08:54:40 -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 c0b1bb51e6 -Xlint 2013-02-04 17:30:31 -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
Eugene Yokota 125727ba83 support binary version in launcher 2013-01-29 16:55:13 -05:00
Mark Harrah e47b8ab578 Make 'eval' command work when project isn't loaded. 2013-01-29 08:47:04 -05:00
Mark Harrah a57407375e Implement InputTask.~= to operate directly on the result type T instead of an InputTask[T]. 2013-01-28 18:01:35 -05:00
Mark Harrah 8d11d1087a Mark the tests failed exception as having already provided feedback 2013-01-28 17:14:53 -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 13ea342b7a use standard Context.weakTypeOf 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
Paolo G. Giarrusso 236143be8d Silence boring Eclipse warnings: catching all exceptions
Here I make explicit where catching all exceptions is intended.
Mark Harrah corrected one decision during review.
2013-01-22 09:05:15 -05:00
Paolo G. Giarrusso 19aaaea923 Fix compile error in Eclipse
Let's consider compile/inc/src/main/scala/sbt/CompileSetup.scala.
There are multiple Output types, and according to Eclipse importing
xsbti.compile.Output within the package sbt does not work because the
import is shadowed by sbt.Output.

However, compilation proceeds just fine within SBT. Reproducing the
example however gives the same warning, if the files are in the same
project. The problem here is probably that the shadowing Output
is declared in the same package but in another project, and that seems
to give different results in Eclipse and SBT, but relying on
that looks fragile.
Reading the spec is inconclusive since it doesn't match with Scalac's
behavior — see
https://groups.google.com/d/topic/scala-internals/-Rquc2HBYLk/discussion .

ForkTests has the same behavior as CompileSetup.
2013-01-22 09:05:15 -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 aefad9c033 when looking for the enclosing val definition in definingValName, allow the macro to be in an expression 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 f0a72e53e8 use proper separator in command tab completion 2013-01-03 11:37:40 -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 329b42453b move Eval test to correct location 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 71f12fbcdb 2.9 compatibility for incremental compilation modules 2012-12-11 14:41:22 -05:00
Mark Harrah f388b07632 fix inputTask construction method and put sbt package object in proper directory 2012-12-09 20:40:41 -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 912948f5c8 update 'apply' help string to include -cp option 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
Mark Harrah f55c8ca15e Tab completion of right side of setting in 'set' command no longer necessary with the new task syntax. 2012-12-06 19:11:07 -05:00
Mark Harrah 769ecbace5 add scala-tool configuration and dependencies when configuring via pom.xml/ivy.xml 2012-12-06 07:25:41 -05:00
Mark Harrah 8f25b07d71 -cp/-classpath option to 'apply' command 2012-12-04 21:08:39 -05:00
Mark Harrah 005b2b356f fix IO tests, which needed scala-compiler.jar on the classpath 2012-12-04 13:20:03 -05:00
Josh Suereth f338018bd1 Modified SBT defualts to pull in app repositories.
* If SBT launcher supports app repositories these are added by default.
* IF SBT launcher does not support app repositories, previous defaults are used.
2012-12-04 13:10:10 -05: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 cdd2e72cdf move top-level settingKey,taskKey,inputKey objects to Def and package object
avoids class file name collision on case insensitive filesystem
2012-12-04 13:08:52 -05:00
Mark Harrah 495e7c6f62 Disable aggregation for `run-main` by default 2012-12-03 08:56:22 -05:00
Mark Harrah 2598a8f1a9 extend source positions to all setting creation methods 2012-12-02 03:17:20 -05:00
Mark Harrah f73e77de16 convert () to {} to workaround macro bug
(bug is fixed in 2.10.x branch)
2012-12-02 03:17:20 -05:00
Mark Harrah 2f2596c133 record source name or full path for settings/tasks depending on whether the enclosing package is the empty package 2012-12-02 03:17:20 -05:00
Mark Harrah a8d0af9464 split out KeyMacro.enclosingTrees 2012-12-02 03:17:20 -05:00
Mark Harrah 8400b992af source positions for settings/tasks in .scala files 2012-12-02 03:17:20 -05:00
Mark Harrah 3bff14d77a taskKey,settingKey,inputKey macros to get name from the defining val 2012-12-02 03:17:20 -05:00
Mark Harrah 538f687208 Use and methods instead of mapR,mapFailure,flatFailure,flatMapR 2012-12-02 03:17:19 -05:00
Mark Harrah c23226d4ae comment EvaluateTask.apply methods 2012-12-02 03:17:19 -05:00
Mark Harrah bb1725f580 Allow root project to be explicitly specified in Build.rootProject 2012-11-18 10:55:26 -05:00
Mark Harrah a9289ad0ce Explicitly specify type parameters in calls to KCons in KList builder.
scalac couldn't infer the type constructor otherwise.
2012-11-18 09:20:26 -05:00
Mark Harrah a38bce8d41 Transition to all camelCase key labels.
1. Hyphenated labels are still accepted when parsing scoped keys (so 'sbt test-only' still works)
   There is currently no timeline for removing this support for hyphenated keys.
2. Only camelCase is shown for tab completion.
3. AttributeKey.rawLabel provides the unnormalized label.
   This should only be used to implement support for accepting hyphenated keys as input for compatibility.
4. AttributeKey.normLabel provides the normalized label (hyphenated converted to camelCase)
2012-11-17 20:23:07 -05:00
Mark Harrah 49e7214fe3 InputTask macro
Similar to task macros, the parsed value is accessed by calling `parsed`
on a Parser[T], Initialize[Parser[T]], or Initialize[State => Parser[T]].
Values of tasks and settings may be accessed as usual via `value`.
2012-11-17 20:23:07 -05:00
Mark Harrah 79aeb7b00e fix testListeners definition, which mixed old and new styles of definitions, resulting in runtime error
This is an example of the need for an annotation to indicate a method shouldn't survive type checking.
2012-11-17 20:23:07 -05:00
Mark Harrah 522414cd99 AbsTypeTag -> WeakTypeTag and converted more settings 2012-11-17 20:23:06 -05:00
Mark Harrah e47a357ab7 Resolve Scala version for projects in the normal `update` task.
1. Scala jars won't be copied to the boot directory, except for those needed to run sbt.
2. Scala SNAPSHOTs behave like normal SNAPSHOTs.  In particular, running `update` will properly re-resolve the dynamic revision.
3. Scala jars are resolved using the same repositories and configuration as other dependencies.
4. Classloaders (currently, Scala classloaders) are cached by the timestamps of entries instead of Scala class loaders being cached by version.

TODO: Support external dependency configuration
2012-11-17 20:23:06 -05:00
Mark Harrah 4cc5bece70 address a valid unchecked warning
In order to correctly pattern match Tree subclasses in reflection/macros,
scalac needs the corresponding implicit for *Tag available because the types
are only abstract types.
2012-11-17 20:23:06 -05:00
Mark Harrah 2c7e9cd893 Scala 2.10.0-M7 2012-11-17 20:23:06 -05:00
Mark Harrah b453af7c45 Properly apply transformations to dynamic tasks.
That is, implement Initialize[Task[T]].flatten correctly.
This requires preserving the transformations applied in a scope so that
they can be applied to an Initialize value after static settings have been
evaluated.
2012-11-17 20:23:06 -05:00
Mark Harrah 0a642f2283 move explicit task/setting macros to Def, move to AbsTypeTag 2012-11-17 20:23:06 -05:00
Mark Harrah 3790d6656a failing use case 2012-11-17 20:23:06 -05:00
Mark Harrah 90faeff546 Task macro cleanup
* use normal TypeTree constructor
* remove unnecessary 'with Singleton' in macro utility
* integrate changes suggested by @xeno-by
* add refVar back and call asTypeConstructor instead of asType to refer to a type variable
2012-11-17 20:22:39 -05:00
Mark Harrah 1c22478edc task setting macros for :=, +=, ++=
also, bump to 2.10.0-M6
2012-11-17 20:19:24 -05:00
Mark Harrah 2e120ed86f split out InputTask 2012-11-17 20:19:24 -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 eecaeafbdf reorganization of main/
* split several source files
* move base settings sources (Scope, Structure, ...) into main/settings/
* breaks cycles.  In particular, setting system moved from Project to Def
2012-11-17 20:19:24 -05:00
Mark Harrah 87e406fcbd support vals/defs in build.sbt
* must start with val, lazy val, or def (no modifiers currently)
* visible only within the same .sbt file
* multiple definitions allowed without being separated by blank lines
* no blank lines allowed within a definition
2012-11-17 16:27:25 -05:00
Mark Harrah f99ba44703 Control over automatically added settings.
Project.autoSettings accepts a sequence of AddSettings, instances of which
are constructed from methods in AddSettings.  The configurable settings
are per-user settings (from ~/.sbt, for example), settings from .sbt files,
and plugin settings (project-level only).  The order in which these instances
are provided to autoSettings determines the order in which they are appended
to the settings explicitly provided in Project.settings.

For .sbt files, defaultSbtFiles adds the settings from all .sbt files in the
project's base directory as usual.  AddSettings.sbtFiles accepts a sequence
of Files that will be loaded according to the standard .sbt format.  Relative
Files are resolved against the project's base directory.

Plugin settings may be included on a per-Plugin basis by using the plugins
method and passing a Plugin => Boolean.  The settings controlled here are
only the automatic per-project settings.  Per-build and global settings will
always be included.
2012-11-16 09:56:49 -05:00
Eugene Vigdorchik 960d17c358 Use java.lang.Throwable.setStackTrace. Proper fix for #543. 2012-11-15 10:14:59 -05:00
Mark Harrah 1c1e5c4977 taking care of deprecations removed in Scala master 2012-11-14 11:48:06 -05:00
Mark Harrah 9bf5405621 Fixes #594. Global plugin products weren't being included on Compile classpath of build definition project. 2012-11-10 18:18:15 -05:00
Mark Harrah 313bb1f8f2 deprecate Project-level delegation 2012-10-29 12:34:47 -04:00
Mark Harrah e1c3240eae split ForkTests react() out to workaround SI-6526 2012-10-29 12:22:07 -04:00
Mark Harrah e532d20732 cleanup of #585: compatible with earlier launchers 2012-10-29 09:52:10 -04:00
Eric Bowman 835ee0d1b3 XSBT-5: maven-style ivy repo support in the launcher config
Change-Id: I22c1ff126961d61d92e2e45a5b7eff329d3def90
Reviewed-on: https://gerrit.gilt.com/10950
Reviewed-by: Eric Bowman <ebowman@gilt.com>
Tested-by: Eric Bowman <ebowman@gilt.com>
2012-10-29 09:04:42 -04:00
Mark Harrah 1612af8dbb Parser.failOnException method, don't let rhs of alias fail the parse. Fixes #572.
alias only parses the right hand side for tab completion help.
The assignment should happen whether or not the parse is successful because the
context may change by the time the alias is actually evaluated.
In particular, the 'set' command uses the loaded project for tab completion in 0.12.1.
When a .sbtrc file is processed, the project has not been loaded yet, so aliases
involving set fail.  Wrapping the rhs in failOnException addresses this.
2012-10-15 12:42:27 -04:00
Mark Harrah a2c2af8b08 add [every] to syntax summary of 'set' command 2012-09-22 16:45:24 -04:00
Kevin Scaldeferri 933d5fb0fe Include all JAR packaging types in the default classpathTypes. Fixes #550
These special types need to be recognized in both the POM parser and added to the classpath.
The previous code was not DRY, and eclipse-plugin was in one but not the other.  This ensures
new types can be added in the future without risking this type of oversight.
2012-09-21 16:56:56 -04:00
Mark Harrah b353d0b94c better internal interfaces to javadoc/scaladoc/raw scalac 2012-09-18 16:30:33 -04:00
Mark Harrah 37661c9576 Strip explicitArtifacts from projectDependencies. Fixes #546.
The module definition (ModuleID) got copied as to be the dependency definition,
but as a dependency definition, it should not include explicit artifacts.
2012-09-12 14:31:57 -04:00
Mark Harrah 2010ae7b3c back all ConsoleLoggers by a common ConsoleOut
The common ConsoleOut merges (overwrites) consecutive Resolving xxxx ... lines
when ansi codes are enabled.
2012-09-01 09:56:09 -04:00
James Roper a3e9b53fe5 Pulled mapper folding into a function for reuse 2012-08-31 06:24:16 -04:00
James Roper 702ee44e0e Source position mapper support 2012-08-31 06:24:16 -04:00
Mark Harrah ed902ea565 Proper isolation of build definition classes. Fixes #536, #511. 2012-08-30 16:37:56 -04:00
Mark Harrah 9d39b5d9e1 Add valid project IDs to 'No project <x> in <uri>' error message 2012-08-30 16:37:56 -04:00
Mark Harrah 3dd3a18996 Force update on change to last modified time of artifacts or cached descriptor.
This is part 2 of the fix for #532.  It may also fix issues when working with
multiple local projects via 'publish-local' and binary dependencies.
2012-08-29 11:13:48 -04:00
Mark Harrah c7f6ce4aec per-project resolution cache that deletes cached files before each update
These are the ivy files, properties, and resolve reports for the project,
not dependencies and their artifacts.
2012-08-28 11:55:24 -04:00
Mark Harrah cbaa805511 clean up temporary directory on exit. ref #502
Directory was already empty, this just removes the empty directory.
2012-08-27 09:14:00 -04:00
Mark Harrah feffe4feb0 toStrings for some concurrent restrictions 2012-08-27 08:33:33 -04:00
Eugene Vigdorchik b4e64d37db Various fork in Test fixes. Closes #512 #515. 2012-08-25 07:15:23 -04:00
Eugene Vigdorchik adb7d42f73 Fix compilation error for 2.10.0-M5 for all but main project. 2012-07-17 15:20:37 -04:00
Mark Harrah 59c025a767 run either javadoc (Java sources only) or scaladoc (Scala only or mixed), but not both 2012-07-17 13:51:17 -04:00
Mark Harrah cbc94f9cb6 experimental tab completion for 'set' 2012-07-13 14:33:28 -04:00
Mark Harrah 2a6ad35502 correct CommandUtil.aligned to use provided prefix 2012-07-13 14:33:27 -04:00
Mark Harrah 2cf9b4bf6e combined cutoff for settings and tasks 2012-07-13 14:33:27 -04:00
Mark Harrah d6d922a858 display message after 'set' with defined and affected scopes+keys 2012-07-13 14:33:27 -04:00
Mark Harrah ad621ecbee update help for `inspect` to include latest options 2012-07-13 14:33:26 -04:00
Eugene Vigdorchik 76943e82ed Add xsbti.Reporter to required inputs instead of maxErrors. 2012-07-13 14:33:26 -04:00
Eugene Vigdorchik b5a29987e6 Changes required to use sbt as-is from Scala-IDE. 2012-07-13 14:33:26 -04:00
Indrajit Raychaudhuri 82a338b3a8 Add OSX JNI library extension in includeFilter by default. Closes #500 2012-07-08 00:38:25 -04:00
Mark Harrah 5a93605d75 'orbit' packaging should be handled like a standard jar. fixes #499. ref #463 2012-07-06 10:28:51 -04:00
Mark Harrah 364d49d4b4 Translate `show x y` into `;show x ;show y` . fixes #495 2012-07-06 10:28:51 -04:00
Mark Harrah 464193d0f6 sourcesInBase setting. fixes #494 2012-07-06 10:28:51 -04:00
Mark Harrah 3d0eb1ac11 better fix for tab completion on invalid project IDs 2012-07-01 15:16:42 -04:00
Josh Suereth 171ff5f808 Fix override repositories flag so we can still resolve inter-project dependencies. 2012-06-25 18:48:06 -04:00
Mark Harrah dc2aaaf7ac show full stack trace by default when running in batch mode 2012-06-22 22:11:24 -04:00
Mark Harrah 8908d0e93b attempt at better error message for linkage errors in plugins. fixes #483
Only catches linkage errors during static initialization of the plugin module,
but these are likely to be the most common.
2012-06-16 23:40:52 -04:00
Mark Harrah bfe78f174c fix makePom delegation 2012-06-16 23:40:52 -04:00
Mark Harrah 47bef51491 tweak command list for help ordering 2012-06-15 07:57:47 -04:00
Mark Harrah 0578a49e43 make publishArtifact setting for makePom affected by more general setting. fixes #484. 2012-06-15 07:54:02 -04:00
xuwei-k 3d450059ae delete pluginDir.exists 2012-06-12 07:15:31 -04:00
kenji yoshida 139e52073e should not load in old plugins style if it is not directory 2012-06-12 07:15:31 -04:00
Mark Harrah ba55430727 update session settings display for multi-line changes 2012-06-02 20:54:45 -04:00
Eugene Vigdorchik d7f7a243e5 Handle the case of missing ~/.sbt/staging directory when asking for a source project dependency. 2012-06-02 19:03:38 -04:00
Mark Harrah e37145137f Revert "use the same logic for selecting extra attributes in addSbtPlugin as in pluginProjectId"
Doesn't compile.

This reverts commit 8f14df1930.
2012-05-30 21:48:06 -04:00
Josh Suereth 76d24091fa Fixes from mark's suggestions.
* Puppies may rest easy from the removal of Option.get calls.
* better names for config values
* Added a helper method to avoid any possible code duplication, besides repeated def, val, match and for keywords.
  Looking for ways to remove this duplciation ASAP.
* Moved from pattern match to ._1, my most hated member.
2012-05-30 21:42:45 -04:00
Josh Suereth 52307d27a4 Adding ability to override resolvers from launcher. * Added key which pulls the repositories used by the launcher, if the API allows. * Added which configures whether or not should just use . * Added parsing to launcher so java property is used by default for override setting. 2012-05-30 21:42:45 -04:00
Johannes Rudolph 8f14df1930 use the same logic for selecting extra attributes in addSbtPlugin as in pluginProjectId
This enables us to use the same plugins.sbt in projects for release and
pre-release versions of sbt.
2012-05-30 20:02:30 -04:00
Mark Harrah be3d565284 global plugin settings. ref #378 2012-05-30 20:02:24 -04:00
Mark Harrah e8fcdc07e8 set organization at higher scope for default project 2012-05-27 20:03:08 -04:00
Mark Harrah cf2402cea4 another fix related to #460 2012-05-23 20:13:52 -04:00
Mark Harrah 9cf2c41fb8 fix exception thrown when tab completing invalid project name 2012-05-21 22:23:44 -04:00
Mark Harrah a099754109 if defined, use explicit historyPath at ThisBuild or Global project scope 2012-05-21 22:23:44 -04:00
Mark Harrah 4b724e1102 inline tasks, for internal use later 2012-05-19 18:20:20 -04:00
Mark Harrah 5ff33fad3e Second try at printing message when stack trace suppressed.
Problems:

  1. Without a message, users don't find 'last'
  2. Showing a message for every error clutters output.

This tries to address these issues by:

1. Only showing the message when other feedback has not been provided and
   'last' would not usually be helpful.  This will require ongoing tweaking.
   For now, all commands except 'compile' display the message.  'update' could
   omit the message as well, but perhaps knowing about 'last' might be
   useful there.

2. Including the exact command to show the output:
    last test:compile
   and not just
    last <task>

3. Highlighting the command in blue for visibility as an experiment.

Review by @ijuma and @retronym, please.
2012-05-19 18:20:19 -04:00
Mark Harrah f4c0a0d9a6 display relative key strings for incomplete tasks 2012-05-19 18:20:19 -04:00
Mark Harrah 53ee1c5adf hk2-jar packaging should be handled like a standard jar. fixes #463 2012-05-16 07:34:15 -04:00
Eugene Vigdorchik c795511e13 Only allow a single task to run at any point in time if parallelExecution in Test is false. 2012-05-12 10:15:59 -04:00
Eugene Vigdorchik 6f03b83446 Remove unneeded map argument. 2012-05-12 10:15:49 -04:00
Eugene Vigdorchik 04d53c05d5 Modify forking tests based on Stefan's feedback. Should be ported to 0.12 2012-05-09 20:07:47 -04:00
Gerolf Seitz cddbb8dd12 Add method Aggregation.runTasksWithResult 2012-05-07 19:09:11 -04:00
Mark Harrah 13e62fd645 Use binary version for cross-version even for snapshots and milestones
Rely instead on users not publishing the same stable version against both
 stable Scala or sbt releases and snapshots/milestones.
2012-05-05 20:35:05 -04:00