forked from BrainiumLLC/rust-xcode-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·34 lines (23 loc) · 1006 Bytes
/
setup.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 -x
# 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 Plug-ins/Rust.ideplugin $plugins_dir
#Get the selected Xcode.app's path
xcode_path=$(xcode-select -p)
xcode_path=$(dirname $xcode_path)
# Get Specifications directory
spec_dir="${xcode_path}/SharedFrameworks/SourceModel.framework/Versions/A/Resources/LanguageSpecifications"
# Copy the language specification to the specs directory
cp Specifications/Rust.xclangspec $spec_dir
#cp Specifications/Rust.xcspec $spec_dir
# Get language metadata directory
metadata_dir="${xcode_path}/SharedFrameworks/SourceModel.framework/Versions/A/Resources/LanguageMetadata"
# Copy the source code language plist to the metadata directory
cp Xcode.SourceCodeLanguage.Rust.plist $metadata_dir
defaults read ${xcode_path}/Info DVTPlugInCompatibilityUUID
echo "Please restart Xcode"