Skip to content

Commit b94a854

Browse files
Fix sbt publish (#1410)
1 parent ad824bb commit b94a854

File tree

6 files changed

+37
-87
lines changed

6 files changed

+37
-87
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,12 @@ jobs:
205205
- name: Release SBT plugin
206206
if: github.event.inputs.publish_sbt_plugin == 'Y'
207207
working-directory: plugins/sbt/graphql-java-codegen-sbt-plugin
208-
run: sbt release with-defaults default-tag-exists-answer k
208+
run: sbt ci-release
209+
env:
210+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
211+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
212+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
213+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
209214

210215
#
211216
# PUBLISH OF RELEASE VERSION COMPLETED
Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
1-
import sbtrelease.ReleaseStateTransformations._
1+
import sbt.url
22

3-
name := "graphql-codegen-sbt-plugin"
4-
// must be equals to oss Group Id
5-
organization := "io.github.jxnu-liguobin"
6-
val jValidationVersion = settingKey[String]("default java Validation api").withRank(KeyRanks.Invisible)
7-
jValidationVersion := "2.0.1.Final"
3+
val javaValidationVersion = settingKey[String]("default Java Validation API")
4+
.withRank(KeyRanks.Invisible)
5+
javaValidationVersion := "2.0.1.Final"
86

97
// keep version is equals with parent project `graphql-java-codegen`.
108
// Plugin don't need to care about the scala version, just the SBT version.
119
lazy val `graphql-codegen-sbt-plugin` = Project(id = "graphql-codegen-sbt-plugin", base = file("."))
1210
.enablePlugins(SbtPlugin, BuildInfoPlugin)
13-
.settings(Publishing.publishSettings)
1411
.settings(
1512
sbtPlugin := true,
1613
scriptedBufferLog := false,
1714
commands ++= Commands.value,
1815
scriptedLaunchOpts += s"-Dplugin.version=${version.value}",
1916
scalacOptions += "-target:jvm-1.8",
20-
releaseIgnoreUntrackedFiles := true,
21-
releaseProcess := Seq[ReleaseStep](
22-
checkSnapshotDependencies,
23-
inquireVersions,
24-
runClean,
25-
setReleaseVersion,
26-
commitReleaseVersion,
27-
tagRelease,
28-
releaseStepCommandAndRemaining("^ publishSigned"),
29-
setNextVersion,
30-
commitNextVersion,
31-
pushChanges
32-
),
3317
libraryDependencies ++= Seq(
3418
"io.github.kobylynskyi" % "graphql-java-codegen" % (ThisBuild / version).value,
3519
"org.freemarker" % "freemarker" % "2.3.31",
3620
"com.graphql-java" % "graphql-java" % "20.2",
3721
"com.fasterxml.jackson.core" % "jackson-databind" % "2.12.1",
3822
"com.typesafe" % "config" % "1.4.2"
3923
),
40-
buildInfoKeys := Seq[BuildInfoKey](name, version, sbtVersion, jValidationVersion),
24+
buildInfoKeys := Seq[BuildInfoKey](name, version, sbtVersion, javaValidationVersion),
4125
buildInfoPackage := "io.github.dreamylost.graphql.codegen"
4226
)
27+
28+
inThisBuild(
29+
List(
30+
name := "graphql-codegen-sbt-plugin",
31+
organization := "io.github.jxnu-liguobin",
32+
sonatypeCredentialHost := "oss.sonatype.org",
33+
sonatypeRepository := "https://oss.sonatype.org/service/local",
34+
homepage := Some(url("https://github.com/kobylynskyi/graphql-java-codegen")),
35+
licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT")),
36+
developers := List(
37+
Developer(
38+
id = "jxnu-liguobin",
39+
name = "梦境迷离",
40+
email = "[email protected]",
41+
url = url("https://github/jxnu-liguobin")
42+
)
43+
)
44+
)
45+
)

plugins/sbt/graphql-java-codegen-sbt-plugin/project/Publishing.scala

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.7.1
1+
sbt.version=1.9.0
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
2-
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
3-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.13")
4-
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
5-
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13")
1+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
2+
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
3+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")

plugins/sbt/graphql-java-codegen-sbt-plugin/src/main/scala/io/github/dreamylost/graphql/codegen/GraphQLCodegenPlugin.scala

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import com.kobylynskyi.graphql.codegen.supplier._
1111
import sbt.{ AutoPlugin, PluginTrigger, _ }
1212
import sbt.Keys.{ sLog, sourceManaged, _ }
1313
import sbt.internal.util.complete.DefaultParsers.spaceDelimited
14-
import com.kobylynskyi.graphql.codegen.kotlin.KotlinGraphQLCodegen
1514

1615
import java.nio.file.{ Path, Paths }
1716
import java.util.{ HashMap => JHashMap, HashSet => JHashSet, List => JList }
@@ -32,13 +31,13 @@ class GraphQLCodegenPlugin(configuration: Configuration, private[codegen] val co
3231
with Compat {
3332
self =>
3433

35-
private val jValidation = BuildInfo.jValidationVersion
36-
private val codegen = BuildInfo.version
34+
private val javaValidation = BuildInfo.javaValidationVersion
35+
private val codegen = BuildInfo.version
3736

3837
object GlobalImport extends GraphQLCodegenKeys {
3938

4039
lazy val GraphQLCodegenPluginDependencies: Def.Setting[Seq[ModuleID]] = libraryDependencies ++= Seq(
41-
"javax.validation" % "validation-api" % javaxValidationApiVersion.value.getOrElse(jValidation),
40+
"javax.validation" % "validation-api" % javaxValidationApiVersion.value.getOrElse(javaValidation),
4241
"io.github.kobylynskyi" % "graphql-java-codegen" % graphqlJavaCodegenVersion.value.getOrElse(codegen)
4342
)
4443

@@ -282,14 +281,6 @@ class GraphQLCodegenPlugin(configuration: Configuration, private[codegen] val co
282281
mappingConfig,
283282
mappingConfigSupplier.orNull
284283
)
285-
case KOTLIN =>
286-
new KotlinGraphQLCodegen(
287-
getSchemas(),
288-
_introspectionResult,
289-
_outputDir,
290-
mappingConfig,
291-
mappingConfigSupplier.orNull
292-
)
293284
case _ =>
294285
throw new LanguageNotSupportedException(language)
295286
}

0 commit comments

Comments
 (0)