2022-05-08 18:04:21 +00:00
|
|
|
#!/usr/bin/env dub
|
|
|
|
/+ dub.sdl:
|
|
|
|
dependency "dsh" version="~>1.6.1"
|
|
|
|
+/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This script will build the Rail Signal Vue app, then bundle it into this
|
|
|
|
* Spring project's files under src/main/resources/app/, and will then build
|
|
|
|
* this project into a jar file.
|
|
|
|
*/
|
|
|
|
module build_system;
|
|
|
|
|
|
|
|
import dsh;
|
2022-05-30 22:47:11 +00:00
|
|
|
import std.stdio;
|
|
|
|
import std.string;
|
2022-05-08 18:04:21 +00:00
|
|
|
|
|
|
|
const DIST = "./src/main/resources/app";
|
2022-05-24 08:38:42 +00:00
|
|
|
const DIST_ORIGIN = "./quasar-app/dist/spa";
|
|
|
|
const APP_BUILD = "quasar build -m spa";
|
2022-05-30 22:47:11 +00:00
|
|
|
const API_BUILD = "mvn clean package spring-boot:repackage -DskipTests=true";
|
2022-05-08 18:04:21 +00:00
|
|
|
|
|
|
|
void main(string[] args) {
|
|
|
|
print("Building RailSignalAPI");
|
2022-05-24 08:38:42 +00:00
|
|
|
chdir("quasar-app");
|
2022-05-08 18:04:21 +00:00
|
|
|
print("Building app...");
|
2022-05-24 08:38:42 +00:00
|
|
|
runOrQuit(APP_BUILD);
|
|
|
|
print("Copying dist from %s to %s", DIST_ORIGIN, DIST);
|
2022-05-08 18:04:21 +00:00
|
|
|
chdir("..");
|
|
|
|
removeIfExists(DIST);
|
|
|
|
mkdir(DIST);
|
2022-05-24 08:38:42 +00:00
|
|
|
copyDir(DIST_ORIGIN, DIST);
|
2022-05-30 22:47:11 +00:00
|
|
|
|
2022-05-08 18:04:21 +00:00
|
|
|
print("Building API...");
|
2022-05-30 22:47:11 +00:00
|
|
|
runOrQuit(API_BUILD);
|
2022-05-08 18:04:21 +00:00
|
|
|
print("Build complete!");
|
|
|
|
}
|
|
|
|
|