Commit Graph

1251 Commits

Author SHA1 Message Date
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