diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..50cb1ec --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,102 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Xcode: Check Toolchain", + "type": "shell", + "command": "xcode-select", + "args": [ + "-p" + ], + "options": { + "cwd": "${workspaceFolder}" + }, + "presentation": { + "reveal": "always", + "panel": "shared", + "clear": true + }, + "problemMatcher": [] + }, + { + "label": "Xcode: Build Debug", + "type": "shell", + "command": "xcodebuild", + "args": [ + "-project", + "${workspaceFolder}/LidAngleSensor.xcodeproj", + "-scheme", + "LidAngleSensor", + "-configuration", + "Debug", + "-destination", + "platform=macOS", + "-derivedDataPath", + "${workspaceFolder}/build", + "CODE_SIGNING_ALLOWED=NO", + "build" + ], + "options": { + "cwd": "${workspaceFolder}" + }, + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "always", + "panel": "shared", + "clear": true + }, + "problemMatcher": "$gcc" + }, + { + "label": "Xcode: Run App", + "type": "shell", + "command": "open", + "args": [ + "${workspaceFolder}/build/Build/Products/Debug/LidAngleSensor.app" + ], + "options": { + "cwd": "${workspaceFolder}" + }, + "dependsOn": [ + "Xcode: Build Debug" + ], + "dependsOrder": "sequence", + "presentation": { + "reveal": "always", + "panel": "shared", + "clear": false + }, + "problemMatcher": [] + }, + { + "label": "Xcode: Clean", + "type": "shell", + "command": "xcodebuild", + "args": [ + "-project", + "${workspaceFolder}/LidAngleSensor.xcodeproj", + "-scheme", + "LidAngleSensor", + "-configuration", + "Debug", + "-destination", + "platform=macOS", + "-derivedDataPath", + "${workspaceFolder}/build", + "clean" + ], + "options": { + "cwd": "${workspaceFolder}" + }, + "presentation": { + "reveal": "always", + "panel": "shared", + "clear": true + }, + "problemMatcher": "$gcc" + } + ] +} diff --git a/README.md b/README.md index c1f9f62..c05ccb0 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,27 @@ Yes, never click "Start Audio". But this energy isn't encouraged. According to [this issue](https://github.com/samhenrigold/LidAngleSensor/issues/12), building requires having Xcode installed. I've only tested this on Xcode 26. YMMV. +## Using VS Code + +You can use VS Code as your editor and task runner, but you still need the full `Xcode.app` toolchain installed for `xcodebuild`. + +1. Install Xcode from the App Store. +2. Point the active developer directory to Xcode: + +```shell +sudo xcode-select -s /Applications/Xcode.app/Contents/Developer +sudo xcodebuild -runFirstLaunch +``` + +3. Open this folder in VS Code. +4. Run `Terminal > Run Task` and use one of the bundled tasks: + - `Xcode: Check Toolchain` + - `Xcode: Build Debug` + - `Xcode: Run App` + - `Xcode: Clean` + +Build artifacts are written to `build/`, which is ignored by git. + ## Installation Via Homebrew: