-
Notifications
You must be signed in to change notification settings - Fork 364
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
WIP: Cross-compile 213 #3363
Closed
Closed
WIP: Cross-compile 213 #3363
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
62a5be1
resolve amgiguity in spark and raster Implicits classes with explicit…
philvarner f4fbe4f
refactor spire dependency to support using different versions between…
philvarner ae97d90
replace two uses of to[T] with equivalent toT
philvarner 4ad25dc
disable eviction warnings, since there are many of them and likely al…
philvarner c7d155f
fixes for non-fqn Seq being immutable in Scala 2.13
philvarner 2a947d1
fix two more instances of resolution of wildcard imports being differ…
philvarner 90ae75e
fix unnecessarily modified imports in Seq update commit
philvarner 9e707ff
Merge branch 'implicits-relative-package-names' into cross-compile-213
philvarner 52e4fc5
Merge branch 'refactor-spire-dep' into cross-compile-213
philvarner 90874fa
Merge branch 'fix-uses-of-to-with-brackets' into cross-compile-213
philvarner 1fe9713
Merge branch 'disable-eviction-warnings' into cross-compile-213
philvarner aded030
Merge branch 'fixes-for-immutable-seq-change-in-213' into cross-compi…
philvarner b041e1f
2.13 build delta
philvarner fe6ce70
resolve a few more problems with ambiguous wildcard resolution in 2.13
philvarner 48fa368
convert use of .to[Vector] to .toVector
philvarner 24a9bb2
replace one private use of method return type of Seq with actual resu…
philvarner 7e0e820
Merge branch 'fixes-for-immutable-seq-change-in-213' into cross-compi…
philvarner 46b8798
Merge branch 'fix-uses-of-to-with-brackets' into cross-compile-213
philvarner 5759af9
Merge branch 'implicits-relative-package-names' into cross-compile-213
philvarner 9ec592c
structure with crosscompile at the project level
philvarner 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuo pipefail | ||
set -x | ||
|
||
./sbt -213 "project macros" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project vector" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project proj4" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project raster" publish -no-colors -J-Drelease=locationtech \ | ||
# && ./sbt -213 "project spark" publish -no-colors -J-Drelease=locationtech \ | ||
# && ./sbt -213 "project spark-pipeline" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project s3" publish -no-colors -J-Drelease=locationtech \ | ||
# && ./sbt -213 "project s3-spark" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project accumulo" publish -no-colors -J-Drelease=locationtech \ | ||
# && ./sbt -213 "project accumulo-spark" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project hbase" publish -no-colors -J-Drelease=locationtech \ | ||
# && ./sbt -213 "project hbase-spark" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project cassandra" publish -no-colors -J-Drelease=locationtech \ | ||
# && ./sbt -213 "project cassandra-spark" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project geotools" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project shapefile" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project layer" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project store" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project util" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project vectortile" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project raster-testkit" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project vector-testkit" publish -no-colors -J-Drelease=locationtech \ | ||
# && ./sbt -213 "project spark-testkit" publish -no-colors -J-Drelease=locationtech \ | ||
&& ./sbt -213 "project gdal" publish -no-colors -J-Drelease=locationtech |
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
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,27 @@ | ||
import sbt._ | ||
import sbt.Keys._ | ||
|
||
object CrossCompileAutoPlugin extends AutoPlugin { | ||
|
||
override def trigger: sbt.PluginTrigger = allRequirements | ||
|
||
override def projectSettings: Seq[Def.Setting[_]] = | ||
Seq( | ||
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, 13)) => Seq.empty | ||
case Some((2, 11 | 12)) => Seq( | ||
compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full), | ||
"org.scala-lang.modules" %% "scala-collection-compat" % "2.4.2" | ||
) | ||
case x => sys.error(s"Encountered unsupported Scala version ${x.getOrElse("undefined")}") | ||
}), | ||
Compile / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, 13)) => Seq( | ||
"-Ymacro-annotations", // replaces paradise in 2.13 | ||
"-Wconf:cat=deprecation&msg=Auto-application:silent" // there are many of these, silence until fixed | ||
) | ||
case Some((2, 11 | 12)) => Seq("-Ypartial-unification") // required by Cats | ||
case x => sys.error(s"Encountered unsupported Scala version ${x.getOrElse("undefined")}") | ||
}) | ||
) | ||
} |
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
import Dependencies._ | ||
import GTBenchmarkPlugin.Keys._ | ||
import sbt._ | ||
import sbt.Keys._ | ||
import sbt.Keys.{crossScalaVersions, _} | ||
import sbtassembly.AssemblyPlugin.autoImport._ | ||
import com.typesafe.tools.mima.plugin.MimaKeys._ | ||
import de.heikoseeberger.sbtheader.{CommentStyle, FileType} | ||
|
@@ -40,12 +40,19 @@ object Settings { | |
val all = external ++ local | ||
} | ||
|
||
lazy val scala211 = "2.11.12" | ||
lazy val scala212 = "2.12.13" | ||
lazy val scala213 = "2.13.5" | ||
|
||
lazy val crossScalaVersionsAll = List(scala213, scala212, scala211) | ||
lazy val crossScalaVersionsSparkOnly = List(scala212, scala211) | ||
|
||
lazy val noForkInTests = Seq( | ||
Test / fork := false, | ||
Test / parallelExecution := false | ||
) | ||
|
||
val commonScalacOptions = Seq( | ||
lazy val commonScalacOptions = Seq( | ||
"-deprecation", | ||
"-unchecked", | ||
"-feature", | ||
|
@@ -56,16 +63,17 @@ object Settings { | |
"-language:existentials", | ||
"-language:experimental.macros", | ||
"-feature", | ||
"-Ypartial-unification", // required by Cats | ||
// "-Yrangepos", // required by SemanticDB compiler plugin | ||
// "-Ywarn-unused-import", // required by `RemoveUnused` rule | ||
"-target:jvm-1.8") | ||
"-target:jvm-1.8" | ||
) | ||
|
||
lazy val commonSettings = Seq( | ||
description := "geographic data processing library for high performance applications", | ||
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")), | ||
homepage := Some(url("https://geotrellis.io")), | ||
scmInfo := Some(ScmInfo(url("https://github.com/locationtech/geotrellis"), "scm:git:[email protected]:locationtech/geotrellis.git")), | ||
crossScalaVersions := crossScalaVersionsAll, | ||
scalacOptions ++= commonScalacOptions, | ||
publishMavenStyle := true, | ||
Test / publishArtifact := false, | ||
|
@@ -93,7 +101,6 @@ object Settings { | |
).filter(_.asFile.canRead).map(Credentials(_)), | ||
|
||
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.11.3" cross CrossVersion.full), | ||
addCompilerPlugin("org.scalamacros" %% "paradise" % "2.1.1" cross CrossVersion.full), | ||
addCompilerPlugin("org.scalameta" % "semanticdb-scalac" % "4.4.10" cross CrossVersion.full), | ||
|
||
pomExtra := ( | ||
|
@@ -121,7 +128,11 @@ object Settings { | |
existingText.flatMap(_ => existingText.map(_.trim)).getOrElse(newText) | ||
} } | ||
) | ||
) | ||
), | ||
evictionWarningOptions in update := EvictionWarningOptions.default | ||
.withWarnTransitiveEvictions(false) | ||
.withWarnDirectEvictions(false) | ||
.withWarnScalaVersionEviction(false) | ||
) | ||
|
||
lazy val accumulo = Seq( | ||
|
@@ -144,6 +155,7 @@ object Settings { | |
|
||
lazy val `accumulo-spark` = Seq( | ||
name := "geotrellis-accumulo-spark", | ||
crossScalaVersions := crossScalaVersionsSparkOnly, | ||
libraryDependencies ++= Seq( | ||
accumuloCore | ||
exclude("org.jboss.netty", "netty") | ||
|
@@ -166,6 +178,7 @@ object Settings { | |
) ++ commonSettings ++ noForkInTests | ||
|
||
lazy val bench = Seq( | ||
crossScalaVersions := crossScalaVersionsSparkOnly, | ||
libraryDependencies += sl4jnop, | ||
jmhIterations := Some(5), | ||
jmhTimeUnit := None, // Each benchmark should determing the appropriate time unit. | ||
|
@@ -196,6 +209,7 @@ object Settings { | |
|
||
lazy val `cassandra-spark` = Seq( | ||
name := "geotrellis-cassandra-spark", | ||
crossScalaVersions := crossScalaVersionsSparkOnly, | ||
libraryDependencies ++= Seq( | ||
cassandraDriverCore | ||
excludeAll( | ||
|
@@ -223,6 +237,7 @@ object Settings { | |
|
||
lazy val `doc-examples` = Seq( | ||
name := "geotrellis-doc-examples", | ||
crossScalaVersions := crossScalaVersionsSparkOnly, | ||
scalacOptions ++= commonScalacOptions, | ||
libraryDependencies ++= Seq( | ||
sparkCore, | ||
|
@@ -376,6 +391,7 @@ object Settings { | |
|
||
lazy val `hbase-spark` = Seq( | ||
name := "geotrellis-hbase-spark", | ||
crossScalaVersions := crossScalaVersionsSparkOnly, | ||
libraryDependencies ++= Seq( | ||
hadoopClient % Provided, | ||
sparkCore % Provided, | ||
|
@@ -399,7 +415,7 @@ object Settings { | |
name := "geotrellis-macros", | ||
Compile / sourceGenerators += (Compile / sourceManaged).map(Boilerplate.genMacro).taskValue, | ||
libraryDependencies ++= Seq( | ||
spireMacro, | ||
spire("spire-macros").value, | ||
scalaReflect(scalaVersion.value) | ||
) | ||
) ++ commonSettings | ||
|
@@ -410,7 +426,8 @@ object Settings { | |
mdocOut := new File("website/docs"), | ||
mdocVariables := Map( | ||
"VERSION" -> (ThisBuild / version).value | ||
) | ||
), | ||
crossScalaVersions := crossScalaVersionsSparkOnly | ||
) | ||
|
||
lazy val proj4 = Seq( | ||
|
@@ -430,7 +447,7 @@ object Settings { | |
name := "geotrellis-raster", | ||
libraryDependencies ++= Seq( | ||
squants, | ||
monocle("core").value, | ||
monocle("core").value, | ||
monocle("macro").value, | ||
scalaXml, | ||
scalaURI.value, | ||
|
@@ -497,6 +514,7 @@ object Settings { | |
|
||
lazy val `s3-spark` = Seq( | ||
name := "geotrellis-s3-spark", | ||
crossScalaVersions := crossScalaVersionsSparkOnly, | ||
libraryDependencies ++= Seq( | ||
hadoopClient % Provided, | ||
sparkCore % Provided, | ||
|
@@ -533,6 +551,7 @@ object Settings { | |
|
||
lazy val spark = Seq( | ||
name := "geotrellis-spark", | ||
crossScalaVersions := crossScalaVersionsSparkOnly, | ||
libraryDependencies ++= Seq( | ||
sparkCore % Provided, | ||
hadoopClient % Provided, | ||
|
@@ -556,7 +575,8 @@ object Settings { | |
|
||
lazy val `spark-pipeline` = Seq( | ||
name := "geotrellis-spark-pipeline", | ||
libraryDependencies ++= Seq( | ||
crossScalaVersions := crossScalaVersionsSparkOnly, | ||
libraryDependencies ++= Seq( | ||
circe("generic-extras").value, | ||
hadoopClient % Provided, | ||
sparkCore % Provided, | ||
|
@@ -587,6 +607,7 @@ object Settings { | |
|
||
lazy val `spark-testkit` = Seq( | ||
name := "geotrellis-spark-testkit", | ||
crossScalaVersions := crossScalaVersionsSparkOnly, | ||
libraryDependencies ++= Seq( | ||
hadoopClient % Provided, | ||
sparkCore % Provided, | ||
|
@@ -600,19 +621,20 @@ object Settings { | |
libraryDependencies ++= Seq( | ||
log4s, | ||
scalaj, | ||
spire, | ||
spire("spire").value, | ||
scalatest % Test | ||
) | ||
) ++ commonSettings | ||
|
||
lazy val vector = Seq( | ||
name := "geotrellis-vector", | ||
libraryDependencies ++= Seq( | ||
scalaReflect(scalaVersion.value), | ||
jts, | ||
shapeless, | ||
pureconfig, | ||
circe("core").value, | ||
circe("generic").value, | ||
circe("core").value, | ||
circe("generic").value, | ||
circe("parser").value, | ||
cats("core").value, | ||
apacheMath, | ||
|
@@ -669,7 +691,7 @@ object Settings { | |
uzaygezenCore, | ||
scalaXml, | ||
apacheLang3, | ||
fs2("core").value, | ||
fs2("core").value, | ||
fs2("io").value, | ||
cats("effect").value, | ||
scalatest % Test | ||
|
@@ -691,6 +713,7 @@ object Settings { | |
|
||
lazy val `gdal-spark` = Seq( | ||
name := "geotrellis-gdal-spark", | ||
crossScalaVersions := crossScalaVersionsSparkOnly, | ||
libraryDependencies ++= Seq( | ||
gdalWarp, | ||
hadoopClient % Provided, | ||
|
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Publish to sonatype for all supported scala version 2.13 | ||
|
||
set -Eeuo pipefail | ||
set -x | ||
|
||
./sbt -213 publishSigned -no-colors -J-Drelease=sonatype |
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.
mapValues
is deprecated in 2.13There 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.
Yes -- this is just to maintain backwards compatibility with 2.11 and 2.12 with the fewest changes possible. There are hundreds if not thousands of deprecation warnings when compiling with 2.13 😬