Automatic code cleanup.

PiperOrigin-RevId: 561970380
diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml
index 4ce348c..599acc4 100644
--- a/.bazelci/presubmit.yml
+++ b/.bazelci/presubmit.yml
@@ -1,7 +1,7 @@
 ---
 platforms:
   macos:
-    xcode_version: "13.2.1"
+    xcode_version: "14.2.0"
     bazel: last_downstream_green
     build_targets:
     - "//:tulsi"
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index ebdbbe5..5980155 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -10,16 +10,11 @@
 #     Name <email address>
 
 Alex Huang <alexhuang@google.com>
-Andrew Bonventre <andybons@google.com>
 Erik Abair <abaire@google.com>
 Dave MacLachlan <dmaclach@google.com>
 David Goldman <davg@google.com>
-Jonathan Dierksen <dierksen@google.com>
-Dmitry Shevchenko <dmishe@google.com>
 Kelvin Chan <kelvinchan@google.com>
-Sergio Campamá <kaipi@google.com>
 Nicholas Levin <nglevin@google.com>
 Thomas Van Lenten <thomasvl@google.com>
-Steven E Wright <stevewright@google.com>
 Rein Hillmann <rein@google.com>
 Ivan Hernandez <ivanhernandez@google.com>
diff --git a/site/index.html b/site/index.html
index 3eacb6c..2759548 100644
--- a/site/index.html
+++ b/site/index.html
@@ -26,9 +26,8 @@
     </div>
     <div class="mdl-cell mdl-cell--3-col-desktop mdl-cell--8-col-tablet
         mdl-cell--4-col-phone">
-      <h1>Correct, reproducible, fast builds - now for Xcode</h1>
-      <p>Tulsi integrates <a href="https://bazel.build">Bazel</a> (Google's build tool) with Apple's
-        Xcode IDE.
+      <h1>Tulsi for Bazel is no longer maintained</h1>
+      <p>Please use <a href="https://github.com/buildbuddy-io/rules_xcodeproj">rules_xcodeproj</a> instead.
       </p>
       <p>Tulsi is currently in Beta but is broadly used within Google. There are still some
          functional limitations, but we believe that Tulsi is stable enough for production use. The
diff --git a/src/Tulsi/BUILD b/src/Tulsi/BUILD
index 73b680e..2d83367 100644
--- a/src/Tulsi/BUILD
+++ b/src/Tulsi/BUILD
@@ -1,6 +1,7 @@
 load("@build_bazel_rules_swift//swift:swift_library.bzl", "swift_library")
 
 package(
+    default_applicable_licenses = ["//:license"],
     default_visibility = ["//:__subpackages__"],
 )
 
diff --git a/src/TulsiEndToEndTests/BUILD b/src/TulsiEndToEndTests/BUILD
index 9e1ade2..e2e8502 100644
--- a/src/TulsiEndToEndTests/BUILD
+++ b/src/TulsiEndToEndTests/BUILD
@@ -1,6 +1,8 @@
 load("//src/TulsiGeneratorIntegrationTests:tulsi_integration_test.bzl", "tulsi_integration_test")
 load("@build_bazel_rules_swift//swift:swift_library.bzl", "swift_library")
 
+package(default_applicable_licenses = ["//:license"])
+
 licenses(["notice"])
 
 test_suite(name = "TulsiEndToEndTests")
diff --git a/src/TulsiEndToEndTests/ButtonsEndToEndTest.swift b/src/TulsiEndToEndTests/ButtonsEndToEndTest.swift
index 28fa3f5..362b6bf 100644
--- a/src/TulsiEndToEndTests/ButtonsEndToEndTest.swift
+++ b/src/TulsiEndToEndTests/ButtonsEndToEndTest.swift
@@ -66,6 +66,8 @@
         "index-files",
         "-targets-of-scheme",
         scheme,
+        "-destination",
+        "platform=iOS Simulator,name=iPhone 12",
         "--",
         "quit",
       ])
diff --git a/src/TulsiEndToEndTests/Resources/Buttons/BUILD b/src/TulsiEndToEndTests/Resources/Buttons/BUILD
index 8ffc4e0..a277b8e 100644
--- a/src/TulsiEndToEndTests/Resources/Buttons/BUILD
+++ b/src/TulsiEndToEndTests/Resources/Buttons/BUILD
@@ -65,6 +65,7 @@
 
 swift_library(
     name = "ButtonsTestsLib",
+    testonly = 1,
     srcs = [
         "ButtonsTests/ButtonsTests.swift",
     ],
@@ -74,6 +75,7 @@
 
 swift_library(
     name = "ButtonsUITestsLib",
+    testonly = 1,
     srcs = [
         "ButtonsUITests/ButtonsUITests.swift",
     ],
@@ -96,6 +98,7 @@
         "iphone",
         "ipad",
     ],
+    features = ["exported_symbols"],
     infoplists = ["Buttons/Info.plist"],
     minimum_os_version = "11.0",
     watch_application = ":ButtonsWatch",
@@ -199,6 +202,7 @@
 
 swift_library(
     name = "ButtonsTVTestsLib",
+    testonly = 1,
     srcs = [
         "ButtonsTVTests/ButtonsTVTests.swift",
     ],
@@ -206,6 +210,7 @@
 
 swift_library(
     name = "ButtonsTVUITestsLib",
+    testonly = 1,
     srcs = [
         "ButtonsTVUITests/ButtonsTVUITests.swift",
     ],
@@ -257,6 +262,7 @@
 
 swift_library(
     name = "ButtonsMacTestsLib",
+    testonly = 1,
     srcs = [
         "ButtonsMacTests/ButtonsMacTests.swift",
     ],
@@ -266,6 +272,7 @@
 
 swift_library(
     name = "ButtonsMacUITestsLib",
+    testonly = 1,
     srcs = [
         "ButtonsMacUITests/ButtonsMacUITests.swift",
     ],
@@ -284,6 +291,7 @@
 macos_application(
     name = "ButtonsMac",
     bundle_id = "com.google.ButtonsMac",
+    features = ["exported_symbols"],
     infoplists = ["ButtonsMac/Info.plist"],
     minimum_os_version = "10.13",
     deps = [
diff --git a/src/TulsiEndToEndTests/TulsiEndToEndTest.swift b/src/TulsiEndToEndTests/TulsiEndToEndTest.swift
index 6a950b0..a6a256e 100644
--- a/src/TulsiEndToEndTests/TulsiEndToEndTest.swift
+++ b/src/TulsiEndToEndTests/TulsiEndToEndTest.swift
@@ -21,7 +21,7 @@
 // generated xcodeproj by running the projects unit tests.
 class TulsiEndToEndTest: BazelIntegrationTestCase {
   fileprivate static let simulatorName = "tulsie2e-\(UUID().uuidString.prefix(8))"
-  fileprivate static let targetVersion = "15.5"
+  fileprivate static let targetVersion = "16.2"
 
   let fileManager = FileManager.default
   var runfilesWorkspaceURL: URL! = nil
@@ -36,7 +36,7 @@
   override class func setUp() {
     super.setUp()
 
-    let targetDevice = "iPhone 12 Pro"
+    let targetDevice = "iPhone 14 Pro"
     let deviceName = targetDevice.replacingOccurrences(of: " ", with: "-")
     let deviceVersion = TulsiEndToEndTest.targetVersion.replacingOccurrences(of: ".", with: "-")
     let typeId = "com.apple.CoreSimulator.SimDeviceType.\(deviceName)"
diff --git a/src/TulsiGenerator/BUILD b/src/TulsiGenerator/BUILD
index edaeece..919d6ff 100644
--- a/src/TulsiGenerator/BUILD
+++ b/src/TulsiGenerator/BUILD
@@ -1,6 +1,7 @@
 load("@build_bazel_rules_swift//swift:swift_library.bzl", "swift_library")
 
 package(
+    default_applicable_licenses = ["//:license"],
     default_visibility = ["//:__subpackages__"],
 )
 
diff --git a/src/TulsiGenerator/Bazel/BUILD b/src/TulsiGenerator/Bazel/BUILD
index 0bc76db..e9a7dde 100644
--- a/src/TulsiGenerator/Bazel/BUILD
+++ b/src/TulsiGenerator/Bazel/BUILD
@@ -2,7 +2,10 @@
 
 licenses(["notice"])
 
-package(default_visibility = ["//:__subpackages__"])
+package(
+    default_applicable_licenses = ["//:license"],
+    default_visibility = ["//:__subpackages__"],
+)
 
 exports_files(
     ["WORKSPACE"],
diff --git a/src/TulsiGenerator/BazelSettingsProvider.swift b/src/TulsiGenerator/BazelSettingsProvider.swift
index cc08fbe..4881524 100644
--- a/src/TulsiGenerator/BazelSettingsProvider.swift
+++ b/src/TulsiGenerator/BazelSettingsProvider.swift
@@ -40,6 +40,10 @@
   /// - Bundles with spaces in the name
   case TreeArtifactOutputs
 
+  /// All intermediate outputs are downloaded regardless of whether they are requested at the top
+  /// level.
+  case OutputAllIntermediates
+
   /// TODO(b/111928007): Remove this and/or BazelSettingFeature once DebugPathNormalization is
   /// supported by all builds.
   public var stringValue: String {
@@ -50,6 +54,8 @@
         return "SwiftForcesdSYMs"
       case .TreeArtifactOutputs:
         return "TreeArtifactOutputs"
+      case .OutputAllIntermediates:
+        return "OutputAllIntermediates"
     }
   }
 
@@ -71,6 +77,8 @@
         return true
       case .TreeArtifactOutputs:
         return true
+      case .OutputAllIntermediates:
+        return true
     }
   }
 
@@ -82,6 +90,8 @@
         return false
       case .TreeArtifactOutputs:
         return true
+      case .OutputAllIntermediates:
+        return true
     }
   }
 
@@ -96,6 +106,7 @@
       case .DebugPathNormalization: return ["--features=debug_prefix_map_pwd_is_dot"]
       case .SwiftForcesdSYMs: return ["--apple_generate_dsym"]
       case .TreeArtifactOutputs: return ["--define=apple.experimental.tree_artifact_outputs=1"]
+      case .OutputAllIntermediates: return ["--config=no_fuseless_with_local_outputs"]
     }
   }
 
diff --git a/src/TulsiGenerator/BazelWorkspaceInfoExtractor.swift b/src/TulsiGenerator/BazelWorkspaceInfoExtractor.swift
index 2069c87..6bf7956 100644
--- a/src/TulsiGenerator/BazelWorkspaceInfoExtractor.swift
+++ b/src/TulsiGenerator/BazelWorkspaceInfoExtractor.swift
@@ -59,14 +59,12 @@
   ) {
     let universalFlags: BazelFlags
       if runAspectsFromWorkspace {
-        // No need for any additional flags.
         universalFlags = BazelFlags()
       } else if let applicationSupport = ApplicationSupport() {
         // Install to ~/Library/Application Support when not running inside a test.
         let tulsiVersion = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "UNKNOWN"
         let aspectPath = try! applicationSupport.copyTulsiAspectFiles(tulsiVersion: tulsiVersion)
         universalFlags = BazelFlags(
-          // TODO(tulsi-team): See if we can avoid using --override_repository.
           build: ["--override_repository=tulsi=\(aspectPath)"]
         )
       } else {  // Running inside a test, just refer to the files directly from TulsiGenerator.
@@ -74,6 +72,7 @@
         let bazelWorkspace =
           bundle.url(forResource: "WORKSPACE", withExtension: nil)!.deletingLastPathComponent()
         universalFlags = BazelFlags(build: ["--override_repository=tulsi=\(bazelWorkspace.path)"])
+        preconditionFailure("Should not use --override_repository anymore")
     }
 
     bazelSettingsProvider = BazelSettingsProvider(universalFlags: universalFlags)
diff --git a/src/TulsiGenerator/PBXTargetGenerator.swift b/src/TulsiGenerator/PBXTargetGenerator.swift
index 635a099..eb2e803 100644
--- a/src/TulsiGenerator/PBXTargetGenerator.swift
+++ b/src/TulsiGenerator/PBXTargetGenerator.swift
@@ -1692,8 +1692,12 @@
         entry.deploymentTarget?.platform == PlatformType.ios  {
       let manifest = "tulsi_resign_manifest.json"
       self.createResignerTargetForUITestTarget(
-          target, buildSettings: ["TULSI_RESIGN_MANIFEST":
-              "$(CONFIGURATION_TEMP_DIR)/\(name).build/\(manifest)"])
+          target,
+          buildSettings: [
+            "SDKROOT": PlatformType.ios.deviceSDK,
+            "TULSI_RESIGN_MANIFEST":
+                "$(CONFIGURATION_TEMP_DIR)/\(name).build/\(manifest)",
+          ])
 
       buildSettings["TULSI_RESIGN_MANIFEST"] = "$(TARGET_TEMP_DIR)/\(manifest)"
     }
diff --git a/src/TulsiGenerator/Scripts/BUILD b/src/TulsiGenerator/Scripts/BUILD
index 1f35926..e995e4a 100644
--- a/src/TulsiGenerator/Scripts/BUILD
+++ b/src/TulsiGenerator/Scripts/BUILD
@@ -1,6 +1,8 @@
 # Tulsi Generator Scripts
-
-package(default_visibility = ["//:__subpackages__"])
+package(
+    default_applicable_licenses = ["//:license"],
+    default_visibility = ["//:__subpackages__"],
+)
 
 licenses(["notice"])
 
diff --git a/src/TulsiGenerator/Scripts/bazel_build.py b/src/TulsiGenerator/Scripts/bazel_build.py
index 5b01848..5038203 100755
--- a/src/TulsiGenerator/Scripts/bazel_build.py
+++ b/src/TulsiGenerator/Scripts/bazel_build.py
@@ -1073,12 +1073,13 @@
           # embedded bundle. Avoid this potential issue by always including the
           # Info.plist in the delta bundle. For some unknown reason, this issue
           # only occurs in iOS 16.
-          os_version = pkg_resources.parse_version(
-              os.environ['TARGET_DEVICE_OS_VERSION'])
-          if (self.platform_name.startswith('macos') or self.is_simulator) and (
-              os_version >= pkg_resources.parse_version('16')):
-            bundle_info_plist = os.path.join(bundle_path, 'Info.plist')
-            os.utime(bundle_info_plist, None)
+          target_os_version = os.environ.get('TARGET_DEVICE_OS_VERSION')
+          if target_os_version:
+            os_version = pkg_resources.parse_version(target_os_version)
+            if ((self.platform_name.startswith('macos') or self.is_simulator)
+                and os_version >= pkg_resources.parse_version('16')):
+              bundle_info_plist = os.path.join(bundle_path, 'Info.plist')
+              os.utime(bundle_info_plist, None)
           self._RsyncBundle(full_name, bundle_path, output_path)
         else:
           _PrintXcodeWarning('Could not find bundle %s in main bundle. ' %
diff --git a/src/TulsiGenerator/TulsiOptionSet.swift b/src/TulsiGenerator/TulsiOptionSet.swift
index 9b809dc..f7632e3 100644
--- a/src/TulsiGenerator/TulsiOptionSet.swift
+++ b/src/TulsiGenerator/TulsiOptionSet.swift
@@ -290,7 +290,7 @@
   /// Whethers aspects should be run from the workspace instead of an override
   // repository.
   var runAspectsFromWorkspace: Bool {
-    return self[.RunAspectsFromWorkspace].commonValueAsBool ?? false
+    return self[.RunAspectsFromWorkspace].commonValueAsBool ?? true
   }
 
   /// Label to refer to Tulsi's aspects bzl file.
@@ -366,7 +366,7 @@
     addBoolOption(.DisableCustomLLDBInit, .Generic, false)
     addBoolOption(.UseBazelCacheReader, .Generic, false)
     addBoolOption(.UseLegacyBuildSystem, .Generic, false)
-    addBoolOption(.RunAspectsFromWorkspace, .Generic, false)
+    addBoolOption(.RunAspectsFromWorkspace, .Generic, true)
 
     let defaultIdentifier = PlatformConfiguration.defaultConfiguration.identifier
     let platformCPUIdentifiers = PlatformConfiguration.allValidConfigurations.map { $0.identifier }
diff --git a/src/TulsiGeneratorIntegrationTests/BUILD b/src/TulsiGeneratorIntegrationTests/BUILD
index 15998e4..b91c75b 100644
--- a/src/TulsiGeneratorIntegrationTests/BUILD
+++ b/src/TulsiGeneratorIntegrationTests/BUILD
@@ -1,6 +1,8 @@
 load("@build_bazel_rules_swift//swift:swift_library.bzl", "swift_library")
 load(":tulsi_integration_test.bzl", "tulsi_integration_test")
 
+package(default_applicable_licenses = ["//:license"])
+
 licenses(["notice"])
 
 test_suite(
diff --git a/src/TulsiGeneratorIntegrationTests/BazelIntegrationTestCase.swift b/src/TulsiGeneratorIntegrationTests/BazelIntegrationTestCase.swift
index df3eef1..2a230f6 100644
--- a/src/TulsiGeneratorIntegrationTests/BazelIntegrationTestCase.swift
+++ b/src/TulsiGeneratorIntegrationTests/BazelIntegrationTestCase.swift
@@ -96,7 +96,7 @@
 
     // Explicitly set Xcode version to use. Must use the same version or the golden files
     // won't match.
-    bazelBuildOptions.append("--xcode_version=13.4.1")
+    bazelBuildOptions.append("--xcode_version=14.2.0")
 
     // Disable the Swift worker as it adds extra dependencies.
     bazelBuildOptions.append("--define=RULES_SWIFT_BUILD_DUMMY_WORKER=1")
@@ -107,11 +107,13 @@
     // TODO(b/203094728): Remove this when it is removed from the ox bazelrc.
     bazelBuildOptions.append("--noexperimental_dynamic_skip_first_build")
 
+    // Force to build on Mac.
+    bazelBuildOptions.append("--extra_execution_platforms=//buildenv/platforms/apple:macos_fom_intel")
+    bazelBuildOptions.append("--noexperimental_stream_log_file_uploads")
+
     guard let workspaceRootURL = workspaceRootURL else {
       fatalError("Failed to find workspaceRootURL.")
     }
-
-    bazelUniversalFlags = BazelFlags()
     workspaceInfoFetcher = BazelWorkspacePathInfoFetcher(bazelURL: bazelURL,
                                                          workspaceRootURL: workspaceRootURL,
                                                          bazelUniversalFlags: bazelUniversalFlags,
diff --git a/src/TulsiGeneratorIntegrationTests/EndToEndIntegrationTestCase.swift b/src/TulsiGeneratorIntegrationTests/EndToEndIntegrationTestCase.swift
index cde48c9..bf6fb69 100644
--- a/src/TulsiGeneratorIntegrationTests/EndToEndIntegrationTestCase.swift
+++ b/src/TulsiGeneratorIntegrationTests/EndToEndIntegrationTestCase.swift
@@ -70,6 +70,7 @@
                                                           // Tulsi artifacts are assumed to have
                                                           // been installed correctly.
                                                           "--exclude=.tulsi",
+                                                          "--exclude=__init__.py",
                                                           projectURL.path,
                                                           goldenProjectURL.path]) {
       completionInfo in
diff --git a/src/TulsiGeneratorIntegrationTests/Resources/BUILD b/src/TulsiGeneratorIntegrationTests/Resources/BUILD
index 0cf0da2..173cae9 100644
--- a/src/TulsiGeneratorIntegrationTests/Resources/BUILD
+++ b/src/TulsiGeneratorIntegrationTests/Resources/BUILD
@@ -1,6 +1,9 @@
 licenses(["notice"])
 
-package(default_visibility = ["//:__subpackages__"])
+package(
+    default_applicable_licenses = ["//:license"],
+    default_visibility = ["//:__subpackages__"],
+)
 
 filegroup(
     name = "Resources",
diff --git a/src/TulsiGeneratorIntegrationTests/Resources/Mac.BUILD b/src/TulsiGeneratorIntegrationTests/Resources/Mac.BUILD
index 487f81c..fc175cc 100644
--- a/src/TulsiGeneratorIntegrationTests/Resources/Mac.BUILD
+++ b/src/TulsiGeneratorIntegrationTests/Resources/Mac.BUILD
@@ -17,11 +17,11 @@
 load(
     "@build_bazel_rules_apple//apple:macos.bzl",
     "macos_application",
+    "macos_bundle",
     "macos_command_line_application",
     "macos_extension",
-    "macos_unit_test",
     "macos_ui_test",
-    "macos_bundle",
+    "macos_unit_test",
 )
 load("@build_bazel_rules_apple//apple:versioning.bzl", "apple_bundle_version")
 
@@ -109,9 +109,7 @@
     data = [
         "Resources/extensions/today/TodayViewController.xib",
     ],
-    sdk_frameworks = [
-        "NotificationCenter",
-    ],
+    sdk_frameworks = ["NotificationCenter"],
 )
 
 objc_library(
@@ -123,9 +121,7 @@
     data = [
         "Resources/plugin/PluginViewController.xib",
     ],
-    sdk_frameworks = [
-        "NotificationCenter",
-    ],
+    sdk_frameworks = ["NotificationCenter"],
 )
 
 macos_command_line_application(
diff --git a/src/TulsiGeneratorIntegrationTests/Resources/Watch.BUILD b/src/TulsiGeneratorIntegrationTests/Resources/Watch.BUILD
index 157bc4d..fc866c9 100644
--- a/src/TulsiGeneratorIntegrationTests/Resources/Watch.BUILD
+++ b/src/TulsiGeneratorIntegrationTests/Resources/Watch.BUILD
@@ -109,7 +109,5 @@
     srcs = [
         "Watch2ExtensionBinary/srcs/watch2_extension_binary.m",
     ],
-    sdk_frameworks = [
-        "WatchKit",
-    ],
+    sdk_frameworks = ["WatchKit"],
 )
diff --git a/src/TulsiGeneratorTests/BUILD b/src/TulsiGeneratorTests/BUILD
index e834c46..96d24e2 100644
--- a/src/TulsiGeneratorTests/BUILD
+++ b/src/TulsiGeneratorTests/BUILD
@@ -1,6 +1,8 @@
 load("@build_bazel_rules_apple//apple:macos.bzl", "macos_unit_test")
 load("@build_bazel_rules_swift//swift:swift_library.bzl", "swift_library")
 
+package(default_applicable_licenses = ["//:license"])
+
 licenses(["notice"])
 
 swift_library(
diff --git a/src/tools/BUILD b/src/tools/BUILD
index fb60196..8723f31 100644
--- a/src/tools/BUILD
+++ b/src/tools/BUILD
@@ -1,4 +1,7 @@
-package(default_visibility = ["//:__subpackages__"])
+package(
+    default_applicable_licenses = ["//:license"],
+    default_visibility = ["//:__subpackages__"],
+)
 
 licenses(["notice"])
 
diff --git a/src/tools/bazel_cache_reader/BUILD b/src/tools/bazel_cache_reader/BUILD
index 0c627a9..d428796 100644
--- a/src/tools/bazel_cache_reader/BUILD
+++ b/src/tools/bazel_cache_reader/BUILD
@@ -1,6 +1,9 @@
 licenses(["notice"])
 
-package(default_visibility = ["//:__subpackages__"])
+package(
+    default_applicable_licenses = ["//:license"],
+    default_visibility = ["//:__subpackages__"],
+)
 
 load("@build_bazel_rules_apple//apple:macos.bzl", "macos_command_line_application")
 
diff --git a/version.bzl b/version.bzl
index e3776a9..99c1e39 100644
--- a/version.bzl
+++ b/version.bzl
@@ -4,9 +4,9 @@
 # Version number (recorded into the Info.plist)
 TULSI_VERSION_MAJOR = "0"
 
-TULSI_VERSION_FIXLEVEL = "499574255"
+TULSI_VERSION_FIXLEVEL = "547903229"
 
-TULSI_VERSION_DATE = "20230104"
+TULSI_VERSION_DATE = "20230713"
 
 TULSI_VERSION_COPYRIGHT = "2015-2018"