Use BuildInfo.h to retrieve version

This commit is contained in:
Alex Beregszaszi 2017-06-27 11:39:48 +01:00
parent 913b9c0e6b
commit cc4f2500fb

View File

@ -45,7 +45,20 @@ rm -f soljson.js
cp ../solc/soljson.js soljson.js
# Update version (needed for some tests)
VERSION=`$REPO_ROOT/build/solc/solc --version | sed -ne "s/^Version: \([0-9]*.[0-9]*.[0-9]*\).*/\1/p"`
echo "Creating version.c"
rm -f version version.c
cat <<EOF > version.c
#include <stdio.h>
#include "../include/solidity/BuildInfo.h"
int main(int argc, char **argv) {
printf(ETH_PROJECT_VERSION);
return 0;
}
EOF
echo "Compiling version.c"
gcc -o version version.c
echo "Running version"
VERSION=`./version`
echo "Updating package.json to version $VERSION"
npm version $VERSION