Class SlocCounter

java.lang.Object
com.streamconverter.sloc.SlocCounter

public class SlocCounter extends Object
全モジュールの JaCoCo XML レポートから SLOC(実ステップ数)を集計するツール。

モジュール名リストを起点に4コマンドのパイプラインで処理する:

  1. ModuleXmlConcatCommand — モジュール名→XML連結ストリーム
  2. JacocoXmlToModuleSlocCommand — XML→ModuleSloc オブジェクト
  3. SlocAggregateCommand — 集約・合計行追加
  4. SlocReportFormatCommand — 整形出力

使用方法:

 ./gradlew :streamconverter-tools:slocCount
 

モジュール名は Gradle タスクから引数として渡される。直接実行する場合は引数にモジュール名を列挙する:

 java SlocCounter streamconverter-core streamconverter-db ...
 
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    CLI エントリポイント。引数にモジュール名を列挙する。プロジェクトルートはカレントディレクトリを使用する。
    void
    run(Path projectRoot, List<String> modules, OutputStream output)
    指定されたモジュールの SLOC を集計し、結果を出力する。

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • run

      public void run(Path projectRoot, List<String> modules, OutputStream output) throws IOException
      指定されたモジュールの SLOC を集計し、結果を出力する。
      Parameters:
      projectRoot - プロジェクトルートディレクトリ
      modules - 集計対象のモジュール名リスト
      output - 集計結果の出力先
      Throws:
      IOException - レポートの読み込みまたは出力に失敗した場合
    • main

      public static void main(String[] args) throws IOException
      CLI エントリポイント。引数にモジュール名を列挙する。プロジェクトルートはカレントディレクトリを使用する。
      Throws:
      IOException