forked from sbt/librarymanagement
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes sbt/sbt#4595 Ref sbt#290 Ref sbt#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.
- Loading branch information
Showing
17 changed files
with
343 additions
and
408 deletions.
There are no files selected for viewing
43 changes: 0 additions & 43 deletions
43
core/src/main/contraband-scala/sbt/librarymanagement/Binary.scala
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
core/src/main/contraband-scala/sbt/librarymanagement/BinaryFormats.scala
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
core/src/main/contraband-scala/sbt/librarymanagement/Constant.scala
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
core/src/main/contraband-scala/sbt/librarymanagement/ConstantFormats.scala
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
core/src/main/contraband-scala/sbt/librarymanagement/CrossVersion.scala
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
core/src/main/contraband-scala/sbt/librarymanagement/CrossVersionFormats.scala
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
core/src/main/contraband-scala/sbt/librarymanagement/Disabled.scala
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
core/src/main/contraband-scala/sbt/librarymanagement/Full.scala
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
core/src/main/contraband-scala/sbt/librarymanagement/FullFormats.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
core/src/main/contraband-scala/sbt/librarymanagement/Patch.scala
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
core/src/main/contraband-scala/sbt/librarymanagement/PatchFormats.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.