Skip to content

Commit

Permalink
Build task
Browse files Browse the repository at this point in the history
  • Loading branch information
SabreML committed Feb 12, 2024
1 parent 473a250 commit 6a59a81
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@
],
"group": "build",
"label": "tgui: sonar"
},
{
"type": "shell",
"command": "bin/tgfont",
"windows": {
"command": ".\\bin\\tgfont.cmd"
},
"problemMatcher": [
"$tsc",
"$eslint-stylish"
],
"group": "build",
"label": "tgui: rebuild tgfont"
}
]
}
2 changes: 2 additions & 0 deletions bin/tgfont.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
call "%~dp0\..\tools\build\build.bat" --wait-on-error tg-font %*
20 changes: 20 additions & 0 deletions tools/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,26 @@ export const YarnTarget = new Juke.Target({
executes: ({ get }) => yarn("install", get(CiParameter) && "--immutable"),
});

export const TgFontTarget = new Juke.Target({
dependsOn: [YarnTarget],
inputs: [
'tgui/.yarn/install-target',
'tgui/packages/tgfont/**/*.+(js|cjs|svg)',
'tgui/packages/tgfont/package.json',
],
outputs: [
'tgui/packages/tgfont/dist/tgfont.css',
'tgui/packages/tgfont/dist/tgfont.eot',
'tgui/packages/tgfont/dist/tgfont.woff2',
],
executes: async () => {
await yarn('tgfont:build');
fs.copyFileSync('tgui/packages/tgfont/dist/tgfont.css', 'tgui/packages/tgfont/static/tgfont.css');
fs.copyFileSync('tgui/packages/tgfont/dist/tgfont.eot', 'tgui/packages/tgfont/static/tgfont.eot');
fs.copyFileSync('tgui/packages/tgfont/dist/tgfont.woff2', 'tgui/packages/tgfont/static/tgfont.woff2');
}
});

export const TguiTarget = new Juke.Target({
dependsOn: [YarnTarget],
inputs: [
Expand Down

0 comments on commit 6a59a81

Please sign in to comment.