sbt/sbt — pull request #1016 by dansanduleac (2013-11-29 10:58:06+00:00)
Title: Handle source, docs artifacts correctly for Ivy

Following our discussion at #1004, I've decided to handle the retrieval of source/docs artifacts by their artifact types.
The steps I took are:
* Completely removed the Sources and Docs configurations. They were unused, incorrect with respect to what Ivy considers a configuration to be, and possibly (at least in my case) a source of confusion (should I use this? can I scope settings under it?)
* Therefore sbt now publishes these src/doc artifacts under `runtime`. Why runtime? No reason specifically, and it might change, but for now it seemed like a sensible default.
* Introduce the SettingKeys `sourceArtifactTypes` and `docArtifactTypes`: Sets which contain the artifact types that would qualify them as either source or doc artifacts.
* Introduce a slightly improved (compared to the Ivy version) `ArtifactTypeFilter` which lets you apply the filter normally or inversed.
* Use this filter in the `update` task (specifically, I added it to `UpdateConfiguration`) to allow "all artifact types except those found in either `sourceArtifactTypes` or`docArtifactTypes`"
* In `updateClassifiers` / `updateSbtClassifiers`, invert the filter from the `UpdateConfiguration`: it will therefore only let through sources and docs
* Pass this artifact filter from the `UpdateConfiguration` to `IvyActions.update` and from there to the Ivy ResolveOptions in `IvyActions.resolve`
* Change `updateClassifiers` to not filter out dependencies whose classifiers were deemed "not found" and thus excluded - they might still contain src/doc artifacts published in their ivys
* Added an include-all include filter to all the `ModuleID`s (and thus the `DependencyDescriptors` they convert to) that will allow Ivy to merge the explicitly given artifacts (where classifier=sources or javadoc) with the publications from the `ModuleDescriptor` (i.e. the artifacts published in an ivy)
* After finishing the update in `updateClassifiers`, map over all artifacts to set their classifier to either sources or javadoc, if it's not already set, according to a reverse mapping from the types in `(source|doc)ArtifactTypes` to "source" and "javadoc" respectively (well, `Artifact.SourceClassifier` and `Artifact.DocClassifier`, to be precise)