2011-12-10 16:45:10 -05:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Because this project consists of a bunch of CommonJS modules, the constructors
|
|
|
|
# have restricted scope. This means that they cannot be used as types in other
|
|
|
|
# modules. Therefore, to permit this, we must generate an extern file containing
|
|
|
|
# basic definitions of each.
|
|
|
|
# #
|
|
|
|
|
|
|
|
# all CamelCase modules are likely to be ctors
|
|
|
|
modules=$( ls lib/ \
|
|
|
|
| sed 's/lib\/\|\.js//' \
|
|
|
|
| grep -vP '^[a-z]'
|
|
|
|
)
|
|
|
|
|
|
|
|
# simple definition for now (we'll worry about members later)
|
|
|
|
for module in $modules; do
|
|
|
|
echo "/** @constructor */"
|
|
|
|
echo "function $module() {};"
|
|
|
|
echo
|
|
|
|
done
|
2011-12-13 21:19:14 -05:00
|
|
|
|
|
|
|
# finally, there's some additional useful metadata that we use to make our lives
|
|
|
|
# easier, better documented and more consistent
|
|
|
|
cat <<ETC
|
|
|
|
|
|
|
|
/** @typedef {{abstractMethods: Object}} */
|
|
|
|
var __class_meta;
|
|
|
|
|
|
|
|
/** @typedef {{public: Object, protected: Object, private: Object}} */
|
|
|
|
var __visobj;
|
|
|
|
ETC
|