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

split codegen plugin into library and sbt modules #327

Merged
merged 6 commits into from
Apr 18, 2020

Conversation

joprice
Copy link
Contributor

@joprice joprice commented Apr 16, 2020

Closes #326

Copy link
Owner

@ghostdogpr ghostdogpr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some code can be moved out of CodegenPlugin into an object that will live in caliban-codegen and is not specific to the sbt part: namely getSchema and generate methods.

build.sbt Outdated Show resolved Hide resolved
build.sbt Outdated
@@ -102,15 +103,28 @@ lazy val codegen = project
.settings(name := "caliban-codegen")
.settings(commonSettings)
.settings(
sbtPlugin := true,
crossScalaVersions := Seq("2.12.10"),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be removed (only needed for the plugin).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You missed this one (I meant crossScalaVersions should be removed, this was to force the sbt plugin to be built on 2.12 only but a regular module can be cross-published.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed that one. Updated

build.sbt Outdated Show resolved Hide resolved
build.sbt Show resolved Hide resolved
@joprice
Copy link
Contributor Author

joprice commented Apr 16, 2020

I moved the two methods into a new object in the codegen module.

Copy link
Owner

@ghostdogpr ghostdogpr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks!

@ghostdogpr ghostdogpr merged commit e9710f5 into ghostdogpr:master Apr 18, 2020
@joprice joprice deleted the codegenModule branch April 18, 2020 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Codegen: make it usable without sbt
2 participants