Skip to content

Commit

Permalink
Compute dynamically shapeless version pulled by kernel in IT
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed Jun 20, 2024
1 parent 9cac6ac commit cb46b28
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
3 changes: 2 additions & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,8 @@ trait Integration extends SbtModule {
s"-Dalmond.test.scala-version=${ScalaVersions.scala3Latest}",
s"-Dalmond.test.scala212-version=${ScalaVersions.scala212}",
s"-Dalmond.test.scala213-version=${ScalaVersions.scala213}",
s"-Dalmond.test.scala213-pulled-by-3-version=${helper.scala213()}"
s"-Dalmond.test.scala213-pulled-by-3-version=${helper.scala213()}",
s"-Dalmond.test.case-app-version=${Versions.caseApp}"
)
}
def tmpDirBase = T.persistent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,28 @@ object Tests {
val sbv = scalaVersion.split('.').take(2).mkString(".")
val isScala2 = scalaVersion.startsWith("2.")

val kernelShapelessVersion = "2.3.10" // might need to be updated when bumping case-app
val testShapelessVersion = "2.3.3" // no need to bump that one
val caseAppVersion = sys.props.getOrElse(
"almond.test.case-app-version",
sys.error("almond.test.case-app-version Java property not set")
)

val kernelShapelessVersion: String = {
val res = coursierapi.Fetch.create()
.addDependencies(
coursierapi.Dependency.of("com.github.alexarchambault", "case-app_" + sbv, caseAppVersion)
)
.fetchResult()
res.getDependencies.asScala
.find { dep =>
dep.getModule.getOrganization == "com.chuusai" &&
dep.getModule.getName == "shapeless_" + sbv
}
.map(_.getVersion)
.getOrElse {
sys.error(s"Cannot get shapeless version pulled by case-app $caseAppVersion")
}
}
val testShapelessVersion = "2.3.3" // no need to bump that one

assert(kernelShapelessVersion != testShapelessVersion)

Expand Down

0 comments on commit cb46b28

Please sign in to comment.