Repository navigation
IEP-1789: Add support for eim_idf.json 3.0 #1485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
55074cb
feat: adding support for multiple eim_json versions
d-almazov 3b02a75
feat: simplifying the approach
d-almazov 15162b6
fix: normalize malformed version strings
d-almazov 89f35d0
fix: treat unrecognized statuses as broken
d-almazov 8d75fe9
feat: added logging if path is missing or we can't get it
d-almazov 5baec42
fix: pass the augmented environment to the process
d-almazov d6816f9
feat: validate the Python before any side effects
d-almazov 46570eb
fix: Require Python before reporting an installation as activatable
d-almazov 4b56d7f
fix: mark the EIM JSON state as seen after accepted handling succeeds
d-almazov b869ee5
fix: run initial setup after the refresh job populates the table
d-almazov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 16 additions & 33 deletions
49
...les/com.espressif.idf.core/src/com/espressif/idf/core/tools/EimIdfConfiguratinParser.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,56 +1,39 @@ | ||
| /******************************************************************************* | ||
| * Copyright 2026 Espressif Systems (Shanghai) PTE LTD. All rights reserved. | ||
| * Use is subject to license terms. | ||
| *******************************************************************************/ | ||
| package com.espressif.idf.core.tools; | ||
|
|
||
| import java.io.File; | ||
| import java.io.FileReader; | ||
| import java.io.IOException; | ||
| import java.nio.file.Path; | ||
|
|
||
| import com.espressif.idf.core.logging.Logger; | ||
| import com.espressif.idf.core.tools.eimjson.EimIdfJsonLoader; | ||
| import com.espressif.idf.core.tools.eimjson.model.EimConfigModel; | ||
| import com.espressif.idf.core.tools.exceptions.EimVersionMismatchException; | ||
| import com.espressif.idf.core.tools.vo.EimJson; | ||
| import com.google.gson.Gson; | ||
| import com.google.gson.GsonBuilder; | ||
|
|
||
| /** | ||
| * Loads {@code eim_idf.json}. Delegates version detection and parsing to | ||
| * {@link EimIdfJsonLoader}. | ||
| */ | ||
| public class EimIdfConfiguratinParser | ||
| { | ||
| private EimJson eimJson; | ||
| private Gson gson; | ||
| private final EimIdfJsonLoader loader = new EimIdfJsonLoader(); | ||
| private EimConfigModel configModel; | ||
|
|
||
| public EimIdfConfiguratinParser() | ||
| { | ||
| gson = new GsonBuilder().setPrettyPrinting().enableComplexMapKeySerialization() | ||
| .excludeFieldsWithoutExposeAnnotation().create(); | ||
| } | ||
|
|
||
| private void load() throws IOException, EimVersionMismatchException | ||
| { | ||
| Path jsonPath = new EimIdfJsonPathResolver().resolveEimIdfJsonFile(); | ||
| String path = jsonPath.toString(); | ||
| File file = new File(path); | ||
| if (!file.exists()) | ||
| { | ||
| Logger.log("EIM config file not found: " + path); //$NON-NLS-1$ | ||
| return; | ||
| } | ||
|
|
||
| try (FileReader fileReader = new FileReader(file)) | ||
| { | ||
| eimJson = gson.fromJson(fileReader, EimJson.class); | ||
| } | ||
|
|
||
| if (Double.parseDouble(eimJson.getVersion()) > Double.parseDouble(EimConstants.EIM_JSON_VALID_VERSION)) | ||
| { | ||
| throw new EimVersionMismatchException(EimConstants.EIM_JSON_VALID_VERSION, eimJson.getVersion()); | ||
| } | ||
| configModel = loader.loadDefault(); | ||
| } | ||
|
|
||
| public EimJson getEimJson(boolean reload) throws IOException, EimVersionMismatchException | ||
| public EimConfigModel getConfigModel(boolean reload) throws IOException, EimVersionMismatchException | ||
| { | ||
| if (reload || eimJson == null) | ||
| if (reload || configModel == null) | ||
| { | ||
| load(); | ||
| } | ||
|
|
||
| return eimJson; | ||
| return configModel; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.