Hi,
I am used to Make / CMake or Ant build systems where I can either type "make -n" and see what is going to happen before it happens, or I can generally enable some sort of debug flag that prints out what low commands are being issued.
I find that SBT ( along with every other Java build tool minus Ant ) makes it too difficult to see what commands are being issued.
How can I turn on extremely low level Debug messages that tell me what are the actual commands to "javac" ?
Now, I've done this inside sbt
set logLevel := Level.Debug
and then run
compilebut looks what happens when I compile Java: ( I'll save you the headache , but essentially this is all that comes up that is important:
[debug] Modified binary dependencies: Set()
[debug] Initial directly
invalidated sources:
Set(/media/jdamon/Development/Documents/Projects/learning_scala/Foo/src/main/java/com/FooBar/MainAc
tivity.java,
/media/jdamon/Development/Documents/Projects/learning_scala/Foo/target/android-gen/com/FooBar/R.java,
/media/jdamon/Development/Docu
ments/Projects/learning_scala/Foo/target/android-gen/com/FooBar/BuildConfig.java,
/media/jdamon/Development/Documents/Projects/learning_scala/Foo
/src/androidTest/java/com/FooBar/MainActivityTest.java)[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug]
All initially invalidated sources:
Set(/media/jdamon/Development/Documents/Projects/learning_scala/Foo/src/main/java/com/FooBar/MainActiv
ity.java,
/media/jdamon/Development/Documents/Projects/learning_scala/Foo/target/android-gen/com/FooBar/R.java,
/media/jdamon/Development/Documen
ts/Projects/learning_scala/Foo/target/android-gen/com/FooBar/BuildConfig.java,
/media/jdamon/Development/Documents/Projects/learning_scala/Foo/sr
c/androidTest/java/com/FooBar/MainActivityTest.java)
[debug] Recompiling all 4 sources: invalidated sources (4) exceeded 50.0% of all sources
[info] Compiling 4 Java sources to /media/jdamon/Development/Documents/Projects/learning_scala/Foo/target/android-bin/classes...
[debug] Attempting to call javac directly...[debug] com.sun.tools.javac.Main not found with appropriate method signature; forking javac instead
[debug] Forking javac: javac @/tmp/sbt_11c2da96/argfile
1. How can I make SBT actually show the commands being invoked : Example, Ant with -verbose will actually show you every single command albeit in a streched out format ( multi-line )
2. Why isn't SBT configured by default so that it shows this information with debug turned on? To me this is as bad as Eclipse that refuses to show the user the actual compilation steps UNLESS you are an Eclipse super user and no how to enable this ( which I am not and is why I left trying to learn Eclipse ).
An example of a better system is what CMake does where every single compilation phase can be traced to miniature shell scripts that build parts of the design. This way if there are any strange behaviours you can at least get down to the bare metal to explore.
Thanks for any suggestions on how to get into how SBT to list every command it runs explicitly.
[debug] resolving dependencies for configuration 'compile'
[debug] == resolving dependencies for com-foobar#com-foobar;0.1-SNAPSHOT [compile]
[debug] == resolving dependencies com-foobar#com-foobar;0.1-SNAPSHOT->org.scala-lang#scala-library;2.10.4 [compile->default(compile)]
[info] Resolving org.scala-lang#scala-library;2.10.4 ...
[debug] sbt-chain: Checking cache for: sbt.ivyint.MergedDescriptors@2c68160c
[debug] sbt-chain: module revision found in cache: org.scala-lang#scala-library;2.10.4
[debug] found org.scala-lang#scala-library;2.10.4 in sbt-chain
[debug] [2.10.4] org.scala-lang#scala-library;2.10.4
[debug] == resolving dependencies com-foobar#com-foobar;0.1-SNAPSHOT->org.scala-lang#scala-library;2.10.4 [compile->runtime]
[debug] == resolving dependencies com-foobar#com-foobar;0.1-SNAPSHOT->org.scala-lang#scala-library;2.10.4 [compile->compile]
[debug] == resolving dependencies com-foobar#com-foobar;0.1-SNAPSHOT->org.scala-lang#scala-library;2.10.4 [compile->master]
[debug] resolving dependencies for configuration 'runtime'
[debug] == resolving dependencies for com-foobar#com-foobar;0.1-SNAPSHOT [runtime]
[debug] == resolving dependencies for com-foobar#com-foobar;0.1-SNAPSHOT [compile]
[debug] == resolving dependencies com-foobar#com-foobar;0.1-SNAPSHOT->org.scala-lang#scala-library;2.10.4 [compile->default(compile)]
[debug] == resolving dependencies com-foobar#com-foobar;0.1-SNAPSHOT->org.scala-lang#scala-library;2.10.4 [compile->runtime]
[debug] == resolving dependencies com-foobar#com-foobar;0.1-SNAPSHOT->org.scala-lang#scala-library;2.10.4 [compile->compile]
[debug] == resolving dependencies com-foobar#com-foobar;0.1-SNAPSHOT->org.scala-lang#scala-library;2.10.4 [compile->master]
[debug] resolving dependencies for configuration 'test'
[debug] == resolving dependencies for com-foobar#com-foobar;0.1-SNAPSHOT [test]
[debug] == resolving dependencies for com-foobar#com-foobar;0.1-SNAPSHOT [runtime]
[debug] == resolving dependencies for com-foobar#com-foobar;0.1-SNAPSHOT [compile]
....
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set(/media/jdamon/Development/Documents/Projects/learning_scala/Foo/src/main/java/com/FooBar/MainActivity.java, /media/jda
mon/Development/Documents/Projects/learning_scala/Foo/target/android-gen/com/FooBar/R.java, /media/jdamon/Development/Documents/Projects/learning
_scala/Foo/target/android-gen/com/FooBar/BuildConfig.java, /media/jdamon/Development/Documents/Projects/learning_scala/Foo/src/androidTest/java/c
om/FooBar/MainActivityTest.java)
[debug] modified: Set()
[debug] Removed products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set(/media/jdamon/Development/Documents/Projects/learning_scala/Foo/src/main/java/com/FooBar/MainAc
tivity.java, /media/jdamon/Development/Documents/Projects/learning_scala/Foo/target/android-gen/com/FooBar/R.java, /media/jdamon/Development/Docu
ments/Projects/learning_scala/Foo/target/android-gen/com/FooBar/BuildConfig.java, /media/jdamon/Development/Documents/Projects/learning_scala/Foo
/src/androidTest/java/com/FooBar/MainActivityTest.java)
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] All initially invalidated sources: Set(/media/jdamon/Development/Documents/Projects/learning_scala/Foo/src/main/java/com/FooBar/MainActiv
ity.java, /media/jdamon/Development/Documents/Projects/learning_scala/Foo/target/android-gen/com/FooBar/R.java, /media/jdamon/Development/Documen
ts/Projects/learning_scala/Foo/target/android-gen/com/FooBar/BuildConfig.java, /media/jdamon/Development/Documents/Projects/learning_scala/Foo/sr
c/androidTest/java/com/FooBar/MainActivityTest.java)
[debug] Recompiling all 4 sources: invalidated sources (4) exceeded 50.0% of all sources
[info] Compiling 4 Java sources to /media/jdamon/Development/Documents/Projects/learning_scala/Foo/target/android-bin/classes...
[debug] Attempting to call javac directly...
[debug] com.sun.tools.javac.Main not found with appropriate method signature; forking javac instead
[debug] Forking javac: javac @/tmp/sbt_ebe6d072/argfile