Path(), ImmutableMap.of(), compilerCommand.build());
  }

  @Override
  public boolean isCacheable() {
    // .swiftmodule artifacts are not cacheable because they can contain machine-specific
    // headers. More specifically, all files included in a bridging header will be
    // literally included in the .swiftmodule file. When the Swift compiler encounters
    // `import Module`, it will include the headers from the .swiftmodule and those
    // headers are referenced via an absolute path stored in the .swiftmodule. This
    // means that Obj-C headers can be included multiple times if the machines which
    // populated the cache and the machine which is building have placed the source
    // repository at different paths (usually the case with CI and developer machines).
    return !bridgingHeader.isPresent() || compileForceCache;
  }

  @Override
  public SortedSet<BuildRule> getBuildDeps() {
    return depsSupplier.get();
  }

  @Override
  public void updateBuildRuleResolver(BuildRuleResolver ruleResolver) {
    this.depsSupplier = BuildableSupport.buildDepsSupplier(this, ruleResolver);
  }

  @Override
  public ImmutableList<Step> getBuildSteps(
      BuildContext context, BuildableContext buildableContext) {
    buildableContext.recordArtifact(outputPath);

    Builder<Step> steps = ImmutableList.builder();
    steps.add(
        MkdirStep.of(
            BuildCellRelativePath.fromCellRelativePath(
                context.getBuildCellRootPath(), getProjectFilesystem(), outputPath)));
    swiftFileListPath.map(
        path -> steps.add(makeFileListStep(context.getSourcePathResolver(), path)));
    steps.add(makeCompileStep(context.getSourcePathResolver()));

    if (useModulewrap) {
      steps.add(makeModulewrapStep(context.getSourcePathResolver()));
    }

    return steps.build();
  }

  private Step makeFileListStep(SourcePathResolverAdapter resolver, AbsPath swiftFileListPath) {
    ImmutableList<String> relativePaths =
        srcs.stream()
            .map(sourcePath -> resolver.getRelativePath(