diff options
author | 2015-10-26 14:23:11 +0000 | |
---|---|---|
committer | 2015-10-27 11:46:59 +0000 | |
commit | e42275c03a1978f4eb5aa97e6a4929606e97bed8 (patch) | |
tree | 729ca2d44892d024cfa7e3652b4e017343b66ed3 /src/main/java/com/google/devtools/build/lib/rules/cpp/FakeCppCompileAction.java | |
parent | 3e46cab997116e6b0a7a40428a414a53f5d7f9a3 (diff) |
Refactor include scanning / .d file parsing in the C++ rules so that validating includes and updating action inputs is clearly separated and easier to understand now.
--
MOS_MIGRATED_REVID=106298050
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/FakeCppCompileAction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/FakeCppCompileAction.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/FakeCppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/FakeCppCompileAction.java index e2446cc127..98d0827d3d 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/FakeCppCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/FakeCppCompileAction.java @@ -137,7 +137,10 @@ public class FakeCppCompileAction extends CppCompileAction { } } IncludeScanningContext scanningContext = executor.getContext(IncludeScanningContext.class); - updateActionInputs(executor.getExecRoot(), scanningContext.getArtifactResolver(), reply); + NestedSet<Artifact> discoveredInputs = + discoverInputsFromDotdFiles( + executor.getExecRoot(), scanningContext.getArtifactResolver(), reply); + reply = null; // Clear in-memory .d files early. // Even cc_fake_binary rules need to properly declare their dependencies... // In fact, they need to declare their dependencies even more than cc_binary rules do. @@ -146,7 +149,10 @@ public class FakeCppCompileAction extends CppCompileAction { // listed in the "srcs" of the cc_fake_binary or in the "srcs" of a cc_library that it // depends on. try { - validateInclusions(actionExecutionContext.getMiddlemanExpander(), executor.getEventHandler()); + validateInclusions( + discoveredInputs, + actionExecutionContext.getMiddlemanExpander(), + executor.getEventHandler()); } catch (ActionExecutionException e) { // TODO(bazel-team): (2009) make this into an error, once most of the current warnings // are fixed. @@ -155,6 +161,8 @@ public class FakeCppCompileAction extends CppCompileAction { e.getMessage() + ";\n this warning may eventually become an error")); } + updateActionInputs(discoveredInputs); + // Generate a fake ".o" file containing the command line needed to generate // the real object file. LOG.info("Generating " + outputFile); |