Introduce build directory for artifacts (#31)

This commit is contained in:
Alex Beregszaszi 2020-05-15 18:23:58 +01:00 committed by GitHub
parent a2e1e5aef0
commit 15fcaa0828
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 13 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build

View File

@ -1,26 +1,22 @@
all: compile all: compile
clean: clean:
@rm -f DepositContract.abi DepositContract.bin IDepositContract.abi IDepositContract.bin deposit_contract.json @rm -rf build
@rm -f DepositContractTest.abi DepositContractTest.bin @rm -f deposit_contract.json
@rm -f VyperSetup.abi VyperSetup.bin
@rm -f DSTest.abi DSTest.bin
@rm -rf combined.json
# Note: using /bin/echo for macOS support
compile: clean compile: clean
@# Note: using /bin/echo for macOS
@git submodule update --recursive --init @git submodule update --recursive --init
@solc --metadata-literal --optimize --optimize-runs 5000000 --bin --abi --combined-json=abi,bin,bin-runtime,srcmap,srcmap-runtime,ast,metadata,storage-layout --overwrite -o . deposit_contract.sol tests/deposit_contract.t.sol @solc --metadata-literal --optimize --optimize-runs 5000000 --bin --abi --combined-json=abi,bin,bin-runtime,srcmap,srcmap-runtime,ast,metadata,storage-layout --overwrite -o build deposit_contract.sol tests/deposit_contract.t.sol
@/bin/echo -n '{"abi": ' > deposit_contract.json @/bin/echo -n '{"abi": ' > deposit_contract.json
@cat DepositContract.abi >> deposit_contract.json @cat build/DepositContract.abi >> deposit_contract.json
@/bin/echo -n ', "bytecode": "0x' >> deposit_contract.json @/bin/echo -n ', "bytecode": "0x' >> deposit_contract.json
@cat DepositContract.bin >> deposit_contract.json @cat build/DepositContract.bin >> deposit_contract.json
@/bin/echo -n '"}' >> deposit_contract.json @/bin/echo -n '"}' >> deposit_contract.json
export DAPP_SKIP_BUILD:=1 export DAPP_SKIP_BUILD:=1
export DAPP_SRC:=. export DAPP_SRC:=.
export DAPP_JSON:=combined.json export DAPP_JSON:=build/combined.json
test: test:
dapp test -v --fuzz-runs 5 dapp test -v --fuzz-runs 5

View File

@ -18,7 +18,7 @@ jobs:
root: . root: .
paths: paths:
- deposit_contract.json - deposit_contract.json
- combined.json - build/combined.json
- lib - lib
spectest: spectest:
@ -56,7 +56,8 @@ jobs:
- run: - run:
name: Test the contract name: Test the contract
command: | command: |
cp /tmp/combined.json . mkdir build
cp -r /tmp/build/* build
cp -r /tmp/lib/* lib cp -r /tmp/lib/* lib
nix-shell --command 'make test' nix-shell --command 'make test'