Skip to content

Commit 7a9fa6e

Browse files
committed
Fix presentation compiler build for JDK 8
1 parent d9658a2 commit 7a9fa6e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

project/Build.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,13 @@ object Build {
670670
recur(lines, false)
671671
}
672672

673+
/** Replaces JDK 9+ methods with their JDK 8 alterantive */
674+
def replaceJDKIncompatibilities(lines: List[String]): List[String] = {
675+
lines.map(
676+
_.replaceAll("""(\").repeat\((\w+)\)""", """$1 * $2""")
677+
)
678+
}
679+
673680
/** replace imports of `com.google.protobuf.*` with compiler implemented version */
674681
def replaceProtobuf(lines: List[String]): List[String] = {
675682
def recur(ls: List[String]): List[String] = ls match {
@@ -2623,7 +2630,7 @@ object Build {
26232630
val mtagsSharedSources = (targetDir ** "*.scala").get.toSet
26242631
mtagsSharedSources.foreach(f => {
26252632
val lines = IO.readLines(f)
2626-
val substitutions = (replaceProtobuf(_)) andThen (insertUnsafeNullsImport(_))
2633+
val substitutions = (replaceProtobuf(_)) andThen (insertUnsafeNullsImport(_)) andThen (replaceJDKIncompatibilities(_))
26272634
IO.writeLines(f, substitutions(lines))
26282635
})
26292636
mtagsSharedSources

0 commit comments

Comments
 (0)