Skip to content

Commit 290d1d8

Browse files
IEP-1334: EIM Integration (#1116)
* Initial integration Initial integration for the eim starting from the start to handle the empty workspace. Tools activation is still to be done along with code cleanup. Just the basic display is working which will also be enhanced. * Initial first flow with successful installation and loading of env in IDE with EIM * constants moved to single place and added refresh function * minor cleanup and logging for user * IEP-1334: code cleanup (Active Review) (#1125) * cleanup of unused classes and code * String internalization * update to ci file * ci error fixed * ci error fix * ci fix * fixing ci error * ci error fix * ci error fix * ci syntax fix * ci syntax indentation fix * ci syntax fix * ci syntax fix * ci fixed * ci fixed2 * ci trigger * workflow trigger fix * cleanup * ci deps isntalled * eim fix * using eim action to install * using Petr's fork * switched back to official action repo * Revert "switched back to official action repo" This reverts commit f8cd7a7. * trying to fix action for eim * trying with petrs fork again * ci fix * back to espressif * name fixed * updated url for eim * old config export handling * fixing tests env setup * logging to verify skip tests * fixing POSIX path resolution * activation script properly sourced * added test run variable in test pom directly * adding cache option for the maven * file name updated * increasing timeout for tests * test fixes and removing redundant and outdated tests * cleanup and update for user messages * updated to handle activation of single esp-idf from eim * removing unwanted test for fixing failures * increased timeout for tests * ci updated for the release branch trigger as well * ci error fix * fix for sdkconfig server * cleaning up the idf_tools_path configuration in the IDE * added the option to include homebrew paths on macos * changes for guide link * Guidance link added to NLS * fix: Launch ESP-IDF Manager view even there is no eim_idf.json file found * fix: Don't launch multiple ESP-IDF Manager editors * fix: Update the msg and convert it to MessageDialog * fix: notify IDF not found while opening Manager view * fix: java.lang.UnsupportedOperationException * fix: File Not found issue and others * updated code for eim watcher added Next commits will do some refactoring and then implement the logic to handle these changes * refactored startup classes * initial base level logic for file watcher So this is very basic first level of file watcher service that watches the file and then also takes care that the file is wasnt changes since last startup. Initial changes only take that the file last modified is verified and just any change in file simply will give you a message box telling that something changed. More advanced and robust checks in upcoming commits * missing copyright added --------- Co-authored-by: Kondal Kolipaka <[email protected]>
1 parent e32037c commit 290d1d8

File tree

77 files changed

+1977
-5949
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1977
-5949
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,31 @@ name: Java CI with Maven
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches:
9+
- master
10+
- release/**
911
pull_request:
10-
branches: [ master ]
12+
branches:
13+
- master
14+
- release/**
1115

1216
jobs:
13-
build:
17+
build_linux:
1418

15-
runs-on:
16-
- self-hosted
17-
- eclipse
18-
- BrnoUBU0004
19+
runs-on: [self-hosted, eclipse, BrnoUBU0004]
1920

2021
steps:
21-
- uses: actions/checkout@v2
22-
23-
- name: Clone IDF Release From Github
24-
uses: actions/checkout@v2
25-
with:
26-
repository: espressif/esp-idf
27-
path: dependencies/idf-tools
28-
submodules: 'true'
29-
ref: release/v5.1
22+
- uses: actions/checkout@v4
3023

3124
- name: Set up Python
3225
uses: actions/setup-python@v2
3326
with:
34-
python-version: '3.10'
27+
python-version: '3.10'
28+
29+
- name: Install ESP-IDF via eim
30+
uses: espressif/install-esp-idf-action@v1
31+
with:
32+
version: 'v5.3'
3533

3634
- name: Set up Maven
3735
uses: stCarolas/setup-maven@v5
@@ -42,8 +40,9 @@ jobs:
4240
uses: actions/setup-java@v4
4341
with:
4442
java-version: '21'
45-
distribution: 'temurin'
46-
43+
distribution: 'temurin'
44+
cache: 'maven'
45+
4746
- name: Build with Maven
4847
run: export NO_AT_BRIDGE=1 && mvn clean verify -Djarsigner.skip=true -DskipTests=false -DtestWorkspace=/opt/actions-runner/_work/workspace
4948

.github/workflows/ci_windows.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ name: Java CI with Maven on Windows
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches:
9+
- master
10+
- release/**
911
pull_request:
10-
branches: [ master ]
12+
branches:
13+
- master
14+
- release/**
1115

1216
jobs:
1317
build_windows:

bundles/com.espressif.idf.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Export-Package: com.espressif.idf.core,
4545
com.espressif.idf.core.tools,
4646
com.espressif.idf.core.tools.util,
4747
com.espressif.idf.core.tools.vo,
48+
com.espressif.idf.core.tools.watcher,
4849
com.espressif.idf.core.util,
4950
com.espressif.idf.core.variable,
5051
org.json.simple,

bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFCorePreferenceConstants.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@
77

88
import org.eclipse.core.resources.IProject;
99
import org.eclipse.core.resources.ProjectScope;
10-
import org.eclipse.core.runtime.Platform;
1110
import org.eclipse.core.runtime.preferences.ConfigurationScope;
1211
import org.eclipse.core.runtime.preferences.DefaultScope;
1312
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
1413
import org.eclipse.core.runtime.preferences.InstanceScope;
1514

16-
import com.espressif.idf.core.util.IDFUtil;
17-
1815
/**
1916
* @author Kondal Kolipaka
2017
*

bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFEnvironmentVariables.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
1919

2020
import com.espressif.idf.core.logging.Logger;
21-
import com.espressif.idf.core.util.IDFUtil;
2221
import com.espressif.idf.core.util.StringUtil;
2322

2423
/**
@@ -52,6 +51,8 @@ public class IDFEnvironmentVariables
5251

5352
public static final String IDF_CCACHE_ENABLE = "IDF_CCACHE_ENABLE"; //$NON-NLS-1$
5453

54+
public static final String ESP_IDF_EIM_ID = "ESP_IDF_EIM_ID"; //$NON-NLS-1$
55+
5556
/**
5657
* @param variableName Environment variable Name
5758
* @return IEnvironmentVariable
@@ -129,16 +130,12 @@ public Map<String, String> getSystemEnvMap()
129130
IEnvironmentVariableManager buildEnvironmentManager = CCorePlugin.getDefault().getBuildEnvironmentManager();
130131
IEnvironmentVariable[] variables = buildEnvironmentManager.getVariables((ICConfigurationDescription) null,
131132
true);
132-
Map<String, String> envMap = IDFUtil.getSystemEnv();
133+
Map<String, String> envMap = new HashMap<String, String>(System.getenv());
133134
if (variables != null)
134135
{
135136
for (IEnvironmentVariable iEnvironmentVariable : variables)
136137
{
137138
String key = iEnvironmentVariable.getName();
138-
if (key.equals(IDFCorePreferenceConstants.IDF_TOOLS_PATH))
139-
{
140-
continue;
141-
}
142139
String value = iEnvironmentVariable.getValue();
143140
envMap.put(key, value);
144141
}

bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,6 @@ private void runCmakeBuildCommand(IConsole console, IProgressMonitor monitor, IP
359359
}
360360
}
361361

362-
envVars.add(new EnvironmentVariable(IDFCorePreferenceConstants.IDF_TOOLS_PATH,
363-
IDFUtil.getIDFToolsPathFromPreferences()));
364-
365362
String buildCommand = getProperty(BUILD_COMMAND);
366363
if (buildCommand.isBlank())
367364
{
@@ -479,10 +476,8 @@ private void runCmakeCommand(IConsole console, IProgressMonitor monitor, IProjec
479476
// Set PYTHONUNBUFFERED to 1/TRUE to dump the messages back immediately without
480477
// buffering
481478
IEnvironmentVariable bufferEnvVar = new EnvironmentVariable("PYTHONUNBUFFERED", "1"); //$NON-NLS-1$ //$NON-NLS-2$
482-
IEnvironmentVariable idfToolsPathEnvVar = new EnvironmentVariable(IDFCorePreferenceConstants.IDF_TOOLS_PATH,
483-
IDFUtil.getIDFToolsPathFromPreferences());
484479

485-
Process p = startBuildProcess(command, new IEnvironmentVariable[] { bufferEnvVar, idfToolsPathEnvVar },
480+
Process p = startBuildProcess(command, new IEnvironmentVariable[] { bufferEnvVar },
486481
workingDir, errConsole, monitor);
487482
if (p == null)
488483
{

bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/Messages.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,23 @@ public class Messages extends NLS
3333
public static String ToolsInitializationDifferentPathMessageBoxOptionYes;
3434
public static String ToolsInitializationDifferentPathMessageBoxOptionNo;
3535
public static String IDFToolChainsMissingErrorMsg;
36+
37+
public static String ToolsInitializationEimMissingMsgBoxTitle;
38+
public static String ToolsInitializationEimMissingMsgBoxMessage;
3639

3740
public static String RefreshingProjects_JobName;
41+
42+
public static String NoActiveEspIdfInWorkspaceMsgTitle;
43+
public static String NoActiveEspIdfInWorkspaceMsg;
44+
45+
public static String OldConfigFoundMsgBoxTitle;
46+
public static String OldConfigFoundMsgBoxMsg;
47+
public static String OldConfigExportDirectorSelectionDialogTitle;
48+
public static String OldConfigExportDirectorSelectionDialogInfo;
49+
public static String OldConfigExportCompleteSuccessMsgTitle;
50+
public static String OldConfigExportCompleteSuccessMsg;
51+
public static String OldConfigExportCompleteFailMsgTitle;
52+
public static String OldConfigExportCompleteFailMsg;
3853

3954
static
4055
{

bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/messages.properties

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,23 @@ IDFBuildConfiguration_ParseCommand=Parse Compile Commands File
1919
IncreasePartitionSizeTitle=Low Application Partition Size
2020
IncreasePartitionSizeMessage=Less than 30% of application partition size is free({0} of {1} bytes), would you like to increase it? Please click <a href={2}>here</a> to check more details.
2121
ToolsInitializationDifferentPathMessageBoxTitle=Different IDF path found in the config file
22+
ToolsInitializationEimMissingMsgBoxTitle=ESP-IDF Not Found
23+
ToolsInitializationEimMissingMsgBoxMessage=ESP-IDF is not found on your system. To use the IDE, install ESP-IDF using <a href="{0}">EIM - GUI Installer</a>. \n\nOnce installed, the IDE will automatically detect ESP-IDF. You can verify and activate it from the ESP-IDF Manager, accessible via the menu: Espressif > ESP-IDF Manager.\n\n
2224
ToolsInitializationDifferentPathMessageBoxMessage=A different ESP-IDF path was found in the esp_idf.json.json configuration file. Do you want to install the tools in the new path or the old path? Please click on the appropriate button.\nNew Path: {0}\nOld Path: {1}
2325
ToolsInitializationDifferentPathMessageBoxOptionYes=Use New Path
2426
ToolsInitializationDifferentPathMessageBoxOptionNo=Use Old Path
2527
RefreshingProjects_JobName=Refreshing Projects...
2628
IDFBuildConfiguration_PreCheck_DifferentIdfPath=The project was built using the ESP-IDF located at the {0} path.\nThe currently active ESP-IDF path in the IDE is {1}.\nPlease clean the project using "ESP-IDF:Project Full Clean" menu option to use the active ESP-IDF configuration.
27-
IDFToolChainsMissingErrorMsg=Toolchains are missing. Please use ESP-IDF Manager for configuring
29+
IDFToolChainsMissingErrorMsg=Toolchains are missing. Please use ESP-IDF Manager for configuring
30+
31+
NoActiveEspIdfInWorkspaceMsgTitle=ESP-IDF Setup
32+
NoActiveEspIdfInWorkspaceMsg=ESP-IDF is required to use Espressif IDE. Would you like to configure it now?
33+
34+
OldConfigFoundMsgBoxTitle=Old Configuration Found
35+
OldConfigFoundMsgBoxMsg=An old ESP-IDF configuration has been detected.\nIf you want to use these you need to export these configuration and pass them on to EIM for updated configurations.\nWould you like to export these settings?\n\nPress 'Yes' to choose a location to save.
36+
OldConfigExportDirectorSelectionDialogTitle=Select Destination
37+
OldConfigExportDirectorSelectionDialogInfo=Choose a directory to save the exported settings.
38+
OldConfigExportCompleteSuccessMsgTitle=Export Successful
39+
OldConfigExportCompleteSuccessMsg=The configuration has been successfully copied to:\n{0}
40+
OldConfigExportCompleteFailMsgTitle=Export Failed
41+
OldConfigExportCompleteFailMsg=An error occurred while copying the configuration.\n{0}

bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public File findToolChain(List<String> paths, String filePattern)
177177

178178
private Path[] getDirectories(String path)
179179
{
180-
return Arrays.stream(path.split(File.pathSeparator)).map(String::trim).map(Paths::get).filter(Files::exists)
180+
return Arrays.stream(path.split(File.pathSeparator)).map(String::trim).map(Paths::get).filter(Files::exists).filter(Files::isDirectory)
181181
.toArray(Path[]::new);
182182
}
183183

@@ -316,7 +316,7 @@ protected String getIdfToolsExportPath()
316316
Logger.log(commands.toString());
317317

318318
IStatus idfToolsExportStatus = new ProcessBuilderFactory().runInBackground(commands,
319-
org.eclipse.core.runtime.Path.ROOT, IDFUtil.getSystemEnv());
319+
org.eclipse.core.runtime.Path.ROOT, System.getenv());
320320
if (idfToolsExportStatus != null && idfToolsExportStatus.isOK())
321321
{
322322
String message = idfToolsExportStatus.getMessage();
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.espressif.idf.core.tools;
2+
3+
public interface EimConstants
4+
{
5+
String EIM_JSON = "eim_idf.json"; //$NON-NLS-1$
6+
7+
String EIM_POSIX_DIR = System.getProperty("user.home").concat("/.espressif/tools/"); //$NON-NLS-1$//$NON-NLS-2$
8+
9+
String EIM_WIN_DIR = "C:\\Espressif\\tools\\"; //$NON-NLS-1$
10+
11+
String EIM_WIN_PATH = EIM_WIN_DIR + EIM_JSON;
12+
13+
String EIM_URL = "https://dl.espressif.com/dl/eim/"; //$NON-NLS-1$
14+
15+
String EIM_POSIX_PATH = EIM_POSIX_DIR + EIM_JSON;
16+
17+
String INSTALL_TOOLS_FLAG = "INSTALL_TOOLS_FLAG"; //$NON-NLS-1$
18+
19+
String TOOL_SET_CONFIG_LEGACY_CONFIG_FILE = "tool_set_config.json"; //$NON-NLS-1$
20+
21+
String OLD_CONFIG_EXPORTED_FLAG = "OLD_CONFIG_EXPORTED_FLAG"; //$NON-NLS-1$
22+
}

0 commit comments

Comments
 (0)