Version 1.1.0 & commit hash tracking

This commit is contained in:
UnicornFreedom 2022-09-20 02:54:03 +02:00
parent d13b442993
commit c4cc0c0af7
9 changed files with 30 additions and 7 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
# SBT
target/
/.bsp/
# Gradle
/.gradle

View File

@ -21,7 +21,7 @@ build:
- sbt assembly
artifacts:
paths:
- target/scala-2.13/ocelot-desktop-assembly-0.1.jar
- target/scala-2.13/ocelot-desktop.jar
pages:
stage: deploy
@ -31,7 +31,7 @@ pages:
script:
- rm -rf public
- mkdir public
- cp target/scala-2.13/ocelot-desktop-assembly-0.1.jar public/ocelot.jar
- cp target/scala-2.13/ocelot-desktop.jar public/ocelot.jar
cache: {}
artifacts:
paths:

View File

@ -90,6 +90,13 @@ A few smaller features are worth mentioning, too:
## Download
Decided to give Ocelot Desktop a shot? [**Download** the latest build][download].
## How to build it?
Just import the project in your favorite IDE.
Make sure to have Scala and SBT installed (manually or through IDE).
Use `sbt run` to start Ocelot Desktop. Use `sbt assembly` to generate JAR file.
(It will appear at `target/scala-2.13/ocelot-desktop.jar` location.)
## Credits
- **LeshaInc**, the author and maintainer of Ocelot Desktop.
- **Totoro**, the creator of ocelot-brain and ocelot-online.

View File

@ -1,10 +1,18 @@
name := "ocelot-desktop"
version := "0.1"
version := "1.1.0"
scalaVersion := "2.13.8"
lazy val root = project.in(file("."))
.dependsOn(brain % "compile->compile")
.aggregate(brain)
.enablePlugins(BuildInfoPlugin)
.settings(
buildInfoKeys := Seq[BuildInfoKey](
BuildInfoKey.action("commit") {
scala.sys.process.Process("git rev-parse HEAD").!!.trim
}, version
)
)
lazy val brain = ProjectRef(file("lib/ocelot-brain"), "ocelot-brain")
@ -21,7 +29,9 @@ libraryDependencies += "org.lwjgl.lwjgl" % "lwjgl-platform" % lwjglVersion class
libraryDependencies += "org.jcraft" % "jorbis" % "0.0.17"
assemblyMergeStrategy in assembly := {
assembly / assemblyMergeStrategy := {
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
case _ => MergeStrategy.first
}
assembly / assemblyJarName := s"ocelot-desktop.jar"

View File

@ -1 +1 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")

View File

@ -1 +1 @@
sbt.version = 1.3.12
sbt.version = 1.7.1

1
project/buildinfo.sbt Normal file
View File

@ -0,0 +1 @@
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")

View File

@ -1,5 +1,6 @@
package ocelot.desktop
import buildinfo.BuildInfo
import li.flor.nativejfilechooser.NativeJFileChooser
import ocelot.desktop.audio.{Audio, SoundSource}
import ocelot.desktop.ui.UiHandler
@ -44,6 +45,7 @@ object OcelotDesktop extends Logging {
def mainInner(args: mutable.HashMap[Argument, Option[String]]): Unit = {
logger.info("Starting up Ocelot Desktop")
logger.info(s"Version: ${BuildInfo.version} (${BuildInfo.commit.take(7)})")
splashScreen.setStatus("Initializing brain...", 0.10f)
Ocelot.initialize(LogManager.getLogger(Ocelot))

View File

@ -1,5 +1,7 @@
package ocelot.desktop.ui.swing
import buildinfo.BuildInfo
import java.awt.Window.Type
import java.awt.{BorderLayout, Color, Dimension, Insets, Rectangle}
import java.time.Year
@ -45,7 +47,7 @@ class SplashScreen extends JDialog {
// Application version
private val applicationVersion: JLabel = addLabel(
new Rectangle(0, 0, Width, Height),
s"Version: 1.0.0",
s"Version: ${BuildInfo.version} (${BuildInfo.commit.take(7)})",
SwingConstants.LEFT,
SwingConstants.BOTTOM
)