LoginSignup
0
0

More than 5 years have passed since last update.

Flex Formatterをソース全体にかける

Posted at

すでにあるソース一つ一つにFlex Formatterをボタンでポチポチしてくのは面倒臭いので一括で掛ける方法を探しました。

  1. フォーマッター用のJarをダウンロード

    http://sourceforge.net/projects/flexformatter/files/flexformatter/0.8.9/

  2. コマンドラインサポートを行うJarをダウンロード

    http://sourceforge.net/projects/flexformatter/files/flexformatter/CommandLineSupportJars/

上記2つを同ディレクトリに展開(jarが同じディレクトリに配置されるようにする)

  1. 展開されたディレクトリへcdで移動し、下記コマンドを実行する

java -Djava.ext.dirs=. utilities.CommandLine "path/to/sources/src" "path/to/properties/formatter.properties" 4 true UTF-8

※最終的にフォーマッター掛けに失敗するファイルがあるようです。そういったファイルはコマンド終了後に表示されます。
何故かソースコードに全角スペースが混じっている事が多いので、全角スペースを半角スペースにすると良いようです。XMLを直接記入していたりするコードも失敗する気がします。

参考

0
0
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
0
0