Skip to content

Update for Scalatra 2.6 #44

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

Merged
merged 6 commits into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`.
19 changes: 4 additions & 15 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")
3 changes: 2 additions & 1 deletion src/main/scala/Plugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
Expand Down