diff --git a/README.md b/README.md index 064bccb..7a139bc 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 @@ -36,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 f22d896..24c2f71 100644 --- a/build.sbt +++ b/build.sbt @@ -1,19 +1,8 @@ -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") - -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") 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 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 = { diff --git a/src/main/scala/gitbucket/gist/controller/GistController.scala b/src/main/scala/gitbucket/gist/controller/GistController.scala index fc2e69c..0d972fc 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 @@ -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) } }