Work around a bug where the new `--apple_bitcode` converter did not work properly in a Starlark transition function.
RELNOTES: None.
package com.google.devtools.build.lib.rules.apple;
import com.google.common.annotations.VisibleForTesting;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;
import com.google.devtools.build.lib.rules.apple.AppleCommandLineOptions.AppleBitcodeMode;
import com.google.devtools.common.options.Converter;
import com.google.devtools.common.options.OptionsParsingException;
+import java.util.List;
import java.util.Map;
/**
@@ -26,7 +28,7 @@ import java.util.Map;
* platform type and the bitcode mode to apply to builds targeting that platform.
*/
public final class AppleBitcodeConverter
- implements Converter<Map.Entry<ApplePlatform.PlatformType, AppleBitcodeMode>> {
+ implements Converter<List<Map.Entry<ApplePlatform.PlatformType, AppleBitcodeMode>>> {
/** Used to convert Bitcode mode strings to their enum value. */
private static final AppleBitcodeMode.Converter MODE_CONVERTER = new AppleBitcodeMode.Converter();
@@ -44,8 +46,8 @@ public final class AppleBitcodeConverter
"Apple Bitcode mode must be in the form " + TYPE_DESCRIPTION;
@Override
- public Map.Entry<ApplePlatform.PlatformType, AppleBitcodeMode> convert(String input)
- throws OptionsParsingException {
+ public ImmutableList<Map.Entry<ApplePlatform.PlatformType, AppleBitcodeMode>> convert(
+ String input) throws OptionsParsingException {
ApplePlatform.PlatformType platformType;
AppleBitcodeMode mode;
@@ -65,7 +67,7 @@ public final class AppleBitcodeConverter
mode = convertAppleBitcodeMode(modeName);
}
- return Maps.immutableEntry(platformType, mode);
+ return ImmutableList.of(Maps.immutableEntry(platformType, mode));
}
@Override
