forked from sschmid/Entitas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entitas.sh
260 lines (230 loc) · 8.74 KB
/
entitas.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
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
#!/usr/bin/env bash
BUILD="Build"
BUILD_SRC="${BUILD}/src"
BUILD_FILES="${BUILD_SRC}/files"
BUILD_DIST="${BUILD}/dist"
DEPS_DIR="Libraries/Dependencies/DesperateDevs"
DEPS=(
"../DesperateDevs/DesperateDevs.CodeGeneration.CodeGenerator.Unity.Editor/bin/Release/"
"../DesperateDevs/DesperateDevs.CodeGeneration.Plugins/bin/Release/"
"../DesperateDevs/DesperateDevs.CodeGeneration.Unity.Plugins/bin/Release/"
"../DesperateDevs/DesperateDevs.Unity.Editor/bin/Release/"
"../DesperateDevs/DesperateDevs.CodeGeneration.CodeGenerator.Unity.Editor/Compile.cs"
"../DesperateDevs/DesperateDevs.CodeGeneration.CodeGenerator.Unity.Editor/DesperateDevs.CodeGeneration.CodeGenerator.Unity.Editor/Images/"
)
ENTITAS_PROJECTS=(
'Entitas'
'Addons/Entitas.CodeGeneration.Attributes'
'Addons/Entitas.CodeGeneration.Plugins'
'Addons/Entitas.Migration'
'Addons/Entitas.Migration.Unity.Editor'
'Addons/Entitas.Unity'
'Addons/Entitas.Unity.Editor'
'Addons/Entitas.VisualDebugging.Unity'
'Addons/Entitas.VisualDebugging.Unity.Editor'
'Addons/Entitas.VisualDebugging.CodeGeneration.Plugins'
)
ENTITAS_EDITOR=(
'Entitas.Migration.dll'
'Entitas.Migration.Unity.Editor.dll'
'Entitas.Unity.Editor.dll'
'Entitas.VisualDebugging.Unity.Editor.dll'
)
ENTITAS_PLUGINS=(
'Entitas.CodeGeneration.Plugins.dll'
'Entitas.VisualDebugging.CodeGeneration.Plugins.dll'
)
BLUEPRINTS_PROJECTS=(
'Addons/Entitas.Blueprints'
'Addons/Entitas.Blueprints.CodeGeneration.Plugins'
'Addons/Entitas.Blueprints.CodeGeneration.Unity.Plugins'
'Addons/Entitas.Blueprints.Unity'
'Addons/Entitas.Blueprints.Unity.Editor'
)
BLUEPRINTS_EDITOR=(
'Entitas.Blueprints.Unity.Editor.dll'
)
BLUEPRINTS_PLUGINS=(
'Entitas.Blueprints.CodeGeneration.Plugins.dll'
'Entitas.Blueprints.CodeGeneration.Unity.Plugins.dll'
)
IMAGES=(
"Addons/Entitas.Unity.Editor/Entitas.Unity.Editor/Images/"
"Addons/Entitas.VisualDebugging.Unity.Editor/Entitas.VisualDebugging.Unity.Editor/Images/"
)
FILES=(
'EntitasUpgradeGuide.md'
'LICENSE.txt'
'README.md'
'CHANGELOG.md'
)
DESPERATEDEVS=(
'Compile.cs'
'DesperateDevs.Logging.dll'
'DesperateDevs.Networking.dll'
'DesperateDevs.Serialization.dll'
'DesperateDevs.Utils.dll'
)
DESPERATEDEVS_EDITOR=(
'DesperateDevs.Analytics.dll'
'DesperateDevs.CodeGeneration.CodeGenerator.dll'
'DesperateDevs.CodeGeneration.CodeGenerator.Unity.Editor.dll'
'DesperateDevs.CodeGeneration.dll'
'DesperateDevs.Unity.Editor.dll'
)
DESPERATEDEVS_IMAGES=(
'Jenny-Header.png'
'Jenny-Header.png.meta'
)
DESPERATEDEVS_PLUGINS=(
'DesperateDevs.CodeGeneration.Plugins.dll'
'DesperateDevs.CodeGeneration.Unity.Plugins.dll'
)
entitas::update() {
log_func
utils::clean_dir "${DEPS_DIR}"
for d in "${DEPS[@]}"; do
utils::sync "${d}" "${DEPS_DIR}"
done
}
entitas::generate() {
msbuild::build
local properties=(
'Tests/TestFixtures/Preferences.properties'
'Readme/Prefrences.properties'
)
for p in "${properties[@]}"; do
local dir="$(dirname ${p})"
pushd "${dir}" > /dev/null
log_strong "Generating ${p}"
jenny gen "$(basename ${p})"
popd > /dev/null
done
}
entitas::collect_entitas_unity() {
log_func
local entitas_dir="${BUILD_SRC}/Unity/Entitas/Assets/Entitas"
local entitas_editor_dir="${entitas_dir}/Editor"
local entitas_plugins_dir="${entitas_editor_dir}/Plugins"
local images_dir="${entitas_editor_dir}/Images"
local desperatedevs_dir="${BUILD_SRC}/Unity/Entitas/Assets/DesperateDevs"
local desperatedevs_editor_dir="${desperatedevs_dir}/Editor"
local desperatedevs_images_dir="${desperatedevs_editor_dir}/Images"
local desperatedevs_plugins_dir="${desperatedevs_editor_dir}/Plugins"
utils::clean_dir "${entitas_dir}" "${entitas_editor_dir}" "${entitas_plugins_dir}" "${images_dir}" \
"${desperatedevs_dir}" "${desperatedevs_editor_dir}" "${desperatedevs_images_dir}" "${desperatedevs_plugins_dir}"
for p in "${ENTITAS_PROJECTS[@]}"; do utils::sync "${p}/bin/Release/" "${entitas_dir}"; done
utils::sync "${DEPS_DIR}/" "${entitas_dir}"
for f in "${ENTITAS_EDITOR[@]}"; do mv "${entitas_dir}/${f}" "${entitas_editor_dir}"; done
for f in "${ENTITAS_PLUGINS[@]}"; do mv "${entitas_dir}/${f}" "${entitas_plugins_dir}"; done
for f in "${IMAGES[@]}"; do utils::sync "${f}" "${images_dir}"; done
for f in "${DESPERATEDEVS[@]}"; do mv "${entitas_dir}/${f}" "${desperatedevs_dir}"; done
for f in "${DESPERATEDEVS_EDITOR[@]}"; do mv "${entitas_dir}/${f}" "${desperatedevs_editor_dir}"; done
for f in "${DESPERATEDEVS_IMAGES[@]}"; do mv "${entitas_dir}/${f}" "${desperatedevs_images_dir}"; done
for f in "${DESPERATEDEVS_PLUGINS[@]}"; do mv "${entitas_dir}/${f}" "${desperatedevs_plugins_dir}"; done
}
entitas::collect_entitas_with_blueprints_unity() {
log_func
local entitas_dir="${BUILD_SRC}/Unity/Entitas/Assets/Entitas-Blueprints"
local entitas_editor_dir="${entitas_dir}/Editor"
local entitas_plugins_dir="${entitas_editor_dir}/Plugins"
local images_dir="${entitas_editor_dir}/Images"
local desperatedevs_dir="${BUILD_SRC}/Unity/Entitas/Assets/DesperateDevs"
local desperatedevs_editor_dir="${desperatedevs_dir}/Editor"
local desperatedevs_images_dir="${desperatedevs_editor_dir}/Images"
local desperatedevs_plugins_dir="${desperatedevs_editor_dir}/Plugins"
utils::clean_dir "${entitas_dir}" "${entitas_editor_dir}" "${entitas_plugins_dir}" "${images_dir}" \
"${desperatedevs_dir}" "${desperatedevs_editor_dir}" "${desperatedevs_images_dir}" "${desperatedevs_plugins_dir}"
for p in "${ENTITAS_PROJECTS[@]}"; do utils::sync "${p}/bin/Release/" "${entitas_dir}"; done
for p in "${BLUEPRINTS_PROJECTS[@]}"; do utils::sync "${p}/bin/Release/" "${entitas_dir}"; done
utils::sync "${DEPS_DIR}/" "${entitas_dir}"
for f in "${ENTITAS_EDITOR[@]}"; do mv "${entitas_dir}/${f}" "${entitas_editor_dir}"; done
for f in "${BLUEPRINTS_EDITOR[@]}"; do mv "${entitas_dir}/${f}" "${entitas_editor_dir}"; done
for f in "${ENTITAS_PLUGINS[@]}"; do mv "${entitas_dir}/${f}" "${entitas_plugins_dir}"; done
for f in "${BLUEPRINTS_PLUGINS[@]}"; do mv "${entitas_dir}/${f}" "${entitas_plugins_dir}"; done
for d in "${IMAGES[@]}"; do utils::sync "${d}" "${images_dir}"; done
for f in "${DESPERATEDEVS[@]}"; do mv "${entitas_dir}/${f}" "${desperatedevs_dir}"; done
for f in "${DESPERATEDEVS_EDITOR[@]}"; do mv "${entitas_dir}/${f}" "${desperatedevs_editor_dir}"; done
for f in "${DESPERATEDEVS_IMAGES[@]}"; do mv "${entitas_dir}/${f}" "${desperatedevs_images_dir}"; done
for f in "${DESPERATEDEVS_PLUGINS[@]}"; do mv "${entitas_dir}/${f}" "${desperatedevs_plugins_dir}"; done
}
entitas::collect_files() {
log_func
utils::clean_dir "${BUILD_FILES}"
for f in "${FILES[@]}"; do
utils::sync "${f}" "${BUILD_FILES}/${f}"
done
}
entitas::sync_unity_visualdebugging() {
log_func
entitas::collect_entitas_unity
local unity_libs="Tests/Unity/VisualDebugging/Assets/Libraries"
utils::clean_dir "${unity_libs}"
utils::sync "${BUILD_SRC}/Unity/Entitas/Assets/Entitas" "${unity_libs}"
utils::sync "${BUILD_SRC}/Unity/Entitas/Assets/DesperateDevs" "${unity_libs}"
}
entitas::sync_unity_blueprints() {
log_func
entitas::collect_entitas_with_blueprints_unity
local unity_libs="Tests/Unity/Blueprints/Assets/Libraries"
utils::clean_dir "${unity_libs}"
utils::sync "${BUILD_SRC}/Unity/Entitas/Assets/Entitas-Blueprints" "${unity_libs}"
utils::sync "${BUILD_SRC}/Unity/Entitas/Assets/DesperateDevs" "${unity_libs}"
}
entitas::sync() {
entitas::sync_unity_visualdebugging
entitas::sync_unity_blueprints
}
entitas::pack_entitas_unity() {
log_func
entitas::collect_entitas_unity
entitas::collect_files
local tmp_dir="${BUILD}/tmp"
utils::clean_dir "${tmp_dir}"
utils::sync "${BUILD_SRC}/Unity/Entitas/Assets" "${tmp_dir}"
utils::sync "${BUILD_FILES}/" "${tmp_dir}/Assets/Entitas"
pushd "${BUILD_DIST}" > /dev/null
local abs_build_dist="$(pwd)"
popd > /dev/null
pushd "${tmp_dir}" > /dev/null
zip -rq "${abs_build_dist}/${PROJECT}.zip" ./
popd > /dev/null
rm -rf "${tmp_dir}"
}
entitas::pack() {
log_func
entitas::update
msbuild::rebuild
nspec::run
utils::clean_dir "${BUILD_SRC}" "${BUILD_DIST}"
doxygen::generate
# create docset tgz
# pushd "${DOCS_BUILD}/docset" > /dev/null
# tar --exclude='.DS_Store' -czf "${BUILD_DIST}/${PROJECT_NAME}.docset.tgz" "${PROJECT}.docset"
# popd > /dev/null
entitas::pack_entitas_unity
tree::create
}
entitas::dist() {
log_func
changelog::merge
entitas::pack
git::commit_release_sync_master
git::push_all
log "bzzz... giving GitHub some time to process..."
sleep 10
github::create_release
open "https://github.com/${GITHUB_REPO}/releases"
}
entitas::dist_major() {
version::bump_major
entitas::dist
}
entitas::dist_minor() {
version::bump_minor
entitas::dist
}
entitas::dist_patch() {
version::bump_patch
entitas::dist
}