Skip to content
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

add custom build folder by conf setting #668

Merged
merged 3 commits into from
Mar 17, 2022

Conversation

brianignacio5
Copy link
Collaborator

Add idf.buildDirectoryName to specify a custom build folder for the extension commands. By default is build

@brianignacio5 brianignacio5 added the Feature A new feature label Mar 14, 2022
@brianignacio5 brianignacio5 merged commit 59a9937 into master Mar 17, 2022
@brianignacio5 brianignacio5 deleted the feature/custom-build-dir branch March 17, 2022 09:31
@project-x51
Copy link

So using this feature I could make the code build to a RAM disk?

@project-x51
Copy link

I was able to make it build to a different folder, but not to another drive. On Windows 11.
NOTE: I have built to a RAM disk before using the idf.py command but not from VSCode. The build to the RAM disk was about 3 x as fast.

@brianignacio5
Copy link
Collaborator Author

This build folder is still relative to the location of the project directory. Resulting build directory is ${workspaceFolder}/${idf.buildDirectoryName}. We could modify it to specify a full build path if this is your intended purpose here.

@project-x51
Copy link

Yeah, that would be awesome. Building to a RAM disk is faster and it doesn't wear my SSD writing files I don't need to keep.

@project-x51
Copy link

The absolute coolest would be if I could specify the build directory anywhere and then copy the distribution files to a different folder after the build. This way I could build to a RAM disk and keep the .bin and .elf files under the project in a dist folder.

@brianignacio5
Copy link
Collaborator Author

Could you try this vsix installer ?

how to Install extension from vsix

@project-x51
Copy link

Sorry, I just got a break in things to try this.

It doesn't appear to work and always builds to the workspace build folder no matter what I put in the setting. The vsix installer says it installed the extension. It still has 1.5.0 as the version so ??

{ "idf.adapterTargetName": "esp32s3", "idf.portWin": "COM4", "idf.flashType": "UART", "files.associations": { "semphr.h": "c" }, "idf.openOcdConfigs": [ "board/esp32s3-bridge.cfg" ], "idf.buildDirectoryName": "build 1" }

or

{ "idf.adapterTargetName": "esp32s3", "idf.portWin": "COM4", "idf.flashType": "UART", "files.associations": { "semphr.h": "c" }, "idf.openOcdConfigs": [ "board/esp32s3-bridge.cfg" ], "idf.buildDirectoryName": "c:/temp/build 1" }

Both build into the 'Build' folder, even if I make the 'build 1' folder manually.

@brianignacio5
Copy link
Collaborator Author

You still can't use spaces in the build path unfortunately... Did you tried without spaces ?

@project-x51
Copy link

Nope. Still defaulting to build no matter what I use as the idf.buildDirectoryName ('build_test', 'build1'). I'm guessing I must be using the new extension as it wont build to alternative folders anymore.

@brianignacio5
Copy link
Collaborator Author

Maybe there is a project settings.json idf.buildDirectoryName value that is overriding the setting as specified in multiple projects ?

@project-x51
Copy link

I don't think so I can't build to anywhere else even with only the Hello_World example project open in VSCode

@brianignacio5
Copy link
Collaborator Author

This MR is just to change the name of the build folder within your current project.

Let's say C:\temp\hello_world\build when idf.buildDirectoryName is default and C:\temp\hello_world\custom_build when idf.buildDirectoryName is custom_build.

The MR with the custom absolute build path is here

@project-x51
Copy link

I defiantly have the change in this MR. If I type "idf.buildDir... " then it autocompletes with "idf.buildDirectoryName": "${workspaceFolder}/build". This change was made in your comit.

@project-x51
Copy link

There are a lot of changes in the commit. I'm not up to speed on everything in there but I notice you have two names for the build directory. I'm guessing there is an inconsistency related to that.

example the change in src/coverage/coverageService.ts. The build path is removed in the join statement but the parameter below remains the same (buildDirName). Elsewhere such as in src/build/buildCmd.ts the idf.buildDirectoryName is mapped to the variable buildDirPath

@project-x51
Copy link

I'll post in the MR and continue our conversation there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants