継続的インテグレーション プロセスへのコード分析の統合

コード分析を継続的インテグレーション (CI) フレームワークおよび機能を拡張する多数のプラグインに統合するには、さまざまな方法があります。

Eclipse COBOL プロジェクトを分析するための Jenkins の構成方法について、いくつかのガイドラインを次に示します。

セットアップ
開始する前に、マシンに Enterprise Developer for Eclipse をインストールしておく必要があります。マシンを Jenkins に接続し、マシンに Apache Ant をインストールする必要があります。
コード分析の統合
  1. COBOL プロジェクトを分析するための Jenkins ジョブを作成します。
  2. Windows バッチ コマンドから次のコマンドを実行するようにジョブを構成します。
    rem use the following script to set the COBOL environment:
    call "product-install-dir\CreateEnv.bat"
    rem change to the directory on the machine that stores the COBOL sources and the .cobolBuild file:
    cd workspace-dir
    rem set the classpath environment variable:
    set CLASSPATH=product-install-dir\bin\mfant.jar;%CLASSPATH%
    rem perform code analysis using the .cobolBuild script:
    ant -f .cobolBuild build.and.analyze -DanalysisFailOnError=true
  3. オプションで、Jenkins に適したプラグインを使用して、コード分析からのレポートなどをカスタマイズできます。たとえば、無料の Log Parser Plugin (Jenkins の Web サイトから入手可能) を使用して、レポートのフォーマットを改善できます。