-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
report scalaCompilerBridgeBinaryJar in ScalaData for sbt >= 1.3
The value is reported for Scala 3 compiler. https://youtrack.jetbrains.com/issue/SCL-21741/dynamically-resolve-compiler-bridge-for-newer-scala-3-versions
- Loading branch information
Showing
8 changed files
with
143 additions
and
74 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
extractor/src/main/scala-sbt-0.13/sbt/jetbrains/keysAdapterEx.scala
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 sbt.jetbrains | ||
|
||
import sbt.{Def, File, Task, TaskKey} | ||
|
||
object keysAdapterEx { | ||
val myScalaCompilerBridgeBinaryJar: Def.Initialize[Task[Option[File]]] = Def.taskDyn { | ||
Def.task { | ||
None | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
extractor/src/main/scala-sbt-1.2/org.jetbrains/keysAdapterEx.scala
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 sbt.jetbrains | ||
|
||
import sbt.{Def, File, Task, TaskKey} | ||
|
||
object keysAdapterEx { | ||
val myScalaCompilerBridgeBinaryJar: Def.Initialize[Task[Option[File]]] = Def.taskDyn { | ||
Def.task { | ||
None | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
extractor/src/main/scala-sbt-1.3/sbt/jetbrains/keysAdapterEx.scala
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,10 @@ | ||
package sbt.jetbrains | ||
|
||
import sbt.{Def, File, Task, TaskKey} | ||
|
||
object keysAdapterEx { | ||
//NOTE: sbt.Keys.scalaCompilerBridgeBinaryJar exists since SBT 1.2.3, so we detect it only since 1.3.0 | ||
val myScalaCompilerBridgeBinaryJar: Def.Initialize[Task[Option[File]]] = Def.taskDyn { | ||
sbt.Keys.scalaCompilerBridgeBinaryJar | ||
} | ||
} |
File renamed without changes.
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
25 changes: 25 additions & 0 deletions
25
extractor/src/test/scala/org/jetbrains/sbt/structure/DataSerializersTest.scala
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,25 @@ | ||
package org.jetbrains.sbt.structure | ||
|
||
import org.scalatest.funsuite.AnyFunSuiteLike | ||
import org.scalatest.matchers.should.Matchers.convertToAnyShouldWrapper | ||
|
||
import java.io.File | ||
import scala.xml.PrettyPrinter | ||
|
||
class DataSerializersTest extends AnyFunSuiteLike { | ||
test("scalaDataSerializer") { | ||
val data = ScalaData( | ||
"myOrg", | ||
"1.2.3", | ||
Seq(new File("a/b/c").getAbsoluteFile), | ||
Seq(new File("a/b/c").getAbsoluteFile), | ||
Seq(new File("a/b/c").getAbsoluteFile), | ||
Some(new File("a/b/c").getAbsoluteFile), | ||
Seq("opt1", "opt2") | ||
) | ||
|
||
val elem = scalaDataSerializer.serialize(data) | ||
val dataDeserialized = scalaDataSerializer.deserialize(elem) | ||
dataDeserialized shouldBe Right(data) | ||
} | ||
} |
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