Fix unknown host exception in junit xml listener.

Fixes #1506
Adds a test case that exercises the multiple-repository -SNAPSHOT issue. #1514

* Create a project "common" which publishes a "bad" artifact.
* Resolve project "dependent" which resolves the "bad" artifact into the cache.
* Publish a new "common" snapshot to a diffferent repository (publishLocal)
* Attempt to build the new project, leading to issues.
Minimizing scripted repro
Fixes #1514, #321. Fixes -SNAPSHOT issue by re-implemeting ChainResolver.

Adds `lastestSnapshots` flag to `updateOptions`, which controls the behavior of the chained resolver. Up until 0.13.6, sbt was picking the first `-SNAPSHOT` revision it found along the chain. When  is enabled (default: ), it will look into all resolvers on the chain, and compare them using the publish date.
The tradeoff is probably a longer resolution time if you have many remote repositories on the build or you live away from the severs. So here's how to disable it:

    updateOptions := updateOptions.value.withLatestSnapshots(false)

Ivy by default uses latest-revision as the latest strategy. This strategy I don't think takes in account for the possibility that a changing revision may exist in multiple repositories/resolvers with having identical version number like 0.1.0-SNAPSHOT.
The implementation is a bit hacky, but I think it attacks the core of this problem.
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.
Added notes so we have a merge conflict for @eed3si9n to deal with.
So apparently scalariform was unable to parse these files.
Remove printlns.
Special treatment for a special resolver: inter-project
Fixes flaky no-such-element exception from bad generation of random tests.
Ok, this is actually the flaky issue with the test.

We use the ch key for testing, so it can't be part of the autogenerated set.
Using iterators
Merge pull request #1520 from sbt/fix/1514

Fixes #1514, #321. Fixes -SNAPSHOT issue by re-implemeting ChainResolver
Merge pull request #1516 from sbt/wip/fix-1455

Allow root plugins to be disabled.
Merge pull request #1521 from sbt/wip/fix-flaky-settings-test

Fixes flaky no-such-element exception from bad generation of random test...
Merge pull request #1512 from sbt/wip/fix-1506

Fix unknown host exception in junit xml listener.
Set currentRun and currentUnit in Eval

First of all, we revert changes to Eval made in
a9cdd96152e08a1fb21e815eabe8fd1d27ef9b97. 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
Merge pull request #1531 from gkossakowski/positions-crash

Set currentRun and currentUnit in Eval
Ensure random file hash for .sbt DSL doesn't conflict across .sbt files.

Fixes #1465
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.