3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ReSharperでコードのチェック(無料)をJenkinsで実施

Last updated at Posted at 2021-08-10

これらの記事の続きです。

Resharper commandline の追加

Reshaperによるコードの分析です。ReSharperはコマンドラインで使う分には無料です。
明示的に書いている場所が少ないですが、C++でも動きます。
(コードの重複チェックはC#とVB.netしか動かないようです。)

エージェントのマシンでglobal .NET Core tool としてインストールします。
powershellで以下のコマンドによりインストールするだけで、どこからでも呼べます。すごい楽です。

powershellで実行
dotnet tool install -g JetBrains.ReSharper.GlobalTools

Jenkinsに戻ります。
ダッシュボード>Jenkinsの管理>プラグインの管理>利用可能 で
Warnings Next Generation Pluginを入れます。

image.png

プロジェクトの設定画面に移動します。
Jenkinsで「ビルド手順の追加」を押して、「Windowsバッチコマンドの実行」を選びます。
inspectcode.xmlは出力用のファイル名です。なんでもいいです。

コマンド欄
jb inspectcode AgileSD_Payroll.sln -o="inspectcode.xml"

image.png

続いて「ビルド後の処理の追加」を押して、「Record compiler warnings and static analysis results」を選びます。
「Tool」は「Resharper Inspeections」を選びます。
「Report File Pattern」 には、先ほど出力ファイル名として設定した 「inspectcode.xml」 と書きます。

image.png

ビルド結果でResharper Inspections Warningsを選べるようになり、統計情報を見れるようになりました。
見やすいです。

image.png

参考

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?