Browse Source

Minor fixes for releasing otclient

Eduardo Bart 8 years ago
parent
commit
4ac3ec8344

+ 1
- 5
init.lua View File

@@ -1,16 +1,11 @@
1 1
 -- this is the first file executed when the application starts
2 2
 -- we have to load the first modules form here
3 3
 
4
-g_app.setName('OTClient')
5
-g_app.setCompactName('otclient')
6
-g_app.setVersion('0.5.0_dev')
7
-
8 4
 -- setup logger
9 5
 g_logger.setLogFile(g_resources.getWorkDir() .. g_app.getCompactName() .. ".log")
10 6
 
11 7
 -- print first terminal message
12
-g_logger.info(g_app.getName() .. ' ' .. g_app.getVersion() .. ' (rev ' .. g_app.getBuildRevision() .. ') built on ' .. g_app.getBuildDate())
8
+g_logger.info(g_app.getName() .. ' ' .. g_app.getVersion() .. ' rev ' .. g_app.getBuildRevision() .. ' (' .. g_app.getBuildCommit() .. ') built on ' .. g_app.getBuildDate())
13 9
 
14 10
 --add base folder to search path
15 11
 g_resources.addToSearchPath(g_resources.getWorkDir())

+ 1
- 1
modules/client_background/background.lua View File

@@ -10,7 +10,7 @@ function Background.init()
10 10
 
11 11
   local clientVersionLabel = background:getChildById('clientVersionLabel')
12 12
   clientVersionLabel:setText('OTClient ' .. g_app.getVersion() .. '\n' ..
13
-                             'Rev  ' .. g_app.getBuildRevision() .. '\n' ..
13
+                             'Rev  ' .. g_app.getBuildRevision() .. ' ('.. g_app.getBuildCommit() .. ')\n' ..
14 14
                              'Protocol  ' .. g_game.getProtocolVersion() .. '\n' ..
15 15
                              'Built on ' .. g_app.getBuildDate())
16 16
 

+ 5
- 1
src/framework/CMakeLists.txt View File

@@ -11,7 +11,8 @@ OPTION(LUAJIT "Use lua jit" OFF)
11 11
 OPTION(USE_STATIC_LIBS "Don't use shared libraries (dlls)" ON)
12 12
 
13 13
 SET(OPENGLES "OFF" CACHE "Use OpenGL ES 1.0 or 2.0 (for mobiles devices)" STRING)
14
-SET(BUILD_REVISION "custom" CACHE "Git revision string (intended for releases)" STRING)
14
+SET(BUILD_COMMIT "custom" CACHE "Git commit string (intended for releases)" STRING)
15
+SET(BUILD_REVISION "0" CACHE "Git revision string (intended for releases)" STRING)
15 16
 
16 17
 IF(NOT CMAKE_BUILD_TYPE)
17 18
     SET(CMAKE_BUILD_TYPE "RelWithDebInfo")
@@ -41,6 +42,9 @@ ENDIF()
41 42
 MESSAGE(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
42 43
 ADD_DEFINITIONS(-D"BUILD_TYPE=\\\"${CMAKE_BUILD_TYPE}\\\"")
43 44
 
45
+MESSAGE(STATUS "Build commit: ${BUILD_COMMIT}")
46
+ADD_DEFINITIONS(-D"BUILD_COMMIT=\\\"${BUILD_COMMIT}\\\"")
47
+
44 48
 MESSAGE(STATUS "Build revision: ${BUILD_REVISION}")
45 49
 ADD_DEFINITIONS(-D"BUILD_REVISION=\\\"${BUILD_REVISION}\\\"")
46 50
 

+ 1
- 0
src/framework/application.h View File

@@ -69,6 +69,7 @@ public:
69 69
     std::string getBuildCompiler() { return BUILD_COMPILER; }
70 70
     std::string getBuildDate() { return BUILD_DATE; }
71 71
     std::string getBuildRevision() { return BUILD_REVISION; }
72
+    std::string getBuildCommit() { return BUILD_COMMIT; }
72 73
     std::string getBuildType() { return BUILD_TYPE; }
73 74
     std::string getStartupOptions() { return m_startupOptions; }
74 75
 

+ 5
- 1
src/framework/const.h View File

@@ -29,8 +29,12 @@
29 29
 #define BUILD_COMPILER "gcc " __VERSION__
30 30
 #define BUILD_DATE __DATE__
31 31
 
32
+    #ifndef BUILD_COMMIT
33
+#define BUILD_COMMIT "custom"
34
+#endif
35
+
32 36
 #ifndef BUILD_REVISION
33
-#define BUILD_REVISION "custom"
37
+#define BUILD_REVISION "0"
34 38
 #endif
35 39
 
36 40
 #ifndef BUILD_TYPE

+ 1
- 9
src/framework/luafunctions.cpp View File

@@ -499,17 +499,9 @@ void Application::registerLuaFunctions()
499 499
     g_lua.bindSingletonFunction("g_app", "getBuildCompiler", &Application::getBuildCompiler, &g_app);
500 500
     g_lua.bindSingletonFunction("g_app", "getBuildDate", &Application::getBuildDate, &g_app);
501 501
     g_lua.bindSingletonFunction("g_app", "getBuildRevision", &Application::getBuildRevision, &g_app);
502
+    g_lua.bindSingletonFunction("g_app", "getBuildCommit", &Application::getBuildCommit, &g_app);
502 503
     g_lua.bindSingletonFunction("g_app", "getBuildType", &Application::getBuildType, &g_app);
503 504
     g_lua.bindSingletonFunction("g_app", "exit", &Application::exit, &g_app);
504
-    g_lua.bindSingletonFunction("g_app", "isRunning", &Application::isRunning, &g_app);
505
-    g_lua.bindSingletonFunction("g_app", "isStopping", &Application::isStopping, &g_app);
506
-    g_lua.bindSingletonFunction("g_app", "getName", &Application::getName, &g_app);
507
-    g_lua.bindSingletonFunction("g_app", "getCompactName", &Application::getCompactName, &g_app);
508
-    g_lua.bindSingletonFunction("g_app", "getVersion", &Application::getVersion, &g_app);
509
-    g_lua.bindSingletonFunction("g_app", "getBuildCompiler", &Application::getBuildCompiler, &g_app);
510
-    g_lua.bindSingletonFunction("g_app", "getBuildDate", &Application::getBuildDate, &g_app);
511
-    g_lua.bindSingletonFunction("g_app", "getBuildRevision", &Application::getBuildRevision, &g_app);
512
-    g_lua.bindSingletonFunction("g_app", "getBuildType", &Application::getBuildType, &g_app);
513 505
 
514 506
     // ConfigManager
515 507
     g_lua.registerSingletonClass("g_configs");

+ 1
- 1
src/framework/platform/unixcrashhandler.cpp View File

@@ -46,7 +46,7 @@ void crashHandler(int signum, siginfo_t* info, void* secret)
46 46
     ss << stdext::format("build compiler: %s\n", BUILD_COMPILER);
47 47
     ss << stdext::format("build date: %s\n", BUILD_DATE);
48 48
     ss << stdext::format("build type: %s\n", BUILD_TYPE);
49
-    ss << stdext::format("build revision: %s\n", BUILD_REVISION);
49
+    ss << stdext::format("build revision: %s (%s)\n", BUILD_REVISION, BUILD_COMMIT);
50 50
     ss << stdext::format("crash date: %s\n", stdext::date_time_string());
51 51
     ss.flags(std::ios::hex | std::ios::showbase);
52 52
 

+ 1
- 1
src/framework/platform/win32crashhandler.cpp View File

@@ -116,7 +116,7 @@ LONG CALLBACK ExceptionHandler(LPEXCEPTION_POINTERS e)
116 116
     ss << stdext::format("build compiler: %s\n", BUILD_COMPILER);
117 117
     ss << stdext::format("build date: %s\n", BUILD_DATE);
118 118
     ss << stdext::format("build type: %s\n", BUILD_TYPE);
119
-    ss << stdext::format("build revision: %s\n", BUILD_REVISION);
119
+    ss << stdext::format("build revision: %s (%s)\n", BUILD_REVISION, BUILD_COMMIT);
120 120
     ss << stdext::format("crash date: %s\n", stdext::date_time_string().c_str());
121 121
     ss << stdext::format("exception: %s (0x%08lx)\n", getExceptionName(e->ExceptionRecord->ExceptionCode), e->ExceptionRecord->ExceptionCode);
122 122
     ss << stdext::format("exception address: 0x%08lx\n", (long unsigned int)e->ExceptionRecord->ExceptionAddress);

+ 5
- 0
src/main.cpp View File

@@ -29,6 +29,11 @@ int main(int argc, const char* argv[])
29 29
 {
30 30
     std::vector<std::string> args(argv, argv + argc);
31 31
 
32
+    // setup application name and version
33
+    g_app.setName("OTClient");
34
+    g_app.setCompactName("otclient");
35
+    g_app.setVersion("0.5.0_dev");
36
+
32 37
     // initialize application framework and otclient
33 38
     g_app.init("otclient", args);
34 39
     g_otclient.init(args);

+ 1
- 1
src/otclient/otclient.cpp View File

@@ -49,7 +49,7 @@ void OTClient::init(const std::vector<std::string>& args)
49 49
         stdext::print(
50 50
             m_appName, " ", m_appVersion, "\n"
51 51
             "Buitt on: ", BUILD_DATE, "\n",
52
-            "Revision: ", BUILD_REVISION, "\n",
52
+            "Commit: ", BUILD_COMMIT, "\n",
53 53
             "Compiled by: ", BUILD_COMPILER, "\n",
54 54
             "Build type: ", BUILD_TYPE, "\n");
55 55
         return;

+ 3
- 1
tools/pkgs/makeotc View File

@@ -34,7 +34,8 @@ else
34 34
 fi
35 35
 
36 36
 gitdir=`pwd`
37
-revision=`git describe --dirty --always`
37
+revision=`git rev-list --all | wc -l`
38
+commit=`git describe --dirty --always`
38 39
 
39 40
 rm -rf build
40 41
 mkdir build
@@ -43,6 +44,7 @@ cd build
43 44
 cmake -DCMAKE_TOOLCHAIN_FILE=$gitdir/src/framework/cmake/${platform}_toolchain.cmake \
44 45
         -DCMAKE_BUILD_TYPE=Release \
45 46
         -DBUILD_REVISION=$revision \
47
+        -DBUILD_COMMIT=$commit \
46 48
         -DBOT_PROTECTION=OFF \
47 49
         -DPROTOCOL=$protocol \
48 50
         .. || exit

Loading…
Cancel
Save