Raised This Month: $51 Target: $400
 12% 

[Sublime Text 2] Auto-increment plugin version


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 11-15-2014 , 06:56   [Sublime Text 2] Auto-increment plugin version
Reply With Quote #1

Description:
When you save a *.sma file in ST2, this plugin searches for a version in your plugin and auto-increments it.
PPalex's plugin helped me in writing this one(this thread), and I haven't asked him about using his plugin as a base for mine. PPalex, if you do not want me to release a plugin that uses your code, feel free to write me a PM and I will take it down.

How to use
The version written in a plugin can't be in any format, it has to follow certain rules.
The version format looks like: [v]{major}.{minor}.{build/revision}[b[eta]], and it can either be a define(macro), or a constant string, with a symbol name of PLUGIN_VERSION or VERSION (case-insensitive). The plugin will increment the {build/revision} number by 1.

Valid version string examples:
PHP Code:
#define PLUGIN_VERSION "1.0.124"
#define       VERSION       "v1.0.124" // Use as many spaces/tabs; also there is 'v' in front of the version number
#define Plugin_Version      "v1.0.124b" // Case-insensitive; 'b' following the version number

new const Version[] = "1.0.124beta" // Constant string; 'beta' following the version number
new   const   VeRsIoN [ ] = "v1.0.124b" // Again, use as many spaces 
Installation:
Put the archive contents to:
  • WinXP: %appdata%/Sublime Text 2/Packages/User
  • Others (or at least I think so): %appdata%/Roaming/Sublime Text 2/Packages/User

* If you have any suggestions, or complaints, feel free to write it down in this thread.
Attached Files
File Type: zip version_inc.zip (1.5 KB, 108 views)
klippy is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 11-15-2014 , 08:22   Re: [Sublime Text 2] Auto-increment plugin version
Reply With Quote #2

Looks nice, good job.
__________________
Kia is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 11-15-2014 , 14:35   Re: [Sublime Text 2] Auto-increment plugin version
Reply With Quote #3

It would be nice to have a way to define your self the macro name. Also, does it check in that particular .sma file which you save? Cause I'm using version number in .inc file. Does this work for ST3?
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 11-15-2014 , 16:03   Re: [Sublime Text 2] Auto-increment plugin version
Reply With Quote #4

Quote:
Originally Posted by GuskiS View Post
It would be nice to have a way to define your self the macro name. Also, does it check in that particular .sma file which you save? Cause I'm using version number in .inc file. Does this work for ST3?
It is ST2, not ST3 (it has some extended API), but either way, I am not sure if I can do it.
I can allow user to change macro name with settings, that would be no problem. And, because you are using it in your .inc, is .inc in the same folder as .sma is? Or at least relative to it, i.e, .sma file location is
Code:
C:/plugins/plugin.sma
and you include your .inc file like so:
Code:
#include "include/version.inc"
so, include file location is
Code:
C:/plugins/include/version.inc
If so, that can be done I guess, because I can get .sma file's path.

@Kia, thanks.

Last edited by klippy; 11-15-2014 at 16:03.
klippy is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 11-15-2014 , 18:53   Re: [Sublime Text 2] Auto-increment plugin version
Reply With Quote #5

I just include it this way:
Quote:
#include <myinclude>
So that file is in my includes folder.
Quote:
C:\plugins\plugin.sma
C:\plugins\includes\myinclude.inc
Also, In windows it is \ not / (smartassoverhere)
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness

Last edited by GuskiS; 11-15-2014 at 18:54.
GuskiS is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 11-16-2014 , 04:48   Re: [Sublime Text 2] Auto-increment plugin version
Reply With Quote #6

Quote:
Originally Posted by GuskiS View Post
I just include it this way:
So that file is in my includes folder.

Also, In windows it is \ not / (smartassoverhere)
In Windows, '\' is standard, but '/' is also valid. And I've only written '/' because I didn't know what OS you are using.

I guess I will check both in the same directory, and also "./include/" for included files, so I will try to fulfill your request.
klippy is offline
Netsys
Senior Member
Join Date: Feb 2010
Old 10-15-2015 , 17:05   Re: [Sublime Text 2] Auto-increment plugin version
Reply With Quote #7

I think it's buggy, of "0.1.10000" goes "0.1.10010" instead of "0.1.10001"

Last edited by Netsys; 10-15-2015 at 17:06.
Netsys is offline
Reply



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 06:37.


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