Add getExec method for AppleCommandLineOptions.

Part of work on execution transitions, #7935.

PiperOrigin-RevId: 245428841
diff --git a/src/main/java/com/google/devtools/build/lib/rules/apple/AppleCommandLineOptions.java b/src/main/java/com/google/devtools/build/lib/rules/apple/AppleCommandLineOptions.java
index f21a639..96e0f20 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/apple/AppleCommandLineOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/apple/AppleCommandLineOptions.java
@@ -436,6 +436,7 @@
     host.tvOsSdkVersion = tvOsSdkVersion;
     host.macOsSdkVersion = macOsSdkVersion;
     host.appleBitcodeMode = appleBitcodeMode;
+    // TODO(http://b/131411178): Replace with the execution platform.
     // The host apple platform type will always be MACOS, as no other apple platform type can
     // currently execute build actions. If that were the case, a host_apple_platform_type flag might
     // be needed.
@@ -444,6 +445,16 @@
     return host;
   }
 
+  @Override
+  public FragmentOptions getExec() {
+    AppleCommandLineOptions exec = (AppleCommandLineOptions) super.getExec();
+    // TODO(http://b/131411178): Replace with the execution platform.
+    // The exec apple platform type will always be MACOS, as no other apple platform type can
+    // currently execute build actions.
+    exec.applePlatformType = PlatformType.MACOS;
+    return exec;
+  }
+
   void serialize(SerializationContext context, CodedOutputStream out)
       throws IOException, SerializationException {
     context.serialize(this, out);