File tree Expand file tree Collapse file tree 5 files changed +49
-5
lines changed
addons/sourcemod/scripting/include/influx Expand file tree Collapse file tree 5 files changed +49
-5
lines changed Original file line number Diff line number Diff line change 1
1
builds
2
+ # autoversion is generated by CI
3
+ autoversion.inc
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ before_script:
36
36
- python setup.py install --prefix=~/.local
37
37
38
38
- cd $TRAVIS_BUILD_DIR
39
+ # Generate autoversion.inc
40
+ - python generate_auto_version.py build-$TRAVIS_BUILD_NUMBER
39
41
40
42
script :
41
43
- smbuilder --flags " -i=addons/sourcemod/scripting/include"
Original file line number Diff line number Diff line change 9
9
#include < msharedutil/arrayvec>
10
10
#include < msharedutil/ents>
11
11
12
+ #tryinclude < influx/autoversion>
13
+
12
14
13
15
# define INF_NAME " Influx"
14
16
# define INF_AUTHOR " Mehis"
15
- # define INF_URL " http ://influxtimer.com/"
16
- // If a plugin doesn't have the same version number, it may need a recompile.
17
- # define INF_VERSION " 1.3 "
18
-
17
+ # define INF_URL " https ://influxtimer.com/"
18
+ #if ! defined INF_VERSION
19
+ # define INF_VERSION " manual "
20
+ #endif
19
21
20
22
# define INF_MAXPLAYERS MAXPLAYERS + 1
21
23
Original file line number Diff line number Diff line change 2
2
3
3
echo " Deploying..."
4
4
5
- # Zip em and roll em into a tar ball
6
5
cd builds
6
+
7
+ # We don't want to include the auto version here.
8
+ rm addons/sourcemod/scripting/include/influx/autoversion.inc
9
+
10
+ # Zip em and roll em into a tar ball
7
11
cd full && zip -rq9 ../full.zip . && cd ..
8
12
cd bhop && zip -rq9 ../bhop.zip . && cd ..
9
13
cd surf && zip -rq9 ../surf.zip . && cd ..
Original file line number Diff line number Diff line change
1
+ import os
2
+ import sys
3
+
4
+
5
+ REL_FILE_PATH = 'addons/sourcemod/scripting/include/influx/autoversion.inc'
6
+
7
+
8
+ def write_to_file (file_path , version ):
9
+ if not os .path .isdir (os .path .dirname (file_path )):
10
+ raise Exception ('Failed to build path to autoversion file! (%s)' %
11
+ file_path )
12
+
13
+ with open (file_path , 'w' ) as fp :
14
+ fp .write ("""
15
+ #if defined _influx_autoversion_included
16
+ #endinput
17
+ #endif
18
+ #define _influx_autoversion_included
19
+
20
+ #define INF_VERSION "%s"
21
+ """ % version )
22
+
23
+
24
+ def main ():
25
+ full_path = os .path .join (os .path .dirname (__file__ ), REL_FILE_PATH )
26
+
27
+ if len (sys .argv ) < 2 :
28
+ raise Exception ('No version string given!' )
29
+
30
+ write_to_file (full_path , sys .argv [1 ])
31
+
32
+
33
+ if __name__ == '__main__' :
34
+ main ()
You can’t perform that action at this time.
0 commit comments