Commit Graph

333 Commits

Author SHA1 Message Date
Josh Suereth dbf69b11cd Split out inter-project resolver into its own Chain.
Fixes #1565

* Create two chains if we have inter-project resolver
  - One which ensures inter-project deps are always taken
  - One which will look in all "other" repositories for
    dependencies and will use the "most up-to-date" -SNAPSHOT
    strategy.
* No additional tests, as this would simple break every
  multi-project test if it were wrong.
2014-09-05 10:40:49 -04:00
Eugene Yokota 7e0c76f5a6 Merge branch '0.13' into 0.13.6 2014-08-24 18:24:37 -04:00
Josh Suereth 260d67f288 Merge pull request #1537 from sbt/fix/1275
Improves pom dynamic revision conversion
2014-08-24 18:19:02 -04:00
Eugene Yokota a5a44a88c2 #1541. Use HTTPS for sbt plugin repository 2014-08-24 16:37:24 -04:00
Eugene Yokota 2904bdcb32 #1541. Use HTTPS for Typesafe repository 2014-08-23 17:47:48 -04:00
Eugene Yokota 9b42a1899d Fixes #1549. Use HTTPS for Java.net Maven 2 repository 2014-08-23 17:47:48 -04:00
Eugene Yokota 1e180cc030 Deprecate JavaNet1Repository. #1541
I don’t think there’s an alternative for java.net Maven 1 repository.
2014-08-23 17:47:47 -04:00
Eugene Yokota f99c5817f5 Based on Ivy's behavior, bringing back approximation
I assumed 1.1+ should be treated as 1.+, but it seems like Ivy treats
it more as “any version that starts with 1.1” including 1.10.
Josh’s original implementation approximates this by making ranges for
multiple digits, 1.1~1.2, 1.10~1.20, etc.
2014-08-22 03:54:32 -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 8c90e7eb74 Fixes #1201. Display instruction to overrideScalaVersion
scala-library is currently treated as just one of the library modules.
This means that it’s at the mercy of eviction if some other library
uses newer version of scala-library.
This commit displays a instruction on how to force scalaVersion if
warnScalaVersionEviction flag is true on EvictionWarningOptions.
2014-08-18 00:54:19 -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 b812cdc916 Fixes #1275. Fixes pom dynamic revision conversion
Ivy and pom uses slightly different notation for version range and
dynamic revision.
This change fixes the dynamic revisions involving “+”.
First, when a revision like “1.1+” is found, it will now be treated as
“1.+”.
Next, when it finds a revision like “1+” is found, it will be treated
as “+”.
The conversion of “+” is hardcoded to be “[0,)”.
2014-08-16 22:38:35 -04:00
Eugene Yokota e1d60b6de0 Fixes #1484. Fixes another variant of update NPE
Ivy gives an array that contains null for caller configurations.
sbinary barfs when it sees null. Curiously two of the sbt plugins that
hit this bug happens to be from Typesafe:
    addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.2")
    addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager"  % "0.7.3")
2014-08-15 02:57:17 -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 58175e28c1 Merge pull request #1520 from sbt/fix/1514
Fixes #1514, #321. Fixes -SNAPSHOT issue by re-implemeting ChainResolver
2014-08-12 10:04:10 -04:00
Eugene Yokota d11427dd85 Using iterators 2014-08-11 22:49:48 -04:00
Eugene Yokota 01c95b5d62 Special treatment for a special resolver: inter-project 2014-08-11 12:45:14 -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
Eugene Yokota 286d567781 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.
2014-08-10 18:56:58 -04:00
Roberto Tyley d46087ff08 Fix pom-export of Maven Central repository
Commit a1e26ca6 broke the `make-pom` & `pom-advanced` dependency-management
tests by replacing one reference to `IBiblioResolver.DEFAULT_M2_ROOT` in
`Resolver`, but not the other reference in `MakePom`:

https://travis-ci.org/sbt/sbt/jobs/31939788#L2517-L2519

...the secure url was no longer recognised as the default Maven Repository
root, so was erroneously exported.
2014-08-08 17:08:54 -04:00
Eugene Yokota f3d71f98e4 Adds sbt.repository.secure (default: true) #1494 2014-08-08 17:08:54 -04:00
Roberto Tyley a826ac743b Use HTTPS for downloading artifacts from Maven Central
Sonatype have enabled HTTPS access for Maven Central:

http://central.sonatype.org/articles/2014/Aug/03/https-support-launching-now/

Note that the Ivy class IBiblioResolver contains the old http url
(ie DEFAULT_M2_ROOT="http://repo1.maven.org/maven2/"):

http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java?revision=1557968&view=markup#l72
2014-08-08 17:07:44 -04:00
Eugene Yokota 840acba087 Adds `dependencyPositions` task to explicitly track dependency positions. 2014-08-08 00:53:09 -04:00
Eugene Yokota d7dba9c095 Moves JCenter and Bintray repo into object Resolver. #1405
This is more consistent with other hardcoded repos like Sonatype.
Also hardcoding everything to https.
2014-08-07 15:50:57 -04:00
Evgeny Goldin 75b815e125 JCenter and BintrayMavenRepository resolvers added 2014-08-06 01:43:19 +02: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
Eugene Yokota f77b6b2b03 scalariform formatting 2014-07-29 22:03:02 -04:00
Eugene Yokota d6dbbaaf2e Improve doc on ModuleDetailReport per @jsuereth 2014-07-28 13:25:54 -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 3e3d7651f8 pseudo-case class VersionNumber
VersionNumber is a pseudo-case class that represents any form of
version number. The unapply extractor can parse String into
three sequences that makes up VersionNumber.
VersionNumberCompatibility trait uses two VersionNumber instances
to evaluate binary compatibility between them.
Two implementations SemVer and SecondSegment are provided.
2014-07-27 12:14:30 -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 ae13cd8412 Improves unresolved dependencies error by displaying the deps nodes. fixes #1422, #381 2014-07-10 17:49:52 -04:00
Josh Suereth fd32070aab Merge pull request #1400 from dpratt/0.13
Add 'scala-jar' to the list of jar artifacts.
2014-07-03 11:57:12 -04:00
Jacek Laskowski ebbb77e200 Typo fixes + removing unnecessary semicolons 2014-06-25 00:08:25 +02:00
David Pratt 0bb9be34df Make jar artifact a 0-byte file. 2014-06-09 13:54:20 -05:00
David Pratt 2ceb4f7d72 Add a unit test for the 'scala-jar' mapping. 2014-06-07 20:58:31 -05:00
David Pratt 0ac485feb7 Add 'scala-jar' to the list of jar artifacts.
The CustomPomParser has a hard-coded list of 'blessed' Maven POM packaging types
that are actually packaged as jar files, but Ivy incorrectly maps the file extension.
This patch allows artifacts published with the 'scala-jar' packaging to be properly
resolved and used in an SBT project.
2014-06-05 18:11:37 -05:00
Josh Suereth 4c2d88649e Fix formatting issues and bump to sbt 0.13.5 2014-05-28 09:12:55 -04:00
Josh Suereth 89091ca4fc Merge remote-tracking branch 'origin/0.13.5' into wip/fix-doc-generation
Conflicts:
	project/Sbt.scala
2014-05-28 09:09:51 -04:00
Josh Suereth b69a273f37 Fix import issues to generate sxr/scaladoc. 2014-05-28 08:55: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
Josh Suereth 244abd3b6f Scalariforming test code 2014-05-07 11:52:23 -04:00
Eugene Yokota adb41611cf added scalariform 2014-05-01 12:50:07 -04:00
Antonio Cunei 350619545d Do not attempt to publish if no artifacts are present
Ivy transactional publishing will abort if no artifacts
are published, either because the temporary directory is
not being created, or because Ivy will detect an anomalous
condition.

Therefore, skip publishing altogether if there is
nothing to publish to begin with.
2014-04-30 17:40:58 +02:00