     // requirements. This is necessary for watchOS2 targets (Xcode will spawn an error when
     // attempting to run the app without the scheme linkage, even though Bazel will create the
     // embedded host correctly) and does not harm other extensions.
-    var extensionHosts = [BuildLabel: RuleEntry]()
+    var extensionHosts = [BuildLabel: Set<RuleEntry>]()
     for entry in info.buildRuleEntries {
       for extensionLabel in entry.extensions {
-        extensionHosts[extensionLabel] = entry
+        if var entrySet = extensionHosts[extensionLabel] {
+          entrySet.insert(entry)
+          extensionHosts[extensionLabel] = entrySet
+        } else {
+          extensionHosts[extensionLabel] = Set([entry])
+        }
       }
     }
 

        schemeEnvVars["TEST_SRCDIR"] = "\(bazelBinPath)/$(TULSI_BUILD_PATH)/$(TARGET_NAME).runfiles"
      }

      let scheme = XcodeScheme(target: target,
                               project: info.project,
                               projectBundleName: projectBundleName,
                               testActionBuildConfig: runTestTargetBuildConfigPrefix + "Debug",
                               profileActionBuildConfig: runTestTargetBuildConfigPrefix + "Release",
                               appExtension: appExtension,
                               extensionType: extensionType,
                               launchStyle: launchStyle,
                               runnableDebuggingMode: runnableDebuggingMode,
                               additionalBuildTargets: additionalBuildTargets,
                               commandlineArguments: commandlineArguments(for: entry),
                               environmentVariables: schemeEnvVars,
                               preActionScripts:preActionScripts(for: entry),
                               postActionScripts:postActionScripts(for: entry),
                               localizedMessageLogger: localizedMessageLogger)
      let xmlDocument = scheme.toXML()


      let data = xmlDocument.xmlData(options: XMLNode.Options.nodePrettyPrint)
      try writeDataHandler(url, data)
      updateManagementDictionary(&schemeManagementDict, schemeName: filename)
    }

    func extractTestTargets(_ testSuite: RuleEntry) -> (Set<PBXTarget>, PBXTarget?) {

        continue
      }

      let targetType = entry.pbxTargetType ?? .Application

      var appExtension: Bool = false
