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

Fix compilation of projects using the ConpileTimeCaliban sbt plugin and the scalac -Xfatal-warnings flag #1247

Merged
merged 1 commit into from
Jan 10, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ object CompileTimeCalibanServerPlugin extends AutoPlugin {
|
|import caliban.tools.compiletime.CompileTime
|import caliban.tools.compiletime.Config.ClientGenerationSettings
|import zio.{ExitCode, URIO}
|
|private[generator] object $generatorName {
| def main(args: Array[String]): Unit =
| zio.Runtime.default.unsafeRun(
| def main(args: Array[String]): Unit = {
| val _ = zio.Runtime.default.unsafeRun(
| CompileTime.generateClient(args.toList)(
| $ref,
| ${clientSettings.asScalaCode}
| )
| )
| }
|}
|""".stripMargin.trim

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import sbt.librarymanagement.Resolver
Global / onChangedBuildSource := ReloadOnSourceChanges

ThisBuild / organization := "Conduktor"
ThisBuild / homepage := Some(url("https://www.conduktor.io/"))
ThisBuild / licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))
ThisBuild / version := "0.0.1"
ThisBuild / homepage := Some(url("https://www.conduktor.io/"))
ThisBuild / licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))
ThisBuild / version := "0.0.1"
ThisBuild / scalaVersion := "2.12.14" // Must stay 2.12 in these tests because the plugin is compiled with 2.12
ThisBuild / resolvers += Resolver.mavenLocal
ThisBuild / resolvers += Resolver.sonatypeRepo("snapshots")
ThisBuild / scalacOptions ++= Seq("-Xfatal-warnings", "-feature")

// ### Dependencies ###

Expand Down Expand Up @@ -54,7 +55,7 @@ lazy val root =
preserveExecutable = args(2).toBoolean
)
},
InputKey[Unit]("sed-in-place") := {
InputKey[Unit]("sed-in-place") := {
val args: Vector[String] = spaceDelimited("<arg>").parsed.toVector

val previousValue = args(0)
Expand Down Expand Up @@ -120,7 +121,7 @@ lazy val postsClients =
.in(file("modules/posts-clients"))
.enablePlugins(CompileTimeCalibanClientPlugin)
.settings(
Compile / ctCalibanClient / ctCalibanClientsSettings := Seq(posts),
Compile / ctCalibanClient / ctCalibanClientsSettings := Seq(posts),
Compile / ctCalibanClient / ctCalibanClientsVersionedCode := false
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import zio._
import zio.duration.durationInt
import zio.stream.ZStream

import scala.language.higherKinds

object Operations {

final case class CreatePostMutationParams(authorName: AuthorName, title: PostTitle, content: PostContent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import zio._
import zio.duration.durationInt
import zio.stream.ZStream

import scala.language.higherKinds

object Operations {

final case class MakeNewSpeciesMutationParams(name: Potato.Name, color: Potato.Color)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0. Reset/clean project

> clean

# 1. Test code generation
# ## From the 'posts' "default" config
$ absent modules/posts-clients/target/scala-2.12/src_managed/main/generated/Client.scala
Expand Down