From ef3c8120da57ebcb9126c92c8a1ef65a432863ed Mon Sep 17 00:00:00 2001 From: Andrew Polk Date: Thu, 30 Oct 2025 13:45:17 -0700 Subject: [PATCH] Automatic tasks to set up development environment --- .vscode/settings.json | 1 + .vscode/tasks.json | 44 ++++++++++++++++++++++++++++++ build/ensure-initialized.sh | 54 +++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 build/ensure-initialized.sh diff --git a/.vscode/settings.json b/.vscode/settings.json index f381aeb8de0a..484fa1afb101 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { + "task.allowAutomaticTasks": "on", "editor.formatOnSave": true, "prettier.endOfLine": "auto", "files.eol": "auto", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 090c48023787..858074959329 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,6 +1,50 @@ { "version": "2.0.0", "tasks": [ + { + "label": "Create terminals", + "dependsOn": ["BloomBrowserUI", "content"], + "runOptions": { + "runOn": "folderOpen" + } + }, + { + "label": "BloomBrowserUI", + "type": "shell", + "command": "bash", + "options": { + "cwd": "${workspaceFolder}/src/BloomBrowserUI" + }, + // Mark as a background task to avoid the spinner animation on the terminal tab + "isBackground": true, + // Create the tasks in a terminal group (split) + "presentation": { + "group": "my-group" + } + }, + { + "label": "content", + "type": "shell", + "command": "bash", + "options": { + "cwd": "${workspaceFolder}/src/content" + }, + "isBackground": true, + "presentation": { + "group": "my-group" + } + }, + { + "label": "Ensure Development Environment Initialized", + "type": "shell", + "command": "bash build/ensure-initialized.sh", + "runOptions": { + "runOn": "folderOpen" + }, + "presentation": { + "reveal": "always" + } + }, { "label": "build", "command": "dotnet", diff --git a/build/ensure-initialized.sh b/build/ensure-initialized.sh new file mode 100644 index 000000000000..ed320dc7b0ca --- /dev/null +++ b/build/ensure-initialized.sh @@ -0,0 +1,54 @@ +#!/bin/bash +set -e + +echo "==========================================================" +echo "Bloom Desktop - Ensure Development Environment Initialized" +echo "==========================================================" +echo "" + +# Get the repository root directory (parent of the build directory) +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(dirname "$SCRIPT_DIR")" + + +echo "Checking for Bloom.chm file in DistFiles..." +echo "--------------------------------------" +if [ ! -e "$REPO_ROOT/DistFiles/Bloom.chm" ]; then + echo "Bloom.chm file not found. Running getDependencies-windows.sh..." + cd "$SCRIPT_DIR" + bash getDependencies-windows.sh +else + echo "Bloom.chm file found. Skipping getDependencies-windows.sh." +fi +echo "" + + +echo "Checking node_modules in content directory..." +echo "--------------------------------------" +cd "$REPO_ROOT/src/content" +if [ ! -d "node_modules" ]; then + echo "node_modules not found. Running yarn in content directory..." + yarn +else + echo "node_modules already exists in content directory. Skipping yarn." +fi +echo "" + + +echo "Checking node_modules in BloomBrowserUI directory..." +echo "--------------------------------------" +cd "$REPO_ROOT/src/BloomBrowserUI" +if [ ! -d "node_modules" ]; then + echo "node_modules not found. Running yarn and yarn build in BloomBrowserUI directory..." + yarn + yarn build +else + echo "node_modules already exists in BloomBrowserUI directory. Skipping yarn and yarn build." +fi +echo "" + +echo "==========================================================" +echo "✓ Development environment initialization complete!" +echo "==========================================================" +echo "" +echo "You can now build and run Bloom Desktop."