Skip to content

Commit

Permalink
fix: fix app size analysis on esp-idf with multiple dots
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaaa committed Sep 26, 2024
1 parent 0917e35 commit 460d95b
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,12 @@ protected List<String> getCommandArgsArchives(String pythonExecutablenPath, IFil

private List<String> addJsonParseCommand()
{
List<String> arguments = new ArrayList<String>();
List<String> arguments = new ArrayList<>();
IEnvironmentVariable idfVersionEnv = new IDFEnvironmentVariables()
.getEnv(IDFEnvironmentVariables.ESP_IDF_VERSION);
String idfVersion = idfVersionEnv != null ? idfVersionEnv.getValue() : null;
if (idfVersion != null && Double.parseDouble(idfVersion) >= 5.1)

if (idfVersion != null && parseVersionWithMultipleDotsToDouble(idfVersion) >= 5.1)
{
arguments.add("--format"); //$NON-NLS-1$
arguments.add("json"); //$NON-NLS-1$
Expand All @@ -205,6 +206,12 @@ private List<String> addJsonParseCommand()
return arguments;
}

public double parseVersionWithMultipleDotsToDouble(String version)
{
String numericVersion = version.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
return Double.parseDouble(numericVersion) / Math.pow(10, version.split("\\.").length - 1.0); //$NON-NLS-1$
}

protected List<String> getCommandArgsSymbolDetails(String pythonExecutablenPath, IFile file)
{
List<String> arguments = new ArrayList<String>();
Expand Down

0 comments on commit 460d95b

Please sign in to comment.