Skip to content

Commit

Permalink
🤖 autodiscover lua sources on build
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberbit committed Oct 11, 2023
1 parent ec460c6 commit 88b6710
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"autobuild": true
}
12 changes: 12 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "./build.sh"
}
]
}
22 changes: 1 addition & 21 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,7 @@
mkdir -p dist
rm -rf dist/*
echo 'building...'
luacc telem.init -o dist/telem.lua -i src \
telem.lib.Backplane \
telem.lib.Metric \
telem.lib.util \
telem.lib.MetricCollection \
telem.lib.ObjectModel \
telem.lib.input.MEStorageInputAdapter \
telem.lib.input.RefinedStorageInputAdapter \
telem.lib.input \
telem.lib.input.ItemStorageInputAdapter \
telem.lib.input.mekanism.FissionReactorInputAdapter \
telem.lib.input.mekanism.IndustrialTurbineInputAdapter \
telem.lib.input.mekanism.InductionMatrixInputAdapter \
telem.lib.input.mekanism.FusionReactorInputAdapter \
telem.lib.input.FluidStorageInputAdapter \
telem.lib.input.HelloWorldInputAdapter \
telem.lib.output.HelloWorldOutputAdapter \
telem.lib.output \
telem.lib.output.GrafanaOutputAdapter \
telem.lib.InputAdapter \
telem.lib.OutputAdapter
luacc telem.init -o dist/telem.lua -i src $(for i in src/telem/lib/**/*.lua; do echo $i; done | sed 'y/\//./;s/^src.//;s/\.lua$//')

echo 'squishing...'
luamin -f dist/telem.lua > dist/telem.min.lua

0 comments on commit 88b6710

Please sign in to comment.