|
| 1 | +{ |
| 2 | + "version": "2.0.0", |
| 3 | + "tasks": [ |
| 4 | + //PRELIMINARY SETUP TASKS |
| 5 | + //Dependency setup task |
| 6 | + { |
| 7 | + "label": "depsetup", |
| 8 | + "type": "shell", |
| 9 | + "group": "none", |
| 10 | + "detail": "Install depedencies for basic setup", |
| 11 | + "command": "${workspaceFolder}/.vscode/setup.sh", |
| 12 | + // // placeholder for windows scripts, not currently planned |
| 13 | + // "windows": { |
| 14 | + // "command": "call -c ${workspaceFolder}\\.vscode\\setup.bat", |
| 15 | + // }, |
| 16 | + "problemMatcher": [] |
| 17 | + }, |
| 18 | + //pnpm setup task to grab all needed modules |
| 19 | + { |
| 20 | + "label": "pnpmsetup", |
| 21 | + "type": "shell", |
| 22 | + "group": "none", |
| 23 | + "detail": "Setup pnpm", |
| 24 | + "command": "which pnpm && pnpm i", |
| 25 | + "problemMatcher": [] |
| 26 | + }, |
| 27 | + //Preliminary "All-in-one" setup task |
| 28 | + { |
| 29 | + "label": "setup", |
| 30 | + "detail": "Set up depedencies, pnpm and update Decky Frontend Library.", |
| 31 | + "dependsOrder": "sequence", |
| 32 | + "dependsOn": [ |
| 33 | + "depsetup", |
| 34 | + "pnpmsetup", |
| 35 | + "updatefrontendlib" |
| 36 | + ], |
| 37 | + "problemMatcher": [] |
| 38 | + }, |
| 39 | + //Preliminary Deploy Config Setup |
| 40 | + { |
| 41 | + "label": "settingscheck", |
| 42 | + "type": "shell", |
| 43 | + "group": "none", |
| 44 | + "detail": "Check that settings.json has been created", |
| 45 | + "command": "${workspaceFolder}/.vscode/config.sh", |
| 46 | + // // placeholder for windows scripts, not currently planned |
| 47 | + // "windows": { |
| 48 | + // "command": "call ${workspaceFolder}\\.vscode\\config.bat", |
| 49 | + // }, |
| 50 | + "problemMatcher": [] |
| 51 | + }, |
| 52 | + //BUILD TASKS |
| 53 | + { |
| 54 | + "label": "cli-build", |
| 55 | + "group": "build", |
| 56 | + "detail": "Build plugin with CLI", |
| 57 | + "command": "${workspaceFolder}/.vscode/build.sh", |
| 58 | + // // placeholder for windows logic, not currently planned |
| 59 | + // "windows": { |
| 60 | + // "command": "call ${workspaceFolder}\\.vscode\\build.bat", |
| 61 | + // }, |
| 62 | + "problemMatcher": [] |
| 63 | + }, |
| 64 | + //"All-in-one" build task |
| 65 | + { |
| 66 | + "label": "build", |
| 67 | + "group": "build", |
| 68 | + "detail": "Build decky-plugin-template", |
| 69 | + "dependsOrder": "sequence", |
| 70 | + "dependsOn": [ |
| 71 | + "setup", |
| 72 | + "settingscheck", |
| 73 | + "cli-build", |
| 74 | + ], |
| 75 | + "problemMatcher": [] |
| 76 | + }, |
| 77 | + //DEPLOY TASKS |
| 78 | + //Copies the zip file of the built plugin to the plugins folder |
| 79 | + { |
| 80 | + "label": "copyzip", |
| 81 | + "detail": "Deploy plugin zip to deck", |
| 82 | + "type": "shell", |
| 83 | + "group": "none", |
| 84 | + "dependsOn": [ |
| 85 | + "chmodplugins" |
| 86 | + ], |
| 87 | + "command": "rsync -azp --chmod=D0755,F0755 --rsh='ssh -p ${config:deckport} ${config:deckkey}' out/ ${config:deckuser}@${config:deckip}:${config:deckdir}/homebrew/plugins", |
| 88 | + "problemMatcher": [] |
| 89 | + }, |
| 90 | + // |
| 91 | + { |
| 92 | + "label": "extractzip", |
| 93 | + "detail": "", |
| 94 | + "type": "shell", |
| 95 | + "group": "none", |
| 96 | + "command": "echo '${config:deckdir}/homebrew/plugins/${config:pluginname}.zip' && ssh ${config:deckuser}@${config:deckip} -p ${config:deckport} ${config:deckkey} 'echo ${config:deckpass} | sudo -S mkdir -m 755 -p \"$(echo \"${config:deckdir}/homebrew/plugins/${config:pluginname}\" | sed \"s| |-|g\")\" && echo ${config:deckpass} | sudo -S chown ${config:deckuser}:${config:deckuser} \"$(echo \"${config:deckdir}/homebrew/plugins/${config:pluginname}\" | sed \"s| |-|g\")\" && echo ${config:deckpass} | sudo -S bsdtar -xzpf \"${config:deckdir}/homebrew/plugins/${config:pluginname}.zip\" -C \"$(echo \"${config:deckdir}/homebrew/plugins/${config:pluginname}\" | sed \"s| |-|g\")\" --strip-components=1 --fflags '", |
| 97 | + "problemMatcher": [] |
| 98 | + }, |
| 99 | + //"All-in-one" deploy task |
| 100 | + { |
| 101 | + "label": "deploy", |
| 102 | + "dependsOrder": "sequence", |
| 103 | + "group": "none", |
| 104 | + "dependsOn": [ |
| 105 | + "copyzip", |
| 106 | + "extractzip" |
| 107 | + ], |
| 108 | + "problemMatcher": [] |
| 109 | + }, |
| 110 | + //"All-in-on" build & deploy task |
| 111 | + { |
| 112 | + "label": "builddeploy", |
| 113 | + "detail": "Builds plugin and deploys to deck", |
| 114 | + "dependsOrder": "sequence", |
| 115 | + "group": "none", |
| 116 | + "dependsOn": [ |
| 117 | + "build", |
| 118 | + "deploy" |
| 119 | + ], |
| 120 | + "problemMatcher": [] |
| 121 | + }, |
| 122 | + //GENERAL TASKS |
| 123 | + //Update Decky Frontend Library, aka DFL |
| 124 | + { |
| 125 | + "label": "updatefrontendlib", |
| 126 | + "type": "shell", |
| 127 | + "group": "build", |
| 128 | + "detail": "Update @decky/ui aka DFL", |
| 129 | + "command": "pnpm update @decky/ui --latest", |
| 130 | + "problemMatcher": [] |
| 131 | + }, |
| 132 | + //Used chmod plugins folder to allow copy-over of files |
| 133 | + { |
| 134 | + "label": "chmodplugins", |
| 135 | + "detail": "chmods plugins folder to prevent perms issues", |
| 136 | + "type": "shell", |
| 137 | + "group": "none", |
| 138 | + "command": "ssh ${config:deckuser}@${config:deckip} -p ${config:deckport} ${config:deckkey} 'echo '${config:deckpass}' | sudo -S chown ${config:deckuser} ${config:deckdir}/homebrew/plugins/'", |
| 139 | + "problemMatcher": [] |
| 140 | + }, |
| 141 | + { |
| 142 | + "label": "restartdecky", |
| 143 | + "detail": "restarts decky", |
| 144 | + "type": "shell", |
| 145 | + "group": "none", |
| 146 | + "command": "ssh ${config:deckuser}@${config:deckip} -p ${config:deckport} ${config:deckkey} 'echo '${config:deckpass}' | sudo -S systemctl restart plugin_loader'", |
| 147 | + "problemMatcher": [] |
| 148 | + }, |
| 149 | + ] |
| 150 | +} |
0 commit comments