|
| 1 | +# Build Scripts |
| 2 | + |
| 3 | +This directory contains build scripts organized by functionality in the `scripts` folder: |
| 4 | + |
| 5 | +``` |
| 6 | +scripts/ |
| 7 | +├── compile/ # Compilation scripts |
| 8 | +├── lint/ # Code linting scripts |
| 9 | +├── packages/ # Package management scripts |
| 10 | +└── tests/ # Test runner scripts |
| 11 | +``` |
| 12 | + |
| 13 | +Each directory contains scripts in multiple formats for cross-platform compatibility: |
| 14 | +- `.bat` - Windows batch files |
| 15 | +- `.ps1` - PowerShell scripts (cross-platform) |
| 16 | +- `.sh` - Shell scripts (Unix-based systems) |
| 17 | + |
| 18 | +## Running Scripts on Windows |
| 19 | + |
| 20 | +### Batch Files (.bat) |
| 21 | +- Simply double-click the `.bat` file in the appropriate directory |
| 22 | +- Or run from command prompt: `scripts\category\ScriptName.bat` |
| 23 | + Example: `scripts\compile\Compile.bat` |
| 24 | + |
| 25 | +### PowerShell Scripts (.ps1) |
| 26 | +1. Right-click method: |
| 27 | + - Right-click on the `.ps1` file in the appropriate directory |
| 28 | + - Select "Run with PowerShell" |
| 29 | + |
| 30 | +2. Command line method: |
| 31 | + - Open PowerShell |
| 32 | + - Navigate to this directory |
| 33 | + - Run: `.\scripts\category\ScriptName.ps1` |
| 34 | + Example: `.\scripts\compile\Compile.ps1` |
| 35 | + |
| 36 | + If you get a security error, you may need to allow script execution: |
| 37 | + ```powershell |
| 38 | + Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser |
| 39 | + ``` |
| 40 | + |
| 41 | +### Shell Scripts (.sh) |
| 42 | +To run `.sh` files on Windows, you need one of these installed: |
| 43 | +1. Git Bash (recommended, comes with Git for Windows): |
| 44 | + ```bash |
| 45 | + ./scripts/category/ScriptName.sh |
| 46 | + ``` |
| 47 | + Example: `./scripts/compile/Compile.sh` |
| 48 | + |
| 49 | +2. Windows Subsystem for Linux (WSL): |
| 50 | + ```bash |
| 51 | + bash scripts/category/ScriptName.sh |
| 52 | + ``` |
| 53 | + |
| 54 | +## Running Scripts on macOS/Linux |
| 55 | + |
| 56 | +### Shell Scripts (.sh) |
| 57 | +1. Open terminal |
| 58 | +2. Navigate to this directory |
| 59 | +3. Make scripts executable (one-time setup): |
| 60 | + ```bash |
| 61 | + chmod +x scripts/**/*.sh |
| 62 | + ``` |
| 63 | +4. Run the script: |
| 64 | + ```bash |
| 65 | + ./scripts/category/ScriptName.sh |
| 66 | + ``` |
| 67 | + Example: `./scripts/compile/Compile.sh` |
| 68 | + |
| 69 | +### PowerShell Scripts (.ps1) |
| 70 | +1. Install PowerShell if not already installed |
| 71 | +2. Open terminal |
| 72 | +3. Navigate to this directory |
| 73 | +4. Run: |
| 74 | + ```bash |
| 75 | + pwsh scripts/category/ScriptName.ps1 |
| 76 | + ``` |
| 77 | + Example: `pwsh scripts/compile/Compile.ps1` |
| 78 | + |
| 79 | +## Available Scripts |
| 80 | + |
| 81 | +### Compile |
| 82 | +- Location: `scripts/compile/` |
| 83 | +- Purpose: Compiles the project |
| 84 | +- Files: `Compile.bat`, `Compile.ps1`, `Compile.sh` |
| 85 | + |
| 86 | +### Lint |
| 87 | +- Location: `scripts/lint/` |
| 88 | +- Purpose: Runs code linting |
| 89 | +- Files: `Lint.bat`, `Lint.ps1`, `Lint.sh` |
| 90 | + |
| 91 | +### Tests |
| 92 | +- Location: `scripts/tests/` |
| 93 | +- Purpose: Runs unit tests |
| 94 | +- Files: `RunUnitTests.bat`, `RunUnitTests.ps1`, `RunUnitTests.sh` |
| 95 | + |
| 96 | +### Packages |
| 97 | +- Location: `scripts/packages/` |
| 98 | +- Purpose: Updates CodeBlock.DevKit NuGet packages |
| 99 | +- Files: `UpdateDevKitPackages.bat`, `UpdateDevKitPackages.ps1`, `UpdateDevKitPackages.sh` |
0 commit comments