diff options
author | Googler <noreply@google.com> | 2015-04-07 20:56:35 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2015-04-08 08:48:25 +0000 |
commit | c70558899e9979af8f6c20f0c0232086cac41b56 (patch) | |
tree | d8d2d893303c734f07e38333dedfdc5338d5e799 /src/main | |
parent | 09a833957d3cb44ad788b5df8a04fe7fb45bf45c (diff) |
Added rule label to CppDebugPackageProvider to allow consumers to report better errors.
--
MOS_MIGRATED_REVID=90543663
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java | 3 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppDebugPackageProvider.java | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java index 6f545ac0e4..9c0626f960 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java @@ -303,7 +303,8 @@ public abstract class CcBinary implements RuleConfiguredTargetFactory { .add(RunfilesProvider.class, RunfilesProvider.simple(runfiles)) .add( CppDebugPackageProvider.class, - new CppDebugPackageProvider(strippedFile, executable, explicitDwpFile)) + new CppDebugPackageProvider( + ruleContext.getLabel(), strippedFile, executable, explicitDwpFile)) .setRunfilesSupport(runfilesSupport, executable) .addProvider(LipoContextProvider.class, new LipoContextProvider( cppCompilationContext, ImmutableMap.copyOf(scannableMap))) diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppDebugPackageProvider.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppDebugPackageProvider.java index 864a4d5a11..eadf13220c 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppDebugPackageProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppDebugPackageProvider.java @@ -18,6 +18,7 @@ import com.google.common.base.Preconditions; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.TransitiveInfoProvider; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; +import com.google.devtools.build.lib.syntax.Label; import javax.annotation.Nullable; @@ -29,22 +30,32 @@ import javax.annotation.Nullable; @Immutable public final class CppDebugPackageProvider implements TransitiveInfoProvider { + private final Label targetLabel; private final Artifact strippedArtifact; private final Artifact unstrippedArtifact; @Nullable private final Artifact dwpArtifact; public CppDebugPackageProvider( + Label targetLabel, Artifact strippedArtifact, Artifact unstrippedArtifact, @Nullable Artifact dwpArtifact) { Preconditions.checkNotNull(strippedArtifact); Preconditions.checkNotNull(unstrippedArtifact); + this.targetLabel = targetLabel; this.strippedArtifact = strippedArtifact; this.unstrippedArtifact = unstrippedArtifact; this.dwpArtifact = dwpArtifact; } /** + * Returns the label for the cc_binary target. + */ + public final Label getTargetLabel() { + return targetLabel; + } + + /** * Returns the stripped file (the explicit ".stripped" target). */ public final Artifact getStrippedArtifact() { |