AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [tweak] Compile plugins by double click (https://forums.alliedmods.net/showthread.php?t=311594)

Dragokas 10-25-2018 00:09

[tweak] Compile plugins by double click
 
1 Attachment(s)
Purpose:

This allows you to compile .sp files by double click, offline.

Installation:
1. Download stand-alone (offline) compiler and unpack it to convenient folder, like "d:\dev\SourceMod" where it'll be untoched.
2. Unpack archive, attached below.
3. Right click on file "SP_Assoc.cmd" => choose "Edit", set correct path to spcomp.exe in this line:
Code:

set SPCompPath=d:\dev\SourceMod\addons\sourcemod\scripting\spcomp.exe
an save.
4. Right click on file "SP_Assoc.cmd" => choose "Run as Administrator".

My batch file will install for you required registry entries. Now, you are fine.

How to use:
Just double click on .sp file.
Console window will appear for ~2 sec if compilation is success. You'll have enough time to read "warnings".
If compilation is failed, console window will be set in pause.

P.S. Also, see notice:
- in post #3 about Notepad++ / Akelpad integration.
- in post #10 about Sublime Text integration.

Lubricant Jam 10-25-2018 05:45

Re: [tweak] Compile plugins by double click
 
Seems very useful, thanks!

Dragokas 10-25-2018 09:08

Re: [tweak] Compile plugins by double click
 
You are welcome.

Using above tweak you can also compile plugins directly from AkelPad or Notepad++ editor.
That requires a little adjustment:

For AkelPad:

Main menu -> Options -> Settings -> General -> Execute ->

"Command" field, enter:
Code:

rundll32.exe shell32,ShellExec_RunDLL "%f"
"Working direcory" field, enter:
Code:

%d
Now, you can run compilation on Ctrl + F5 hotkey from AkelPad.


For Notepad++:

Press F5, enter in field:
Code:

rundll32.exe shell32,ShellExec_RunDLL "$(FULL_CURRENT_PATH)"
Press save, select convenient hotkey, e.g. Ctrl + F5, press OK. Close.

Now, you can run compilation on Ctrl + F5 hotkey from N++.

Lubricant Jam 10-29-2018 05:55

Re: [tweak] Compile plugins by double click
 
Quote:

Originally Posted by Dragokas (Post 2621231)
You are welcome.

Using above tweak you can also compile plugins directly from AkelPad or Notepad++ editor.
That requires a little adjustment:

For AkelPad:

Main menu -> Options -> Settings -> General -> Execute ->

"Command" field, enter:
Code:

rundll32.exe shell32,ShellExec_RunDLL "%f"
"Working direcory" field, enter:
Code:

%d
Now, you can run compilation on Ctrl + F5 hotkey from AkelPad.


For Notepad++:

Press F5, enter in field:
Code:

rundll32.exe shell32,ShellExec_RunDLL "$(FULL_CURRENT_PATH)"
Press save, select convenient hotkey, e.g. Ctrl + F5, press OK. Close.

Now, you can run compilation on Ctrl + F5 hotkey from N++.

If you could get it to work with Visual Studio Code, that'd be perfect.

Dragokas 10-29-2018 08:21

Re: [tweak] Compile plugins by double click
 
Quote:

Originally Posted by Lubricant Jam (Post 2621742)
If you could get it to work with Visual Studio Code, that'd be perfect.

lol. MSVS is too slow donkey for such simple tasks.

N++ + Autocompletion/highlight + hotkey compilation + ftp uploader + autoreload + good theme => you are in chocolate :)

P.S. Or you mean compile C++ in N++ ?

Lubricant Jam 10-29-2018 09:49

Re: [tweak] Compile plugins by double click
 
Quote:

Originally Posted by Dragokas (Post 2621757)
lol. MSVS is too slow donkey for such simple tasks.

N++ + Autocompletion/highlight + hotkey compilation + ftp uploader + autoreload + good theme => you are in chocolate :)

P.S. Or you mean compile C++ in N++ ?

Nah, on about Visual Studio Code. I don't see no performance issues, probably because my PC is overkill xD

Dragokas 12-14-2018 14:21

Re: [tweak] Compile plugins by double click
 
Updated archive in 1st post to set current directory (required by Notepad++).

SteveSmith10 01-15-2019 04:15

Re: [tweak] Compile plugins by double click
 
Windows Drag and Drop. Drag the .sma file onto "compile.exe". Look in the compiled folder for the output .amxx file. Compiling All Plugins. Double click compile.exe to compile all plugins into the compiled folder.For More Details..

Dragokas 01-15-2019 06:50

Re: [tweak] Compile plugins by double click
 
SteveSmith10, what is a goal of your post?
Are you asking about adding amx plugins support to double-click tweak?

404UserNotFound 01-30-2019 13:52

Re: [tweak] Compile plugins by double click
 
Any chance of a Sublime Text 3 compiler?

Also thanks for the double-click compile thing. I'm gonna spread this around as this is really useful.

Dragokas 01-31-2019 03:46

Re: [tweak] Compile plugins by double click
 
Hi, 404UNF!
Thank you for interest.

Quote:

Any chance of a Sublime Text 3 compiler?
That is easy:

Tools -> Build System -> New Build System ...
Code:

{
        "shell_cmd": "rundll32.exe shell32,ShellExec_RunDLL $file"
}

File -> Save -> SourceMod.sublime-build

Building process:

Open any .sp file
Select Tools -> Build System -> SourceMod
Ctrl + B

Next time it should remember it. Otherwise: e.g. do like in this topic:
https://stackoverflow.com/questions/...file-extension
(actually, I never worked with Sublime yet)

Quote:

Also thanks for the double-click compile thing. I'm gonna spread this around as this is really useful.
Unfortunately, I missed Windows 8+ has file association protection. I will update my script as soon as I have a free time.
Current Win8+ support is partial.
Also, I am going to add automatic custom include files support.

404UserNotFound 02-06-2019 18:02

Re: [tweak] Compile plugins by double click
 
Excellent! Thanks for all the info :D

xFlane 02-07-2019 09:11

Re: [tweak] Compile plugins by double click
 
Thanks for sharing!

xtance 12-17-2019 13:34

Re: [tweak] Compile plugins by double click
 
Is it possible to add flags to spcomp when using this? https://wiki.alliedmods.net/Spcomp_switches
Thanks in advance

Dragokas 12-17-2019 15:36

Re: [tweak] Compile plugins by double click
 
What exact argument do you want to append to?

Most easy way for you would be open Registry Editor, navigate to:
Quote:

HKCR\sourcepawnfile\shell\open\command
and insert desired argument after this part of line:
Code:

\spcomp.exe" "%1"

user2000 06-07-2020 05:30

Re: [tweak] Compile plugins by double click
 
excuse my ignorance what is the difference between compile and spcomp?

Dragokas 06-07-2020 15:20

Re: [tweak] Compile plugins by double click
 
I think, you found inappropriate topic to ask such question.
AFAIK, compiler.exe is a tool intended for batch compiling all sp files located next to him. Just double-click it, and you found all smx in "compiled" subfolder.
spcomp.exe is a tool responsible for compiling process with ability to accept additional options via command line:
Spoiler

user2000 06-08-2020 00:47

Re: [tweak] Compile plugins by double click
 
ok thanks for the explanation Dragokas


All times are GMT -4. The time now is 22:28.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.