Skip to content

Commit

Permalink
バッチ生成変数APPVEYOR_PR_NUMBER_LABEL追加
Browse files Browse the repository at this point in the history
リソーススクリプト内でリテラル文字列の連結が行われない対策として、
githash.batでラベル用のリテラル文字列を生成させるように変更。
当初APPVEYOR_PULL_REQUEST_NUMBER_LABELで作成したが、
シンボル名が長すぎて切り詰められるので短い名前に変更。

切り詰めが発生したときのログ↓
3>..\sakura_core\sakura_rc.rc(119): warning RC4011: identifier truncated to 'APPVEYOR_PULL_REQUEST_NUMBER_LA'
3>
3>sakura.vcxproj -> F:\gitroot\sakura-mygithub\Win32\Debug\sakura.exe
  • Loading branch information
berryzplus committed Oct 21, 2018
1 parent f046334 commit 4cc8280
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions appveyor.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
| APPVEYOR_BUILD_NUMBER_LABEL | APPVEYOR_BUILD_NUMBER |数値 |
| APPVEYOR_PULL_REQUEST_NUMBER |APPVEYOR_PULL_REQUEST_NUMBER |文字列 |
| APPVEYOR_PULL_REQUEST_NUMBER_INT |APPVEYOR_PULL_REQUEST_NUMBER |数値 |
| APPVEYOR_PR_NUMBER_LABEL |APPVEYOR_PULL_REQUEST_NUMBER |文字列 |
| GITHUB_COMMIT_URL |GITHUB_COMMIT_URL |文字列 |
| GITHUB_COMMIT_URL_PR_HEAD |GITHUB_COMMIT_URL_PR_HEAD |文字列 |
| APPVEYOR_SHORTHASH |APPVEYOR_SHORTHASH |文字列 |
Expand Down
2 changes: 2 additions & 0 deletions sakura/githash.bat
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@ if "%APPVEYOR_BUILD_NUMBER%" == "" (
if "%APPVEYOR_PULL_REQUEST_NUMBER%" == "" (
echo // APPVEYOR_PULL_REQUEST_NUMBER is not defined
echo // APPVEYOR_PULL_REQUEST_NUMBER_INT is not defined
echo // APPVEYOR_PR_NUMBER_LABEL is not defined
) else (
echo #define APPVEYOR_PULL_REQUEST_NUMBER "%APPVEYOR_PULL_REQUEST_NUMBER%"
echo #define APPVEYOR_PULL_REQUEST_NUMBER_INT %APPVEYOR_PULL_REQUEST_NUMBER%
echo #define APPVEYOR_PR_NUMBER_LABEL "PR %APPVEYOR_PULL_REQUEST_NUMBER%"
)

if "%GITHUB_COMMIT_URL%" == "" (
Expand Down
2 changes: 1 addition & 1 deletion sakura_core/dlg/CDlgAbout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ BOOL CDlgAbout::OnInitDialog( HWND hwndDlg, WPARAM wParam, LPARAM lParam )
#ifdef APPVEYOR_SHORTHASH
m_UrlGitHubCommitWnd.SetSubclassWindow( GetItemHwnd( IDC_STATIC_URL_GITHUB_COMMIT ) );
#endif
#ifdef APPVEYOR_PULL_REQUEST_NUMBER
#ifdef APPVEYOR_PR_NUMBER_LABEL
m_UrlGitHubPRWnd.SetSubclassWindow( GetItemHwnd( IDC_STATIC_URL_GITHUB_PR ) );
#endif

Expand Down
6 changes: 3 additions & 3 deletions sakura_core/sakura_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ BEGIN
LTEXT "Build URL:", IDC_STATIC_URL_APPVEYOR_CAPTION, 33, 123, 71, 8, NOT WS_GROUP
LTEXT APPVEYOR_BUILD_NUMBER_LABEL, IDC_STATIC_URL_APPVEYOR_BUILD, 101, 123, 120, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
#if defined( APPVEYOR_SHORTHASH ) || defined( APPVEYOR_PULL_REQUEST_NUMBER )
#if defined( APPVEYOR_SHORTHASH ) || defined( APPVEYOR_PR_NUMBER_LABEL )
LTEXT "GitHub URL:", IDC_STATIC_URL_GITHUB_CAPTION, 33, 133, 50, 8, NOT WS_GROUP
#endif
#ifdef APPVEYOR_SHORTHASH
LTEXT APPVEYOR_SHORTHASH, IDC_STATIC_URL_GITHUB_COMMIT, 101, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
#ifdef APPVEYOR_PULL_REQUEST_NUMBER
LTEXT "PR " APPVEYOR_PULL_REQUEST_NUMBER, IDC_STATIC_URL_GITHUB_PR, 150, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#ifdef APPVEYOR_PR_NUMBER_LABEL
LTEXT APPVEYOR_PR_NUMBER_LABEL, IDC_STATIC_URL_GITHUB_PR, 150, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
EDITTEXT IDC_EDIT_ABOUT, 5, 146, 233, 53, ES_MULTILINE | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP
DEFPUSHBUTTON "&OK", IDOK, 97, 203, 50, 14
Expand Down
6 changes: 3 additions & 3 deletions sakura_lang_en_US/sakura_lang_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ BEGIN
LTEXT "Build URL:", IDC_STATIC_URL_APPVEYOR_CAPTION, 33, 123, 71, 8, NOT WS_GROUP
LTEXT APPVEYOR_BUILD_NUMBER_LABEL, IDC_STATIC_URL_APPVEYOR_BUILD, 101, 123, 120, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
#if defined( APPVEYOR_SHORTHASH ) || defined( APPVEYOR_PULL_REQUEST_NUMBER )
#if defined( APPVEYOR_SHORTHASH ) || defined( APPVEYOR_PR_NUMBER_LABEL )
LTEXT "GitHub URL:", IDC_STATIC_URL_GITHUB_CAPTION, 33, 133, 50, 8, NOT WS_GROUP
#endif
#ifdef APPVEYOR_SHORTHASH
LTEXT APPVEYOR_SHORTHASH, IDC_STATIC_URL_GITHUB_COMMIT, 101, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
#ifdef APPVEYOR_PULL_REQUEST_NUMBER
LTEXT "PR " APPVEYOR_PULL_REQUEST_NUMBER, IDC_STATIC_URL_GITHUB_PR, 150, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#ifdef APPVEYOR_PR_NUMBER_LABEL
LTEXT APPVEYOR_PR_NUMBER_LABEL, IDC_STATIC_URL_GITHUB_PR, 150, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
EDITTEXT IDC_EDIT_ABOUT, 5, 146, 233, 53, ES_MULTILINE | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP
DEFPUSHBUTTON "&OK", IDOK, 97, 203, 50, 14
Expand Down

0 comments on commit 4cc8280

Please sign in to comment.