Release v2.1.0 solc 0.5.x (#1568)

* Now compiling in a separate directory using truffle 5.

* Ported to 0.5.1, now compiling using 0.5.1.

* test now also compiles using the truffle 5 hack.

* Downgraded to 0.5.0.

* Sorted scripts.

* Cleaned up the compile script a bit.
This commit is contained in:
Nicolás Venturo
2018-12-20 12:26:43 -03:00
committed by GitHub
parent 02f9727dd8
commit be5ed7364b
127 changed files with 284 additions and 236 deletions

View File

@ -16,7 +16,7 @@ do
done < contracts/.npmignore
# Compile everything else.
node_modules/.bin/truffle compile
npm run compile
# Return ignored files to their place.
mv "$tmp_dir/"* contracts/

42
scripts/compile.sh Executable file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env bash
# Configure to exit script as soon as a command fails.
set -o errexit
SOLC_05_DIR=solc-0.5
# Delete any previous build artifacts
rm -rf build/
# Create a subproject where 0.5.x compilation will take place
mkdir -p "$SOLC_05_DIR"
cd "$SOLC_05_DIR"
npm init --yes
npm install --save-dev truffle@5.0.0
rm -rf contracts
ln --symbolic ../contracts contracts
# Delete any previous build artifacts
rm -rf build/
# Compile
echo "
module.exports = {
compilers: {
solc: {
version: \"0.5.0\",
},
},
};
" > truffle-config.js
npx truffle compile
# Modify the paths in the artifacts to make it look as if they were built in the root
sed --in-place --expression "s/\/$SOLC_05_DIR//g" build/contracts/*.json
# Copy them back into the root
cd ..
cp --recursive "$SOLC_05_DIR"/build build