Commit Graph

108 Commits

Author SHA1 Message Date
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 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
eugene yokota 96558930c3 Merge pull request #1226 from sbt/wip/bump-to-latest-ivy
Bump to our own release of ivy 2.4.x
2014-04-10 10:15:26 -07:00
eugene yokota 46598ea575 Merge pull request #1232 from sbt/wip/fix-1156
Ensure that if artifact is published, we overwrite default checksums.
2014-04-07 08:36:16 -07:00
Eugene Yokota d8ee16c600 Roll back sbt/sbt@482f99 (aggressive deletion of cache). Fixes #1091.
* sbt 0.12.3 introduced sbt/sbt@482f99 to fix #637 and #641.
* The underlying issue of #641 was an incorrect classifier, and it was
  fixed in sbt/sbt@718fa9 for #683 and shipped as sbt 0.13.0.
2014-04-05 01:53:31 -07:00
Josh Suereth e8dd19cb92 Remove JDK7 features from Resolver shim. 2014-04-04 20:25:37 -04:00
Josh Suereth 60a457d083 Ensure that if artifact is published, we overwrite default checksums.
Fixes # 1233

* Add a new "shim" for RepositoryResolvers that modifies the "put"
  method so that it will ignore the overwrite flag for checksums.
2014-04-04 17:19:56 -04:00
Josh Suereth 6e72324b88 Bump to our own nightly of ivy 2.4.0 (RC1+).
* Testing the infrastructure to use our own instance of ivy
* Allow us to push bug-fixes/performance directly into ivy
  on our own pace, as we submit patches back to ivy master
2014-03-29 13:06:27 -04:00
Eugene Yokota f58fbb8d7d CustomPomParser compatibility with 0.13.1. #1191 #1192 2014-03-21 23:53:06 -04:00
Dan Sanduleac 6588ac1b62 sbtTransformHash -> e:sbtTransformHash 2014-03-19 11:08:17 +00:00
Josh Suereth 875562f3db Don't fail publishing on overwrite, but issue a warning.
Workaround for #1156.

* Creates a new FileRepository that will stil allow local files
  to be transfered if overwrite is true (non-snapshot module),
  but will issue a warning about deprecated behavior.
* Ensure warning is long enough to annoy people into asking
  what it's about.
2014-03-08 14:08:25 -05:00
Josh Suereth f06948a4af Merge pull request #1145 from sbt/wip/issue-1136
Fix #1136 - Ivy's + dependency ranges not converted appropriately to maven.
2014-03-07 17:22:29 -05:00
Josh Suereth 5486daf700 Pull in @cunei's suggestion for a more complete Ivy->Maven dynamic revision convertor.
We attempt to convert these constructs to maven:
   * 1.+
   * ]1,2]
   * [2,3[
   * 1+  - Albeit this one is a heuristic for accuracy.

This should help ivy users which prefer the nicer 1.2.+ syntax.

Also adds tests/improves exisitng tests.
2014-03-05 19:14:21 -05:00
Josh Suereth 21da87c4e7 Fixes #429 - Add better error messages when credentials are not found.
* Create hackery to inspect registered credentials in the IvyCredentialStore.
* Create a new authenticator which inserts itself *after* the ivy authenticator.
  - Will issue an error message detailing host/realm required if credentials are
    not found.
  - Also lists out configured Realms with a 'is misspelled' message.
  - Ignores proxy-related authentication errors, for now.
2014-03-04 11:36:34 -05:00
Josh Suereth 8cd44646b7 Fix #1136 - Ivy's `+` dependencies not converted to maven style syntax.
* Attempt to convert dependencies that end in `+` into maven-style version range
* if a failure occurs, just use the original version (could be bad...).
2014-03-03 12:10:37 -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
William Benton 3a1ad44c45 Support Ivy 2.3.0-final.
This entailed modifying ResolutionCache and the CustomPomParser
to reflect changes to the ResolutionCacheManager interface and
DefaultExtendsDescriptor class between Ivy 2.3.0-rc1 and
2.3.0-rc2. Specifically,

1. ResolutionCacheManager now includes two additional methods
that needed implementations in ResolutionCache:
getResolvedModuleDescriptor(mrid: ModuleRevisionId) and
saveResolvedModuleDescriptor(md: ModuleDescriptor). I adapted
the implementations for these (which are expressed primarily in
terms of other interface methods) from Ivy 2.3.0's
DefaultResolutionCacheManager.

2. Instead of taking a ModuleRevisionIdentifier and a resolved
ModuleRevisionIdentifier as its first two arguments, the
DefaultExtendsDescriptor constructor now takes a
ModuleDescriptor. This was a trivial change.

Note that ResolutionCache.getResolvedModuleDescriptor does not
appear to be used by Ivy as sbt uses Ivy and there is thus no
test coverage for its implementation. Also note that the
DefaultResolutionCacheManager object created in
Update.configureResolutionCache now requires a reference to an
IvySettings object; DRCM expects this to be non-null.
2013-12-13 14:24:37 -06:00
Mark Harrah 57306e6257 Better representation of no cross-version suffix in suffix conflict error message. 2013-10-23 09:46:43 -04:00
Mark Harrah 0cd8849ec1 Work around various issues with Maven local repositories. Fixes #321.
* when mvn does a local 'install', it doesn't update the pom.xml last modified time if the pom.xml content hasn't changed
* an ivy.xml includes publicationDate, so an ivy.xml will always be touched even if the other content hasn't changed
* when Ivy checks if a snapshot is uptodate
  + it sees a SNAPSHOT, so it knows the module metadata and artifacts might change
  + it then checks the lastModified time of the metadata
  + if unchanged, it uses the cached information
  + if useOrigin is effectively false (either it is explicitly false or a resource is remote/isLocal=false),
    this means that a new artifact won't be retrieved
* the Ivy IBiblioResolver
  + must be used for Maven repositories for proper behavior (no FileResolver, for example)
  + only returns URLResources, even for file: URLs
  + a FileResource is needed in combination with useOrigin to avoid copying artifacts from .m2/repository/

This commit fixes the above by setting a custom URLRepository on a constructed IBiblioResolver.
This URLRepository returns FileResources for file: URLs and standard URLResources for others.
The returned FileResource has isLocal=true and sbt sets useOrigin=true by default, so the artifacts
are used from the origin.

If it turns out a similar situation happens when mvn publishes to remote repositories, it is likely the fix for
that would be to figure out how to disable the lastModified check on the metadata and always download the metadata.
This would be slower, however.
2013-10-10 21:36:11 -04:00
Mark Harrah 77ed899a96 'makePom' should not generate <type> elements for standard classifiers. Fixes #728.
The <type> element was generated for any explicit Artifact with a type other than "jar".
withSources() and withJavadoc() create explicit Artifacts of this kind, but shouldn't
have <type> elements.  They are primarily artifacts with classifiers- the type is an
Ivy aspect.  So, when writing to a pom, don't use write a type for known classifiers.
2013-10-02 19:39:17 -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
Mark Harrah 8ff424711c parse external pom.xml with CustomPomParser to handle multiple definitions.
Fixes #758.  This is the same issue fixed by 74c07c64a7
but in this case the cause was the top-level pom.xml, which didn't go through CustomPomParser.
2013-09-16 11:58:13 -04:00
Mark Harrah 6a293c4efe don't transform a module descriptor after it has already been processed by this sbt version. Ref #876. 2013-09-13 23:19:06 -04:00
Mark Harrah 31f6f9905d do custom pom processing when reading from cache, fixes #876 2013-09-13 23:18:13 -04:00
Mark Harrah d279f2ed76 Move some logic in custom pom parser to separate methods 2013-09-13 16:37:22 -04:00
William Benton c6cee694ab Add factory methods to PatternsBasedRepository
This commit adds convenience methods to PatternsBasedRepository that
produce a copy of the repository with metadata optional or with
consistency checking disabled.
2013-08-26 14:06:21 -04:00