Skip to content

Commit

Permalink
Applied restyler fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anush-apple committed Jan 26, 2024
1 parent 1770f1f commit 4c25a10
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/helpers/generate_darwin_compdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ CHIP_ROOT="$(dirname "$0")/../.."
OUTPUT_DIR=$2

# Build the framework
scripts/examples/gn_build_example.sh $@ generate_compilation_database=true
scripts/examples/gn_build_example.sh "$@" generate_compilation_database=true

# Cleanup any stale DB files
find $OUTPUT_DIR -iname compile_commands\*.json | xargs rm
find "$OUTPUT_DIR" -iname compile_commands\*.json | xargs rm

# Construct json from fragments generated by xcodebuild
COMPDB_FRAGMENTS_DIR=$(find $OUTPUT_DIR -type d -name compdb)
sed -e '1s/^/[\'$'\n''/' -e '$s/,$/\'$'\n'']/' "${COMPDB_FRAGMENTS_DIR}"/*.json > $OUTPUT_DIR/compile_commands_darwin_framework.json
COMPDB_FRAGMENTS_DIR=$(find "$OUTPUT_DIR" -type d -name compdb)
sed -e '1s/^/[\'$'\n''/' -e '$s/,$/\'$'\n'']/' "$COMPDB_FRAGMENTS_DIR"/*.json >"$OUTPUT_DIR"/compile_commands_darwin_framework.json

# Get ninja to build comdb for the rest
ninja -C "$OUTPUT_DIR" -t compdb > "$OUTPUT_DIR"/compile_commands_rest.json
ninja -C "$OUTPUT_DIR" -t compdb >"$OUTPUT_DIR"/compile_commands_rest.json

# Combine the generated compdb into one
find $OUTPUT_DIR -iname compile_commands\*.json | xargs jq -s 'map(.[])' > "${OUTPUT_DIR}"/compile_commands.json
find "$OUTPUT_DIR" -iname compile_commands\*.json | xargs jq -s 'map(.[])' >"$OUTPUT_DIR"/compile_commands.json

0 comments on commit 4c25a10

Please sign in to comment.