Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross compilation Scala 2.13 #236

Merged
merged 9 commits into from Feb 24, 2020
Merged

Cross compilation Scala 2.13 #236

merged 9 commits into from Feb 24, 2020

Conversation

juanpedromoreno
Copy link
Member

This PR cross-compile the project with Scala 2.13.

@juanpedromoreno juanpedromoreno marked this pull request as ready for review February 21, 2020 16:45
- tests
- deploy
- microsite
- test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are the jobs for this stage defined? I'm also a bit confused by the script above. When does that run?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without being an expert, I believe that test is reserved for the script section. TBH, it's the only way I made it work with the help of @fedefernandez .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test is the default one, yes. It's a bit confusing though

case Comparison.CompareBoth(x, y) => Comparison.CompareBoth(f(x), f(y))
case Comparison.CompareList(i, rep) => Comparison.CompareList(i.map(f), rep)
case Comparison.MatchInList(a, rep) => Comparison.MatchInList(a.map(f), rep)
case Comparison.AlignUnionMembers(a, rep) => Comparison.AlignUnionMembers(a.view.mapValues(_.map(f)).toMap, rep)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me a while to spot the difference 😄


package higherkindness.skeuomorph.openapi

trait OperationHelpers {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this file to OperationHelpers.scala ?

import schema._

def operationWithReferences[A](request: Reference, responses: (String, Reference)*): Path.Operation[A] =
operationFrom(request.asRight.some, responses.toMap.view.mapValues(_.asRight).toMap)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try scala-collection-compat? I think it will allow us to write .view.mapValues.toMap in Scala 2.12, so we don't need to duplicate files.

Copy link
Member

@BenFradet BenFradet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 , a fair bit of duplicated code, I would have expected cross compilation to be a bit smoother

@juanpedromoreno
Copy link
Member Author

@cb372 Thanks for the suggestion! Ready for another look :)

CC @BenFradet

@juanpedromoreno juanpedromoreno merged commit 22d188f into master Feb 24, 2020
@juanpedromoreno juanpedromoreno deleted the cross-scala-2.13 branch February 24, 2020 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants