Skip to content

Commit 3078420

Browse files
committed
docs: add instructions for Linux and macOS development and testing
1 parent 5590c5b commit 3078420

4 files changed

Lines changed: 54 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ To run the tests, run the following command from the root of the repository:
3939
dotnet test WinHome.sln
4040
```
4141

42+
## 🐧 Linux & 🍎 macOS Development
43+
44+
You can develop and run unit tests for WinHome on Linux and macOS using the .NET 10 SDK. Since the engine is Windows-specific, we use mocks to ensure high test coverage on non-Windows platforms.
45+
46+
For a detailed guide on how to contribute from a non-Windows machine, see the **[Cross-Platform Development Guide](./docs/cross-platform-dev.md)**.
47+
4248
### Make your changes
4349

4450
Now, go make your changes!

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ Built with modern .NET engineering patterns:
221221
* **Dependency Injection** (`Microsoft.Extensions.Hosting`)
222222
* **Strategy Pattern** across package managers
223223
* **Testable Core** via abstractions (Registry, FS, Processes)
224+
* **Cross-Platform Dev**: Can be developed/unit-tested on Linux & macOS.
224225
* **CI/CD** via GitHub Actions (SingleFile & Native builds)
225226

226227
---

docs/cross-platform-dev.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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.

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@
1212
href: plugins/toc.yml
1313
- name: Architecture
1414
href: architecture/toc.yml
15+
- name: 🐧 Cross-Platform Development
16+
href: cross-platform-dev.md
1517
- name: Testing Guide
1618
href: testing.md

0 commit comments

Comments
 (0)