mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
externalTests: Neutralize npm hooks instead of replacing pragmas twice
- This also has the nice effect of stopping projects from trying to compile contracts during installation
This commit is contained in:
parent
7b7cc081db
commit
c090ff9d83
@ -41,8 +41,7 @@ function colony_test
|
||||
setup_solcjs "$DIR" "$SOLJSON"
|
||||
download_project "$repo" "$branch" "$DIR"
|
||||
|
||||
replace_version_pragmas
|
||||
force_truffle_solc_modules "$SOLJSON"
|
||||
neutralize_package_json_hooks
|
||||
force_truffle_compiler_settings "$config_file" "${DIR}/solc" "$min_optimizer_level"
|
||||
yarn
|
||||
git submodule update --init
|
||||
|
@ -104,6 +104,14 @@ function neutralize_package_lock
|
||||
rm --force --verbose package-lock.json
|
||||
}
|
||||
|
||||
function neutralize_package_json_hooks
|
||||
{
|
||||
printLog "Disabling package.json hooks..."
|
||||
[[ -f package.json ]] || fail "package.json not found"
|
||||
sed -i 's|"prepublish": *".*"|"prepublish": ""|g' package.json
|
||||
sed -i 's|"prepare": *".*"|"prepare": ""|g' package.json
|
||||
}
|
||||
|
||||
function force_truffle_solc_modules
|
||||
{
|
||||
local soljson="$1"
|
||||
|
@ -45,8 +45,7 @@ function ens_test
|
||||
force_truffle_version ^5.1.55
|
||||
|
||||
neutralize_package_lock
|
||||
replace_version_pragmas
|
||||
force_truffle_solc_modules "$SOLJSON"
|
||||
neutralize_package_json_hooks
|
||||
force_truffle_compiler_settings "$config_file" "${DIR}/solc" "$min_optimizer_level"
|
||||
npm install
|
||||
|
||||
|
@ -46,8 +46,7 @@ function gnosis_safe_test
|
||||
sed -i -E 's|"@gnosis.pm/util-contracts": "[^"]+"|"@gnosis.pm/util-contracts": "github:solidity-external-tests/util-contracts#solc-7_080"|g' package.json
|
||||
|
||||
neutralize_package_lock
|
||||
replace_version_pragmas
|
||||
force_truffle_solc_modules "$SOLJSON"
|
||||
neutralize_package_json_hooks
|
||||
force_truffle_compiler_settings "$config_file" "${DIR}/solc" "$min_optimizer_level"
|
||||
npm install --package-lock
|
||||
|
||||
|
@ -44,8 +44,7 @@ function gnosis_safe_test
|
||||
sed -i 's|github:gnosis/mock-contract#sol_0_5_0|github:solidity-external-tests/mock-contract#master_080|g' package.json
|
||||
|
||||
neutralize_package_lock
|
||||
replace_version_pragmas
|
||||
force_truffle_solc_modules "$SOLJSON"
|
||||
neutralize_package_json_hooks
|
||||
force_truffle_compiler_settings "$config_file" "${DIR}/solc" "$min_optimizer_level"
|
||||
npm install --package-lock
|
||||
|
||||
|
@ -41,8 +41,7 @@ function zeppelin_test
|
||||
setup_solcjs "$DIR" "$SOLJSON"
|
||||
download_project "$repo" "$branch" "$DIR"
|
||||
|
||||
replace_version_pragmas
|
||||
force_truffle_solc_modules "$SOLJSON"
|
||||
neutralize_package_json_hooks
|
||||
force_truffle_compiler_settings "$config_file" "${DIR}/solc" "$min_optimizer_level"
|
||||
npm install
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user