2024-02-23 06:31:03 +00:00
|
|
|
# Takes two parameters, the destination directory and what to include
|
|
|
|
# in the plugin:
|
|
|
|
# full - everything
|
|
|
|
# wrl - just the wrl viewer
|
|
|
|
modules="$2"
|
2023-10-05 06:19:11 +00:00
|
|
|
mkdir -p $1/deps/x_ite/assets/images
|
|
|
|
mkdir -p $1/deps/x_ite/assets/components
|
2024-02-21 15:46:43 +00:00
|
|
|
versionLine=$(grep version package.json5)
|
|
|
|
regex="'(.*)'"
|
|
|
|
if [[ $versionLine =~ $regex ]]
|
|
|
|
then
|
2024-02-23 06:31:03 +00:00
|
|
|
version="${BASH_REMATCH[1]}"
|
|
|
|
fi
|
|
|
|
# Mark full versions with an extra version number field:
|
|
|
|
if [ "$modules" = full ]
|
|
|
|
then
|
|
|
|
version="${version}.2"
|
|
|
|
fi
|
2024-02-21 15:46:43 +00:00
|
|
|
echo "Building plugin version $version"
|
|
|
|
|
2024-02-23 06:31:03 +00:00
|
|
|
VERSION="$version" WHAT="$modules" bash etc/manifest.bash > $1/manifest.json
|
|
|
|
WHAT="$modules" bash etc/options.bash > $1/options.html
|
|
|
|
|
2023-10-05 06:19:11 +00:00
|
|
|
cp etc/deps/x_ite/x_ite.css $1/deps/x_ite
|
|
|
|
cp etc/deps/x_ite/assets/images/logo.128.png $1/deps/x_ite/assets/images
|
|
|
|
cp etc/deps/x_ite/x_ite.mjs $1/deps/x_ite
|
|
|
|
cp etc/deps/x_ite/assets/components/* $1/deps/x_ite/assets/components
|
2023-10-10 03:17:19 +00:00
|
|
|
npx rollup public/js/giveAwrl.js --dir $1
|
2024-02-23 06:31:03 +00:00
|
|
|
cp public/js/options.js public/js/conway.js public/js/prism.js $1
|
|
|
|
cp public/js/adapptypes.js $1
|
|
|
|
|
2023-10-10 03:17:19 +00:00
|
|
|
cp node_modules/webextension-polyfill/dist/browser-polyfill.js $1
|
|
|
|
cp node_modules/@webcomponents/custom-elements/custom-elements.min.js $1
|
2024-02-20 04:14:44 +00:00
|
|
|
mkdir -p $1/assets
|
|
|
|
cp public/assets/arch*.png $1/assets
|
2024-02-23 06:31:03 +00:00
|
|
|
cp public/assets/vrmlExample.png $1/assets
|
|
|
|
|
|
|
|
if [ "$modules" = full ]
|
|
|
|
then
|
|
|
|
geoFiles=($(grep deps/GeoGebra $1/manifest.json))
|
|
|
|
for spec in "${geoFiles[@]}"
|
|
|
|
do
|
|
|
|
quotspec=${spec%,}
|
|
|
|
trimRspec="${quotspec%\"}"
|
|
|
|
trimspec="${trimRspec#\"}"
|
|
|
|
dest=${trimspec%/*}
|
|
|
|
mkdir -p $1/$dest
|
|
|
|
cp -r etc/$trimspec $1/$dest
|
|
|
|
done
|
|
|
|
|
|
|
|
npx rollup public/js/adapptlet.js --file $1/adapptlet.js
|
|
|
|
npx rollup public/js/adapptext.js --file $1/adapptext.js
|
|
|
|
|
|
|
|
cp public/assets/joyceExample.png $1/assets
|
|
|
|
fi
|
|
|
|
|
2024-02-20 04:14:44 +00:00
|
|
|
# Wrap it all up
|
2024-02-21 15:46:43 +00:00
|
|
|
cd $1
|
|
|
|
zip -r ../$1 *
|