sourcepawn-vscode icon indicating copy to clipboard operation
sourcepawn-vscode copied to clipboard

AutoCompile?

Open Rostu13 opened this issue 7 years ago • 3 comments

Hello, I feel like a complete kettle, but I can not figure out how to enable auto-complation of plugins.

Rostu13 avatar Jan 18 '18 05:01 Rostu13

Auto-compilation is currently not supported by the extension, though it is a possible future feature.

Dreae avatar Jan 20 '18 16:01 Dreae

it is will very conveniently. (Open notepad++ sake of compile not convenient) :)

Rostu13 avatar Jan 21 '18 08:01 Rostu13

It is very easy to make a custom build task in vscode.

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Compile plugin",
            "type": "process",
            "command": ".\\spcomp.exe",
            "args": [
                "${fileBasename}",
                "-w205"
            ],
            "group": "build"
        },
        {
            "label": "Compile && deploy",
            "type": "shell",
            "command": ".\\spc.bat",
            "args": [
                "${fileBasename}"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}
@ECHO OFF
move /Y "..\plugins\%~n1.smx" "..\plugins\disabled\%~n1.smx.bak"
spcomp.exe "%~1"
move /Y "%~n1.smx" "..\plugins"

The first one is using spcomp.exe to compile the plugin; the second one is a custom bat file that compile and copy the plugin to plugins folder.

kice avatar Sep 23 '18 04:09 kice