-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New version control * check dependencies * fix error code 128 * test fix * test fix 2 * test fix 3 * test fix 4 * test fix 5 * test fix 6 * test fix 7 * test fix 8 * test fix 9 * test fix 10 * test fix 11 * test fix 12 * test fix 13 * test fix 14 * test fix 15 * test fix 15 * test fix 16 * test fix 17 * test fix 18 * test fix 19 * test fix 20 * test fix 21 * final fix? * improving for pr * another fix * fixing again -_-
- Loading branch information
1 parent
a92b207
commit b0d5573
Showing
10 changed files
with
253 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#if defined _mm_checks_included_ | ||
#endinput | ||
#endif | ||
#define _mm_checks_included_ | ||
|
||
// Do NOT modify this file! | ||
|
||
/** | ||
* AMX Mod X version check | ||
*/ | ||
#if AMXX_VERSION_NUM < 200 | ||
#error "Multimod Manager CS requires AMX Mod X 1.10 or higher. Download from: https://www.amxmodx.org/downloads-new.php?branch=master" | ||
#endif | ||
|
||
/** | ||
* ReAPI version check | ||
*/ | ||
#if REAPI_VERSION < 524300 | ||
#error "Multimod Manager CS requires ReAPI 5.24.300 or higher. Download from: https://github.com/s1lentq/reapi/releases/latest" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
addons/amxmodx/scripting/include/multimod_manager_checks.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#if defined _multimod_manager_checks_included_ | ||
#endinput | ||
#endif | ||
#define _multimod_manager_checks_included_ | ||
|
||
// Do NOT modify this file! | ||
|
||
/** | ||
* AMX Mod X version check | ||
*/ | ||
#if defined AMXX_VERSION_NUM | ||
#if AMXX_VERSION_NUM < 200 | ||
#error "[API] Multimod Manager CS requires AMX Mod X 1.10 or higher. Download from: https://www.amxmodx.org/downloads-new.php?branch=master" | ||
#endif | ||
#else | ||
#error "[API] Multimod Manager CS: please include multimod_manager_natives.inc after including amxmodx.inc." | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/bin/bash | ||
|
||
init() | ||
{ | ||
SOURCE_DIR=$1 | ||
GIT_DIR=$SOURCE_DIR | ||
VERSION_FILE=$SOURCE_DIR/version/version.h | ||
APPVERSION_FILE=$SOURCE_DIR/version/version.inc | ||
APPVERSION_FILE_NATIVES=$SOURCE_DIR/version/multimod_manager_version.inc | ||
|
||
MAJOR=$(cat "$VERSION_FILE" | grep -wi 'MM_VERSION_MAJOR' | sed -e 's/.*MM_VERSION_MAJOR.*[^0-9]\([0-9][0-9]*\).*/\1/i' -e 's/\r//g') | ||
if [ $? -ne 0 -o "$MAJOR" = "" ]; then | ||
MAJOR=0 | ||
fi | ||
|
||
MINOR=$(cat "$VERSION_FILE" | grep -wi 'MM_VERSION_MINOR' | sed -e 's/.*MM_VERSION_MINOR.*[^0-9]\([0-9][0-9]*\).*/\1/i' -e 's/\r//g') | ||
if [ $? -ne 0 -o "$MINOR" = "" ]; then | ||
MINOR=0 | ||
fi | ||
|
||
MAINTENANCE=$(cat "$VERSION_FILE" | grep -i 'MM_VERSION_MAINTENANCE' | sed -e 's/.*MM_VERSION_MAINTENANCE.*[^0-9]\([0-9][0-9]*\).*/\1/i' -e 's/\r//g') | ||
if [ $? -ne 0 -o "$MAINTENANCE" = "" ]; then | ||
MAINTENANCE=0 | ||
fi | ||
|
||
BRANCH_NAME=$(git -C "$GIT_DIR" rev-parse --abbrev-ref HEAD) | ||
if [ $? -ne 0 -o "$BRANCH_NAME" = "" ]; then | ||
BRANCH_NAME=master | ||
fi | ||
|
||
COMMIT_COUNT=$(git -C "$GIT_DIR" rev-list --count $BRANCH_NAME) | ||
if [ $? -ne 0 -o "$COMMIT_COUNT" = "" ]; then | ||
COMMIT_COUNT=0 | ||
fi | ||
|
||
NEW_VERSION_INC="$MAJOR$MINOR$MAINTENANCE$COMMIT_COUNT" | ||
NEW_VERSION="$MAJOR.$MINOR.$MAINTENANCE.$COMMIT_COUNT" | ||
|
||
echo "NEW_VERSION_INC=${NEW_VERSION_INC}" >> $GITHUB_ENV | ||
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV | ||
|
||
update_appversion | ||
} | ||
|
||
update_appversion() | ||
{ | ||
echo Updating $APPVERSION_FILE, new version is '"'$NEW_VERSION'"' | ||
|
||
echo -e "#if defined _mm_version_included_\r">$APPVERSION_FILE | ||
echo -e " #endinput\r">>$APPVERSION_FILE | ||
echo -e "#endif\r">>$APPVERSION_FILE | ||
echo -e "#define _mm_version_included_\r">>$APPVERSION_FILE | ||
echo -e "\r">>$APPVERSION_FILE | ||
echo -e "// MultiMod Manager version\r">>$APPVERSION_FILE | ||
echo -e "#define MM_VERSION $NEW_VERSION_INC\r">>$APPVERSION_FILE | ||
echo -e "#define MM_VERSION_MAJOR $MAJOR\r">>$APPVERSION_FILE | ||
echo -e "#define MM_VERSION_MINOR $MINOR\r">>$APPVERSION_FILE | ||
echo -e "#define MM_VERSION_MAINTENANCE $MAINTENANCE\r">>$APPVERSION_FILE | ||
echo -e "#define MM_VERSION_COMMIT $COMMIT_COUNT\r">>$APPVERSION_FILE | ||
echo -e "\r">>$APPVERSION_FILE | ||
echo -e "#define PLUGIN_VERSION fmt(\"v%d.%d.%d.%d\", MM_VERSION_MAJOR, MM_VERSION_MINOR, MM_VERSION_MAINTENANCE, MM_VERSION_COMMIT)\r">>$APPVERSION_FILE | ||
|
||
echo Updating $APPVERSION_FILE_NATIVES, new version is '"'$NEW_VERSION'"' | ||
|
||
echo -e "#if defined _multimod_manager_version_included_\r">$APPVERSION_FILE_NATIVES | ||
echo -e " #endinput\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#endif\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define _multimod_manager_version_included_\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "// MultiMod Manager version\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_VERSION $NEW_VERSION_INC\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_VERSION_MAJOR $MAJOR\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_VERSION_MINOR $MINOR\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_VERSION_MAINTENANCE $MAINTENANCE\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_VERSION_COMMIT $COMMIT_COUNT\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_NATIVES_API_VER fmt(\"v%d.%d.%d.%d\", MM_VERSION_MAJOR, MM_VERSION_MINOR, MM_VERSION_MAINTENANCE, MM_VERSION_COMMIT)\r">>$APPVERSION_FILE_NATIVES | ||
} | ||
|
||
# Initialise | ||
init $* | ||
|
||
# Exit normally | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/bash | ||
|
||
init() | ||
{ | ||
SOURCE_DIR=$1 | ||
GIT_DIR=$SOURCE_DIR | ||
VERSION_FILE=$SOURCE_DIR/version/version.h | ||
APPVERSION_FILE=$SOURCE_DIR/version/version.inc | ||
APPVERSION_FILE_NATIVES=$SOURCE_DIR/version/multimod_manager_version.inc | ||
PULL_REQUEST_ID=$2 | ||
|
||
MAJOR=$(cat "$VERSION_FILE" | grep -wi 'MM_VERSION_MAJOR' | sed -e 's/.*MM_VERSION_MAJOR.*[^0-9]\([0-9][0-9]*\).*/\1/i' -e 's/\r//g') | ||
if [ $? -ne 0 -o "$MAJOR" = "" ]; then | ||
MAJOR=0 | ||
fi | ||
|
||
MINOR=$(cat "$VERSION_FILE" | grep -wi 'MM_VERSION_MINOR' | sed -e 's/.*MM_VERSION_MINOR.*[^0-9]\([0-9][0-9]*\).*/\1/i' -e 's/\r//g') | ||
if [ $? -ne 0 -o "$MINOR" = "" ]; then | ||
MINOR=0 | ||
fi | ||
|
||
MAINTENANCE=$(cat "$VERSION_FILE" | grep -i 'MM_VERSION_MAINTENANCE' | sed -e 's/.*MM_VERSION_MAINTENANCE.*[^0-9]\([0-9][0-9]*\).*/\1/i' -e 's/\r//g') | ||
if [ $? -ne 0 -o "$MAINTENANCE" = "" ]; then | ||
MAINTENANCE=0 | ||
fi | ||
|
||
BRANCH_NAME=$(git -C "$GIT_DIR" rev-parse --abbrev-ref HEAD) | ||
if [ $? -ne 0 -o "$BRANCH_NAME" = "" ]; then | ||
BRANCH_NAME=master | ||
fi | ||
|
||
COMMIT_COUNT=$(git -C "$GIT_DIR" rev-list --count $BRANCH_NAME) | ||
if [ $? -ne 0 -o "$COMMIT_COUNT" = "" ]; then | ||
COMMIT_COUNT=0 | ||
fi | ||
|
||
NEW_VERSION_INC="$MAJOR$MINOR$MAINTENANCE$COMMIT_COUNT" | ||
NEW_VERSION="$MAJOR.$MINOR.$MAINTENANCE.$COMMIT_COUNT-pr#$PULL_REQUEST_ID" | ||
|
||
echo "NEW_VERSION_INC=${NEW_VERSION_INC}" >> $GITHUB_ENV | ||
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV | ||
|
||
update_appversion | ||
} | ||
|
||
update_appversion() | ||
{ | ||
echo Updating $APPVERSION_FILE, new version is '"'$NEW_VERSION'"' | ||
|
||
echo -e "#if defined _mm_version_included_\r">$APPVERSION_FILE | ||
echo -e " #endinput\r">>$APPVERSION_FILE | ||
echo -e "#endif\r">>$APPVERSION_FILE | ||
echo -e "#define _mm_version_included_\r">>$APPVERSION_FILE | ||
echo -e "\r">>$APPVERSION_FILE | ||
echo -e "// MultiMod Manager version\r">>$APPVERSION_FILE | ||
echo -e "#define MM_VERSION $NEW_VERSION_INC\r">>$APPVERSION_FILE | ||
echo -e "#define MM_VERSION_MAJOR $MAJOR\r">>$APPVERSION_FILE | ||
echo -e "#define MM_VERSION_MINOR $MINOR\r">>$APPVERSION_FILE | ||
echo -e "#define MM_VERSION_MAINTENANCE $MAINTENANCE\r">>$APPVERSION_FILE | ||
echo -e "#define MM_VERSION_COMMIT $COMMIT_COUNT\r">>$APPVERSION_FILE | ||
echo -e "#define MM_VERSION_PR_ID $PULL_REQUEST_ID\r">>$APPVERSION_FILE | ||
echo -e "\r">>$APPVERSION_FILE | ||
echo -e "#define PLUGIN_VERSION fmt(\"v%d.%d.%d.%d-pr#%d\", MM_VERSION_MAJOR, MM_VERSION_MINOR, MM_VERSION_MAINTENANCE, MM_VERSION_COMMIT, MM_VERSION_PR_ID)\r">>$APPVERSION_FILE | ||
|
||
echo Updating $APPVERSION_FILE_NATIVES, new version is '"'$NEW_VERSION'"' | ||
|
||
echo -e "#if defined _multimod_manager_version_included_\r">$APPVERSION_FILE_NATIVES | ||
echo -e " #endinput\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#endif\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define _multimod_manager_version_included_\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "// MultiMod Manager version\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_VERSION $NEW_VERSION_INC\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_VERSION_MAJOR $MAJOR\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_VERSION_MINOR $MINOR\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_VERSION_MAINTENANCE $MAINTENANCE\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_VERSION_COMMIT $COMMIT_COUNT\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_VERSION_PR_ID $PULL_REQUEST_ID\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "\r">>$APPVERSION_FILE_NATIVES | ||
echo -e "#define MM_NATIVES_API_VER fmt(\"v%d.%d.%d.%d-pr#%d\", MM_VERSION_MAJOR, MM_VERSION_MINOR, MM_VERSION_MAINTENANCE, MM_VERSION_COMMIT, MM_VERSION_PR_ID)\r">>$APPVERSION_FILE_NATIVES | ||
} | ||
|
||
# Initialise | ||
init $* | ||
|
||
# Exit normally | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Version declaration dependency file | ||
* | ||
*/ | ||
|
||
#define MM_VERSION_MAJOR 2 | ||
#define MM_VERSION_MINOR 3 | ||
#define MM_VERSION_MAINTENANCE 0 |