Commit Graph

281 Commits

Author SHA1 Message Date
Shani Elharrar db2a871391 Print: use roots when rendering reverse graph (#808)
* Print: use roots when rendering reverse graph

* Print: Refactored to be able to return Tree data structure

* SBT: Refactored code and added coursierWhatDependsOn Task (?)

* SBT: Added tests to the new coursierWhatDependsOn task

* Tasks: Another try to fix the build

* Tree: Restored Apply[A] for binary compatibility

* Print.scala: Fix the build

* sbt-coursier: Refined what depends on check to check correctness

* PrintTests: Added test for reverseTree

* CR Fixes...

1. changed gotVersion to reconciledVersion
2. Moved AppliedTree to tests project
3. Changed message (wanted version, got version) to X -> Y
2018-03-18 23:45:11 +01:00
Alexandre Archambault 5bd162d5fe Tweak scalac options 2018-03-12 21:50:35 +01:00
Alexandre Archambault 29f8d7b680 Remove scalaz dependency from core and cache, add scalaz-interop module 2018-03-12 21:50:35 +01:00
Yi Cheng a7605ff900
Retry on ChecksumError (#797)
Fix for #780
2018-03-10 12:57:47 -08:00
Nick Howard d0b46864c8 json-report: one file per dependency instead of multiple; use m2 coords (#782)
When classifiers are used as part of dependency specifications, it's important to be able to select just the classified artifact. Unfortunately, in the current json, dependencies don't specify classifiers, so it isn't possible to just get one of the artifacts for a dependency when a classifier is required.

This patch introduces maven style artifact prefixes in order to include classifier and packaging information in the coordinates. By doing that, we can use them as keys in dependency lists more easily and it allows consumers of the json to treat those dependency keys as mostly opaque ids rather than having to parse them.

Addresses #743
2018-03-09 14:47:27 -08:00
Alexandre Archambault 838a340b89 Remove deprecated stuff 2018-03-03 14:57:14 +01:00
Alexandre Archambault c037dbaeeb Add coursier.util.Gather 2018-03-03 14:55:46 +01:00
Alexandre Archambault 5e1eeef757 Add coursier.util.Monad 2018-03-03 14:55:46 +01:00
Alexandre Archambault a83df3e1c8 Add coursier.util.ValidationNel 2018-03-03 14:55:46 +01:00
Alexandre Archambault dc87950dc4 Remove some uses of scalaz.Scalaz.*Ops 2018-03-03 14:55:46 +01:00
Yi Cheng 015e906481
Remove deprecation prior to 1.1.0-SNAPSHOT and clarify versioning and deprecation strategy (#800)
Version was bumped to 1.1.0-SNAPSHOT and backward compatiliby was removed for up to 1.0.2 at 0123a37, so it should be safe to remove all the deprecations.
2018-03-02 11:39:44 -08:00
Alexandre Archambault 1816b25b84 Stop using scalaz.{EitherT, \/}
Use scala.Either instead of \/

Use the custom coursier.util.EitherT instead of scalaz.EitherT
2018-02-22 18:20:34 +01:00
Dorothy Ordogh 3e4a65d5ee Add ability to fetch artifact with a given url (#774)
* changes

* changes to Attributes

* make changes

* add test and fix bug

* add more tests

* fix failing tests

* fix parentheses

* remove comments I added and add test that's guarenteed not to exist in a repo

* remove Attributes third parameter and refactor Parse's moduleVersionConfig to return a tuple of Dependency and a Map of String to String representing extra parameters for the dependency

* update some return types and methods in the Helper class

* return FallbackDependenciesRepository back to original state

* refactor helper

* remove url from attributes

* fix tests and add cache to extra in build.sbt

* remove FallbackDepsRepo from sbt-coursier

* add variable for url and call encode in tests

* update tests and helper to have proper behavior

* remove setting deps to intransitive when url is present and add two tests

* add more tests, implement @wisechengyi's comments

* fix nits

* update ParseTests because some failed

* fix tests

* incorporate feedback from @alexarchambault and @wisechengyi

* update ParseTests to check for returned error vs thrown error

* remove one test that is covered in ParseTests

* fix nits

* add back deleted brackets

* return errors in Left without using return statement

* revert change because it's broken

* fix some positional things

* add return statement or else error won't be processed

* fix nits. thanks @wisechengyi

* Remove return statements
2018-02-22 18:06:06 +01:00
Yi Cheng 849d128b90 Specify classifier on module level on CLI (#735) 2018-01-29 21:02:49 +01:00
Yi Cheng a4258f48ce
Add json report to fetch and local exclusion option (#692)
This patch introduces changes for cli with json output #659. Format as follows:
```
{
  "conflict_resolution": {
    "org:name:version" (requested): "org:name:version" (reconciled) 
  },
  "dependencies": [
    {
      "coord": "orgA:nameA:versionA",
      "files": [
        [
          <classifier>,
          <path>
        ]
      ],
      "dependencies": [ // coodinates for its transitive dependencies
        <orgX:nameX:versionX>,
        <orgY:nameY:versionY>,
      ]
    },
    {
      "coord": "orgB:nameB:versionB",
      "files": [
        [
          <classifier>,
          <path>
        ]
      ],
      "dependencies": [ // coodinates for its transitive dependencies
        <orgX:nameX:versionX>,
        <orgZ:nameZ:versionZ>,
      ]
    },
  ]
}
```
For example:
```
fetch -t org.apache.avro:trevni-avro:1.8.2  org.slf4j:slf4j-api:1.7.6 --json-output-file x.out
  Result:
├─ org.apache.avro:trevni-avro:1.8.2
│  ├─ org.apache.avro:trevni-core:1.8.2
│  │  ├─ org.apache.commons:commons-compress:1.8.1
│  │  ├─ org.slf4j:slf4j-api:1.7.7
│  │  └─ org.xerial.snappy:snappy-java:1.1.1.3
│  └─ org.slf4j:slf4j-api:1.7.7
└─ org.slf4j:slf4j-api:1.7.6 -> 1.7.7
```
would produce the following json file:
```
$ jq < x.out 
{
  "conflict_resolution": {
    "org.slf4j:slf4j-api:1.7.6": "org.slf4j:slf4j-api:1.7.7"
  },
  "dependencies": [
    {
      "coord": "org.apache.avro:trevni-core:1.8.2",
      "files": [
        [
          "",
          "/Users/yic/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/avro/trevni-core/1.8.2/trevni-core-1.8.2.jar"
        ]
      ],
      "dependencies": [
        "org.slf4j:slf4j-api:1.7.7",
        "org.xerial.snappy:snappy-java:1.1.1.3",
        "org.apache.commons:commons-compress:1.8.1"
      ]
    },
    {
      "coord": "org.apache.avro:trevni-avro:1.8.2",
      "files": [
        [
          "",
          "/Users/yic/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/avro/trevni-avro/1.8.2/trevni-avro-1.8.2.jar"
        ]
      ],
      "dependencies": [
        "org.apache.avro:trevni-core:1.8.2",
        "org.slf4j:slf4j-api:1.7.7",
        "org.xerial.snappy:snappy-java:1.1.1.3",
        "org.apache.commons:commons-compress:1.8.1"
      ]
    },
    {
      "coord": "org.slf4j:slf4j-api:1.7.7",
      "files": [
        [
          "",
          "/Users/yic/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.jar"
        ]
      ],
      "dependencies": []
    },
    {
      "coord": "org.apache.commons:commons-compress:1.8.1",
      "files": [
        [
          "",
          "/Users/yic/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar"
        ]
      ],
      "dependencies": []
    },
    {
      "coord": "org.xerial.snappy:snappy-java:1.1.1.3",
      "files": [
        [
          "",
          "/Users/yic/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/xerial/snappy/snappy-java/1.1.1.3/snappy-java-1.1.1.3.jar"
        ]
      ],
      "dependencies": []
    }
  ]
}

```
2017-12-26 10:46:35 -08:00
Yi Cheng 1296459de3 Add Pants build tool (#709) 2017-12-11 17:50:04 +01:00
Alexandre Archambault 03f7cbb42d More careful handling of extenstion / type with snapshot versioning 2017-12-04 13:39:40 +01:00
Alexandre Archambault 389375da5d Fix divergence when parsing versions
Those starting with neither a letter, nor a digit, nor a known separator
2017-11-30 13:03:17 +01:00
Alexandre Archambault 7ac3038d2e Switch to scala 2.12.4 2017-11-01 16:20:47 +01:00
Yi Cheng 07e985bffc Fix cli print out completeness and cyclic handling issue (#671)
* simplify

* doc

* rename

* char

* more tests

* add tests then fix bugs

* Small tweak to avoid quadratic calculation
2017-10-20 00:54:58 +02:00
Alexandre Archambault 964151392b Allow exclusions to have no explicit artifact ID in POM 2017-09-04 02:01:36 +02:00
Gabor Aranyossy dd3e8be410 introducing sha-256 checksum support (#625)
introducing sha-256 checksum support
2017-08-04 16:23:22 +02:00
Alexandre Archambault 9dfed94053 Add short syntax for jitpack repo 2017-07-22 17:29:33 +02:00
Alexandre Archambault 862169c6bb Add more guarantees that a same module can't be downloaded concurrently
traverse called in ResolutionProcess.fetchAll relies on Applicative, so
doesn't guarantee that the module groups will be fetched one after the
other. The Applicative instance of scalaz.concurrent.Task doesn't
parallelize the tasks by default, so it works fine here. But that extra
security ensures that code can be fine with other monads.
2017-07-22 17:29:29 +02:00
Alexandre Archambault ea8927d7b2 Don't unnecesarily mark some artifacts as optional 2017-07-22 17:29:26 +02:00
Alexandre Archambault bddf67cc17 Always try to get artifacts corresponding to packaging 2017-07-22 17:29:25 +02:00
Alexandre Archambault 5a271fffc5 Merge pull request #614 from coursier/topic/fix-compatibility-api
Fix compatibility API
2017-07-19 15:30:26 +02:00
Alexandre Archambault 2815897b7a Fix compatibility API
It wasn't returning some (non optional) artifacts
2017-07-19 14:38:03 +02:00
Alexandre Archambault db3679dce4 Factor default max # of iterations 2017-07-19 02:07:15 +02:00
Alexandre Archambault 4e5971129b Take into account classifiers specified via attributes in Ivy repos 2017-07-18 10:11:37 +02:00
Alexandre Archambault fc0a1ccec7 Really filter out optional artifacts by default 2017-07-17 17:12:30 +02:00
Alexandre Archambault f665ab1ac2 Add stub for bin compat 2017-07-06 18:14:51 +02:00
Alexandre Archambault 5758e0d786 Rework property substitution 2017-07-06 17:25:45 +02:00
Alexandre Archambault 9b1d329d0b Prevent downloading the same artifact concurrently multiple times 2017-07-03 12:59:26 +02:00
Alexandre Archambault 2929c47652 Revert "Ensure a same artifact isn't downloaded twice in the same iteration"
This reverts commit d437cfb87d.
2017-07-03 12:56:34 +02:00
Alexandre Archambault 8d1ff10914 Dummy fix 2017-06-24 15:22:03 +02:00
Alexandre Archambault 3c1d99e64f Some cleanup 2017-06-24 15:22:01 +02:00
Alexandre Archambault d437cfb87d Ensure a same artifact isn't downloaded twice in the same iteration
coursier.Cache.Logger doesn't handle this well
2017-06-24 15:21:59 +02:00
Alexandre Archambault 45e4f6d7f7 Tweak dependency printing 2017-06-20 18:23:33 +02:00
Alexandre Archambault a0e04a6c85 Tweak dependency management scope overriding 2017-06-20 18:23:31 +02:00
Alexandre Archambault 3c30c9762c Merge pull request #581 from coursier/develop
Latest developments
2017-06-16 16:33:51 +02:00
Ryo Fukumuro ab9341ac9b Better handling of snapshot versioning 2017-06-16 14:27:50 +02:00
Alexandre Archambault d5d84cb336 Add workaround for multi-range version intervals 2017-06-16 14:27:49 +02:00
Alexandre Archambault f57977dcd4 Add support for version ranges for sbt plugins from Maven repositories
These seem to lack some maven-metadata.xml files, so require specific
handling
2017-06-16 14:27:49 +02:00
Alexandre Archambault 310364ed93 Don't include optional artifacts by default
Except for classifiers artifacts, where they were already assumed to be
optional
2017-06-13 14:24:48 +02:00
Alexandre Archambault f4e98c6bc5 Merge pull request #574 from sschuberth/fix-pipe-symbol-in-tree
Tree: Fix the pipe symbol to match the other UTF-8 symbols used
2017-06-13 14:13:06 +02:00
Sebastian Schuberth 0701df35a4 Tree: Fix the pipe symbol to match the other UTF-8 symbols used
The "branching" symbols used to print the tree are UTF-8 characters.
Make the pipe symbol be the matching UTF-8 character to close the tiny gap
between symbols visible in the tree before.
2017-06-09 15:29:10 +02:00
Claudio Bley 2851f7d364 Support resolving the latest sub-revision of a module
Components of revisions are separated by dots or hyphens.

In case you "end the revision with a `+`" (see [1]), the latest sub-revision of the
dependency module should be selected when resolving dependencies.

Accept revisions such as "1.2+" or "1.2.+" and "1.2.3-+".

Fixes #424.

[1]: http://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html
2017-06-08 18:00:06 +02:00
Alexandre Archambault 69ffdeb553 Don't return duplicated artifacts from Ivy repos 2017-06-06 18:01:28 +02:00
Alexandre Archambault f5ef7d8179 Add non-reg tests for Nexus proxies
Ensure everything work fine again with those (things went bad at
1.0.0-RC1, because of the use of directory listings, that may not be
exhaustive in proxies - or may be just empty, e.g. currently with nexus 3)
2017-05-31 21:19:27 +02:00