Commit Graph

1041 Commits

Author SHA1 Message Date
Dale Wijnand 22df64365b
Replace util-collection dep with util-position
With Position being extracted to its own dependency we can drop this
dependency, allowing util-collection to move (back) to sbt/sbt!
2017-07-06 14:30:06 +01:00
Dale Wijnand a375f57101
Mini cleanup JsonUtil 2017-07-06 14:30:06 +01:00
Dale Wijnand f255894413
Drop RepositoriesParser & therefore util-completion
This code originates from a PR against sbt 0.13:
https://github.com/sbt/sbt/pull/2576

The sbt/librarymanagement part was forward-ported to
sbt/librarymanagement and merged, while the sbt/sbt part wasn't.

So let's get rid of this so we can drop the dependency on
util-completion.
2017-07-06 14:30:05 +01:00
Dale Wijnand 85cfe4d78c
Drop util-testing 2017-07-06 14:30:05 +01:00
Dale Wijnand f5d66db0a6
Format the build 2017-07-06 14:02:04 +01:00
eugene yokota 4074e283d3 Merge pull request #119 from eed3si9n/wip/bumputil3
bump util and contraband to the latest
2017-07-01 19:57:59 -04:00
Eugene Yokota 4ac724e529 bump to sbt-contraband 0.3.0-M7 and latest util 2017-07-01 19:44:49 -04:00
Eugene Yokota e8d5bcc600 bump sjson-new to latest 2017-07-01 19:16:16 -04:00
Eugene Yokota e4c1a1c559 Adjust to util bump 2017-07-01 19:16:16 -04:00
eugene yokota 11f9dc6534 Merge pull request #121 from dwijnand/cross-version-aliases
Add CrossVersion val/type compat aliases & .disabled
2017-07-01 16:44:52 -04:00
Dale Wijnand 9d9e8112df
Add CrossVersion val/type compat aliases & .disabled
To ease migrating code from sbt 0.13 to sbt 1 this introduces val and
type aliases to CrossVersion's companion object (via
CrossVersionFunctions).

In addition, for consistency, it introduces CrossVersion.disabled.
2017-06-30 14:55:08 +01:00
Dale Wijnand eef8c11ca8 Merge pull request #120 from eed3si9n/wip/fixtostring
Fix toString
2017-06-30 10:21:29 +01:00
Eugene Yokota 31d519a003 Fix toString 2017-06-30 04:46:54 -04:00
Dale Wijnand 7e87603b5f Merge pull request #6 from jozic/updateoptions-tostring
add toString to UpdateOptions
2017-06-27 15:55:05 +01:00
Dale Wijnand 8782c40a22 Merge pull request #117 from smarter/add-constant
Add constant CrossVersion
2017-06-27 15:52:59 +01:00
Guillaume Martres f325d466de Add tests for CrossVersion.constant 2017-06-23 16:50:29 +02:00
Guillaume Martres aaf471dd36 Add constant CrossVersion
sbt 1 removes CrossVersion.binaryMapped which was used in the sbt-dotty
plugin to provide a way to depend on Scala 2.x artifacts in a project
that cross-compiles between Scala 2.x and Dotty (see `withDottyCompat()` in
https://github.com/lampepfl/dotty/blob/master/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala).

Using `binaryWith` is not enough because it only allows the user to
specify a prefix and a suffix for the binary version which will always
be set to `scalaBinaryVersion`. This commit introduces a new `Constant`
kind of CrossVersion which allows the user to specify any string he
wants as a cross-version, thus making it possible to port
`withDottyCompat()` to sbt 1.
2017-06-23 16:24:48 +02:00
eugene yokota 0bb1aa7120 Merge pull request #114 from eed3si9n/wip/sbt_bump
Bump to sbt 1.0.0-M6
2017-06-17 02:32:50 -04:00
Eugene Yokota 60e1eb6275 Bump to sbt 1.0.0-M6 2017-06-17 02:19:37 -04:00
eugene yokota ffd165c6cc Merge pull request #112 from dwijnand/sbt-1-binary-version
Change the sbt API/binary version for sbt 1.x to be 1.0
2017-06-09 22:43:55 -04:00
Dale Wijnand e45d9a254b
Switch version patterns to Long instead of Int
For sbt/sbt#3011 reasons.
2017-06-09 15:36:06 +01:00
Dale Wijnand 039e2e6b6a
Change the sbt API/binary version for sbt 1.x to be 1.0 2017-06-09 12:17:46 +01:00
Dale Wijnand f98ee86668
Clarify NonRelease variants in CrossVersion 2017-06-09 12:17:42 +01:00
Dale Wijnand 1bbc4719c6
Cleanup CrossVersion code & tests 2017-06-09 11:47:38 +01:00
eugene yokota 46cc7055b1 Merge pull request #111 from eed3si9n/wip/null
Guard ManagedChecksums setting retrieval
2017-05-30 00:45:13 -04:00
Eugene Yokota 128798247c Guard ManagedChecksums setting retrieval
This setting doesn't exist for ivysettings.xml, which then causes null problem.

Fixes sbt/librarymanagement#110
2017-05-30 00:32:44 -04:00
eugene yokota fae2b0de51 Merge pull request #105 from scalacenter/managed-checksums
Implement `managedChecksums` in ivy
2017-05-27 18:01:57 -04:00
jvican 9d0dfce869
Move checksum to artifact
This is a more elegant solution than before since module IDs can bring
different artifacts (in updateClassifiers, for instance).
2017-05-27 23:48:21 +02:00
eugene yokota be972124c6 Merge pull request #107 from eed3si9n/fport/3202
[fport] Improve the eviction warning presentation
2017-05-27 00:19:34 -04:00
eugene yokota 5558a13cd4 Merge pull request #106 from eed3si9n/fport/3152
[fport] Fix default scalaBinaryVersion for Dotty
2017-05-27 00:19:20 -04:00
Eugene Yokota 182b50a12b Improve the eviction warning presentation.
Fixes sbt/sbt#2699

Before:

    [warn] There may be incompatibilities among your library dependencies.
    [warn] Here are some of the libraries that were evicted:
    [warn]  * com.google.code.findbugs:jsr305:2.0.1 -> 3.0.0
    [warn] Run 'evicted' to see detailed eviction warnings

After:

    [warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
    [warn]
    [warn] 	* com.typesafe.akka:akka-actor_2.12:2.5.0 is selected over 2.4.17
    [warn] 	    +- de.heikoseeberger:akka-log4j_2.12:1.4.0            (depends on 2.5.0)
    [warn] 	    +- com.typesafe.akka:akka-parsing_2.12:10.0.6         (depends on 2.4.17)
    [warn] 	    +- com.typesafe.akka:akka-stream_2.12:2.4.17 ()       (depends on 2.4.17)
    [warn]
    [warn] Run 'evicted' to see detailed eviction warnings
2017-05-26 23:21:33 -04:00
Eugene Yokota 182a07402a update EvictionWarningSpec 2017-05-26 23:07:25 -04:00
Eugene Yokota a50f96c7c4 change EvictionWarningOptions.default
Fixes sbt/sbt#3171

change EvictionWarningOptions.default to include transitive evictions and caller info.
2017-05-26 22:53:07 -04:00
Guillaume Martres 87a53986e3 Fix default scalaBinaryVersion for Dotty
Dotty is versioned as 0.*, but `CrossVersionUtil#binaryScalaVersion`
will return the full version instead of just `major.minor` for all
compiler versions < 2.10, add a special case for Dotty to avoid this.
2017-05-26 22:11:51 -04:00
eugene yokota 2e46857ae3 Merge pull request #104 from eed3si9n/wip/gigahorse2
use okhttp to download the artifacts
2017-05-26 15:19:16 -04:00
jvican 27bf130853
Move `managedChecksums` to InlineIvyConfiguration
`UpdateOptions` is only meant for user-provided options. Since this
option should not be exposed to users, it's moved to inline ivy
configuration, whose parameters require information about the build and
is usually defined project-wide instead of `Global`-wide.
2017-05-26 20:10:53 +02:00
jvican e3a52c3e1f
Make explicit where we deviate from ivy behaviour 2017-05-26 14:47:01 +02:00
jvican 7bf60557d9
Implement `managedChecksums` in ivy
Managed checksums tells ivy to forget about checking checksums for jar
files and just persist them in the cache.

The user that enables that option will take care of verifying they are
correct.

This is a big deal because:

1. Ivy takes *a lot of time* checking timestamps for big jars, and does
   it sequentially. The user (sbt) can do better by running these checks
   in parallel, speeding up the whole resolution process!
2. The fact that the sha files are not present in the cache means that
   build tools cannot check if a checksum is correct without preprocessing
   the jar.

Note that the user is responsible for keeping the cache consistent. If
the checksum is not correct, the user should report it and overwrite the
checksum file with the valid digest.
2017-05-26 12:43:06 +02:00
jvican 4c8036c7cb
Add `managedChecksums` to `UpdateOptions` 2017-05-26 12:43:06 +02:00
jvican 892f6e3775
Add checksum to ModuleID
A checksum in a `ModuleID` ensures that the checksum of the resolved
module id matches. This checksum check is done at the same time ivy
checks it.
2017-05-26 12:43:05 +02:00
jvican 7500291dfc
Fix bug in updateOptionsFormat 2017-05-26 12:43:05 +02:00
jvican 80ee35b01c
Add custom checksum checks to ivy 2017-05-26 12:42:56 +02:00
Eugene Yokota fd7cec0148 use okhttp to download the artifacts
This adds a custom URLHandler that internally uses Square OkHttp.

Fixes sbt/librarymanagement#95
2017-05-26 04:13:55 -04:00
eugene yokota 4d9013a3a3 Merge pull request #102 from eed3si9n/wip/gigahorse
add Gigahorse
2017-05-25 14:16:56 -04:00
Eugene Yokota dd4b33105b add Gigahorse 2017-05-15 16:34:38 -04:00
eugene yokota 9e799a80f3 Merge pull request #97 from scalacenter/unique-resolvers
Allow to define concrete resolvers for dependencies
2017-05-12 22:57:53 -04:00
jvican 8bb1676e61
Allow to define concrete resolvers for dependencies
Sometimes, for predictability and performance, we may be interested in
specifying the concrete resolver that a `ModuleID` should use.

This patch achieves this by adding a new field to `UpdateOptions` and
then getting this information from the `SbtChainResolver`, that will
select the concrete resolver for a given dependency descriptor.

Why is this useful? Well, two reasons:

* Predictable behaviour. We have the guarantee that an artifact only
  comes from a concrete resolver.
* Resolution speedup. Around 1/3 or 1/2 times faster than normal
  resolution in a moderate test case scenario. If there is a lot of
  latency or network connection is poor, speedups will be higher.

LOGS:

```
NORMAL RESOLUTION TIME 1790
FASTER RESOLUTION TIME 1054
```

```
NORMAL RESOLUTION TIME 2078
FASTER RESOLUTION TIME 1055
```

Lots of projects can benefit from this option, as well as organizations
and companies. This will eventually integrate with the dependency lock
file, but can be used independently of it.
2017-05-12 23:47:05 +02:00
eugene yokota 3b55a30141 Merge pull request #98 from scalacenter/issue-3051
Fix sbt/sbt#2650: Degrade log level and clarify
2017-05-12 13:24:20 -04:00
jvican 92cc5339eb
Fix sbt/sbt#2650: Degrade log level and clarify
To ensure that SNAPSHOTs are always the latest, we go through all the
resolved modules and check their timestamps. Good.

However, if in the process of reparsing/redownloading the module
descriptor we fail (or it's not found in that resolver at all), then we
cannot refresh the resolved module that could have been internalized or
heavily cached in memory by ivy. We do this for correctness.

This patch does two things:

1. Adds more comments.
2. Warns only when there are parsing errors in ivy files.
3. Adds debug info in the rest of the cases.

This removes the pain of seeing `Unable to parse` that could be caused by
other reasons that are not related to parsing at all and which would not
affect the algorithm at hand. For instance, if we get a URLResource,
that's totally fine -- there is no way we could parse the ivy file. Ivy
uses URLResources in several cases where the artifact origin URL is
specified.
2017-05-12 18:56:00 +02:00
eugene yokota ccc63d3ee0 Merge pull request #100 from scalacenter/add-frozen-mode
Add a frozen mode to update configuration
2017-05-12 12:43:24 -04:00