Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ msbuild-*.log.csv
msbuild-*.log.xlsx
sakura-*.zip
sakura-*.zip.md5
set_appveyor_env.bat
sha256.txt
tags
testData_*.txt
Expand Down
7 changes: 1 addition & 6 deletions build-sln.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ set SLN_FILE=sakura.sln

@rem https://www.appveyor.com/docs/environment-variables/

if "%APPVEYOR%"=="True" (
set EXTRA_CMD=/verbosity:minimal /logger:"%ProgramFiles%\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
) else (
set EXTRA_CMD=
)

set EXTRA_CMD=
set LOG_FILE=msbuild-%platform%-%configuration%.log
@rem https://msdn.microsoft.com/ja-jp/library/ms171470.aspx
set LOG_OPTION=/flp:logfile=%LOG_FILE%
Expand Down
53 changes: 16 additions & 37 deletions ci/build-envvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,25 @@

## githash.bat で設定する環境変数

|||ローカルビルド|Appveyor|gitbash.h への出力|
|--|--|--|--|--|
|GIT_COMMIT_HASH|git の commit Hash|◎|◎|◎|
|GIT_SHORT_COMMIT_HASH|git の commit Hash 短縮形|◎|◎|◎|
|GIT_REMOTE_ORIGIN_URL|git remote origin URL|◎|◎|◎|
|GIT_TAG_NAME|git の tag|◎|◎|◎|
|CI_ACCOUNT_NAME|CI のアカウント名|×|◎|◎|
|CI_REPO_NAME|リポジトリ名|×|◎|◎|
|CI_BUILD_VERSION|CI のビルドバージョン (文字列)|×|◎|◎|
|CI_BUILD_NUMBER|CI のビルド番号 (数値)|×|◎|◎|
|CI_BUILD_URL|CI のビルドURL|×|◎|◎|
|GITHUB_COMMIT_URL|GitHub の Commit URL|×|◎|◎|
|GITHUB_PR_NUMBER|GitHub の PR 番号|×|○ (PRのみ)|○ (PRのみ)|
|GITHUB_PR_HEAD_COMMIT | GitHub の PR の Head commit Hash | × |○ (PRのみ) |○ (PRのみ) |
|GITHUB_PR_HEAD_SHORT_COMMIT | GitHub の PR の Head commit Hash 短縮形 | × |○ (PRのみ) |○ (PRのみ) |
|GITHUB_PR_HEAD_URL | GitHub の PR の Head commit の URL | × |○ (PRのみ) |○ (PRのみ) |
|||ローカルビルド|gitbash.h への出力|
|--|--|--|--|
|GIT_COMMIT_HASH|git の commit Hash|◎|◎|
|GIT_SHORT_COMMIT_HASH|git の commit Hash 短縮形|◎|◎|
|GIT_REMOTE_ORIGIN_URL|git remote origin URL|◎|◎|
|GIT_TAG_NAME|git の tag|◎|◎|
|CI_ACCOUNT_NAME|CI のアカウント名|×|◎|
|CI_REPO_NAME|リポジトリ名|×|◎|
|CI_BUILD_VERSION|CI のビルドバージョン (文字列)|×|◎|
|CI_BUILD_NUMBER|CI のビルド番号 (数値)|×|◎|
|CI_BUILD_URL|CI のビルドURL|×|◎|
|GITHUB_COMMIT_URL|GitHub の Commit URL|×|◎|
|GITHUB_PR_NUMBER|GitHub の PR 番号|×|○ (PRのみ)|
|GITHUB_PR_HEAD_COMMIT | GitHub の PR の Head commit Hash | × |○ (PRのみ) |
|GITHUB_PR_HEAD_SHORT_COMMIT | GitHub の PR の Head commit Hash 短縮形 | × |○ (PRのみ) |
|GITHUB_PR_HEAD_URL | GitHub の PR の Head commit の URL | × |○ (PRのみ) |

## 入力として使用する環境変数

### Appveyor

| 環境変数 | 説明 |
----|----
|APPVEYOR | バッチが appveyor で実行されているかどうか |
|APPVEYOR_URL | https://ci.appveyor.com |
|APPVEYOR_ACCOUNT_NAME | AppVeyor のアカウント名 (sakura editor の場合 "sakuraeditor") |
|APPVEYOR_PROJECT_SLUG | AppVeyor のプロジェクト名 |
|APPVEYOR_REPO_PROVIDER | AppVeyor が参照するリポジトリの種別 (GitHub の場合 "gitHub") |
|APPVEYOR_REPO_NAME | リポジトリ名 (owner-name/repo-name) |
|APPVEYOR_BUILD_VERSION | ビルドバージョン (文字列) |
|APPVEYOR_BUILD_NUMBER | ビルド番号 (数値) |
|APPVEYOR_PULL_REQUEST_NUMBER | Pull Request 番号 |
|APPVEYOR_PULL_REQUEST_HEAD_COMMIT | Pull Request の Head commit Hash |

APPVEYOR_REPO_TAG_NAME は利用をやめて 代わりに GIT_TAG_NAME を使うようにしました。[#876](https://github.com/sakura-editor/sakura/pull/876)

* 上記環境変数をローカル環境で set コマンドで設定することにより appveyor でビルドしなくてもローカルでテストできます。
- 成果物に含まれる `set_appveyor_env.bat` を使用して設定することもできます。
* 上記の環境変数がどんな値になるのかは、過去の appveyor ビルドでのログを見ることによって確認できます。

## githash.h で生成するマクロ

|生成するマクロ名|元にする環境変数|型|
Expand Down
1 change: 0 additions & 1 deletion help/make-artifacts.bat
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ if not "%SHORTHASH%" == "" (

@rem ---------------------- BASENAME ---------------------------------
@rem "sakura"
@rem BUILD_ACCOUNT: (option) APPVEYOR_ACCOUNT_NAME
@rem TAG_NAME : (option) tag Name
@rem PR_NAME : (option) PRxxx (xxx is a PR number)
@rem BUILD_NUMBER : (option) buildYYY or "buildLocal" (YYY is build number)
Expand Down
77 changes: 0 additions & 77 deletions sakura/githash.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ set OUT_DIR=%OUT_DIR:/=\%
@echo.
@echo ---- Make githash.h ----
call :set_git_variables
call :set_repo_and_pr_variables
call :set_ci_build_url
call :update_output_githash
exit /b 0
Expand Down Expand Up @@ -85,67 +84,10 @@ exit /b 0
)
exit /b 0

:set_repo_and_pr_variables
if defined APPVEYOR_REPO_NAME (
set CI_REPO_NAME=%APPVEYOR_REPO_NAME%
)

if defined APPVEYOR_ACCOUNT_NAME (
set CI_ACCOUNT_NAME=%APPVEYOR_ACCOUNT_NAME%
)

@rem ----------------------------------------------------------------------------------------------------------
if defined APPVEYOR_BUILD_NUMBER (
@rem APPVEYOR_BUILD_NUMBER=1624
set CI_BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER%
)

if defined APPVEYOR_BUILD_VERSION (
@rem APPVEYOR_BUILD_VERSION=1.0.1624
set CI_BUILD_VERSION=%APPVEYOR_BUILD_VERSION%
)

if defined APPVEYOR_PULL_REQUEST_NUMBER (
set GITHUB_PR_NUMBER=%APPVEYOR_PULL_REQUEST_NUMBER%
)

if defined APPVEYOR_PULL_REQUEST_HEAD_COMMIT (
set GITHUB_PR_HEAD_SHORT_COMMIT=%APPVEYOR_PULL_REQUEST_HEAD_COMMIT:~0,8%
set GITHUB_PR_HEAD_COMMIT=%APPVEYOR_PULL_REQUEST_HEAD_COMMIT%
)

if "%APPVEYOR_REPO_PROVIDER%"=="gitHub" (
set GITHUB_ON=1
)

set PREFIX_GITHUB=https://github.com
if "%GITHUB_ON%" == "1" (
set "GITHUB_COMMIT_URL=%PREFIX_GITHUB%/%CI_REPO_NAME%/commit/%GIT_COMMIT_HASH%"
@rem Not Pull Request
if "%GITHUB_PR_NUMBER%" == "" (
@rem No PR
) else (
@rem PR URL
set "GITHUB_PR_HEAD_URL=%PREFIX_GITHUB%/%CI_REPO_NAME%/pull/%GITHUB_PR_NUMBER%/commits/%GITHUB_PR_HEAD_COMMIT%"
)
)
exit /b 0

:set_ci_build_url
call :set_ci_build_url_for_appveyor
call :set_ci_build_url_for_githubactions
exit /b 0

:set_ci_build_url_for_appveyor
if not defined APPVEYOR exit /b 0
if not defined APPVEYOR_URL exit /b 0
if not defined APPVEYOR_ACCOUNT_NAME exit /b 0
if not defined APPVEYOR_PROJECT_SLUG exit /b 0
if not defined APPVEYOR_BUILD_VERSION exit /b 0
set BUILD_ENV_NAME=Appveyor
set CI_BUILD_URL=%APPVEYOR_URL%/project/%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_SLUG%/build/%APPVEYOR_BUILD_VERSION%
exit /b 0

:set_ci_build_url_for_githubactions
if not defined GITHUB_ACTIONS exit /b 0
if not "%GITHUB_ACTIONS%" == "true" exit /b 0
Expand Down Expand Up @@ -196,9 +138,6 @@ exit /b 0
@echo GITHUB_PR_HEAD_COMMIT : %GITHUB_PR_HEAD_COMMIT%
@echo GITHUB_PR_HEAD_URL : %GITHUB_PR_HEAD_URL%
@echo.
@echo APPVEYOR_URL : %APPVEYOR_URL%
@echo APPVEYOR_PROJECT_SLUG : %APPVEYOR_PROJECT_SLUG%
@echo.
@echo BUILD_ENV_NAME : %BUILD_ENV_NAME%
@echo BUILD_VERSION : %BUILD_VERSION%
@echo.
Expand Down Expand Up @@ -306,22 +245,6 @@ exit /b 0
echo #define CI_BUILD_URL "%CI_BUILD_URL%"
)

echo // APPVEYOR specific variables

if "%APPVEYOR_URL%" == "" (
echo // APPVEYOR_URL is not defined
) else (
echo #define APPVEYOR_URL "%APPVEYOR_URL%"
)

if "%APPVEYOR_PROJECT_SLUG%" == "" (
echo // APPVEYOR_PROJECT_SLUG is not defined
) else (
echo #define APPVEYOR_PROJECT_SLUG "%APPVEYOR_PROJECT_SLUG%"
)
echo // APPVEYOR specific variables end
echo //

echo #define BUILD_ENV_NAME "%BUILD_ENV_NAME%"
echo #define BUILD_VERSION %BUILD_VERSION%

Expand Down
13 changes: 2 additions & 11 deletions tests/run-tests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ set configuration=%2
set TEST_LAUNCHED=0
set ERROR_RESULT=0

if defined APPVEYOR (
set FILTER_BAT=%~dp0test_result_filter_tell_AppVeyor.bat
)

set BUILDDIR=build\%platform%
set BINARY_DIR=%~dp0%BUILDDIR%\unittests\%platform%\%configuration%

Expand All @@ -34,11 +30,6 @@ exit /b 0
set EXEPATH=%1
set XMLPATH=%2

if defined FILTER_BAT (
@echo %EXEPATH% --gtest_output=xml:%XMLPATH% ^| "%FILTER_BAT%"
%EXEPATH% --gtest_output=xml:%XMLPATH% | "%FILTER_BAT%" || set TEMP_RESULT=1
) else (
@echo %EXEPATH% --gtest_output=xml:%XMLPATH%
%EXEPATH% --gtest_output=xml:%XMLPATH% || set TEMP_RESULT=1
)
@echo %EXEPATH% --gtest_output=xml:%XMLPATH%
%EXEPATH% --gtest_output=xml:%XMLPATH% || set TEMP_RESULT=1
exit /b %TEMP_RESULT%
60 changes: 0 additions & 60 deletions tests/test_result_filter_tell_AppVeyor.bat

This file was deleted.

1 change: 0 additions & 1 deletion tests/unittest.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ GUI でステップ実行することができます。
- cmake.exe
- [tests\run-tests.bat](run-tests.bat)
- tests\tests*.exe : 単体テストを実行する
- [tests\test_result_filter_tell_AppVeyor.bat](test_result_filter_tell_AppVeyor.bat) : AppVeyor のテストタブにテスト結果を出力する

### 使用するバッチファイルの引数

Expand Down
5 changes: 0 additions & 5 deletions zipArtifacts.bat
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ if not "%RELEASE_PHASE%" == "" (

@rem ---------------------- BASENAME ---------------------------------
@rem "sakura"
@rem BUILD_ACCOUNT: (option) APPVEYOR_ACCOUNT_NAME
@rem TAG_NAME : (option) tag Name
@rem PR_NAME : (option) PRxxx (xxx is a PR number)
@rem BUILD_NUMBER : (option) buildYYY or "buildLocal" (YYY is build number)
Expand Down Expand Up @@ -245,10 +244,6 @@ if exist "doxygen-%platform%-%configuration%.log" (
copy /Y "doxygen-%platform%-%configuration%.log" %WORKDIR_LOG%\
)

if exist "set_appveyor_env.bat" (
copy /Y "set_appveyor_env.bat" %WORKDIR_LOG%\
)

set HASHFILE=sha256.txt
if exist "%HASHFILE%" (
del %HASHFILE%
Expand Down