mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Take into account multi-line license comments when adding preamble in test frameworks
This commit is contained in:
parent
69e5b634ea
commit
0c2fce579a
@ -52,7 +52,7 @@ AnalysisFramework::parseAnalyseAndReturnError(
|
||||
{
|
||||
compiler().reset();
|
||||
// Do not insert license if it is already present.
|
||||
bool insertLicense = _insertLicenseAndVersionPragma && _source.find("// SPDX-License-Identifier:") == string::npos;
|
||||
bool insertLicense = _insertLicenseAndVersionPragma && _source.find("SPDX-License-Identifier:") == string::npos;
|
||||
compiler().setSources({{"",
|
||||
string{_insertLicenseAndVersionPragma ? "pragma solidity >=0.0;\n" : ""} +
|
||||
string{insertLicense ? "// SPDX-License-Identifier: GPL-3.0\n" : ""} +
|
||||
|
@ -146,7 +146,7 @@ string SolidityExecutionFramework::addPreamble(string const& _sourceCode)
|
||||
{
|
||||
// Silence compiler version warning
|
||||
string preamble = "pragma solidity >=0.0;\n";
|
||||
if (_sourceCode.find("// SPDX-License-Identifier:") == string::npos)
|
||||
if (_sourceCode.find("SPDX-License-Identifier:") == string::npos)
|
||||
preamble += "// SPDX-License-Identifier: unlicensed\n";
|
||||
if (
|
||||
solidity::test::CommonOptions::get().useABIEncoderV1 &&
|
||||
|
Loading…
Reference in New Issue
Block a user