Forums: Japanese (Thread #31570)

StepCounter3.0.0の-showDirectoryオプション (2012-02-18 15:13 by nabedge #62278)

ども。StepCounter3.0.0の-showDirectoryオプションがうまく効かないようなのですが、
コマンドオプションの指定の仕方が違うのでしょうか?

$ find ./ -type f
./src/com/example/HelloWorld.java
./stepcounter-3.0.0-jar-with-dependencies.jar

$ java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode)

$ java -cp stepcounter-3.0.0-jar-with-dependencies.jar jp.sf.amateras.stepcounter.Main src

ファイル 種類 カテゴリ 実行 空行 コメント 合計
-------------------------------------------------------------------------------------
HelloWorld.java Java 8 2 0 10
-------------------------------------------------------------------------------------
合計 8 2 0 10

$ java -cp stepcounter-3.0.0-jar-with-dependencies.jar jp.sf.amateras.stepcounter.Main -showDirectory src

ファイル 種類 カテゴリ 実行 空行 コメント 合計
-------------------------------------------------------------------------------------
-showDirectory 未対応
HelloWorld.java Java 8 2 0 10
-------------------------------------------------------------------------------------
合計 8 2 0 10

Reply to #62278×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: StepCounter3.0.0の-showDirectoryオプション (2012-02-18 15:34 by takezoe #62279)

-showDirectory=true のように =true を付けて指定してください。
Reply to #62278

Reply to #62279×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: StepCounter3.0.0の-showDirectoryオプション (2012-02-18 17:18 by nabedge #62283)

ありがとうございます!動きました。

が、今度はAntタスクではshowDirectoryオプションが動かないようです。こっちは仕様でしょうか?

<?xml version="1.0" ?>
<project default="count" basedir=".">
<taskdef
name="stepcounter"
classname="jp.sf.amateras.stepcounter.ant.StepCounterTask"
classpath="lib/stepcounter-3.0.0-jar-with-dependencies.jar" />

<target name="count">
<stepcounter
showDirectory="true"
format="csv"
output="count.txt"
encoding="UTF-8">
<fileset dir="src">
<include name="**/*.java" />
</fileset>
</stepcounter>
</target>
</project>

結果:

BUILD FAILED
C:\workspace\zzz-ant\build.xml:15: stepcounter doesn't support the "showDirectory" attribute
Reply to #62278

Reply to #62283×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: StepCounter3.0.0の-showDirectoryオプション (2012-02-19 00:06 by takezoe #62290)

多分こんな感じです。-showDirectoryオプションの指定方法とあわせてREADMEに書いておきます。

<stepcounter format="excel" output="count.xls" encoding="UTF-8">
<src="src" />
</stepcounter>
Reply to #62283

Reply to #62290×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: StepCounter3.0.0の-showDirectoryオプション (2012-02-19 11:50 by nabedge #62307)

ありがとうございます。最終的にはこんな感じでうごきました!

<project default="count" basedir=".">
<taskdef
name="stepcounter"
classname="jp.sf.amateras.stepcounter.ant.StepCounterTask"
classpath="lib/stepcounter-3.0.0-jar-with-dependencies.jar" />
<target name="count">
<stepcounter
format="csv"
encoding="UTF-8">
<src path="src"/>
</stepcounter>
</target>
</project>

結果:
Buildfile: C:\workspace\zzz\build.xml
count:
[stepcounter] 1起点ディレクトリ
[stepcounter] /src/com/example/zzz/App.java,Java,,8,1,4,13
[stepcounter] /src/com/example/zzz/App2.java,Java,,8,1,4,13
[stepcounter] /src/com/example/zzz/foo/App.java,Java,,7,3,8,18
BUILD SUCCESSFUL
Total time: 347 milliseconds
Reply to #62290

Reply to #62307×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login