Skip to content

Commit

Permalink
sakura-editor#18: リソースファイルには短い形式のハッシュを使う
Browse files Browse the repository at this point in the history
  • Loading branch information
m-tmatma committed May 30, 2018
1 parent 390e21a commit 6011cc6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions sakura/preBuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@ set GITREV_H=..\sakura_core\gitrev.h
for /f "usebackq" %%s in (`git show -s --format^=%%H`) do (
set COMMITID=%%s
)
for /f "usebackq" %%s in (`git show -s --format^=%%h`) do (
set SHORT_COMMITID=%%s
)

type nul > %GITREV_H%
if "%COMMITID%" == "" (
type nul > %GITREV_H%
type nul >> %GITREV_H%
) else (
echo #define GIT_COMMIT_HASH "%COMMITID%" >> %GITREV_H%
)
if "%SHORT_COMMITID%" == "" (
type nul >> %GITREV_H%
) else (
echo #define GIT_COMMIT_HASH "%COMMITID%" > %GITREV_H%
echo #define GIT_SHORT_COMMIT_HASH "%SHORT_COMMITID%" >> %GITREV_H%
)

SubWCRev.exe "..\\" "..\sakura_core\svnrev_template.h" "..\sakura_core\svnrev.h"
Expand Down
4 changes: 2 additions & 2 deletions sakura_core/sakura_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2812,8 +2812,8 @@ BEGIN
VALUE "OriginalFilename", "sakura.exe\0"
VALUE "ProductName", "�T�N���G�f�B�^\0"
VALUE "ProductVersion", PR_VER_STR
#if defined(GIT_COMMIT_HASH)
" (hash " GIT_COMMIT_HASH ")"
#if defined(GIT_SHORT_COMMIT_HASH)
" (hash " GIT_SHORT_COMMIT_HASH ")"
#elif (SVN_REV != 0)
" (Rev." SVN_REV_STR ")"
#endif
Expand Down

0 comments on commit 6011cc6

Please sign in to comment.