Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Commit

Permalink
Use some magic for cross publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
danpersa committed Mar 25, 2020
1 parent 1af4c0c commit 49f16fc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import de.zalando.beard.BeardParser._
import de.zalando.beard.BeardParserBaseListener
import de.zalando.beard.ast._
import scala.collection.immutable.Seq
import scala.jdk.CollectionConverters._
import de.zalando.beard.parser.JDKCollectionConvertersCompat.Converters._

class BeardTemplateListener extends BeardParserBaseListener {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package de.zalando.beard.parser

/**
* Magic to get cross-compiling access to `scala.jdk.CollectionConverters`
* with a fallback on `scala.collection.JavaConverters`, without deprecation
* warning in any Scala version.
*/
object JDKCollectionConvertersCompat {
object Scope1 {
object jdk {
type CollectionConverters = Int
}
}
import Scope1._

object Scope2 {
import scala.collection.{JavaConverters => CollectionConverters}
object Inner {
import scala._
import jdk.CollectionConverters
val Converters = CollectionConverters
}
}

val Converters = Scope2.Inner.Converters
}

0 comments on commit 49f16fc

Please sign in to comment.