|
| 1 | +# Cross-Platform Development Guide |
| 2 | + |
| 3 | +Although WinHome is an "Infrastructure-as-Code tool for Windows," it is built using **modern .NET 10**, allowing developers on **Linux** and **macOS** to contribute to the project effectively. |
| 4 | + |
| 5 | +## 💻 Developing on Linux & macOS |
| 6 | + |
| 7 | +### 1. Prerequisites |
| 8 | +* **[.NET 10 SDK](https://dotnet.microsoft.com/download/dotnet/10.0)**: Required for building and running unit tests. |
| 9 | +* **[VS Code](https://code.visualstudio.com/)**: With the **C# Dev Kit** extension. |
| 10 | + |
| 11 | +### 2. Building the Project |
| 12 | +You can compile the solution normally on any platform: |
| 13 | +```bash |
| 14 | +dotnet build WinHome.sln |
| 15 | +``` |
| 16 | + |
| 17 | +### 3. Running Unit Tests |
| 18 | +Our unit tests are designed with **abstractions and mocks**. This means you can run the logic-heavy unit tests (like config parsing, state management logic, and plugin discovery) without being on Windows: |
| 19 | +```bash |
| 20 | +dotnet test tests/WinHome.Tests/WinHome.Tests.csproj |
| 21 | +``` |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## ⚠️ Platform Limitations |
| 26 | + |
| 27 | +WinHome is a **Windows-native engine**. While the code compiles on other OSs, the core reconciliation logic (`Engine.cs`) contains platform guards: |
| 28 | + |
| 29 | +* **Registry/Services/WSL**: These modules will be skipped or throw errors if run natively on Linux/macOS. |
| 30 | +* **Dry-Run**: You can run `dotnet run -- --dry-run` to test configuration parsing and plugin loading, but many modules will log "Skipping: Platform not supported." |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +## 🧪 Testing Windows Logic from Linux/macOS |
| 35 | + |
| 36 | +If you are modifying Windows-specific logic (e.g., the Registry Service) and need to verify it: |
| 37 | + |
| 38 | +### 1. Automated CI (Recommended) |
| 39 | +Push your branch to your fork. Our **GitHub Actions CI** (`test.yaml`) runs on `windows-latest` VMs. It will execute the full suite, including E2E tests, on a real Windows environment. |
| 40 | + |
| 41 | +### 2. Remote Development |
| 42 | +Use the **VS Code Remote - SSH** extension to connect to a Windows machine or VM and develop/debug directly in that environment. |
| 43 | + |
| 44 | +### 3. Windows Containers / VM |
| 45 | +If you have a local Windows machine, you can use the scripts in `test-data/` to run acceptance tests inside a clean Windows Sandbox. |
0 commit comments