-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathconfigure_template_files.sh
More file actions
executable file
·78 lines (69 loc) · 2.54 KB
/
configure_template_files.sh
File metadata and controls
executable file
·78 lines (69 loc) · 2.54 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
71
72
73
74
75
76
77
78
#!/usr/bin/env bash
set -x -e
export TEMPLATES_DIR="${APP_PROJECT_ROOT_DIR}/scripts/app_config/templates"
export T_PUBSPEC="${TEMPLATES_DIR}/pubspec.template.yaml"
export ACTUAL_PUBSPEC="${APP_PROJECT_ROOT_DIR}/pubspec.yaml"
export ANDROID_TF_0="android/app/build.gradle"
export ANDROID_TF_1="android/app/src/debug/AndroidManifest.xml"
export ANDROID_TF_2="android/app/src/profile/AndroidManifest.xml"
export ANDROID_TF_3="android/app/src/main/AndroidManifest.xml"
export ANDROID_TF_4="android/app/src/main/profile/AndroidManifest.xml"
export ANDROID_TF_5="android/app/src/main/kotlin/com/cypherstack/stackwallet/MainActivity.kt"
export IOS_TF_0="ios/Runner/Info.plist"
export IOS_TF_1="ios/Runner.xcodeproj/project.pbxproj"
export LINUX_TF_0="linux/CMakeLists.txt"
export LINUX_TF_1="linux/my_application.cc"
export MAC_TF_0="macos/Runner.xcodeproj/project.pbxproj"
export MAC_TF_1="macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme"
export MAC_TF_2="macos/Runner/Configs/AppInfo.xcconfig"
export WIN_TF_0="windows/runner/Runner.rc"
export WIN_TF_1="windows/runner/main.cpp"
export WIN_TF_2="windows/CMakeLists.txt"
mkdir -p "${APP_PROJECT_ROOT_DIR}/android/app/src/debug"
mkdir -p "${APP_PROJECT_ROOT_DIR}/android/app/src/profile"
mkdir -p "${APP_PROJECT_ROOT_DIR}/android/app/src/main/profile"
mkdir -p "${APP_PROJECT_ROOT_DIR}/android/app/src/main/kotlin/com/cypherstack/stackwallet"
mkdir -p "${APP_PROJECT_ROOT_DIR}/ios/Runner"
mkdir -p "${APP_PROJECT_ROOT_DIR}/ios/Runner.xcodeproj"
mkdir -p "${APP_PROJECT_ROOT_DIR}/macos/Runner.xcodeproj"
mkdir -p "${APP_PROJECT_ROOT_DIR}/macos/Runner.xcodeproj/xcshareddata/xcschemes"
mkdir -p "${APP_PROJECT_ROOT_DIR}/macos/Runner/Configs"
mkdir -p "${APP_PROJECT_ROOT_DIR}/windows/runner"
TEMPLATE_FILES=(
"${ANDROID_TF_0}"
"${ANDROID_TF_1}"
"${ANDROID_TF_2}"
"${ANDROID_TF_3}"
"${ANDROID_TF_4}"
"${ANDROID_TF_5}"
"${IOS_TF_0}"
"${IOS_TF_1}"
"${LINUX_TF_0}"
"${LINUX_TF_1}"
"${MAC_TF_0}"
"${MAC_TF_1}"
"${MAC_TF_2}"
"${WIN_TF_0}"
"${WIN_TF_1}"
"${WIN_TF_2}"
)
if [ -f "${ACTUAL_PUBSPEC}" ]; then
rm "${ACTUAL_PUBSPEC}"
fi
if [ "$BUILD_ISAR_FROM_SOURCE" -eq 1 ]; then
sed '/^# %%ENABLE_ISAR%%$/,/^# %%END_ENABLE_ISAR%%$/{
/^# %%ENABLE_ISAR%%$/d
/^# %%END_ENABLE_ISAR%%$/d
s/^# / /g
s/^# / /g
}' "${T_PUBSPEC}" > "${ACTUAL_PUBSPEC}"
else
cp "${T_PUBSPEC}" "${ACTUAL_PUBSPEC}"
fi
for TF in "${TEMPLATE_FILES[@]}"; do
FILE="${APP_PROJECT_ROOT_DIR}/${TF}"
if [ -f "${FILE}" ]; then
rm "${FILE}"
fi
cp -rp "${TEMPLATES_DIR}/${TF}" "${FILE}"
done