Skip to content

Commit

Permalink
Remove vscode.sh and add vsix.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbattle committed Nov 1, 2023
1 parent 3b0945b commit 17f5ae9
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 143 deletions.
8 changes: 2 additions & 6 deletions packaging/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@
<fileMode>0777</fileMode>
</file>
<file>
<source>src/main/scripts/vscode.sh</source>
<destName>vscode.sh</destName>
<source>src/main/scripts/vsix.sh</source>
<destName>vsix.sh</destName>
<fileMode>0777</fileMode>
</file>
<file>
<source>src/main/scripts/README_VDMJ</source>
<destName>README_VDMJ</destName>
</file>
<file>
<source>src/main/scripts/README_VSCODE</source>
<destName>README_VSCODE</destName>
</file>
</files>

<fileSets>
Expand Down
55 changes: 0 additions & 55 deletions packaging/src/main/scripts/README_VSCODE

This file was deleted.

82 changes: 0 additions & 82 deletions packaging/src/main/scripts/vscode.sh

This file was deleted.

56 changes: 56 additions & 0 deletions packaging/src/main/scripts/vsix.sh
Original file line number Diff line number Diff line change
@@ -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) <VDM VSCode VSIX>"
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

0 comments on commit 17f5ae9

Please sign in to comment.