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

Ampersand post-processing in post-build action #41

Closed
ghost opened this issue Nov 21, 2023 · 2 comments · Fixed by #43
Closed

Ampersand post-processing in post-build action #41

ghost opened this issue Nov 21, 2023 · 2 comments · Fixed by #43
Labels
enhancement New feature or request
Milestone

Comments

@ghost
Copy link

ghost commented Nov 21, 2023

Description

There is an advanced use case in which a post-build action comes with a couple of cascaded scripts executed in succession, in case the first one is successfully executed (a && b, or "execute b if a was successful"). Here is an example:

$PROJ_DIR$/script1.bat && $PROJ_DIR$/script2.bat

The ampersand (&) is a special character in the XML specification. The IDE escapes it so that the <postbuild> tag becomes:

<postbuild>$PROJ_DIR$/script1.bat &amp;&amp; $PROJ_DIR$/script2.bat</postbuild>

When EWPtool post-process the project file containing such entry, the tag becomes:

<postbuild>$PROJ_DIR$/script1.bat &amp;amp;&amp;amp; $PROJ_DIR$/script2.bat</postbuild>

If EWPtool processes the project once more:

<postbuild>$PROJ_DIR$/script1.bat &amp;amp;amp;&amp;amp;amp; $PROJ_DIR$/script2.bat</postbuild>

...and so on. These entries in excess make the project fail to build.

Workaround

No automated workaround known to the date. Manual XML intervention required.

Resolution

EWPtool was initially designed with the sole purpose of populating an empty project and such advanced use case was not predicted from the start, as it involves exceptional handling for XML special characters. Hence, this special use case will be addressed in the next version.

@ghost ghost added the enhancement New feature or request label Nov 21, 2023
@ghost ghost added this to the 4.2.4 milestone Nov 21, 2023
@ghost ghost self-assigned this Nov 21, 2023
@NotKasperNielsen
Copy link

Hi @felipe-iar

I ran into this issue as well, after switching to EWARM 9.40.2. The migration of the .ewp introduced the && to the .postbuild
I hadn't gotten around to reporting it, and now you've saved me the effort.
The workaround is manageable for now. Thanks for taking up the issue.

// Kasper

@ghost
Copy link
Author

ghost commented Nov 23, 2023

Hi @NotKasperNielsen and thanks for your feedback. Right now, fixing this one is amongst my top priority items. Please hold on as 4.2.4 will also cover #42.

@ghost ghost mentioned this issue Nov 23, 2023
@ghost ghost closed this as completed in #43 Nov 23, 2023
This issue was closed.
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

Successfully merging a pull request may close this issue.

1 participant