-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
GitHub Action
committed
May 31, 2024
1 parent
4b3b5a0
commit 22d9ffb
Showing
2 changed files
with
154 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
Build Instruction | ||
===================== | ||
|
||
### 1. Install OpenJDK 11 | ||
|
||
- For Windows, download [Microsoft Build of OpenJDK](https://docs.microsoft.com/en-us/java/openjdk/download) and install it. | ||
- For Linux, install it through your distro's package manager. | ||
- For MacOS | ||
1. Install Homebrew | ||
2. Run `brew install openjdk@11` to install | ||
|
||
### 2. Install [SBT][1] (Simple Build Tool) | ||
|
||
- Follow the [Download](https://www.scala-sbt.org/download.html) page of SBT to install it. | ||
|
||
### 3. Compile | ||
|
||
1. After SBT is installed, run the following command the clone this project from GitHub. | ||
|
||
```console | ||
username@hostname:~$ git clone https://github.com/brianhsu/Live2DForScala.git | ||
Cloning into 'Live2DForScala'... | ||
remote: Enumerating objects: 10853, done. | ||
remote: Counting objects: 100% (30/30), done. | ||
remote: Compressing objects: 100% (23/23), done. | ||
remote: Total 10853 (delta 6), reused 22 (delta 1), pack-reused 10823 | ||
Receiving objects: 100% (10853/10853), 67.14 MiB | 7.30 MiB/s, done. | ||
Resolving deltas: 100% (4483/4483), done. | ||
|
||
username@hostname:~$ | ||
``` | ||
|
||
2. Change directory into it and type `sbt` to run SBT console. It may take a while to download files for the first time of execution. | ||
|
||
```console | ||
username@hostname:~$ cd Live2DForScala | ||
username@hostname:~/Live2DForScala$ sbt | ||
copying runtime jar... | ||
[info] [launcher] getting org.scala-sbt sbt 1.5.8 (this may take some time)... | ||
:: loading settings :: url = jar:file:/usr/share/sbt-bin/lib/sbt-launch.jar!/org/apache/ivy/core/settings/ivysettings.xml | ||
:: loading settings :: url = jar:file:/usr/share/sbt-bin/lib/sbt-launch.jar!/org/apache/ivy/core/settings/ivysettings.xml | ||
.... | ||
[info] welcome to sbt 1.5.8 (Eclipse Adoptium Java 11.0.15) | ||
[info] loading global plugins from /home/brianhsu/.sbt/1.0/plugins | ||
[info] loading settings for project live2dforscala-build from plugins.sbt ... | ||
[info] loading project definition from /home/brianhsu/Live2DForScala/project | ||
[info] loading settings for project core from build.sbt ... | ||
[info] loading settings for project lwjglBinding from build.sbt ... | ||
[info] loading settings for project live2dforscala from build.sbt,publish.sbt,version.sbt ... | ||
[info] set current project to live2dforscala (in build file:/home/brianhsu/Live2DForScala/) | ||
[info] sbt server started at local:///home/brianhsu/.sbt/1.0/server/7f96e432f44ce5ee45c1/sock | ||
[info] started sbt server | ||
sbt:live2dforscala> | ||
``` | ||
|
||
3. Compile it by typing `compile` in the SBT console. | ||
|
||
```console | ||
sbt:live2dforscala> compile | ||
[info] compiling 154 Scala sources and 1 Java source to /home/brianhsu/Live2DForScala/modules/core/target/scala-2.13/classes ... | ||
[info] Non-compiled module 'compiler-bridge_2.13' for Scala 2.13.8. Compiling... | ||
[info] Compilation completed in 4.259s. | ||
[info] compiling 2 Scala sources to /home/brianhsu/Live2DForScala/modules/lwjglBinding/target/scala-2.13/classes ... | ||
[info] compiling 1 Scala source to /home/brianhsu/Live2DForScala/modules/swtBinding/target/scala-2.13/classes ... | ||
[info] compiling 3 Scala sources to /home/brianhsu/Live2DForScala/modules/joglBinding/target/scala-2.13/classes ... | ||
[info] compiling 7 Scala sources to /home/brianhsu/Live2DForScala/modules/examples/base/target/scala-2.13/classes ... | ||
[info] compiling 8 Scala sources to /home/brianhsu/Live2DForScala/modules/examples/swt/target/scala-2.13/classes ... | ||
[info] compiling 8 Scala sources to /home/brianhsu/Live2DForScala/modules/examples/swing/target/scala-2.13/classes ... | ||
sbt:live2dforscala> | ||
``` | ||
|
||
### 3. Unit Test | ||
|
||
- Type `test` in SBT console to run unit test. | ||
- Since MacOS does not support SWT+JWJGL, SWTOpenGLCanvasInfoFeature would faild. It's expected. | ||
|
||
```console | ||
sbt:live2dforscala> test | ||
[info] compiling 1 Scala source to /home/brianhsu/Live2DForScala/modules/swtBinding/target/scala-2.13/test-classes ... | ||
[info] compiling 1 Scala source to /home/brianhsu/Live2DForScala/modules/lwjglBinding/target/scala-2.13/test-classes ... | ||
[info] compiling 3 Scala sources to /home/brianhsu/Live2DForScala/modules/joglBinding/target/scala-2.13/test-classes ... | ||
[info] Run completed in 326 milliseconds. | ||
[info] Total number of tests run: 2 | ||
[info] Suites: completed 1, aborted 0 | ||
[info] Tests: succeeded 2, failed 0, canceled 0, ignored 0, pending 0 | ||
[info] All tests passed. | ||
[info] SWTOpenGLCanvasInfoFeature: | ||
[info] Feature: Get canvas information | ||
[info] Scenario: Get canvas information from SWT OpenGL Canvas | ||
.... | ||
[info] Tests: succeeded 394, failed 0, canceled 0, ignored 0, pending 0 | ||
[info] All tests passed. | ||
sbt:live2dforscala> | ||
``` | ||
|
||
### 3. Run Demo Application | ||
|
||
Type the following command in SBT console to run the demo application. | ||
|
||
- `exampleSwing/run` to run Swing version. Works for Linux / Windows / MacOS. | ||
- `exampleSWTLinux/run` to run SWT version on Linux. | ||
- `exampleSWTWin/run` to run SWT version on Windows. | ||
|
||
```console | ||
sbt:live2dforscala> exampleSwing/run | ||
[info] running (fork) moe.brianhsu.live2d.demo.swing.SwingMain | ||
``` | ||
|
||
```console | ||
sbt:live2dforscala> exampleSWTLinux/run | ||
[info] running (fork) moe.brianhsu.live2d.demo.swing.SwingMain | ||
``` | ||
|
||
|
||
[1]: https://www.scala-sbt.org/ |