This repository was archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathupdate-simc.sh
More file actions
executable file
·70 lines (54 loc) · 2.25 KB
/
update-simc.sh
File metadata and controls
executable file
·70 lines (54 loc) · 2.25 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
set -eEuo pipefail
target_branch="dragonflight"
this_script=$(realpath "${BASH_SOURCE[0]}")
script_dir=$(realpath "$(dirname "$this_script")")
function rcmd() {
echo -e "\e[38;5;208mExecuting: \e[38;5;226m$@\e[0m" >&2
"$@"
}
function f_info() {
echo -e "\e[38;5;196m$@\e[0m" >&2
}
simc_dir="$script_dir/simc"
build_dir="$script_dir/simc-build"
output_dir="$script_dir/Support/Generated"
if [[ ! -e "$simc_dir" ]]; then
rcmd git clone -b $target_branch git@github.com:tzarc/simulationcraft-simc.git "$simc_dir"
fi
cd "$simc_dir"
if [[ -z "$(git remote -v | grep upstream)" ]]; then
rcmd git remote add upstream https://github.com/simulationcraft/simc.git
fi
f_info "Updating"
rcmd git fetch --all
rcmd git fetch --tags
rcmd git fetch --prune
f_info "Merging"
rcmd git merge upstream/$target_branch
if [[ ! -d "$build_dir" ]]; then
mkdir -p "$build_dir"
fi
if [[ ! -d "$output_dir" ]]; then
mkdir -p "$output_dir"
fi
cd "$build_dir"
if [[ ! -f "$build_dir/CMakeCache.txt" ]] || [[ "${1:-}" == "-f" ]]; then
f_info "Configuring"
rcmd cmake -G Ninja "$simc_dir" -DBUILD_GUI=OFF
fi
f_info "Building"
rcmd cmake --build "$build_dir" --config RelWithDebInfo --target all
f_info "Exporting all spells"
rcmd ./simc ptr=0 spell_query="spell" spell_query_xml_output_file=${output_dir}/spells_live.xml
rcmd ./simc ptr=1 spell_query="spell" spell_query_xml_output_file=${output_dir}/spells_ptr.xml
rcmd ./simc ptr=0 spell_query="spell" >${output_dir}/spells_live.txt
rcmd ./simc ptr=1 spell_query="spell" >${output_dir}/spells_ptr.txt
CLASSES=(warrior hunter monk paladin rogue shaman mage warlock druid deathknight priest demonhunter evoker)
for class_name in "${CLASSES[@]}"; do
f_info "Exporting $class_name"
rcmd ./simc ptr=0 spell_query="class_spell.class=$class_name" spell_query_xml_output_file=${output_dir}/class_spells_${class_name}_live.xml
rcmd ./simc ptr=1 spell_query="class_spell.class=$class_name" spell_query_xml_output_file=${output_dir}/class_spells_${class_name}_ptr.xml
rcmd ./simc ptr=0 spell_query="class_spell.class=$class_name" >${output_dir}/class_spells_${class_name}_live.txt
rcmd ./simc ptr=1 spell_query="class_spell.class=$class_name" >${output_dir}/class_spells_${class_name}_ptr.txt
done