iarsystems / iar-vsc-build

Visual Studio Code extension for developing and building IAR projects
Mozilla Public License 2.0
38 stars 5 forks source link

Can't load project with multiple prebuild directives #61

Open mfruendtxylem opened 1 year ago

mfruendtxylem commented 1 year ago

Describe the bug: When I load a project with multiple prebuild directives like

<prebuild>python "$PROJ_DIR$\CommonCode\version_gen.py" chdr -o "$PROJ_DIR$\CommonCode\version.h" --dirty && $PROJ_DIR$\Tools\AStyle\astyle.bat</prebuild>

I get the following error

Could not parse project file 'Project.ewp': Error: Invalid character in entity name Line: 6577 Column: 124 Char: &

Loading the project in IAR works fine.

To Reproduce:

Have multiple prebuild directives, connected by && in the project.

Expected behavior:

The project should load, just like in IAR

Actual behavior:

Loading is aborted

Environment:

mfruendtxylem commented 1 year ago

After finally building with IAR I noticed IAR automatically replaced && with &amp;&amp; in the ewp file and after that it works again. So not sure if this is something that can be fixed on your side. Possibly the error could tell the user to replace && with &amp;&amp; or the auto conversion is also applied.

jlonnberg commented 10 months ago

Hi @mfruendtxylem, Did you manually add the pre-build to the ewp-file or did you add it using the Embedded Workbench. We typically discourage users from manually editing the ewp-file as we cannot guarantee that the file will be readable by the IDE and/or VsCode.

mfruendtxylem commented 10 months ago

I'm mostly sure it was through EW, but an older version at the time, though we also used https://github.com/IARSystems/project-migration-tools at the time which messed with the && too (I was told it's fixed now). So it mostly confused me that the IAR compiler did automatic correction while the VSC extension did not.

jlonnberg commented 10 months ago

So, we do some minor parsing that differs between the Embedded Workbench and VsCode which will be removed in the next release. So most likely, this will be fixed in the next release!