Skip to content
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

Update contrabandSjsonNewVersion. enable sbt 2 scripted test #184

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: sbt -v "++2.12.x" test scripted
- if: ${{ matrix.jobtype == 3 }}
shell: bash
run: sbt -v "++3.x" test # TODO scripted
run: sbt -v "++3.x" test scripted
- if: ${{ matrix.jobtype == 4 }}
shell: bash
run: sbt -v "++2.12.x" scalafmtSbtCheck scalafmtCheckAll
9 changes: 8 additions & 1 deletion plugin/src/main/scala/ContrabandPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,14 @@ object ContrabandPlugin extends AutoPlugin {
)

override def globalSettings = Seq(
contrabandSjsonNewVersion := "0.9.0"
contrabandSjsonNewVersion := {
scalaBinaryVersion.value match {
case "3" =>
"0.13.1"
case _ =>
"0.9.0"
}
}
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ lazy val root = (project in file(".")).
if (substitutions contains name) substitutions(name) :: Nil
else ((Compile / generateContrabands / contrabandFormatsForType).value)(tpe)
},
TaskKey[Unit]("check") := {
val dir = (Compile / generateContrabands / sourceManaged).value
val src = dir / "generated" / "CustomProtocol.scala"
assert(src.isFile)
},
libraryDependencies += "com.eed3si9n" %% "sjson-new-scalajson" % contrabandSjsonNewVersion.value
// scalacOptions += "-Xlog-implicits"
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

> compile

$ exists target/scala-2.13/src_managed/main/generated/CustomProtocol.scala
> check

> run
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ lazy val root = (project in file(".")).
if (substitutions contains name) substitutions(name) :: Nil
else ((Compile / generateContrabands / contrabandFormatsForType).value)(tpe)
},
TaskKey[Unit]("check") := {
val dir = (Compile / generateContrabands / sourceManaged).value
val src = dir / "generated" / "CustomProtocol.scala"
assert(src.isFile)
},
libraryDependencies += "com.eed3si9n" %% "sjson-new-scalajson" % contrabandSjsonNewVersion.value
// scalacOptions += "-Xlog-implicits"
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

> compile

$ exists target/scala-2.13/src_managed/main/generated/CustomProtocol.scala
> check

> run
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ lazy val root = (project in file(".")).
settings(
name := "example",
scalaVersion := "2.13.15",
TaskKey[Unit]("check") := {
val dir = (Compile / generateContrabands / sourceManaged).value
val src = dir / "com" / "example" / "codec" / "CustomJsonProtocol.scala"
assert(src.isFile)
},
libraryDependencies += "com.eed3si9n" %% "sjson-new-scalajson" % contrabandSjsonNewVersion.value
// scalacOptions += "-Xlog-implicits"
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

> compile

$ exists target/scala-2.13/src_managed/main/com/example/codec/CustomJsonProtocol.scala
> check

> run