1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-29 03:19:44 +00:00
OpenMW/scripts/generate_teal_declarations.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
863 B
Bash
Raw Normal View History

if [ -z "$1" ]; then
echo "Takes a path to the output directory as the argument"
exit
fi
2023-01-27 18:53:10 +00:00
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
OPENMW_DIR=$(realpath $SCRIPTS_DIR/..)
DOCS_DIR=$(realpath $OPENMW_DIR/docs)
FILES_DIR=$(realpath $OPENMW_DIR/files)
OUTPUT_DIR=$(realpath "$1")
PATH=$PATH:~/lua-5.1.5/src
eval "$(luarocks path)"
2023-01-26 22:31:27 +00:00
rm -rf $OUTPUT_DIR
mkdir $OUTPUT_DIR
cp "$DOCS_DIR/tlconfig.lua" "$OUTPUT_DIR/tlconfig.lua"
build_path() {
for file in $1
do
mkdir -p $OUTPUT_DIR/$(dirname $file)
openmwluadocumentor -f teal -d "$OUTPUT_DIR" $file
2023-01-26 22:31:27 +00:00
done
}
cd $FILES_DIR
2023-01-27 18:53:10 +00:00
build_path "lua_api/openmw/*lua"
2023-01-26 22:31:27 +00:00
data_paths=$($DOCS_DIR/source/luadoc_data_paths.sh)
for path in $data_paths
do
2023-01-27 18:53:10 +00:00
build_path "data/$path"
2023-01-26 22:31:27 +00:00
done
cd $OUTPUT_DIR
mv lua_api/openmw ./
rm -r lua_api
mv data/* ./
rm -r data
cyan check **/*.d.tl