Created
November 18, 2022 02:20
-
-
Save ManWithBear/1e3ece277725567e1d3fbd382d1409a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# For each framework in current folder list all imported frameworks. | |
# `find_imports_directories_to_skip.txt` contains list of directories to ignore (e.g. xcodeproj) | |
# `find_imports_imports_to_skip.txt` contains list of imported frameworks that should be removed from output (e.g. UIKit) | |
DIRECTORIES_TO_SKIP=$(cat find_imports_directories_to_skip.txt) | |
for FORFramework in $(ls -d -- */) # itterate over all directories in current folder | |
do | |
if [[ $DIRECTORIES_TO_SKIP =~ "${FORFramework}" ]]; then | |
continue | |
fi | |
echo "$FORFramework:" | |
grep -rh "^import " "$FORFramework" `# find all lines strating with "import " in directory $FORFramework` \ | |
| sort \ | |
| uniq `# remove all duplicates` \ | |
| sed "s/^import //" `# remove "import " prefix` \ | |
| grep -vf find_imports_imports_to_skip.txt `# remove frameworks that are ignored` \ | |
| sed "s/^/ ./" `# add indentation and "." to framework name` \ | |
| sed "s/$/,/" # add "," in the end | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Derived/ | |
FORFrameworks.xcodeproj/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AVKit | |
AudioToolbox | |
Foundation | |
MapKit | |
ObjectiveC | |
QuartzCore | |
SafariServices | |
SystemConfiguration | |
UIKit | |
WebKit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment