Skip to content

Commit 38913c6

Browse files
committed
bump gitbucket
1 parent 3eb7227 commit 38913c6

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

build.sbt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ name := "pages-plugin"
33
scalaVersion := "2.11.8"
44
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8", "-feature")
55

6-
resolvers += Resolver.jcenterRepo
7-
resolvers += "amateras-repo" at "http://amateras.sourceforge.jp/mvn/"
6+
resolvers ++= Seq(
7+
Resolver.jcenterRepo,
8+
Resolver.mavenLocal
9+
)
810

911
libraryDependencies ++= Seq(
10-
"gitbucket" % "gitbucket-assembly" % "4.3.0" % "provided",
11-
"javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided"
12+
"io.github.gitbucket" %% "gitbucket" % "4.6.0",
13+
"javax.servlet" % "javax.servlet-api" % "3.1.0"
1214
)
1315

1416
// bintrayReleaseOnPublish in ThisBuild := false

src/main/scala/Plugin.scala

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
21
import gitbucket.core.controller.ControllerBase
32
import gitbucket.plugin.pages.PagesController
3+
import gitbucket.plugin.pages.util.VersionUtil
44
import io.github.gitbucket.solidbase.model.Version
55

66
class Plugin extends gitbucket.core.plugin.Plugin {
7-
import gitbucket.plugin.pages.util.VersionUtil
87
override val pluginId = "pages"
98
override val pluginName = "Pages Plugin"
109
override val description = "Project pages for gitbucket"
@@ -15,19 +14,3 @@ class Plugin extends gitbucket.core.plugin.Plugin {
1514
)
1615
}
1716

18-
package gitbucket.plugin.pages.util {
19-
import scala.collection.JavaConverters._
20-
import scala.util.Try
21-
import java.util.jar.{ Manifest => JarManifest }
22-
23-
object VersionUtil {
24-
val version = Try(getVersionFromManifests()).toOption.flatten
25-
def getVersionFromManifests() = {
26-
val resources = getClass.getClassLoader.getResources("META-INF/MANIFEST.MF").asScala.toList
27-
resources
28-
.flatMap(res => Try(new JarManifest(res.openStream())).toOption.toList)
29-
.find(manifest => Option(manifest.getMainAttributes.getValue("Implementation-Title")).contains("pages-plugin"))
30-
.flatMap(manifest => Option(manifest.getMainAttributes.getValue("Implementation-Version")))
31-
}
32-
}
33-
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package gitbucket.plugin.pages.util
2+
3+
import java.util.jar.{ Manifest => JarManifest }
4+
5+
import scala.util.Try
6+
import scala.collection.JavaConverters._
7+
8+
object VersionUtil {
9+
val version = Try(parseManifest()).toOption.flatten
10+
11+
def parseManifest() = {
12+
val resources = getClass.getClassLoader.getResources("META-INF/MANIFEST.MF").asScala.toList
13+
resources
14+
.flatMap(res => Try(new JarManifest(res.openStream())).toOption.toList)
15+
.find(manifest => Option(manifest.getMainAttributes.getValue("Implementation-Title")).contains("pages-plugin"))
16+
.flatMap(manifest => Option(manifest.getMainAttributes.getValue("Implementation-Version")))
17+
}
18+
}

0 commit comments

Comments
 (0)