diff options
author | 2016-01-20 18:32:56 +0000 | |
---|---|---|
committer | 2016-01-21 10:32:49 +0000 | |
commit | fbb6c6b84810e001d7cc58ed4e5782913e65199b (patch) | |
tree | 4023c68755924a99e4b20fe204852eb9706c0859 /src/main/java/com/google/devtools/build/lib | |
parent | f5cc0b2ae077581046aa9a6265554738d891d9c0 (diff) |
Refer to objc's gcov under @bazel_tools
This is part of removing the requirement of having base_workspace in your
package_path for bazel builds.
This also removes --experimental_objc_gcov_binary, since it doesn't seem to be needed anymore.
--
MOS_MIGRATED_REVID=112595137
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
3 files changed, 13 insertions, 22 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java index 7e8c5b3486..707fd337be 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java @@ -29,6 +29,7 @@ import com.google.common.collect.ListMultimap; import com.google.common.collect.Maps; import com.google.common.collect.Multimap; import com.google.common.collect.MutableClassToInstanceMap; +import com.google.devtools.build.lib.Constants; import com.google.devtools.build.lib.actions.ArtifactFactory; import com.google.devtools.build.lib.actions.PackageRootResolver; import com.google.devtools.build.lib.actions.Root; @@ -836,19 +837,20 @@ public final class BuildConfiguration { public List<Label> targetEnvironments; @Option(name = "objc_gcov_binary", - converter = LabelConverter.class, - defaultValue = "//third_party/gcov:gcov_for_xcode", + converter = ToolsLabelConverter.class, + defaultValue = "//third_party/gcov:gcov_for_xcode_osx", category = "undocumented") public Label objcGcovBinary; - // This performs the same function as objc_gcov_binary but applies to experminental_ios_test - // rather than ios_test. - // TODO(bazel-team): Remove this once experimental_ios_test replaces to ios_test. - @Option(name = "experimental_objc_gcov_binary", - converter = LabelConverter.class, - defaultValue = "//third_party/gcov:gcov_for_xcode_osx", - category = "undocumented") - public Label experimentalObjcGcovBinary; + /** Converter for labels in the @bazel_tools repository. The @Options' defaultValues can't + * prepend TOOLS_REPOSITORY, unfortunately, because then the compiler thinks they're not + * constant. */ + public static class ToolsLabelConverter extends LabelConverter { + @Override + public Label convert(String input) throws OptionsParsingException { + return convertLabel(Constants.TOOLS_REPOSITORY + input); + } + } @Option(name = "experimental_dynamic_configs", defaultValue = "false", @@ -913,7 +915,6 @@ public final class BuildConfiguration { } if (collectCodeCoverage) { labelMap.put("objc_gcov", objcGcovBinary); - labelMap.put("experimental_objc_gcov", experimentalObjcGcovBinary); } } } diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/IosTestRule.java b/src/main/java/com/google/devtools/build/lib/rules/objc/IosTestRule.java index ac197912f4..bcf28e1a89 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/IosTestRule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/IosTestRule.java @@ -163,7 +163,7 @@ public class IosTestRule implements RuleDefinition { return ImmutableList.of( configuration .getFragment(ObjcConfiguration.class) - .getExperimentalGcovLabel()); + .getGcovLabel()); } })) .build(); diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java index 3e12c00a33..f0a0c4bde5 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java @@ -70,7 +70,6 @@ public class ObjcConfiguration extends BuildConfiguration.Fragment { // configuration, the late bound attribute will fail to be initialized because it hasn't been // loaded. @Nullable private final Label gcovLabel; - @Nullable private final Label experimentalGcovLabel; @Nullable private final Label dumpSymsLabel; ObjcConfiguration(ObjcCommandLineOptions objcOptions, BuildConfiguration.Options options, @@ -85,7 +84,6 @@ public class ObjcConfiguration extends BuildConfiguration.Fragment { this.copts = ImmutableList.copyOf(objcOptions.copts); this.compilationMode = Preconditions.checkNotNull(options.compilationMode, "compilationMode"); this.gcovLabel = options.objcGcovBinary; - this.experimentalGcovLabel = options.experimentalObjcGcovBinary; this.dumpSymsLabel = objcOptions.dumpSyms; this.iosSplitCpu = Preconditions.checkNotNull(objcOptions.iosSplitCpu, "iosSplitCpu"); this.fastbuildOptions = ImmutableList.copyOf(objcOptions.fastbuildOptions); @@ -166,14 +164,6 @@ public class ObjcConfiguration extends BuildConfiguration.Fragment { } /** - * Returns the label of the experimental gcov binary, used to get test coverage data for {@code - * experimental_ios_test}. Null iff not in coverage mode. - */ - @Nullable public Label getExperimentalGcovLabel() { - return experimentalGcovLabel; - } - - /** * Returns the label of the dump_syms binary, used to get debug symbols from a binary. Null iff * !{@link #generateDebugSymbols}. */ |