Commit Graph

136 Commits

Author SHA1 Message Date
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
Peter Neyens 3b9385dfc5 Set Gigahorse readTimeout to 1 hour 2018-06-16 13:19:32 +01:00
Eugene Yokota c0a0b7db0c Merge branch '1.1.x' into wip/merge-1.1.x 2018-06-14 01:42:01 -04:00
tanishiking24 c24ab5c4ee Enable sbt to specify config.resource without disabling gigahorse
Fix https://github.com/sbt/sbt/issues/3585.
Gigahorse.config tries to load specified config file in sbt's classpath
and of course fail to find the specified config file, and throw
java.io.IOException if we specify config.resource, because

We can avoid trying to load specified config file inside sbt by
avoid using Gigahorse.config that call `ConfigFactory.load()` inside.

This commit fixes librarymanagement not to use Gigahorse.config and make
it use gigahorse.Config() which returns gigahorse's default config
without calling `ConfigFactory.load()` instead.
2018-05-17 10:46:21 +09:00
tanishiking24 d5f5cbb061 Rename VersionNumber#satisfies to VersionNumber#matchesSemVer
VersionNumber#matchesSemVer receive SemanticSelector instead of String
2018-05-12 12:28:03 +09:00
tanishiking24 4e8b6dc7aa Use contraband for generating SemanticSelector instead of using case class. 2018-05-12 12:23:58 +09:00
tanishiking24 f8efdb1ac2 Make semantic selector honor semver ordering around pre-release tags.
- When major, minor, and patch are equal, a pre-release version has lower precedence than a normal version. Example: 1.0.0-alpha < 1.0.0.
- Precedence for two pre-release versions with the same major, minor, and patch version MUST be determined by comparing each <del>dot</del> hyphen separated identifier from left to right until a difference is found as follows
- identifiers consisting of only digits are compared numerically and identifiers with letters or hyphens are compared lexically in ASCII sort order.
- Numeric identifiers always have lower precedence than non-numeric identifiers.
- A larger set of pre-release fields has a higher precedence than a smaller set, if all of the preceding identifiers are equal.
- Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0.

https://semver.org/#spec-item-11
2018-05-11 02:15:43 +09:00
tanishiking24 c0c88eda9f Add semantic version number selector API.
This semantic version number selector API is based on
- https://draftin.com/documents/375100?token=rR30GmJJzi4l3BRlD-cHs8lcAcdDAXH4oTzqOWeL0CT0BNv3PZEx0g8pBkI13sQgYXTBqShZ0Ucsqek3Fn3d-aU
- https://docs.npmjs.com/misc/semver
2018-05-09 02:53:01 +09:00
xuwei-k 4d3818f9f7 use foldLeft instead of /:
02776afa79/src/library/scala/collection/IterableOnce.scala (L465)
2018-05-03 23:03:44 +09:00
eugene yokota cf9311a2e3
Merge pull request #222 from dwijnand/cleanup/VersionNumber
Cleanup & tweak VersionNumber
2018-04-05 11:41:25 -04:00
Dale Wijnand f74ec06699
Change semantics to match previous semantics
We're unsure about SemVer's semantics around pre-releases, so for now we
just revert this refactoring to preserve the semantics it's always had.
2018-04-05 14:42:41 +01:00
Dale Wijnand 79e31a3e0f
Allow pre-release versions to be compatible with normal versions 2018-04-03 17:48:26 +01:00
Eugene Yokota 1073513b49 Merge branch '1.1.x' into wip/merge-1.1.x 2018-03-27 06:19:28 -04:00
Eugene Yokota a29a12054a bump contraband to 0.4.0
Ref https://github.com/sbt/contraband/issues/119
2018-03-23 22:21:05 +09:00
Dale Wijnand 0f93849214
Cleanup & tweak VersionNumber 2018-03-20 09:38:54 +00:00
Dale Wijnand c6b2b626c8
Merge pull request #221 from dwijnand/cleanup/VersionNumberSpec
Cleanup VersionNumberSpec
2018-03-20 09:36:36 +00:00
Dale Wijnand 4b9eb388a2
In VersionNumberSpec switch to FreeSpec, add "assert" prefix 2018-03-19 19:47:55 +00:00
Dale Wijnand f159846376
In VersionNumberSpec pass VersionString explicitly 2018-03-19 14:58:08 +00:00
Dale Wijnand dee7390117
Rename to MakePomConfigurationExtra.scala to match
See for example CrossVersionExtra.scala
2018-03-15 14:57:50 +00:00
Dale Wijnand a1999a9b90
Cleanup VersionNumberSpec 2018-03-15 01:47:30 +00:00
Antonio Cunei e55362e4c2 Renaming MakePomConfiguration.scala
The regular file has a name collision with the contraband-generated
name. Fixes #219.
2018-03-15 02:26:55 +01:00
Dale Wijnand 76d1f73333
Replace abstract protected[this] copy with abstract withX methods 2018-03-09 13:51:14 +00:00
Dale Wijnand 95544d5175
Make Configuration's copy private[this]
.. now that it doesn't need to share it with a parent type.
2018-03-09 13:51:14 +00:00
Dale Wijnand de360bb139
Add notes as to why Configuration isn't managed by Contraband 2018-03-09 13:51:13 +00:00
Dale Wijnand 8d49d5163c
Cleanup Configuration 2018-03-09 13:51:13 +00:00
Dale Wijnand 127b90ee43
Make MakePomConfiguration a Contraband type again
Requires a separate file because of https://github.com/sbt/contraband/pull/118.
2018-03-09 13:51:13 +00:00
Dale Wijnand 866b0a1d3f
Upgrade to contraband 0.3.3 2018-03-09 12:54:15 +00:00
Dale Wijnand b969f7362c
Make *Extra & *Functions classes private[librarymanagement]
They were never meant to be public types: they're implementation detail.
2018-03-09 12:54:11 +00:00
Jason Zaugg 4f2933d364 Cache the hashCode of Configuration
I noticed this was showing up in profiles when SBT's task engine
was using Keys, etc (that contain Configurations) in HashMap's.

Let's cache it instead. I don't think there is a need to use a lazy
val for this, we can compute it eagerly.
2018-02-23 14:58:00 +10:00
exoego 091edf6ea1 Add a new eviction warning summary to decide whether or not to warn eviction summary. 2018-02-15 22:06:55 +09:00
Dale Wijnand 60b9c7dacb
Remove a bunch of compilation warnings 2018-02-15 09:26:13 +00:00
Andreas Jim-Hartmann 5e275da2a9 Fix typo. 2018-01-30 08:50:08 +01:00
Eugene Yokota c0ac7061db Reorganize existing tests 2018-01-12 23:10:15 -05:00
Antonio Cunei 72dd0064c3 Change modifiedTime definitions 2017-12-22 00:55:24 +01:00
Antonio Cunei 42f23e62aa Revert *ModifiedTime() calls to *lastModified*() calls
There are just too many instances in which sbt's code relies on
the `lastModified`/`setLastModified` semantics, so instead of moving
to `get`/`setModifiedTime`, we use new IO calls that offer the new
timestamp precision, but retain the old semantics.
2017-12-22 00:27:30 +01:00
Eugene Yokota 68356306ec bump modules and plugins 2017-12-15 14:07:05 -05:00
Dale Wijnand 02c2ab5203 Use IO.getModified over importing the method 2017-12-15 14:06:16 -05:00
Antonio Cunei 41980634a4 Moved Milli._ to IO. 2017-12-15 14:06:16 -05:00
Antonio Cunei 340f1684c2 Temporary workaround to FileNotFoundException in RichUpdateReport() 2017-12-15 14:06:16 -05:00
Antonio Cunei ca2617e99e Convert lastModified/setLastModified calls to sbt.io.Milli calls (more precise) 2017-12-15 14:06:16 -05:00
Eugene Yokota 9c1566dfa1 Fix false positive on sbt 1.x module eviction warnings
Fixes #187
2017-11-29 20:02:37 -05:00
eugene yokota 50d024ac60
Merge pull request #183 from tpunder/fm-sbt-s3-resolver-conflict-fix
Be friendly to SBT plugins that also use URLHandlerRegistry.setDefault
2017-11-24 17:26:09 -05:00
xuwei-k a385a13fa5 fix incorrect eviction warning message 2017-11-02 15:10:05 +09:00
Alexey Alekhin 364ba9b44b Removed extra slash in the localBasePattern
When the `scala_[scalaVersion]/` segment is present and the `/[branch]` segment isn't, an extra slash appears before `/[revision]`.
2017-09-23 15:20:43 +02:00
Philippus Baalman d976980af2 Replace `ivys` and `artifacts` in comments
The `ivys` and `artifacts` methods are not available anymore, now referring to `withPatterns`
2017-09-04 15:46:39 +02:00
Peter Vlugter 437165eeb5 Include sbt plugin extra attributes in cached resolution 2017-08-16 11:27:26 +12:00
Dale Wijnand df108f7c78
Scalafmt 1.2.0 2017-08-14 15:29:06 +01:00
Dale Wijnand e91e5c9e77 Merge pull request #153 from dwijnand/UpdateReport.toString-2
Make sure UpdateReport has a nice toString^2
2017-08-10 16:41:34 +01:00
Dale Wijnand 63e63f05fa
Add back, re-configure & re-enable Scalafmt 2017-08-10 12:04:58 +01:00
Dale Wijnand f45a076241
Make sure UpdateReport has a nice toString^2
Fixes sbt/sbt#3357
2017-08-07 15:10:11 +01:00
Dale Wijnand c6e8bd72d2 Merge pull request #146 from dwijnand/UpdateReport.toString
Make sure UpdateReport has a nice toString
2017-07-28 10:36:35 +01:00
Dale Wijnand 52923854cc
Make sure UpdateReport has a nice toString
Fixes sbt/sbt#3357
2017-07-28 08:16:38 +01:00
Eugene Yokota d6e2720201 Let `ModuleDescriptor` declare cache inputs 2017-07-28 01:37:01 -04:00
Eugene Yokota 93c06d29b1 Implement better fake formats than ???
Fixes sbt/librarymanagement#67
Fixes sbt/sbt#3288
2017-07-26 22:46:06 -04:00
Eugene Yokota 3db33720a9 Use IvyAuthenticator and JavaNetAuthenticator
Fixes sbt/sbt#3331

The siatuation is a bit complicated.
Currently the credentials are stored in Ivy's credential store.
This needs to be translated into `java.net.Authenticator` by installing `IvyAuthenticator` and `ErrorMessageAuthenticator` in succession.
This, then, needs to be translated into OkHttp Authenticator using `okhttp3.JavaNetAuthenticator`.
2017-07-24 05:16:42 -04:00
Eugene Yokota 26fa1c5f4b Fixes sbtApiVersion logic
The NonRelease pattern matcher is ony checking for the third segment, but for sbt 1.x, we need to check both the second and third segment since 1.1.0-M1 would be bincompat with 1.0.

Fixes sbt/sbt#3360
2017-07-23 02:34:36 -04:00
Dale Wijnand c5c20db754
Add Constant aliases to CrossVersion 2017-07-20 11:13:52 +01:00
Dale Wijnand c61a690109
Improve config-creating macro error message
Fixes #130
2017-07-17 14:23:00 +01:00
Eugene Yokota a09af23cc6 Builder pattern for MakePomConfiguration 2017-07-15 12:00:21 -04:00
Eugene Yokota 1d2f4d02cf Remove transitiveScratch
This is used only by sbt, and we are not sure if it needs to be part of the API
2017-07-15 11:19:14 -04:00
Eugene Yokota c95a885a3a Bump to latest Contraband 2017-07-15 11:17:23 -04:00
Eugene Yokota 0c28db9d21 rename to DependencyResolutionInterface 2017-07-15 11:17:23 -04:00
Eugene Yokota 358b750dde turn back syntax classes into traits 2017-07-15 11:17:23 -04:00
Eugene Yokota 7844190964 Use delegation instead of inheritance 2017-07-15 11:17:23 -04:00
Eugene Yokota a98c5f4c65 Minor cleanups per review 2017-07-15 11:17:23 -04:00
Eugene Yokota 7b22e78fd9 Library management API
This splits the core of LM and Ivy-based implementation.

- InlineConfiguration is renamed to ModuleConfiguration
- IvyScala is renamed to ScalaModuleInfo
- UpdateConfiguration, RetrieveConfiguration, PublishConfiguration are refactored to use builder pattern.
- Adds ConfigRef for referencing Configuration
- Moves syntax related things into `sbt.librarymagement.syntax`
2017-07-15 11:17:23 -04:00