General XMetaL Discussion
asaremba August 17, 2009 at 3:17 pm
How to share macro code between projects?August 17, 2009 at 3:17 pmParticipants 1Replies 2Last Activity 13 years, 3 months ago
The same question applies to the other components of an XM customization, i.e. CTM and CSS files.Derek Read August 18, 2009 at 5:49 pm
Reply to: How to share macro code between projects?August 18, 2009 at 5:49 pm
When you add an existing file to a project you should have the option to “reference” it or copy it to the project.asaremba August 23, 2009 at 8:26 am
Reply to: How to share macro code between projects?August 23, 2009 at 8:26 am
Thank you for your helpful answer. In fact I had overlooked that in the “Add existing item…” dialog box the “Add” button gives you the choice of referencing an item instead of copying it. (You may admit that this is not quite obvious, so it would make sense to document this fact.)
Some points, however, have to be added:
- While it is possible to add a single (isolated) script file by reference, the same is not possible for a macro script (i.e. one that is to be integrated in the MCR file). This looks to me like an oversight.
- Fortunately, there is a workaround: If you edit the XDP file manually, changing the name of a script file to a fully qualified path name and changing ProjRelPath from T to F (this is what the “Add as link” button does in the case of non-macro script files), everything works like it should.
(By the way, it is not very robust that shared files can only be referenced by absolute path names because it makes it impossible to checkout a project to an arbitrary location from the source code repository. I don't know whether this is a limitation of MS Visual Studio or of XmetaL Developer.)
- You must be logged in to reply to this topic.