Again, I appreciate the amount of detail you put into the WIP already. I think
this might be a case where it would have been better to discuss the high level
concept here first but you did a good job describing the feature.
Overall, I’m against adding a macro language to the WiX toolset. I already try
to discourage use of the preprocessor. It seems like many of the language
benefits of macros can already be attained by creating an extension.
Admittedly, creating an extension takes a bit more work but you get a strongly
type, documented enhancement to the WiX toolset that can do very robust error
handling. I’d rather we tackle any issues with the extension model than create
a macro system in the preprocessor.
That said, you certainly could create a project to create the preprocessor
extension that implements this feature. If people flock to the concept then
we’d reconsider inclusion in the core toolset. This is similar to what happened
with Neil’s extended wixstdba. He added a couple features that people seemed to
find quite useful that were eventually integrated into the WiX toolset.
_______________________________________________________________
FireGiant | Dedicated support for the WiX toolset |
http://www.firegiant.com/
From: Tamir Daniely [mailto:tamirdani...@gmail.com]
Sent: Friday, April 25, 2014 8:41 PM
To: wix-devs@lists.sourceforge.net
Subject: [WiX-devs] RFC - issue #4375 - Preprocessor Enrichment - Parameterized
Macros
Hi,
I'm sorry for the delay in sending this, we all still have jobs :).
First off, the original issue on tinybugs:
http://wixtoolset.org/issues/4375/
Second, the draft WIP on my fork
https://github.com/Tetnacious/site/blob/master/root/src/documents/development/wips/4375-parameterized-macro-tags.html.md
For the general idea, please read the User Stories and Proposal sections of the
WIP.
Please discuss this idea.
* How much would you like to see this feature in WiX?
* Suggestions of better ways to achieve the same goals?
* Suggestions, remarks or requests regarding the syntax of the macros.
* Suggestions or remarks regarding implementation.
* Any other thoughts.
My thoughts on the implementation.
I originally proposed that it'd be written as a PreprocessorExtension. I have
one major problem with this approach and that is the early expansion.
Currently, preprocessor extensions can only access the full document after the
regular preprocessing. This is both counter-intuitive and limits the
functionality and reuse potential of the macro.
Consider for example that in my macro I want to get the TargetPath of a
referenced project just using the project name. I would write something like
`$(var.$(mac.ProjectName).TargetPath)` which will fail because of the early
expansion since the preprocessor is not aware of the variable and the extension
can't supply it because it is call specific.
So long story short, in my opinion macros should be expanded before standard
preprocessor commands, and so a new extension point is required on
IPreprocessorExtension and in Preprocessor. Something like PreprocessDocument
but before parsing the variables and conditionals. And that is the only
addition to WiX that the feature requires in my opinion.
Regarding Votive. It seems only natural that we give the user some
documentation syntax on the macro definition which will show up in the tooltips
and autocomplete, otherwise there will be a heavy overhead of constantly
checking the macro source when using it. Also, I think that a basic "Go-To"\F12
functionality will be nice and sort of expected. And on the same breath we
could add the go-to functionality to other places like XXXXXref tags and
include directives.
Regarding the Votive build. Obviously, if the whole thing is implemented as a
preprocessor extension, then there's no need for any change to the Votive build
process.
Best Regards,
Tamir Daniely
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
WiX-devs mailing list
WiX-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-devs