Commit Graph

115 Commits

Author SHA1 Message Date
Eugene Yokota 12d46e3fce Make ModuleID#cross(...) preserve existing prefix
Fixes https://github.com/sbt/sbt/issues/6280

sbt-platform-deps implements `%%%` operator in https://github.com/portable-scala/sbt-platform-deps/blob/v1.0.0/src/main/scala/org/portablescala/sbtplatformdeps/PlatformDepsBuilders.scala#L36-L43
by setting the prefix field on `sbt.librarymanagement.Binary(...)`.
Currently `.cross(...)` would wipe this out, so `%%%` and `cross(CrossVersion.for3Use2_13)` do not compose.

This changes the implementation of `.cross(...)` so it can be chained
together and it will try to preserve the prefix (and suffix) values from
the existing `crossVersion` values.
This should fix the 2.13-3.x sandwich on Scala.JS and Scala Native.
2021-01-23 15:47:33 -05:00
Eugene Yokota 7b45fc594f Contraband files 2021-01-17 06:00:12 -05:00
Eugene Yokota 417a30f8db Update to Scala 2.12.13 + 2.13.4 2021-01-17 04:18:49 -05:00
Adrien Piquerez 2b1806ae25 Add for3Use2_13 and for2_13Use3 2021-01-08 18:25:01 +01:00
eugene yokota 42aae724f8
Merge pull request #359 from adpi2/scala3doc
Add scala3doc artifact
2021-01-03 01:07:06 -05:00
Eugene Yokota 5942ccbe1f Add Scala 2.13 support 2021-01-03 00:59:38 -05:00
Adrien Piquerez ec34dd71a3 Add scala3-tasty-inspector artifact 2020-12-30 15:01:08 +01:00
Adrien Piquerez 51d64c7eef Add scala3doc artifact 2020-12-29 16:42:20 +01:00
João Ferreira 997ce66a1a regen contraband 2020-12-21 17:43:24 +00:00
Eugene Yokota 9297139f6a Implement EvictionError
Ref https://eed3si9n.com/enforcing-semver-with-sbt-strict-update

This adds EvictionError, a replacement for EvictionWarning.
The problem with the current eviction warning is that it has too many
false positives. Using the versionScheme information that could be
supplied by the library authors and/or the build users, this eliminates
the guessing work. At which point, we can fail the resolution.
2020-12-20 19:35:15 -05:00
Eugene Yokota aac1edb426 Add Strict and Always support 2020-12-20 19:34:03 -05:00
Eugene Yokota dc0d873f7b Use evalPvp
Follow-up on https://github.com/sbt/librarymanagement/pull/352
2020-12-20 16:58:50 -05:00
eugene yokota 7547f67294
Merge pull request #352 from eed3si9n/wip/match_error
Fixes match error when using withDottyCompat
2020-12-19 17:32:40 -05:00
Eugene Yokota 2308d0a3a7 Fixes match error when using withDottyCompat
Fixes https://github.com/sbt/sbt/issues/6210

scodec-bits is published with pvp versionScheme (nice), this means that
we should just evaluate the version portion for pvp-ness, but I was
using `guessSecondSegment` that checks for Scala suffix. That's mistake
1.

`guessSecondSegment` assumes that the Scala suffix uses the given
ScalaModuleInfo, but with 2.13-3 sandwich we can't assume this.
In the reported case, Scala module is 3.0.0-M3 but scodec-bits uses
2.13. So that's mistake 2.

This attempts to correct both the mistakes.
1. Instead of `guessSecondSegment`, this adds a simpler `evalPvp`
function.
2. `guessSecondSegment` just looks for `_2.` or `_3` and ignores the
Scala module.
2020-12-19 17:08:24 -05:00
Adrien Piquerez 24f85fd18c Adapt ScalaOverride to Scala 3 2020-12-18 17:28:47 +01:00
Adrien Piquerez 48b2a7a0a1 Add Scala 3 artifacts 2020-12-17 09:32:40 +01:00
Adrien Piquerez f1ede7cd06 Add Scala 3 binary versioning 2020-12-17 09:32:40 +01:00
Eugene Yokota 39090fa0d3 Formatting 2020-09-21 22:29:08 -04:00
izharahmd fa0f859552 retry with backoff while publishing 2020-09-15 20:32:38 +05:30
Eugene Yokota 9d87715100 Automatic eviction warning
This extracts info.versionScheme from POM and uses that to guide the
eviction report instead of taking a stab in the dark that all Scala
libraries are using pvp.
2020-08-05 16:39:11 -04:00
Eugene Yokota 5f4cbad6c4 support UNC path
Fixes https://github.com/sbt/sbt/issues/5596
2020-06-25 23:24:43 -04:00
Eugene Yokota 375613efbf Make validateProtocol return Boolean
Ref https://github.com/sbt/sbt/issues/4905

To deprecate and unsupport HTTP, first log all the error messages out then throw at sbt level.
2020-06-06 19:29:09 -04:00
Eugene Yokota fd71e8cb17 Bump Contraband 2020-04-06 18:15:46 -04:00
Eugene Yokota b01b61384e Add custom handling for Disabled companion object
https://github.com/sbt/librarymanagement/pull/316 started returning Disabled companion object for `apply()` instead of creating a new instance.
This leaked into JSON as it uses runtime types for union. This works around that by providing a hand-crafted format.

Ref https://github.com/sbt/sbt/pull/4997
2019-08-28 18:33:46 -04:00
Eugene Yokota 2071b29748 Remove unused file 2019-08-28 18:28:30 -04:00
Eugene Yokota 337716830f Deprecate HTTP resolvers (take 2)
Ref https://github.com/sbt/sbt/issues/4905
Ref https://github.com/sbt/librarymanagement/pull/312

Based on the discussion in https://github.com/sbt/sbt/issues/4905, this will exempt localhost, and also allows per-resolver opt-in for HTTP.
2019-08-28 15:20:23 -04:00
Eugene Yokota 7ad02276e9 adding try-catch per review 2019-08-27 23:37:45 -04:00
Eugene Yokota 5480646715 pass in Locale
toLowerCase would act differently in Turkey.
2019-08-27 17:51:19 -04:00
Eugene Yokota c5ce636376 Flip the default to not use Gigahorse by default
Fixes https://github.com/sbt/sbt/issues/3570

The primary motivation for bringing in Gigahorse was to speed up the dependency resolution, especially in a high-latency environment like Australia, by enabling keep-alive. One of unintended consequences was that it ended up exposing either a bug in okhttp or Nexus / Artifactory's handling of keep-alive, since corporate users behind these proxy repositories started to experience problem publishing. Multiple people have also reported that putting network proxies like HAProxy works around this issue, which seems consistent with the theory.

Now that dependency resolution has switched to using Coursier by default, I am just going to flip the default here so publishing would use Ivy's default URL handler based on `java.net.HttpURLConnection` - 5681e1a77a/src/java/org/apache/ivy/util/url/BasicURLHandler.java
2019-08-27 17:47:32 -04:00
Eugene Yokota d0ce65378c Refactor system properties lookup 2019-08-27 17:18:05 -04:00
Eugene Yokota 4a1b6232e4 deprecate CrossVersion.Disabled 2019-08-22 13:11:10 -04:00
Eugene Yokota c22cb34e7b Make CrossVersion.Disabled stable
Fixes https://github.com/sbt/sbt/issues/4975

This makes `CrossVersion.Disabled` a stable identifier by reverting `final def` back to `final val`.

This is to fix Scala.JS build

```
[error] ScalaJSCrossVersion.scala:34:23: stable identifier required, but sbt.`package`.CrossVersion.Disabled found.
[error]     case CrossVersion.Disabled =>
[error]                       ^
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
```

### notes

- #121 added `final val Disabled = sbt.librarymanagement.Disabled` but it was just a companion object
- #280 actually made it `final val Disabled = sbt.librarymanagement.Disabled()`, but this broke Cat's build that was calling `CrossVersion.Disabled()`
- #290 changed to `final def Disabled = sbt.librarymanagement.Disabled` and `object Disabled extends sbt.librarymanagement.Disabled`
- This changes back to `final val Disabled = sbt.librarymanagement.Disabled` (but because we changed the companion object in #290 that's ok)
2019-08-22 01:54:14 -04:00
Eugene Yokota a9873101bf Fix validatePatterns
https://github.com/sbt/librarymanagement/pull/312 had a bug.
2019-08-17 22:17:58 -04:00
Eugene Yokota 8fee1e2666 improve "X is evicted completely"
Fixes https://github.com/sbt/sbt/issues/4946

1. This rewords "evicted completely" to "evicted for all versions"
2. Skips transitive and complete evictions (eviction that has no winner version)
2019-08-13 23:35:50 -04:00
Eugene Yokota c89695b4b2 Deprecate HTTP resolvers
Ref https://github.com/sbt/sbt/issues/4905
2019-08-01 16:20:22 -04:00
Eugene Yokota 6a36ce7689 applying Scalafmt 2.0.0-RC6 with sbt/sbt rules 2019-04-29 23:32:52 -04:00
Eugene Yokota 2f8d9ad8ca move CrossVersion to src/
Fixes sbt/sbt#4595
Ref #290
Ref #280

This is bit of an odd one.

To keep bincompat and also to fix sbt 0.13 compatibility issue we have made `Disabled` companion object extend `Disabled` type.
This actually created a subtle deserialization issue:

```
[error] scala.MatchError: Disabled() (of class sbt.librarymanagement.Disabled$)
[error] 	at sjsonnew.FlatUnionFormats$$anon$5.write(FlatUnionFormats.scala:220)
[error] 	at sjsonnew.JsonWriter.addField(JsonFormat.scala:40)
[error] 	at sjsonnew.JsonWriter.addField$(JsonFormat.scala:37)
[error] 	at sjsonnew.FlatUnionFormats$$anon$5.addField(FlatUnionFormats.scala:208)
[error] 	at sjsonnew.Builder.addField(Builder.scala:43)
[error] 	at sbt.librarymanagement.ModuleIDFormats$$anon$1.write(ModuleIDFormats.scala:46)
```

This is because Contraband generates `flatUnionFormat5[CrossVersion, Disabled, ...]` for all of the subtypes of `CrossVersion`, which uses the runtime type information. Now that `Disabled` object is also in the mix, this created JSON that `CrossVersionFormats` cannot deserialize. This brings the code into src/ so we can write this part manually.
2019-04-01 23:35:39 -04:00
eugene yokota 82735ae983
Merge pull request #290 from eed3si9n/wip/disabled-bincompat
make object Disabled extend Disabled
2019-01-23 19:40:04 -05:00
Eugene Yokota 75c319e6bb make object Disabled extend Disabled
Ref https://github.com/sbt/librarymanagement/pull/280

This is to workaround bincompat error detected by sbt community build.

```
[cats] [error] java.lang.NoSuchMethodError: sbt.librarymanagement.CrossVersion$.Disabled()Lsbt/librarymanagement/Disabled$;
```
2019-01-23 15:06:47 -05:00
bigwheel 8d4f6cee48 [Fix #287] Add alternative constructor for binary compatibility 2019-01-14 19:02:41 +09:00
bigwheel c1a93c65b7 [Fix #287] Eviction warning summary shows only binary incompatible 2019-01-10 22:24:11 +09:00
Dale Wijnand ead0f82575
Fix CrossVersion.Disabled compat 2018-11-24 09:31:30 +00:00
eugene yokota 4b179e526d
Merge pull request #270 from andreaTP/coursierAgain
Add Coursier as a  library management implementation
2018-10-29 13:26:30 -04:00
Dale Wijnand 58bfe85f42 Collapse eviction warnings
Rather than

    [warn] There may be incompatibilities among your library dependencies.
    [warn] Run 'evicted' to see detailed eviction warnings
    [info] Done updating.
    [warn] There may be incompatibilities among your library dependencies.
    [warn] Run 'evicted' to see detailed eviction warnings
    [info] Done updating.
    [warn] There may be incompatibilities among your library dependencies.
    [warn] Run 'evicted' to see detailed eviction warnings
    [info] Done updating.
    [warn] There may be incompatibilities among your library dependencies.
    [warn] Run 'evicted' to see detailed eviction warnings

I would get:

    [warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings
    [info] Done updating.
    [warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings
    [info] Done updating.
    [warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings
    [info] Done updating.
    [warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings

which is a touch better. (IMO!)
2018-10-18 14:10:59 -04:00
tanishiking 1d429e4c51 Update scaladoc for SemanticVersionSelector
Fix for https://github.com/sbt/sbt/issues/4422
2018-10-17 00:30:13 +09:00
Leonard Ehrenfried ed25bcba43 Add implementation of coursier 2018-10-15 10:24:34 +01:00
Eugene Yokota f1a99e5e4a Fix the contains issue
Fixes https://github.com/sbt/librarymanagement/issues/259
2018-10-15 03:02:53 -04:00
Eugene Yokota 02475c7a66 -Xfatal-warnings 2018-09-21 01:16:55 -04:00
xuwei-k 326342cf32 fix #134 validate Configuration id 2018-08-01 22:45:02 +09:00
Eugene Yokota 22a4eed65f Default eviction warning to summary 2018-07-01 02:10:41 -04:00