diff --git a/packaging/assembly.xml b/packaging/assembly.xml index 70dfc7673..57f1d4724 100644 --- a/packaging/assembly.xml +++ b/packaging/assembly.xml @@ -20,18 +20,14 @@ 0777 - src/main/scripts/vscode.sh - vscode.sh + src/main/scripts/vsix.sh + vsix.sh 0777 src/main/scripts/README_VDMJ README_VDMJ - - src/main/scripts/README_VSCODE - README_VSCODE - diff --git a/packaging/src/main/scripts/README_VSCODE b/packaging/src/main/scripts/README_VSCODE deleted file mode 100644 index 71d034db5..000000000 --- a/packaging/src/main/scripts/README_VSCODE +++ /dev/null @@ -1,55 +0,0 @@ -VSCode Script -============= - -This VDMJ distribution includes a bash script to help you patch a VSCode installation, that -already has the VDM VSCode extension installed. The script will update the version of VDMJ -and the associated libraries to that in the distribution. This can be helpful if you want -the latest changes quickly, and cannot wait for the next VDM VSCode marketplace update. - -To run the "vscode.sh" script, you must first include the installation folder (where you -unzipped the distribution) on your $PATH. For example: - -PATH=$PATH:~/vdmj-suite-4.5.0-SNAPSHOT/ - -You can then try running vscode.sh without any arguments, which will detect the VDM VSCode -installation in the default location ($HOME/.vscode/extensions/overturetool.vdm-vscode-). - -You do not have to be in any particular directory when you run the script. - -If you know your VSCode installation uses a different extension location, you can pass this -as an option to the script. - -nick@pollux:~> vscode.sh -help -Usage: vscode.sh [] -e.g. vscode.sh "~/.vscode/extensions/overturetool.vdm-vscode-1.3.7" - -nick@pollux:~> vscode.sh -**************************** WARNING! **************************** -This script will OVERWRITE your VDM VSCode extension with new jars -This CANNOT be undone! -If anything goes wrong, you will have to REINSTALL the extension. - -VDM-VSCode installation = /home/nick/.vscode/extensions/overturetool.vdm-vscode-1.3.7 -VDMJ distribution = /home/nick/vdmj-suite-4.5.0-SNAPSHOT -Version = 4.5.0-SNAPSHOT - -Do you want to continue [yes/no]? yes -**************************** COPYING! **************************** - -removed '/home/nick/.vscode/extensions/overturetool.vdm-vscode-1.3.7/resources/jars/vdmj/vdmj-4.5.0-SNAPSHOT.jar' -removed '/home/nick/.vscode/extensions/overturetool.vdm-vscode-1.3.7/resources/jars/vdmj/lsp-4.5.0-SNAPSHOT.jar' -removed '/home/nick/.vscode/extensions/overturetool.vdm-vscode-1.3.7/resources/jars/vdmj/annotations-4.5.0-SNAPSHOT.jar' -removed '/home/nick/.vscode/extensions/overturetool.vdm-vscode-1.3.7/resources/jars/vdmj/libs/stdlib-4.5.0-SNAPSHOT.jar' - -'vdmj-4.5.0-SNAPSHOT.jar' -> '/home/nick/.vscode/extensions/overturetool.vdm-vscode-1.3.7/resources/jars/vdmj/vdmj-4.5.0-SNAPSHOT.jar' -'lsp-4.5.0-SNAPSHOT.jar' -> '/home/nick/.vscode/extensions/overturetool.vdm-vscode-1.3.7/resources/jars/vdmj/lsp-4.5.0-SNAPSHOT.jar' -'annotations-4.5.0-SNAPSHOT.jar' -> '/home/nick/.vscode/extensions/overturetool.vdm-vscode-1.3.7/resources/jars/vdmj/annotations-4.5.0-SNAPSHOT.jar' -'stdlib-4.5.0-SNAPSHOT.jar' -> '/home/nick/.vscode/extensions/overturetool.vdm-vscode-1.3.7/resources/jars/vdmj/libs/stdlib-4.5.0-SNAPSHOT.jar' -'quickcheck-4.5.0-SNAPSHOT.jar' -> '/home/nick/.vscode/extensions/overturetool.vdm-vscode-1.3.7/resources/jars/vdmj/libs/quickcheck-4.5.0-SNAPSHOT.jar' - -**************************** FINISHED **************************** - -You must restart VSCode! -if problems, remove and re-install VDM-VSCode from the marketplace. - -nick@pollux:~> diff --git a/packaging/src/main/scripts/vscode.sh b/packaging/src/main/scripts/vscode.sh deleted file mode 100755 index 256ecc1b3..000000000 --- a/packaging/src/main/scripts/vscode.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# -# Update a VDM VSCode installation, using the jars in this distribution. -# - -function usage() -{ - echo "Usage: $(basename $0) []" - echo "e.g. $(basename $0) \"~/.vscode/extensions/overturetool.vdm-vscode-1.3.7\"" - exit 1 -} - -if [ $# -gt 1 -o "$1" = "-help" ] -then - usage -fi - -SELF=$(which "$0") -DISTRIBUTION=$(dirname "$SELF") -cd "$DISTRIBUTION" - -VERSION="4.5.0-SNAPSHOT" -RESDIR="vdmj" -EXTENSION=${1:-~/.vscode/extensions/overturetool.vdm-vscode-1.3.7} - -if [ ! -e "vdmj-$VERSION.jar" ] -then - echo "Install script version $VERSION does not match distribution jars?" - usage -fi - -if [ ! -e "$EXTENSION" ] -then - echo "Cannot find VDM VSCode extension at $EXTENSION" - usage -fi - -echo "**************************** WARNING! ****************************" -echo "This script will OVERWRITE your VDM VSCode extension with new jars" -echo "This CANNOT be undone!" -echo "If anything goes wrong, you will have to REINSTALL the extension." -echo -echo "VDM-VSCode installation = $EXTENSION" -echo "VDMJ distribution = $DISTRIBUTION" -echo "Version = $VERSION" -echo - -RESP="" - -while [ "$RESP" != "yes" -a "$RESP" != "no" ] -do - echo -n "Do you want to continue [yes/no]? " - read RESP -done - -if [ "$RESP" = "no" ] -then - echo "Aborted." - exit 0 -fi - -echo "**************************** COPYING! ****************************" -echo -rm -vf "$EXTENSION"/resources/jars/$RESDIR/vdmj-*.jar -rm -vf "$EXTENSION"/resources/jars/$RESDIR/lsp-*.jar -rm -vf "$EXTENSION"/resources/jars/$RESDIR/annotations-*.jar -rm -vf "$EXTENSION"/resources/jars/$RESDIR/libs/stdlib-*.jar -rm -vf "$EXTENSION"/resources/jars/$RESDIR/libs/quickcheck-*.jar -echo -cp -vf vdmj-$VERSION.jar "$EXTENSION"/resources/jars/$RESDIR -cp -vf lsp-$VERSION.jar "$EXTENSION"/resources/jars/$RESDIR -cp -vf annotations-$VERSION.jar "$EXTENSION"/resources/jars/$RESDIR -cp -vf stdlib-$VERSION.jar "$EXTENSION"/resources/jars/$RESDIR/libs -cp -vf quickcheck-$VERSION.jar "$EXTENSION"/resources/jars/$RESDIR/libs -echo -echo "**************************** FINISHED ****************************" -echo -echo "You must restart VSCode!" -echo "if problems, remove and re-install VDM-VSCode from the marketplace." -echo - -exit 0 diff --git a/packaging/src/main/scripts/vsix.sh b/packaging/src/main/scripts/vsix.sh new file mode 100755 index 000000000..1b523f2b7 --- /dev/null +++ b/packaging/src/main/scripts/vsix.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# +# Update a VDM VSCode VSIX, using the jars in this distribution. +# Download VSIX from https://marketplace.visualstudio.com/items?itemName=overturetool.vdm-vscode +# + +function usage() +{ + echo "Usage: $(basename $0) " + echo "e.g. $(basename $0) overturetool.vdm-vscode-1.3.7.vsix" + exit 1 +} + +if [ $# -ne 1 -o "$1" = "-help" ] +then + usage +fi + +VERSION="4.5.0-SNAPSHOT" +VDMJ="vdmj" + +SELF=$(which "$0") +DISTRIBUTION=$(dirname "$SELF") +VSIX=$(realpath ${1}) + +if [ ! -e "$VSIX" ] +then + echo "Cannot find VDM VSCode VSIX at $VSIX" + usage +fi + +if [[ "$VSIX" != *.vsix ]] +then + echo "File passed is not a VSIX?" + usage +fi + +echo "**************************** Updating VSIX! ****************************" +( + cd "$DISTRIBUTION" + rm -rf extension + EXTRACT="extension/resources/jars" + unzip -q "$VSIX" "$EXTRACT/$VDMJ/*" "$EXTRACT/plugins/*" + + cp -vf vdmj-$VERSION.jar $EXTRACT/$VDMJ + cp -vf lsp-$VERSION.jar $EXTRACT/$VDMJ + cp -vf annotations-$VERSION.jar $EXTRACT/$VDMJ + cp -vf stdlib-$VERSION.jar $EXTRACT/$VDMJ/libs + cp -vf quickcheck-$VERSION.jar $EXTRACT/plugins + + zip -q "$VSIX" $(find $EXTRACT -type f) + rm -rf extension +) +echo "**************************** FINISHED **********************************" + +exit 0