-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathsetup-xcode11.sh
executable file
·34 lines (25 loc) · 1.12 KB
/
setup-xcode11.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
set -o xtrace
xcode_contents_dir=$(dirname "$(xcode-select -p)")
# Create plug-ins directory if it doesn't exist
plugins_dir=~/Library/Developer/Xcode/Plug-ins/
if [ ! -d "$plugins_dir" ]; then
mkdir $plugins_dir
fi
# Copy the IDE Plugin to the plug-ins directory
cp -r GraphQL.ideplugin $plugins_dir
# Create Specifications directory if it doesn't exist
spec_dir="${xcode_contents_dir}/SharedFrameworks/SourceModel.framework/Versions/A/Resources/LanguageSpecifications"
if [ ! -d "$spec_dir" ]; then
mkdir $spec_dir
fi
# Copy the language specification to the specs directory
cp GraphQL.xclangspec $spec_dir
# Create the language metadata directory if it doesn't exist
metadata_dir="${xcode_contents_dir}/SharedFrameworks/SourceModel.framework/Versions/A/Resources/LanguageMetadata"
if [ ! -d "$metadata_dir" ]; then
mkdir $metadata_dir
fi
# Copy the source code language plist to the metadata directory
cp Xcode.SourceCodeLanguage.GraphQL.plist $metadata_dir
echo '🎉 Apollo Xcode Add-ons installation has completed! Please restart Xcode and click "Load bundle" when an alert shows about GraphQL.ideplugin.'