From 982a32d799893828eec7727275771e2e25469111 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sun, 26 Apr 2020 06:38:37 -0700 Subject: [PATCH] Setup build files for releasing plugin --- CONTRIBUTING.md | 2 +- build.gradle | 8 ++++++-- plugins/sbt/build.sbt | 6 +++--- plugins/sbt/project/plugins.sbt | 3 +++ plugins/sbt/version.sbt | 1 + 5 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 plugins/sbt/project/plugins.sbt create mode 100644 plugins/sbt/version.sbt diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 181e29efb..d8c0f26fb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,7 +52,7 @@ Please follow the steps below in order to make the changes: ### For the sbt plugin -1. Publish the core library locally with `./gradlew publishIvyPublicationToIvyRepository` +1. Publish the core library locally. See the instructions at the bottom of build.gradle discussing the necessary process due to Gradle bug 2. Publish the sbt plugin locally ```shell script cd plugins/sbt diff --git a/build.gradle b/build.gradle index 8755395e6..5e2b6d392 100644 --- a/build.gradle +++ b/build.gradle @@ -127,8 +127,12 @@ publishing { } ivy { url "${System.properties['user.home']}/.ivy2/local" - // use this layout pattern to work around https://github.com/gradle/gradle/issues/12911 patternLayout { + // Need to publish twice due to a Gradle bug https://github.com/gradle/gradle/issues/12911 + // First uncomment the 'layout' line below and comment out the 'artifact' and 'ivy' lines and run `./gradlew publishIvyPublicationToIvyRepository` + // Then restore the code to its original state and run `./gradlew publishIvyPublicationToIvyRepository` again + + // layout "ivy" artifact '[organisation]/[module]/[revision]/[ext]s/[artifact](-[classifier])(.[ext])' ivy '[organisation]/[module]/[revision]/[artifact]/[artifact](-[classifier])(.[ext])' } @@ -140,4 +144,4 @@ if (project.hasProperty("signing.keyId")) { signing { sign publishing.publications.mavenJava } -} \ No newline at end of file +} diff --git a/plugins/sbt/build.sbt b/plugins/sbt/build.sbt index 20002eedb..dab913ac2 100644 --- a/plugins/sbt/build.sbt +++ b/plugins/sbt/build.sbt @@ -4,9 +4,7 @@ name := "sbt-graphql-java-codegen" organization := "io.github.kobylynskyi" description := "Plugin for generating Java code based on GraphQL schema" -version := "1.6.1-SNAPSHOT" - -libraryDependencies += "io.github.kobylynskyi" % "graphql-java-codegen" % "1.6.1-SNAPSHOT" +libraryDependencies += "io.github.kobylynskyi" % "graphql-java-codegen" % version.value enablePlugins(SbtPlugin) scriptedLaunchOpts := { scriptedLaunchOpts.value ++ @@ -15,3 +13,5 @@ scriptedLaunchOpts := { scriptedLaunchOpts.value ++ scriptedBufferLog := false licenses := Seq("MIT License" -> url("https://github.com/kobylynskyi/graphql-java-codegen/blob/master/LICENSE.md")) +bintrayOrganization := None +bintrayRepository := "sbt-plugins" diff --git a/plugins/sbt/project/plugins.sbt b/plugins/sbt/project/plugins.sbt new file mode 100644 index 000000000..ec9dd88ad --- /dev/null +++ b/plugins/sbt/project/plugins.sbt @@ -0,0 +1,3 @@ +addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6") +addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13") +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0") diff --git a/plugins/sbt/version.sbt b/plugins/sbt/version.sbt new file mode 100644 index 000000000..b25a67382 --- /dev/null +++ b/plugins/sbt/version.sbt @@ -0,0 +1 @@ +version in ThisBuild := "1.6.1-SNAPSHOT"