Skip to content

Commit

Permalink
Merge branch 'master' into change_mode_based_on_config
Browse files Browse the repository at this point in the history
  • Loading branch information
kolipakakondal authored Mar 6, 2024
2 parents 7754aaf + 21c0573 commit f064ef5
Show file tree
Hide file tree
Showing 30 changed files with 442 additions and 184 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
repository: espressif/esp-idf
path: dependencies/idf-tools
submodules: 'true'
ref: v4.4
ref: release/v5.1

- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -51,9 +51,12 @@ jobs:

- name: Publish Test Reports
if: ${{ always() }}
uses: scacap/action-surefire-report@v1
uses: phoenix-actions/test-reporting@v12
with:
check_name: 'Linux Test Reports'
name: Linux Test Reports
path:
tests/*/*/*/TEST-*.xml
reporter: java-junit

build_macos:
runs-on: macos-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
repository: espressif/esp-idf
path: dependencies/idf-tools
submodules: 'true'
ref: v5.1
ref: release/v5.1

- name: Set up Python
uses: actions/setup-python@v2
Expand Down
8 changes: 8 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ Yes, you can create IDF CMake project using `File > New > Espressif IDF Project`
Yes, you can import using Import Menu. `Import... > Espressif > Existing IDF Project`
## Where can I find the IDF installed tools in my system?
Default directory is `$HOME/.espressif` for Linux/MacOS users or `%USER_PROFILE%.espressif` for Windows users
## Why am I getting timeout errors when Installing tools?
If you are getting errors when downloading or installing tools this can be due to some issue with the mirrors. You can try to set the mirrors in Eclipse `Preferences > Espressif` you will see two settings for Git and Pip Py Wheels please set these to proper mirror according to your region. Currently these two mirrors are available.
### Mirror for GIT (IDF_GITHUB_ASSETS)
- dl.espressif.com/github_assets (default)
- dl.espressif.cn/github_assets
### Mirror for python wheels (PIP_EXTRA_INDEX_URL)
- https://dl.espressif.com/pypi (default)
- https://dl.espressif.cn/pypi
## Deleted C/C++ build envrionment variables still appearing?
- You need to uncheck the preference recorder. This can be performed by following. Eclipse `Preferences > Oomph > Setup Tasks > Preference Recorder`
- Uncheck `Record into`
Expand Down
1 change: 0 additions & 1 deletion NewAndNoteworthy/README.md

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,9 @@ Note this configuration changes where all the project build artifacts will be ge

| IEP | Eclipse | Java | Installer | Description |
| ------ | ------ | ------ |------ | ------ |
| IEP 2.11.0 | Eclipse 2023-03, Eclipse 2023-06, Eclipse 2023-09 |Java 17 and above | |
| IEP 2.12.1 | Eclipse 2023-03 to Eclipse 2023-12 |Java 17 and above |[espressif-ide-setup-2.12.1-with-esp-idf-5.2.exe](https://github.com/espressif/idf-installer/releases/download/espressif-ide-2.12.1-esp-idf-5.2/espressif-ide-setup-2.12.1-with-esp-idf-5.2.exe) |
| IEP 2.12.0 | Eclipse 2023-03, Eclipse 2023-06, Eclipse 2023-09 |Java 17 and above | [espressif-ide-setup-2.12.0-with-esp-idf-5.1.2](https://github.com/espressif/idf-installer/releases/download/espressif-ide-2.12.0-esp-idf-5.1.2/espressif-ide-setup-2.12.0-with-esp-idf-5.1.2.exe) |
| IEP 2.11.0 | Eclipse 2023-03, Eclipse 2023-06, Eclipse 2023-09 |Java 17 and above |[espressif-ide-setup-2.11.0-with-esp-idf-5.1.1.exe](https://github.com/espressif/idf-installer/releases/download/espressif-ide-2.11.0-esp-idf-5.1.1/espressif-ide-setup-2.11.0-with-esp-idf-5.1.1.exe) |
| IEP 2.10.0 | Eclipse 2022-09,2022-12,2023-03 |Java 17 and above | [espressif-ide-setup-2.10.0-with-esp-idf-5.0.1.exe](https://github.com/espressif/idf-installer/releases/download/untagged-52aeb689780472c126c1/espressif-ide-setup-2.10.0-with-esp-idf-5.0.1.exe)|
| IEP 2.9.1 | Eclipse 2022-09 and Eclipse 2022-12 |Java 17 and above | [espressif-ide-setup-2.9.0-with-esp-idf-5.0.1.exe](https://github.com/espressif/idf-installer/releases/download/espressif-ide-2.9.0-esp-idf-5.0.1/espressif-ide-setup-2.9.0-with-esp-idf-5.0.1.exe) | For Windows Users, it's recommended to use the Windows Offline Installer and upgrade to the latest IEP v2.9.1 plugin|
| IEP 2.9.0 | Eclipse 2022-09 |Java 17 and above | [espressif-ide-setup-2.9.0-with-esp-idf-5.0.1.exe](https://github.com/espressif/idf-installer/releases/download/espressif-ide-2.9.0-esp-idf-5.0.1/espressif-ide-setup-2.9.0-with-esp-idf-5.0.1.exe) | For Windows, it's recommended to use the Windows Offline Installer|
Expand Down
2 changes: 1 addition & 1 deletion bundles/com.espressif.idf.branding/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: com.espressif.idf.branding;singleton:=true
Bundle-Version: 2.12.0.qualifier
Bundle-Version: 2.13.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-11
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public interface IDFConstants

String ESP_CORE_DUMP_FOLDER = "espcoredump"; //$NON-NLS-1$

String ESP_CORE_DUMP_SCRIPT = "espcoredump.py";
String ESP_CORE_DUMP_SCRIPT = "espcoredump.py"; //$NON-NLS-1$

/**
* COMPONENT_FOLDER/esptool_py
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public class IDFCorePreferenceConstants
public static final boolean CMAKE_CCACHE_DEFAULT_STATUS = true;
public static final boolean AUTOMATE_BUILD_HINTS_DEFAULT_STATUS = true;
public static final boolean HIDE_ERRORS_IDF_COMPONENTS_DEFAULT_STATUS = true;
public static final String IDF_GITHUB_ASSETS = "IDF_GITHUB_ASSETS"; //$NON-NLS-1$
public static final String IDF_GITHUB_ASSETS_DEFAULT = "dl.espressif.com/github_assets"; //$NON-NLS-1$
public static final String PIP_EXTRA_INDEX_URL = "PIP_EXTRA_INDEX_URL"; //$NON-NLS-1$
public static final String PIP_EXTRA_INDEX_URL_DEFAULT = "https://dl.espressif.com/pypi"; //$NON-NLS-1$
/**
* Returns the node in the preference in the given context.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
*
* Contributors:
* QNX - Initial API and implementation
* kondal.kolipaka@espressif.com - ESP-IDF specific build configuration
Expand Down Expand Up @@ -140,10 +140,12 @@ public class IDFBuildConfiguration extends CBuildConfiguration
public boolean isProgressSet;
private QualifiedName TIMESTAMP_COMPILE_COMMANDS_PROPERTY = new QualifiedName(null,
"timestamp:compile_commands.json"); //$NON-NLS-1$
private ILaunchConfiguration configuration;

public IDFBuildConfiguration(IBuildConfiguration config, String name) throws CoreException
{
super(config, name);
this.configuration = LAUNCH_CONFIG_PROVIDER.getActiveLaunchConfiguration();
}

public IDFBuildConfiguration(IBuildConfiguration config, String name, IToolChain toolChain)
Expand All @@ -156,6 +158,14 @@ public IDFBuildConfiguration(IBuildConfiguration config, String name, IToolChain
{
super(config, name, toolChain, launchMode);
this.toolChainFile = toolChainFile;

Check warning on line 160 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

View workflow job for this annotation

GitHub Actions / spotbugs

EI_EXPOSE_REP2

new com.espressif.idf.core.build.IDFBuildConfiguration(IBuildConfiguration, String, IToolChain, ICMakeToolChainFile, String) may expose internal representation by storing an externally mutable object into IDFBuildConfiguration.toolChainFile
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
try
{
this.configuration = LAUNCH_CONFIG_PROVIDER.getActiveLaunchConfiguration();
}
catch (CoreException e)
{
Logger.log(e);
}
}

@Override
Expand Down Expand Up @@ -247,7 +257,6 @@ public String getProperty(String name)
{
try
{
ILaunchConfiguration configuration = LAUNCH_CONFIG_PROVIDER.getActiveLaunchConfiguration();
if (configuration != null
&& configuration.getType().getIdentifier().equals(IDFLaunchConstants.DEBUG_LAUNCH_CONFIG_TYPE))
{
Expand Down Expand Up @@ -639,7 +648,7 @@ private static String getIdfToolsPath()

/**
* Link build components(build_component_paths) from project_description.json to the project.
*
*
* @param project
* @throws Exception
*/
Expand Down Expand Up @@ -976,7 +985,7 @@ public void elementChanged(ElementChangedEvent event)
/**
* Processes the delta in order to detect whether one of the CMakeLists.txt files in the project has been modified
* and saved by the user since the last build.
*
*
* @return <code>true</code> to continue with delta processing, otherwise <code>false</code>
*/
private boolean processElementDelta(ICElementDelta delta)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.eclipse.core.resources.IFile;

import com.espressif.idf.core.IDFConstants;
import com.espressif.idf.core.util.StringUtil;

/**
* @author Kondal Kolipaka <kondal.kolipaka@espressif.com>
Expand All @@ -19,7 +20,9 @@ public class SDKConfigPropertyTester extends PropertyTester
@Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
{
if (receiver instanceof IFile && ((IFile) receiver).getName().equals(IDFConstants.SDKCONFIG_FILE_NAME))
boolean isIFile = receiver instanceof IFile;
String fileName = isIFile ? ((IFile) receiver).getName() : StringUtil.EMPTY;
if (fileName.startsWith(IDFConstants.SDKCONFIG_FILE_NAME))
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;

/**
Expand All @@ -17,33 +19,66 @@
public class ConfigServerManager
{
public static ConfigServerManager INSTANCE = new ConfigServerManager();
private Map<IProject, JsonConfigServer> jsonServermap = new HashMap<IProject, JsonConfigServer>();
private Map<ProjectFileMapKey, JsonConfigServer> jsonServermap = new HashMap<ProjectFileMapKey, JsonConfigServer>();

public void clearAll()
{
jsonServermap.clear();
}

public void deleteServer(IProject project)
public void deleteServer(IProject project, IFile file)
{
jsonServermap.remove(project);
ProjectFileMapKey projectFileMapKey = new ProjectFileMapKey(project, file);
jsonServermap.remove(projectFileMapKey);
}

/**
* @param project
* @return
* @throws IOException
*/
public synchronized JsonConfigServer getServer(IProject project) throws IOException
{
JsonConfigServer jsonConfigServer = jsonServermap.get(project);
public synchronized JsonConfigServer getServer(final IProject project, final IFile file) throws IOException
{
ProjectFileMapKey projectFileMapKey = new ProjectFileMapKey(project, file);

JsonConfigServer jsonConfigServer = jsonServermap.get(projectFileMapKey);
if (jsonConfigServer == null)
{
jsonConfigServer = new JsonConfigServer(project);
jsonServermap.put(project, jsonConfigServer);
jsonConfigServer = new JsonConfigServer(project, file);
jsonServermap.put(projectFileMapKey, jsonConfigServer);
jsonConfigServer.start();
return jsonConfigServer;
}

return jsonConfigServer;
}


private class ProjectFileMapKey
{
private IProject project;
private IFile file;

private ProjectFileMapKey(IProject project, IFile file)
{
this.file = file;
this.project = project;
}

@Override
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ProjectFileMapKey that = (ProjectFileMapKey) o;

return project.getName().equals(that.project.getName()) && file.getName().equals(that.file.getName());
}

@Override
public int hashCode()
{
return Objects.hash(project.getName(), file.getName());

Check warning on line 81 in bundles/com.espressif.idf.sdk.config.core/src/com/espressif/idf/sdk/config/core/server/ConfigServerManager.java

View workflow job for this annotation

GitHub Actions / spotbugs

SIC_INNER_SHOULD_BE_STATIC

Should com.espressif.idf.sdk.config.core.server.ConfigServerManager$ProjectFileMapKey be a _static_ inner class?
Raw output
This class is an inner class, but does not use its embedded reference to the object which created it.  This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary.  If possible, the class should be made static.
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
*******************************************************************************/
package com.espressif.idf.sdk.config.core.server;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
Expand All @@ -38,12 +41,15 @@ public class JsonConfigServer implements IMessagesHandlerNotifier
private IProject project;
private JsonConfigServerRunnable runnable;
private JsonConfigOutput configOutput;
private Process process;
private IFile file;

public JsonConfigServer(IProject project)
public JsonConfigServer(IProject project, IFile file)
{
this.project = project;

Check warning on line 49 in bundles/com.espressif.idf.sdk.config.core/src/com/espressif/idf/sdk/config/core/server/JsonConfigServer.java

View workflow job for this annotation

GitHub Actions / spotbugs

EI_EXPOSE_REP2

new com.espressif.idf.sdk.config.core.server.JsonConfigServer(IProject, IFile) may expose internal representation by storing an externally mutable object into JsonConfigServer.project
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
listeners = new ArrayList<IMessageHandlerListener>();
configOutput = new JsonConfigOutput();
this.file = file;

Check warning on line 52 in bundles/com.espressif.idf.sdk.config.core/src/com/espressif/idf/sdk/config/core/server/JsonConfigServer.java

View workflow job for this annotation

GitHub Actions / spotbugs

EI_EXPOSE_REP2

new com.espressif.idf.sdk.config.core.server.JsonConfigServer(IProject, IFile) may expose internal representation by storing an externally mutable object into JsonConfigServer.file
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
}

@Override
Expand Down Expand Up @@ -103,7 +109,7 @@ public void start() throws IOException
try
{
arguments = new ArrayList<String>(Arrays.asList(pythonPath, idfPythonScriptFile.getAbsolutePath(), "-B", //$NON-NLS-1$
IDFUtil.getBuildDir(project), IDFConstants.CONF_SERVER_CMD));
IDFUtil.getBuildDir(project), "-DSDKCONFIG=".concat(file.getName()), IDFConstants.CONF_SERVER_CMD)); //$NON-NLS-1$
}
catch (CoreException e)
{
Expand All @@ -118,6 +124,7 @@ public void start() throws IOException
}
Map<String, String> environment = processBuilder.environment();
environment.putAll(idfEnvMap);
environment.put("IDF_CCACHE_ENABLE", "false");

Logger.log(environment.toString());

Expand All @@ -134,11 +141,47 @@ public void start() throws IOException

// redirect error stream to input stream
processBuilder.redirectErrorStream(true);

Process process = processBuilder.start();
runnable = new JsonConfigServerRunnable(process, this);
String oldSdkconfigValue = StringUtil.EMPTY;
try
{
oldSdkconfigValue = getCmakeCacheSdkconfigValue();
}
catch (CoreException e)
{
Logger.log(e);
}
process = processBuilder.start();
runnable = new JsonConfigServerRunnable(process, this, project, oldSdkconfigValue);
Thread t = new Thread(runnable);
t.start();

}

private String getCmakeCacheSdkconfigValue() throws CoreException
{
File cmakeCacheFile = new File(IDFUtil.getBuildDir(project).concat("/CMakeCache.txt"));
if (cmakeCacheFile.exists())
{
try (BufferedReader reader = new BufferedReader(new FileReader(cmakeCacheFile)))

Check warning on line 165 in bundles/com.espressif.idf.sdk.config.core/src/com/espressif/idf/sdk/config/core/server/JsonConfigServer.java

View workflow job for this annotation

GitHub Actions / spotbugs

DM_DEFAULT_ENCODING

Found reliance on default encoding in com.espressif.idf.sdk.config.core.server.JsonConfigServer.getCmakeCacheSdkconfigValue(): new java.io.FileReader(File)
Raw output
Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behavior to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.
{
String line;
while ((line = reader.readLine()) != null)
{
// Check if the line starts with the specific prefix
if (line.startsWith("SDKCONFIG:UNINITIALIZED=")) //$NON-NLS-1$
{
// Replace the line
return line;
}
}
}
catch (IOException e)
{
Logger.log(e);
}
}

return StringUtil.EMPTY;
}

public IJsonConfigOutput getOutput(String response, boolean isUpdate)
Expand All @@ -165,4 +208,8 @@ public void addConsole(MessageConsoleStream console)
this.console = console;

Check warning on line 208 in bundles/com.espressif.idf.sdk.config.core/src/com/espressif/idf/sdk/config/core/server/JsonConfigServer.java

View workflow job for this annotation

GitHub Actions / spotbugs

EI_EXPOSE_REP2

com.espressif.idf.sdk.config.core.server.JsonConfigServer.addConsole(MessageConsoleStream) may expose internal representation by storing an externally mutable object into JsonConfigServer.console
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object.  If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
}

public boolean isAlive()
{
return runnable.isAlive(process);
}
}
Loading

0 comments on commit f064ef5

Please sign in to comment.