From f4a8b67dae2aab06b1857a23f1e727312d3c8533 Mon Sep 17 00:00:00 2001 From: Marin Minnerly Date: Wed, 20 Mar 2024 19:40:38 -0700 Subject: [PATCH] Builds work :) --- .darklua.json | 2 +- .gitignore | 2 +- .justfile | 19 +++++++++++++------ .vscode/settings.json | 2 +- build.project.json | 2 +- default.project.json | 4 ++-- dev.project.json | 2 +- tests.project.json | 10 ++-------- 8 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.darklua.json b/.darklua.json index 30799fcc..183d337f 100644 --- a/.darklua.json +++ b/.darklua.json @@ -11,7 +11,7 @@ }, "target": { "name": "roblox", - "rojo_sourcemap": "./sourcemap.json", + "rojo_sourcemap": "./sourcemap-darklua.json", "indexing_style": "property" } }, diff --git a/.gitignore b/.gitignore index d87bab87..4acb3cba 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ /*.rbxm* # Luau -sourcemap.json +sourcemap*.json # Selene /roblox.toml diff --git a/.justfile b/.justfile index 163e417c..cb08987f 100644 --- a/.justfile +++ b/.justfile @@ -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` @@ -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 @@ -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 }} \ diff --git a/.vscode/settings.json b/.vscode/settings.json index 23009fdc..4e584057 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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" ], diff --git a/build.project.json b/build.project.json index 9d407fbb..39ea158d 100644 --- a/build.project.json +++ b/build.project.json @@ -4,6 +4,6 @@ "Packages": { "$path": "Packages" }, - "$path": "build" + "$path": "src" } } \ No newline at end of file diff --git a/default.project.json b/default.project.json index 4a64feb5..9d407fbb 100644 --- a/default.project.json +++ b/default.project.json @@ -4,6 +4,6 @@ "Packages": { "$path": "Packages" }, - "$path": "src" + "$path": "build" } -} +} \ No newline at end of file diff --git a/dev.project.json b/dev.project.json index 446d3be9..75873ad1 100644 --- a/dev.project.json +++ b/dev.project.json @@ -7,6 +7,6 @@ "Example": { "$path": "example" }, - "$path": "src" + "$path": "build" } } \ No newline at end of file diff --git a/tests.project.json b/tests.project.json index 99374214..321ec7b4 100644 --- a/tests.project.json +++ b/tests.project.json @@ -4,17 +4,11 @@ "$className": "DataModel", "ServerScriptService": { "flipbook": { - "Packages": { - "$path": "Packages" - }, - "Example": { - "$path": "example" - }, "TestRunner": { "$path": "tests" }, - "$path": "src" + "$path": "dev.project.json" } } } -} +} \ No newline at end of file