For the incremental compiling, I used '--subcommands' option to see the which commmands are execute:
____Loading...
____Found 64 targets...
____[0 / 1] BazelWorkspaceStatusAction stable-status.txt
____[1 / 2] Building libreporter.jar (2088 source files)
>>>>>>>>> # //:reporter [action 'Building libreporter.jar (2088 source files)']
(cd /root/.cache/bazel/_bazel_root/172c3c523723d1ac9fd40665cdc272a1/SPA_V3R5_BUILD && \
exec env - \
external/local_jdk/bin/java -Xbootclasspath/p:external/bazel_tools/third_party/java/jdk/langtools/javac.jar -client -jar external/bazel_tools/tools/jdk/JavaBuilder_deploy.jar @bazel-out/local_linux-fastbuild/bin/libreporter.jar-2.params)
____[1 / 2] Still waiting for 1 job to complete:
Running (sandbox):
Building libreporter.jar (2088 source files), 10 s
____From Building libreporter.jar (2088 source files):
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
____Building complete.
____Elapsed time: 17.563s, Critical Path: 17.00s
The content of file bazel-out/local_linux-fastbuild/bin/libreporter.jar-2.params is as follows.
1 --classdir
2 bazel-out/local_linux-fastbuild/bin/_javac/reporter/libreporter_classes
3 --tempdir
4 bazel-out/local_linux-fastbuild/bin/_javac/reporter/libreporter_temp
5 --output
6 bazel-out/local_linux-fastbuild/bin/libreporter.jar
7 --sourcegendir
8 bazel-out/local_linux-fastbuild/bin/_javac/reporter/libreporter_sourcegenfiles
9 --output_manifest_proto
10 bazel-out/local_linux-fastbuild/bin/libreporter.jar_manifest_proto
11 --compress_jar
12 --output_deps_proto
13 bazel-out/local_linux-fastbuild/bin/libreporter.jdeps
...
18 --sources
19 systemAnalyzer/reporterSrc/src/main/FE/FE-BE-adapter/java/com/huawei/ism/adapter/AdapterUtils.java
20 systemAnalyzer/reporterSrc/src/main/FE/FE-BE-adapter/java/com/huawei/ism/adapter/ApplicationContextHolder.java
21 systemAnalyzer/reporterSrc/src/main/FE/FE-BE-adapter/java/com/huawei/ism/adapter/GenerateDefaultMoPreProcessor.java
22 systemAnalyzer/reporterSrc/src/main/FE/FE-BE-adapter/java/com/huawei/ism/adapter/InitServlet.java
23 systemAnalyzer/reporterSrc/src/main/FE/FE-BE-adapter/java/com/huawei/ism/adapter/LegoSystemBuilder.java
24 systemAnalyzer/reporterSrc/src/main/FE/FE-BE-adapter/java/com/huawei/ism/adapter/ListenerInitializeCallback.java
25 systemAnalyzer/reporterSrc/src/main/BE/Lego-Core-Log-Bundle/com/huawei/lego/core/log/DateFormatUtil.java
...
2104 systemAnalyzer/reporterSrc/src/main/dynamictablepro/com/huawei/ism/report/tablemanager/ResourceTypeUtil.java
2105 systemAnalyzer/reporterSrc/src/main/dynamictablepro/com/huawei/ism/report/tablemanager/TableChecker.java
2106 systemAnalyzer/reporterSrc/src/main/dynamictablepro/com/huawei/ism/report/tablemanager/UserAclUtil.java
2107 --javacopts
2108 -source
2109 8
...
All the java files (2088) are listed in the file bazel-out/local_linux-fastbuild/bin/libreporter.jar-2.params.
Is that the reason that the incremental compiling took the similar time as a clean compiling?
I also performed some incremental compilings for other java_library() rules of small numbers of java files. The experiments showed "*.jar-2.params" files always contained the whole source files.
-Leo
在 2016年5月6日星期五 UTC+8下午5:34:31,Leo Yin写道: