espressif / idf-eclipse-plugin

Espressif-IDE (based on Eclipse CDT) for ESP-IDF CMake based projects 4.x and above
Eclipse Public License 2.0
302 stars 121 forks source link

IEP-1146: fix for building to default folder when flashing with custom build folder defined #881

Closed alirana01 closed 8 months ago

alirana01 commented 8 months ago

Description

Introduced a dynamic variable for the flash arguments to handle the custom build folder when flashing, previously the user had to explicitly define the custom build folder on two places one in the main build config and other in the flash arguments. Now only defining the build folder in the build args is required.

Fixes # (IEP-1146)

Type of change

Please delete options that are not relevant.

How has this been tested?

Build project with custom build folder and flash the project should not build again and the custom build folder must be used for the flashing as well.

Also try to test building with default and then defining a custom build folder and deleting the old default folder.

Test Configuration:

Checklist

Summary by CodeRabbit

coderabbitai[bot] commented 8 months ago

[!WARNING]

Rate Limit Exceeded

@alirana01 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 26 minutes and 21 seconds before requesting another review.

How to resolve this issue? After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.
How do rate limits work? CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.
Commits Files that changed from the base of the PR and between 760337b63211e558b291550678ed552466a54077 and 92feacae956053cccc44f743777997e8400f9589.

Walkthrough

The changes encompass the expansion of Espressif IDF's Eclipse plugin with a new dynamic variable, BUILD_DIR, enabling dynamic specification of the build directory. This includes updates to the flashing utilities' command construction and the introduction of a resolver class for the build folder. Additionally, there are adjustments to Eclipse formatter preferences to ensure consistent code styling within the development environment.

Changes

File Path Change Summary
.../IDFDynamicVariables.java Added BUILD_DIR constant to the enum for dynamic variables.
.../IDFUtil.java Introduced getProjectFromActiveLaunchConfig() method for retrieving the project from the active launch configuration.
.../ESPFlashUtil.java Modified getParseableEspFlashCommand method to include the new command -B followed by the build directory variable.
.../.settings/org.eclipse.jdt.core.prefs Adjusted Eclipse JDT Core formatting settings for alignment, spacing, and line wrapping.
.../.settings/org.eclipse.jdt.ui.prefs Updated formatter profile from "_CDT" to "_Espressif_eclipse" and incremented the formatter settings version.
.../OSGI-INF/l10n/bundle.properties Added BUILD_DIR_VAR with its description to the bundle.properties file.
.../BuildFolderVariableResolver.java Introduced BuildFolderVariableResolver class to resolve the build folder path and handle flash arguments.

πŸ‡βœ¨ "In the burrow of the code, a new path has been bestowed, With a hop and a flash, the build dir's not guessed, Now dynamic and swift, the plugins are dressed, A carrot for each line, perfectly pressed." πŸ₯•πŸŽ‰

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

Tips ### Chat There are 3 ways to chat with CodeRabbit: - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit-tests for this file.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit tests for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository from git and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit tests.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json` ### CodeRabbit Discord Community Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback.
AndriiFilippov commented 8 months ago

@alirana01 hi !

Tested: OS - Windows 10 ESP-IDF: v5.1.2

1) Create new project -> Add custom build folder -> flash project -> do not see re-build πŸ‘ 2) Add multiple launch configurations to the project, one with the custom build folder and one without. Build flash them in different combinations and make sure that we are flashing appropriate binaries πŸ‘

LGTM πŸ‘