<commit_before>#!/bin/bash

set -euo pipefail

# Modify the WORKSPACE to pull in the master branches of some deps.
/usr/bin/sed \
  -i "" \
  -e \
    's/apple_rules_dependencies()/apple_rules_dependencies(ignore_version_differences = True)/' \
  -e \
    '1i \
\
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")\
\
git_repository(\
\    name = "bazel_skylib",\
\    remote = "https://github.com/bazelbuild/bazel-skylib.git",\
\    branch = "master",\
)\
\
git_repository(\
\    name = "build_bazel_apple_support",\
\    remote = "https://github.com/bazelbuild/apple_support.git",\
\    branch = "master",\
)\
\
git_repository(\
\    name = "build_bazel_rules_swift",\
\    remote = "https://github.com/bazelbuild/rules_swift.git",\
\    branch = "master",\
)\
\
git_repository(\
\    name = "build_bazel_rules_apple",\
\    remote = "https://github.com/bazelbuild/rules_apple.git",\
\    branch = "master",\
)\
' \
  WORKSPACE<commit_msg>Workaround to make integration tests run with rules_swift at HEAD<commit_after>#!/bin/bash

set -euo pipefail

# Modify the WORKSPACE to pull in the master branches of some deps.
/usr/bin/sed \
  -i "" \
  -e \
    's/apple_rules_dependencies()/apple_rules_dependencies(ignore_version_differences = True)/' \
  -e \
    '1i \
\
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")\
\
git_repository(\
\    name = "bazel_skylib",\
\    remote = "https://github.com/bazelbuild/bazel-skylib.git",\
\    branch = "master",\
)\
\
git_repository(\
\    name = "build_bazel_apple_support",\
\    remote = "https://github.com/bazelbuild/apple_support.git",\
\    branch = "master",\
)\
\
git_repository(\
\    name = "build_bazel_rules_swift",\
\    remote = "https://github.com/bazelbuild/rules_swift.git",\
\    branch = "master",\
)\
\
git_repository(\
\    name = "build_bazel_rules_apple",\
\    remote = "https://github.com/bazelbuild/rules_apple.git",\
\    branch = "master",\
)\
' \
  WORKSPACE

# rules_swift at HEAD changed the path of module map.
# TODO: Remove once rules_swift has a new release.
file=src/TulsiGeneratorIntegrationTests/Resources/GoldenProjects/SwiftProject.xcodeproj/project.pbxproj
/usr/bin/sed -i "" -e \
  's/[.]modulemaps\/module[.]modulemap/.swift.modulemap/' $file
# sed appends a newline at EOF; remove it.
/bin/dd if=/dev/null of=$file obs="$(($(wc -c < $file)-1))" seek=1
{'fraction_non_alphanumeric': 0.1726890756302521, 'fraction_numerical': 0.0016806722689075631, 'mean_word_length': 3.206713780918728, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4614779', 'n_tokens_mistral': 938, 'n_tokens_neox': 888, 'n_words': 154}