-
Notifications
You must be signed in to change notification settings - Fork 243
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
Support cross-compiling build with 2.13.0-M5 #759
Merged
Merged
Changes from 28 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
95f41a8
compat code for ScalaOrderingWrapper and ArrayBuilder.make
erikerlandson e94e694
add scala-2.13 and scala-pre-2.13 as conditional source dirs
erikerlandson 85913cd
add scala-collection-compat dependency
erikerlandson 53c18c2
guard -Ywarn-unused-import flag
erikerlandson 258346d
cross compile ArrayBuilder.make calls
erikerlandson 862f28b
insert ScalaOrderingWrapperCompat
erikerlandson 91112b8
CanBuildFrom -> Factory
erikerlandson 89d3246
Traversable -> Iterable
erikerlandson d3563d1
add toMap call to fix MapView returns
erikerlandson 63f84b4
fix some 2.13 compiles issues in Dist
erikerlandson 6ff2288
code tweaks for 2.13 compat
erikerlandson c4217c3
compat layer for SeqLike
erikerlandson b58eb69
change imports to compat layer for SeqLike
erikerlandson 91507ba
compat layer for IterableLike
erikerlandson bf770cd
use compat layer for IterableLike
erikerlandson 0f56610
TraversableLike -> IterableLike
erikerlandson 53fe5e3
toSeq call to satisfy 2.13
erikerlandson 23b6a12
cross compile DataSets example for 2.13
erikerlandson 19dbc47
parallel sequence shim
erikerlandson 399b020
more compat layer for 2.13 crossbuilding
erikerlandson 533a544
tweaks for 2.13 cross compiling
erikerlandson 8e34c0e
This is commented out because I haven't figured out how to cross comp…
erikerlandson d04cfcd
take out JS testing to see if JVM tests run in CI
erikerlandson 78e9d31
comment out some tests that aren't compiling or inf-looping
erikerlandson 52d5a35
add explicit return type to parallelSeq shim
erikerlandson b8d5e52
use %%% for scala-collection-compat
erikerlandson 5d4a06d
try adding 2.13 to CI
erikerlandson 5e279d1
pay the code style bridge troll
erikerlandson 0e85226
bump sbt-scoverage rev to pick up 2.13
erikerlandson a0056c6
turn off buffering and parallel for tests to localize inf-loops
erikerlandson 45196c1
uncomment test
erikerlandson f4d5edc
annotate tests causing compile errors with 2.13
erikerlandson 6761f06
comment out a couple tests causing infinite loops on 2.13
erikerlandson 314878d
turn off docs/tut on 2.13
erikerlandson f95d0c7
rename implicits to avoid import conflicts
erikerlandson c506939
uncomment unit tests using Sized that are now compiling with 2.13
erikerlandson e9c06b8
add preScala2p13 method for runtime disable of a couple unit tests
erikerlandson 37d8e9c
turn off inf-looping tests at runtime for 2.13 only
erikerlandson 3db7fb7
IterableLikeCompat, for squaring the newBuilder method circle
erikerlandson 69f3e40
simplification example complies using IterableLikeCompat shim
erikerlandson aaa4715
remove logBuffered and parallelExecution settings I used for debuggin…
erikerlandson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ language: scala | |
scala: | ||
- 2.11.12 | ||
- 2.12.6 | ||
- 2.13.0-M5 | ||
|
||
jdk: | ||
- oraclejdk8 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package spire | ||
package object scalacompat { | ||
|
||
import scala.collection.mutable.ArrayBuilder | ||
import scala.reflect.ClassTag | ||
|
||
def arrayBuilderMake[T]()(implicit tag: ClassTag[T]): ArrayBuilder[T] = | ||
ArrayBuilder.make[T] | ||
|
||
def parallelSeq[A](s: Seq[A]): Seq[A] = { | ||
erikerlandson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
throw new Exception("parallel sequences are currently disabled for scala 2.13 and higher") | ||
} | ||
|
||
type SeqLike[A, C] = scala.collection.SeqOps[A, Seq, C] | ||
|
||
type IterableLike[A, C] = scala.collection.IterableOps[A, Iterable, C] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package spire.scalacompat | ||
|
||
trait ScalaOrderingWrapperCompat[A] extends scala.math.Ordering[A] { | ||
override def min[U <: A](x:U, y:U): U = if (lt(x, y)) x else y | ||
override def max[U <: A](x:U, y:U): U = if (gt(x, y)) x else y | ||
} | ||
|
||
trait BuilderCompat[-A, +To] extends scala.collection.mutable.Builder[A, To] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package spire | ||
package object scalacompat { | ||
|
||
import scala.collection.mutable.ArrayBuilder | ||
import scala.collection.parallel.ParSeq | ||
import scala.reflect.ClassTag | ||
|
||
def arrayBuilderMake[T]()(implicit tag: ClassTag[T]): ArrayBuilder[T] = | ||
ArrayBuilder.make[T]() | ||
|
||
def parallelSeq[A](s: Seq[A]): ParSeq[A] = s.par | ||
|
||
type SeqLike[A, C] = scala.collection.SeqLike[A, C] | ||
|
||
type IterableLike[A, C] = scala.collection.IterableLike[A, C] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package spire.scalacompat | ||
|
||
trait ScalaOrderingWrapperCompat[A] extends scala.math.Ordering[A] { | ||
override def min(x:A, y:A): A = if (lt(x, y)) x else y | ||
override def max(x:A, y:A): A = if (gt(x, y)) x else y | ||
} | ||
|
||
trait BuilderCompat[-A, +To] extends scala.collection.mutable.Builder[A, To] { | ||
def addOne(elem: A): this.type | ||
def +=(elem: A): this.type = addOne(elem) | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,6 @@ object Searching { | |
if (!aIsNotMinimal) | ||
candidates += a | ||
} | ||
Seq(candidates: _*) | ||
candidates.toSeq | ||
} | ||
} |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a silly style thing, but you can
case Some((2, 11 | 12))
. I sometimes forget that|
is usable other than at the top level of the match.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had no idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also