Skip to content

Commit

Permalink
Revert "Use git for revision instead of genrevision magic"
Browse files Browse the repository at this point in the history
This reverts commit a3742c8.
  • Loading branch information
namreeb committed Nov 10, 2016
1 parent bf2bb58 commit eefb4bb
Show file tree
Hide file tree
Showing 27 changed files with 1,125 additions and 23 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

src/shared/revision_nr.h eol=lf
src/shared/revision_sql.h eol=lf
src/shared/revision.h ident

# Whitespace rules
# strict (no trailing, no tabs)
Expand Down
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,21 @@ if(NOT BUILD_CORE AND NOT BUILD_EXTRACTOR AND NOT BUILD_VMAP_EXTRACTOR AND NOT B
message(FATAL_ERROR "You must select something to build!")
endif()

# Generate revision-extractor
set(GENREV_SRC
src/tools/genrevision/genrevision.cpp
)

add_executable(genrev
${GENREV_SRC}
)

add_custom_target("revision.h" ALL
COMMAND genrev ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
DEPENDS genrev
)

if(WIN32)
install(
FILES
Expand Down
2 changes: 2 additions & 0 deletions src/game/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@ if(UNIX)
endif()
endif()

add_dependencies(${LIBRARY_NAME} revision.h)

# Generate precompiled header
if(PCH)
cotire(${LIBRARY_NAME})
Expand Down
6 changes: 3 additions & 3 deletions src/game/Level0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "AccountMgr.h"
#include "ScriptMgr.h"
#include "SystemConfig.h"
#include "revision.h"
#include "Util.h"

bool ChatHandler::HandleHelpCommand(char* args)
Expand Down Expand Up @@ -95,10 +96,9 @@ bool ChatHandler::HandleServerInfoCommand(char* /*args*/)

char const* full;
if (m_session)
full = "|cffffffff|Hurl:" _FULLVERSION "|h";
full = _FULLVERSION(REVISION_DATE, REVISION_TIME, "|cffffffff|Hurl:" REVISION_ID "|h" REVISION_ID "|h|r");
else
full = _FULLVERSION;

full = _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_ID);
SendSysMessage(full);

if (sScriptMgr.IsScriptLibraryLoaded())
Expand Down
2 changes: 2 additions & 0 deletions src/mangosd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ add_executable(${EXECUTABLE_NAME}
${EXECUTABLE_SRCS}
)

add_dependencies(${EXECUTABLE_NAME} revision.h)

target_link_libraries(${EXECUTABLE_NAME}
game
shared
Expand Down
4 changes: 2 additions & 2 deletions src/mangosd/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ int main(int argc, char *argv[])

if (vm.count("version"))
{
std::cout << _FULLVERSION << std::endl;
std::cout << _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_ID) << std::endl;
std::cout << "Boost version " << (BOOST_VERSION / 10000) << "." << ((BOOST_VERSION / 100) % 1000) << "." << (BOOST_VERSION % 100) << std::endl;
return 0;
}
Expand Down Expand Up @@ -172,7 +172,7 @@ int main(int argc, char *argv[])
}
#endif

sLog.outString("%s [world-daemon]", _FULLVERSION);
sLog.outString("%s [world-daemon]", _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_ID));
sLog.outString("<Ctrl-C> to stop.");
sLog.outString("\n\n"
" _____ __ __ _ _ _____ ____ _____ \n"
Expand Down
2 changes: 2 additions & 0 deletions src/realmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ add_executable(${EXECUTABLE_NAME}
${EXECUTABLE_SRCS}
)

add_dependencies(${EXECUTABLE_NAME} revision.h)

target_link_libraries(${EXECUTABLE_NAME}
shared
framework
Expand Down
2 changes: 1 addition & 1 deletion src/realmd/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ int main(int argc, char *argv[])

sLog.Initialize();

sLog.outString("%s [realm-daemon]", _FULLVERSION);
sLog.outString("%s [realm-daemon]", _FULLVERSION(REVISION_DATE, REVISION_TIME, REVISION_ID));
sLog.outString("<Ctrl-C> to stop.\n");
sLog.outString("Using configuration file %s.", configFile.c_str());

Expand Down
4 changes: 4 additions & 0 deletions src/scriptdev2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

## magic to include revision data in SD2 version string
# revision.h: FORCE
# $(top_builddir)/src/tools/genrevision/genrevision $(srcdir)

file(GLOB_RECURSE mangosscript_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h)

source_group("Other"
Expand Down
2 changes: 1 addition & 1 deletion src/scriptdev2/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#endif

#ifndef _SD2VERSION
#define _SD2VERSION "Revision [" SD2_REVISION_NR "] (" REVISION ")"
#define _SD2VERSION "Revision [" SD2_REVISION_NR "] (" REVISION_ID ") " REVISION_DATE " " REVISION_TIME
#endif

#if PLATFORM == PLATFORM_WINDOWS
Expand Down
14 changes: 14 additions & 0 deletions src/shared/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# NOTE! Don't add files that are generated in specific
# subdirectories here. Add them in the ".gitignore" file
# in that subdirectory instead.
#
# NOTE! Please use 'git-ls-files -i --exclude-standard'
# command after changing this file, to see if there are
# any tracked files which get ignored after the change.
#
# MaNGOS generated files
#

SystemConfig.h
revision.h
3 changes: 3 additions & 0 deletions src/shared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ else()
include_directories(${MYSQL_INCLUDE_DIR})
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SystemConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/SystemConfig.h)

add_library(${LIBRARY_NAME} STATIC
${LIBRARY_SRCS}
)
Expand All @@ -184,3 +186,4 @@ if(POSTGRESQL)
target_link_libraries(${LIBRARY_NAME} ${PostgreSQL_LIBRARIES})
endif()

add_dependencies(${LIBRARY_NAME} revision.h)
4 changes: 2 additions & 2 deletions src/shared/SystemConfig.h → src/shared/SystemConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
// Format is YYYYMMDDRR where RR is the change in the conf file
// for that day.
#ifndef _MANGOSDCONFVERSION
# define _MANGOSDCONFVERSION 2014110301
# define _MANGOSDCONFVERSION 2016101401
#endif
#ifndef _REALMDCONFVERSION
# define _REALMDCONFVERSION 2010062001
Expand Down Expand Up @@ -94,7 +94,7 @@
# define _AUCTIONHOUSEBOT_CONFIG SYSCONFDIR"ahbot.conf"
#endif

#define _FULLVERSION _PACKAGENAME "/" VERSION " (" REVISION ") for " _ENDIAN_PLATFORM
#define _FULLVERSION(REVD,REVT,REVH) _PACKAGENAME "/" _VERSION(REVD,REVT,REVH) " for " _ENDIAN_PLATFORM

#define DEFAULT_PLAYER_LIMIT 100
#define DEFAULT_WORLDSERVER_PORT 8085 //8129
Expand Down
2 changes: 1 addition & 1 deletion src/shared/WheatyExceptionReport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void WheatyExceptionReport::GenerateExceptionReport(
GetLocalTime(&systime);

// Start out with a banner
_tprintf(_T("Revision: %s\r\n"), REVISION);
_tprintf(_T("Revision: %s %s %s\r\n"), REVISION_DATE, REVISION_TIME, REVISION_ID);
_tprintf(_T("Date %u:%u:%u. Time %u:%u \r\n"), systime.wDay, systime.wMonth, systime.wYear, systime.wHour, systime.wMinute);
PEXCEPTION_RECORD pExceptionRecord = pExceptionInfo->ExceptionRecord;

Expand Down
4 changes: 0 additions & 4 deletions src/shared/revision.h

This file was deleted.

Loading

0 comments on commit eefb4bb

Please sign in to comment.