From d92cfdad8043bbda53f4b17d4a0435fd819f3bfc Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Thu, 16 Nov 2017 18:28:08 +0900 Subject: [PATCH 1/5] Update for Scalatra 2.6 --- build.sbt | 2 +- src/main/scala/gitbucket/gist/controller/GistController.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index f22d896..577a0e2 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,7 @@ val Organization = "io.github.gitbucket" val ProjectName = "gitbucket-gist-plugin" val ProjectVersion = "4.10.0" -val GitBucketVersion = Option(System.getProperty("gitbucket.version")).getOrElse("4.18.0") +val GitBucketVersion = Option(System.getProperty("gitbucket.version")).getOrElse("4.19.0-SNAPSHOT") lazy val root = (project in file(".")).enablePlugins(SbtTwirl) diff --git a/src/main/scala/gitbucket/gist/controller/GistController.scala b/src/main/scala/gitbucket/gist/controller/GistController.scala index fc2e69c..5cb781d 100644 --- a/src/main/scala/gitbucket/gist/controller/GistController.scala +++ b/src/main/scala/gitbucket/gist/controller/GistController.scala @@ -2,7 +2,7 @@ package gitbucket.gist.controller import java.io.File import gitbucket.core.view.helpers -import io.github.gitbucket.scalatra.forms._ +import org.scalatra.forms._ import gitbucket.core.controller.ControllerBase import gitbucket.core.service.AccountService From de7da0c61607146cf149985cc437c0263d044bd2 Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Thu, 16 Nov 2017 18:31:09 +0900 Subject: [PATCH 2/5] Update version to 4.11.0 --- README.md | 5 +++-- build.sbt | 2 +- src/main/scala/Plugin.scala | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 064bccb..2b737c8 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,9 @@ This is a GitBucket plug-in which provides code snippet repository like Gist. Plugin version | GitBucket version :--------------|:-------------------- -4.10.x | 4.15.x - -4.9.x | 4.14.x - +4.11.x | 4.19.x - +4.10.x | 4.15.x - 4.18.x +4.9.x | 4.14.x 4.8.x | 4.11.x - 4.13.x 4.7.x | 4.11.x 4.6.x | 4.10.x diff --git a/build.sbt b/build.sbt index 577a0e2..c5951f8 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ val Organization = "io.github.gitbucket" val ProjectName = "gitbucket-gist-plugin" -val ProjectVersion = "4.10.0" +val ProjectVersion = "4.11.0" val GitBucketVersion = Option(System.getProperty("gitbucket.version")).getOrElse("4.19.0-SNAPSHOT") lazy val root = (project in file(".")).enablePlugins(SbtTwirl) diff --git a/src/main/scala/Plugin.scala b/src/main/scala/Plugin.scala index c029d4f..b35b9cf 100755 --- a/src/main/scala/Plugin.scala +++ b/src/main/scala/Plugin.scala @@ -32,7 +32,8 @@ class Plugin extends gitbucket.core.plugin.Plugin { new Version("4.8.0"), new Version("4.9.0"), new Version("4.9.1"), - new Version("4.10.0") + new Version("4.10.0"), + new Version("4.11.0") ) override def initialize(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Unit = { From 5124e43b8a62ff9b4ca03456edd02c84ffd1f7b5 Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Sun, 26 Nov 2017 22:48:24 +0900 Subject: [PATCH 3/5] Fix diff --- src/main/scala/gitbucket/gist/controller/GistController.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/gitbucket/gist/controller/GistController.scala b/src/main/scala/gitbucket/gist/controller/GistController.scala index 5cb781d..0d972fc 100644 --- a/src/main/scala/gitbucket/gist/controller/GistController.scala +++ b/src/main/scala/gitbucket/gist/controller/GistController.scala @@ -193,7 +193,7 @@ trait GistControllerBase extends ControllerBase { case Right((revisions, hasNext)) => { val commits = revisions.map { revision => defining(JGitUtil.getRevCommitFromId(git, git.getRepository.resolve(revision.id))){ revCommit => - JGitUtil.getDiffs(git, revision.id, false) match { case (diffs, oldCommitId) => + JGitUtil.getDiffs(git, revision.id, true) match { case (diffs, oldCommitId) => (revision, diffs) } } From b2f53c841203c7299f473ec44df48a95a475175b Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Sun, 26 Nov 2017 22:48:45 +0900 Subject: [PATCH 4/5] Introduce sbt-gitbucket-plugin --- README.md | 8 +++++--- build.sbt | 19 ++++--------------- project/plugins.sbt | 1 + 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 2b737c8..7a139bc 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ See [Connect to H2 database](https://github.com/gitbucket/gitbucket/wiki/Connect ## Build from source -1. Install sbt and hit `sbt package` in the root directory of this repository. -2. Copy `target/scala-2.12/gitbucket-gist-plugin_2.12-x.x.x.jar` into `GITBUCKET_HOME/plugins`. -3. Restart GitBucket. +1. Install sbt and hit `sbt assembly` in the root directory of this repository. +2. Copy `target/scala-2.12/gitbucket-gist-plugin-assembly-x.x.x.jar` into `GITBUCKET_HOME/plugins`. +3. GitBucket restarts automatically. + +or you can build and install by just hitting `sbt install`. diff --git a/build.sbt b/build.sbt index c5951f8..2e480c8 100644 --- a/build.sbt +++ b/build.sbt @@ -1,19 +1,8 @@ -val Organization = "io.github.gitbucket" -val ProjectName = "gitbucket-gist-plugin" -val ProjectVersion = "4.11.0" -val GitBucketVersion = Option(System.getProperty("gitbucket.version")).getOrElse("4.19.0-SNAPSHOT") - -lazy val root = (project in file(".")).enablePlugins(SbtTwirl) - -organization := Organization -name := ProjectName -version := ProjectVersion +organization := "io.github.gitbucket" +name := "gitbucket-gist-plugin" +version := "4.11.0" scalaVersion := "2.12.4" - -libraryDependencies ++= Seq( - "io.github.gitbucket" %% "gitbucket" % GitBucketVersion % "provided", - "javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided" -) +gitbucketVersion := Option(System.getProperty("gitbucket.version")).getOrElse("4.19.0-SNAPSHOT") scalacOptions := Seq("-deprecation", "-feature", "-language:postfixOps") javacOptions in compile ++= Seq("-target", "8", "-source", "8") diff --git a/project/plugins.sbt b/project/plugins.sbt index 056c065..46eac21 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,3 +1,4 @@ logLevel := Level.Warn addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.3.12") +addSbtPlugin("io.github.gitbucket" % "sbt-gitbucket-plugin" % "1.2.0") \ No newline at end of file From 0cd3768418363484eac9964d2eacd4cb791a9930 Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Wed, 29 Nov 2017 10:20:08 +0900 Subject: [PATCH 5/5] Bump to GitBucket 4.19.0 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index c5951f8..8ba930e 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,7 @@ val Organization = "io.github.gitbucket" val ProjectName = "gitbucket-gist-plugin" val ProjectVersion = "4.11.0" -val GitBucketVersion = Option(System.getProperty("gitbucket.version")).getOrElse("4.19.0-SNAPSHOT") +val GitBucketVersion = Option(System.getProperty("gitbucket.version")).getOrElse("4.19.0") lazy val root = (project in file(".")).enablePlugins(SbtTwirl)