prepare for integration with Equinox

This commit is contained in:
Aria Moradi 2021-06-06 01:34:49 +04:30
parent e21f3b9c75
commit 2c7ebd8ece
75 changed files with 9 additions and 9 deletions

View File

@ -55,7 +55,7 @@ jobs:
with:
path: |
**/react/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/react/yarn.lock') }}
key: ${{ runner.os }}-${{ hashFiles('**/webUI/yarn.lock') }}
- name: Build and copy webUI, Build Jar
uses: eskatos/gradle-command-action@v1

View File

@ -57,7 +57,7 @@ jobs:
with:
path: |
**/react/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/react/yarn.lock') }}
key: ${{ runner.os }}-${{ hashFiles('**/webUI/yarn.lock') }}
- name: Build and copy webUI, Build Jar
uses: eskatos/gradle-command-action@v1

View File

@ -56,7 +56,7 @@ jobs:
with:
path: |
**/react/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/react/yarn.lock') }}
key: ${{ runner.os }}-${{ hashFiles('**/react/webUI.lock') }}
- name: Build and copy webUI, Build Jar
uses: eskatos/gradle-command-action@v1

2
.gitignore vendored
View File

@ -6,7 +6,7 @@ gradle.properties
# Ignore Gradle build output directory
build
server/src/main/resources/react
server/src/main/resources/webUI
server/tmp/
server/tachiserver-data/

View File

@ -35,12 +35,12 @@ object JavalinSetup {
val app = Javalin.create { config ->
try {
// if the bellow line throws an exception then webUI is not bundled
this::class.java.getResource("/react/index.html")
this::class.java.getResource("/webUI/index.html")
// no exception so we can tell javalin to serve webUI
hasWebUiBundled = true
config.addStaticFiles("/react")
config.addSinglePageRoot("/", "/react/index.html")
config.addStaticFiles("/webUI")
config.addSinglePageRoot("/", "/webUI/index.html")
} catch (e: RuntimeException) {
logger.warn("react build files are missing.")
hasWebUiBundled = false

View File

@ -2,7 +2,7 @@ plugins {
id("com.github.node-gradle.node") version "3.0.1"
}
val nodeRoot = "${project.projectDir}/react"
val nodeRoot = "${project.projectDir}/src"
node {
nodeProjectDir.set(file(nodeRoot))
}
@ -10,7 +10,7 @@ node {
tasks {
register<Copy>("copyBuild") {
from(file("$nodeRoot/build"))
into(file("$rootDir/server/src/main/resources/react"))
into(file("$rootDir/server/src/main/resources/webUI"))
dependsOn("yarn_build")
}

View File

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

View File

Before

Width:  |  Height:  |  Size: 579 KiB

After

Width:  |  Height:  |  Size: 579 KiB