generated from phoughton/python_package_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_classes_from_xsds.bsh
executable file
·44 lines (32 loc) · 1.09 KB
/
build_classes_from_xsds.bsh
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
#!/usr/bin/bash
generate_xsdata() {
package=$1
directory=$2
list_of_xsd=$(find $directory -name "*.xsd")
for xsd in $list_of_xsd
do
filename=$(basename "$xsd" .xsd)
filename=$(echo $filename | tr '.' '_')
xsdata $xsd --package pyiso20022.$package.$filename &
echo "- $package.$filename" >> supported_msg_types.md
done
}
REMOVE_DIRS=("pacs" "head" "pain" "camt" "admi")
for a_dir in "${REMOVE_DIRS[@]}"
do
rm -rf "pyiso20022/${a_dir}"
done
echo "# Supported message types" > supported_msg_types.md
generate_xsdata "pacs" "xsd/payments_clearing_and_settlement"
generate_xsdata "head" "xsd/business_application_header"
generate_xsdata "pain" "xsd/payments_initiation"
generate_xsdata "camt" "xsd/cash_management"
generate_xsdata "admi" "xsd/administration"
generate_xsdata "remt" "xsd/remittance"
wait
cat supported_msg_types.md | sort -n | uniq > supported_msg_types_final.md
rm supported_msg_types.md
# Help pdoc with the docs
# echo '"""' > pyiso20022/__init__.py
# cat README.md >> pyiso20022/__init__.py
# echo '"""' >> pyiso20022/__init__.py