Raised This Month: $2 Target: $400
 0% 

New compile.bat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-21-2004 , 14:07   New compile.bat
Reply With Quote #1

Do you think it is annoying that compile.bat always recompiles all the plugins in the folder? I also do, so here is a solution:
PM's 1337 compile.bat
The main advantages are:
- It only recompiles plugins that are new in the scripting folder or were changed
- In the end, it gives you a nice report about the compilation
- *NEW* You can use any compiler you want

Updating from version1:
Just download the new compile.zip, unzip it into your scripting folder (or whatever), and run it. It will do all neccessary steps on its own!

Changelog:
Code:
  Version3:
    - Fixed bug where the compile.bat wouldn't find sc.exe (Thanks rex!)
    - Fixed bug with clearing the cbnewest env var (Thanks rex!)
    - Fixed bug where the file would be marked as succesfully compiled although there were warnings / errors
    - Added /I option which tells the compile.bat not to recompile plugins that had warnings but generated a .amx next time.
  Version2:
    - Moved the 0pluginname.sma.cbtmi files into the (also hidden) cbtmi directory (used rex's way; thanks again rex!)
    - The file name now doesn't matter (but it has to be .bat)
    - Added /C [compiler] option where you can specify an another compiler (not "sc.exe")
    - The compiler now doesn't put informations about plugins that haven't changed since last compilation into the end report
    - You can change this behaviour using the /V (verbose) option
  Version1:
    Initial release
Optional parameters are:
Code:
 /H
   Display usage info
 /R
   Recompile all plugins
    Default: off
 /C [compiler]
   Use the specified compiler
    Default: sc.exe
 /V
   Verbose: Print info into the end report also when no compilation occured
    Default: off
 /I
   Don't recompile plugins with warnings
    Default: off (recompile them)
Planned features:
Code:
  Parameter /Q [optional: filename]
   Quiet mode: The compile.bat won't output anything to the screen and will write the report to filename, if specified.
Post any bug reports / feature requests / whatever in this thread
Have fun!
Attached Files
File Type: zip compile.zip (2.7 KB, 872 views)
__________________
hello, i am pm
PM is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 07-21-2004 , 14:25  
Reply With Quote #2

sweet, gonna try this baby out

-----

Do I have to do something special to make it work???

Code:
The system cannot find the file specified.
Press any key to continue . . .
Thats the only output I get besides the welcome message thing which gets cleared, then that displays
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
blackflagg
Member
Join Date: Apr 2004
Old 07-21-2004 , 15:15  
Reply With Quote #3

Nice idea! I did something a little easier. I put all the sma files into a directory called sma. Then when I want to compile a script its the only one in the compile directory.
blackflagg is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-21-2004 , 15:26  
Reply With Quote #4

I might change my script to use the compiled .amx files as compile time indicators instead of using hidden 0pluginname.sma.cbtmi files. That would be better, but harder to implement
__________________
hello, i am pm
PM is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 07-21-2004 , 16:24  
Reply With Quote #5

Its not working for me..... is there something special that needs to be done? See my post above for the error I am getting.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
Ingram
Veteran Member
Join Date: May 2004
Old 07-21-2004 , 18:44  
Reply With Quote #6

PM, plz do i don't like hidden files. I always show all files on (not OS files of course) and i don't like seeing files hidden in a folder i'm trying to keep clean
Ingram is offline
rex
Senior Member
Join Date: Mar 2004
Location: Australia
Old 07-21-2004 , 20:49  
Reply With Quote #7

Very nice PM, works well.
To get around the 0pluginname.sma.cbtmi files in the scripting directory cound you put them in another directory eg. scripting\cbtmi that would keep the scripting directory clean.
anyway thumbs up on a good job.
__________________
Come and join us at Cricket Manager
http://boundary.cricketmanager.co.uk...t Manager Fans
rex is offline
Send a message via MSN to rex
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 07-21-2004 , 21:38  
Reply With Quote #8

ok I got it to work, for some reaosn it wont work if I rename it.

Also, I don't like the hidden files because I also have the showing of hidden files ON so I see them all :/

Makes it cluttered.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-22-2004 , 03:41  
Reply With Quote #9

If you look at the batch file source, you can see that it is hacky enough :=
But I'll try to hack it more so that it can handle the .amx files.
The problem is:
a) Another directory
b) Another extension

(debug.exe hacking probably)
__________________
hello, i am pm
PM is offline
rex
Senior Member
Join Date: Mar 2004
Location: Australia
Old 07-22-2004 , 05:16  
Reply With Quote #10

can you just make it write the .cbtmi into another directory?
eg \addons\amxx\scripting\check
instead of just \addons\amxx\scripting
something like this.
IF "%cbnewest%"=="check\0%1.cbtmi"
that way the hidden files wouldn't be in the scripting directory.
just an ideal.
or maybe if you have the compile.bat in another directory and just a shortcut to it in the scripting directory.

or or
hang testing this out.
here you go, this should work.
if you add these lines to the compile.bat file.
to the very top
move check\*.cbtmi
cls

eg
Code:
move check\*.cbtmi cls @ECHO OFF REM ******* Write header *******   ECHO AMX Mod X   ECHO.   ECHO by the AMX Mod X Development Team   ECHO originally developed by OLO   ECHO.   ECHO This file is part of AMX Mod X.   ECHO.
and to the bottom
if not exist check mkdir check
attrib -h *.cbtmi
move *.cbtmi check [/small]

eg
Code:
REM ***** Pause so the user can read the output pause if not exist check mkdir check attrib -h *.cbtmi move *.cbtmi check
that way all the .cbtmi files are in there own directoy and only show in the scripting directoy while compile.bat is running.
not really a fix but a work around
__________________
Come and join us at Cricket Manager
http://boundary.cricketmanager.co.uk...t Manager Fans
rex is offline
Send a message via MSN to rex
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:52.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode