forked from vczh-libraries/gGac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-tutorials.sh
executable file
·154 lines (147 loc) · 3.72 KB
/
build-tutorials.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
#!/bin/bash
git submodule update
function create-tutorial() {
CATEGORY=$1
APP=$2
cd Tests
if ! [ -d "$CATEGORY" ]; then
mkdir $CATEGORY
fi
cd $CATEGORY
if ! [ -d "$APP" ]; then
mkdir $APP
fi
cd $APP
echo "project($APP)" >> CMakeLists.txt
echo "add_executable($APP" >> CMakeLists.txt
echo " ../../../GacUI/Tutorial/$CATEGORY/$APP/UI/Source/DemoPartialClasses.cpp" >> CMakeLists.txt
echo " ../../../GacUI/Tutorial/$CATEGORY/$APP/Main.cpp" >> CMakeLists.txt
echo " ../../App.cpp)" >> CMakeLists.txt
echo "target_link_libraries ($APP \${gGac_LIBRARIES})" >> CMakeLists.txt
cd ..
cd ..
cd ..
}
function create-tutorial-category() {
CATEGORY=$1
APPS=("${@:2}")
for APP in "${APPS[@]}"; do
APP_SOURCE="./GacUI/Tutorial/$CATEGORY/$APP"
APP_DEST="./Tests/$CATEGORY/$APP"
if [ -d "$APP_SOURCE" ]; then
if ! [ -d "$APP_DEST" ]; then
create-tutorial $CATEGORY $APP
fi
echo "ADD_SUBDIRECTORY(Tests/$CATEGORY/$APP)" >> build-tutorials.index.log
else
echo "$APP_SOURCE not found" >> build-tutorials.errors.log
fi
done
}
function build-tutorial() {
CATEGORY=$1
APP=$2
cd "./$CATEGORY/$APP"
make
if ! [ -a "$APP" ]; then
echo "$CATEGORY/$APP does not compile" >> ../../../../build-tutorials.errors.log
fi
cd ../..
}
function build-tutorial-category() {
CATEGORY=$1
APPS=("${@:2}")
for APP in "${APPS[@]}"; do
APP_DEST="./$CATEGORY/$APP"
if [ -d "$APP_DEST" ]; then
build-tutorial $CATEGORY $APP
else
echo "$APP_DEST not found" >> ../../build-tutorials.errors.log
fi
done
}
GACUI_HELLOWORLDS=(GacUI_HelloWorlds
Cpp
CppXml
MVVM
)
GACUI_LAYOUT=(GacUI_Layout
Alignment
Flow
Responsive1
Responsive2
RichTextEmbedding
SharedSize
Stack
Table
TableSplitter
)
GACUI_XML=(GacUI_Xml
Binding_Bind
Binding_Eval
Binding_Format
Binding_Uri
Binding_ViewModel
Event_Cpp
Event_Script
Event_ViewModel
Instance_Control
Instance_MultipleWindows
Instance_Window
Member_Field
Member_Parameter
Member_Property
Misc_ImportFolder
)
GACUI_CONTROLS=(GacUI_Controls
AddressBook
Animation
CalculatorAndStateMachine
ColorPicker
ContainersAndButtons
DataGrid
DocumentEditorRibbon
DocumentEditorToolstrip
ListControls
Localization
MenuVisibility
ProgressAndAsync
QueryService
TextEditor
TriplePhaseImageButton
)
GACUI_CONTROLTEMPLATE=(GacUI_TEMPLATE
WindowSkin
)
if [ -a "build-tutorials.index.log" ]; then
rm build-tutorials.index.log
fi
if [ -a "build-tutorials.errors.log" ]; then
rm build-tutorials.errors.log
fi
create-tutorial-category "${GACUI_HELLOWORLDS[@]}"
create-tutorial-category "${GACUI_LAYOUT[@]}"
create-tutorial-category "${GACUI_XML[@]}"
create-tutorial-category "${GACUI_CONTROLS[@]}"
create-tutorial-category "${GACUI_CONTROLTEMPLATE[@]}"
./build-cmake.sh
cd ./out
cmake ..
cd ./Tests
build-tutorial-category "${GACUI_HELLOWORLDS[@]}"
build-tutorial-category "${GACUI_LAYOUT[@]}"
build-tutorial-category "${GACUI_XML[@]}"
build-tutorial-category "${GACUI_CONTROLS[@]}"
build-tutorial-category "${GACUI_CONTROLTEMPLATE[@]}"
cd ../..
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
if [ -a "build-tutorials.index.log" ]; then
cat build-tutorials.index.log
rm build-tutorials.index.log
fi
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
if [ -a "build-tutorials.errors.log" ]; then
cat build-tutorials.errors.log
rm build-tutorials.errors.log
fi
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"