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

EWPtool.exe returns before it is actually done #52

Open
NotKasperNielsen opened this issue Feb 10, 2025 · 3 comments
Open

EWPtool.exe returns before it is actually done #52

NotKasperNielsen opened this issue Feb 10, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@NotKasperNielsen
Copy link

I have a project with 4 configurations. Two MCU cores with each their own program, in both DEBUG and RELEASE.

When I add new files to my project I want EWPtool to scan the existing folders, to add new source and header files to the Embedded Workbench Project.

While the source (.c) files are added to all configurations, the include paths are only updated for the currently active configuration.
That means I have to tediously switch through my configurations (with associated project-reload and wait) and select "re-scan ..." and wait for the project to reload again.
To remove the hassle of this, I wanted to setup a PowerShell script that calls EWPtool.exe once for each configuration. Like so:

path\to\EWPtool.exe -p $pwd -n My-Application -c CoreM4-Debug -i false -l true
path\to\EWPtool.exe -p $pwd -n My-Application -c CoreM7-Debug -i false -l true
path\to\EWPtool.exe -p $pwd -n My-Application -c CoreM4-Release -i false -l true
path\to\EWPtool.exe -p $pwd -n My-Application -c CoreM7-Release -i false -l true

My problem:
When I call EWPTool.exe it returns almost immediately, but I can see that it takes "a lot longer" before the actual file operations are done.
So I get 4 quick calls, but only one configuration is actually updated.

Is there a way for EWPtool to not return until it's done? Alternatively, is there a way to "know" when the actual project update has finished.

// Thanks
// Kasper

@ghost ghost self-assigned this Feb 10, 2025
@ghost ghost added the enhancement New feature or request label Feb 10, 2025
@ghost
Copy link

ghost commented Feb 10, 2025

Hi Kasper,

Thanks for reporting this. It is indeed a good suggestion for ewptool: offer a way to propagate options across multiple build configurations. I will start working on that as a new feature though this might take a little while.

For now, please consider the following workaround, if it suits your script:

[String[]]$configs = "CoreM4-Debug", "CoreM4-Release", "CoreM7-Debug", "CoreM7-Release"
foreach ($config in $configs) {
  invoke-expression "path\to\ewptool.exe -p $pwd -n My-Application -c $config -i false -l true"
  Start-Sleep -Seconds 1
}

@ghost
Copy link

ghost commented Feb 10, 2025

A slightly improved version of the previous PowerShell snippet, which does not hardcode a delay between the processes. It also uses introspection for retrieving the actual project's build configuration XML tags:

$ewp_configs = ([xml](Get-Content -Path "My-Application.ewp")).Project.Configuration.Name
foreach ($config in $ewp_configs) {
  Start-Process -FilePath "path\to\ewptool.exe" -ArgumentList "-p $pwd -n My-Application -c $config -i false -l true" -Wait
}

@NotKasperNielsen
Copy link
Author

Hi Felipe,
Your first suggestion had some weird effects. but the last one worded like a charm.

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant