Skip to content

Commit

Permalink
Builds work :)
Browse files Browse the repository at this point in the history
  • Loading branch information
vocksel committed Mar 21, 2024
1 parent 473d6d0 commit f4a8b67
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .darklua.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"target": {
"name": "roblox",
"rojo_sourcemap": "./sourcemap.json",
"rojo_sourcemap": "./sourcemap-darklua.json",
"indexing_style": "property"
}
},
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*.rbxm*

# Luau
sourcemap.json
sourcemap*.json

# Selene
/roblox.toml
Expand Down
19 changes: 13 additions & 6 deletions .justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ plugins_dir := if os_family() == "unix" {
}

source_dir := "src"
example_dir := "example"
build_dir := "build"
testez_defs_path := "testez.d.lua"
plugin_filename := "flipbook.rbxm"
plugin_output := plugins_dir / plugin_filename

default_project := "default.project.json"
tests_project := "tests.project.json"
dev_project := "dev.project.json"
build_project := "build.project.json"

tmpdir := `mktemp -d`
Expand All @@ -39,16 +40,22 @@ _prune:
rm -rf {{ build_dir / "**/*.storybook.lua" }}

_build target output:
#!/usr/bin/env sh
set -euxo pipefail
just clean

mkdir -p {{ build_dir }}

rojo sourcemap {{ default_project }} -o sourcemap.json
rojo sourcemap {{ build_project }} -o sourcemap-darklua.json
darklua process {{ source_dir }} {{ build_dir }}

{{ if target == "prod" { `just _prune` } else { `` } }}

rojo build {{ build_project }} -o {{ output }}
if [[ "{{ target }}" = "prod" ]]; then
just _prune
rojo build {{ default_project }} -o {{ output }}
else
rojo build {{ dev_project }} -o {{ output }}
fi

init:
foreman install
Expand Down Expand Up @@ -77,7 +84,7 @@ analyze:
curl -s -o {{ global_defs_path }} \
-O https://raw.githubusercontent.com/JohnnyMorganz/luau-lsp/master/scripts/globalTypes.d.lua

rojo sourcemap {{ tests_project }} -o {{ sourcemap_path }}
rojo sourcemap {{ dev_project }} -o {{ sourcemap_path }}

luau-lsp analyze --sourcemap={{ sourcemap_path }} \
--defs={{ global_defs_path }} \
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"luau-lsp.sourcemap.rojoProjectFile": "tests.project.json",
"luau-lsp.sourcemap.rojoProjectFile": "dev.project.json",
"luau-lsp.types.definitionFiles": [
"testez.d.lua"
],
Expand Down
2 changes: 1 addition & 1 deletion build.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"Packages": {
"$path": "Packages"
},
"$path": "build"
"$path": "src"
}
}
4 changes: 2 additions & 2 deletions default.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"Packages": {
"$path": "Packages"
},
"$path": "src"
"$path": "build"
}
}
}
2 changes: 1 addition & 1 deletion dev.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"Example": {
"$path": "example"
},
"$path": "src"
"$path": "build"
}
}
10 changes: 2 additions & 8 deletions tests.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@
"$className": "DataModel",
"ServerScriptService": {
"flipbook": {
"Packages": {
"$path": "Packages"
},
"Example": {
"$path": "example"
},
"TestRunner": {
"$path": "tests"
},
"$path": "src"
"$path": "dev.project.json"
}
}
}
}
}

0 comments on commit f4a8b67

Please sign in to comment.