Force linked files to be included in the zip file uploaded to Icenium servers for build

4 posts, 1 answers
  1. Support
    Support avatar
    8 posts
    Member since:
    Jun 2013

    Posted 29 Oct 2013 Link to this post

    Hello,

    I've 2 Icenium projects loaded in my Visual Studio solution with linked files between the projects. It's running fine in the simulator (with a small modification at the end of the iceproj file), as follow:

    <Import Project="$(IceniumTargets)Build.targets" />
    <Target Name="CopyLinkedFiles" BeforeTargets="Build">
      <ItemGroup>
        <LinkedItem Include="@(Content)" Condition="%(Content.Link) != ''" />
      </ItemGroup>
      <Copy SourceFiles="@(LinkedItem)" DestinationFiles="%(LinkedItem.Link)" />
    </Target>


    But when I build the project in cloud, the linked files are not included in the zip file that is uploaded to the Icenium servers. The ZIP file I'm speaking about is in the "%project_folder%/obj/Debug" folder.

    How can I force Visual Studio to include these linked files in the package before it is uploaded to Icenium servers? Would it be possible to use the build or post-build events? My preferred option would be a modification of the .iceproj file, 

    Thanks for your help.
    Bastien
  2. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 29 Oct 2013 Link to this post

    Hello Bastien,

    Currently the Icenium extension for Visual Studio doesn't support linked files. As you correctly noticed you can overcome this limitation with some custom MSbuild code. What you also need to do is to change the linked Content items to point to the project folder instead of their original location like this:
    <Target Name="BeforeBuild">
      <ItemGroup>
        <LinkedItem Include="@(Content)" Condition="%(Content.Link) != ''" />
        <Content Remove="@(Content)" Condition="%(Content.Link) != ''" />
      </ItemGroup>
       
      <Copy SourceFiles="@(LinkedItem)" DestinationFiles="%(LinkedItem.Link)" />
      <ItemGroup>
        <Content Include="%(LinkedItem.Link)" />
      </ItemGroup>
    </Target>

    Please notice that this work-around may not work in some edge cases.

    If you have further questions don't hesitate to ask.

    All the best,
    Miroslav Nedyalkov
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  3. Joe
    Joe avatar
    16 posts
    Member since:
    Jan 2013

    Posted 24 Jan 2014 Link to this post

    This works great when building the solution to copy the files over before the build. The Visual Studio context menu "Copy as Link" from one Icenium project and "Paste Link" to another does not work, however; the file is copied to the destination project folder instead of a link. It would be very convenient if this worked. The only way I have found to create links in the second Icenium project is create the destination folder, right click on it > add > existing item, navigate to source project directory, select all files to link, then click the file explorer Add button dropdown and select "Add As Link".

    Is there an easier way or are there plans to implement solution "Copy As Link" and "Paste Link" context menu functionality?

    http://joemeeks.net/Files/Images/ExistingItem.png
    http://joemeeks.net/Files/Images/AddAsLink.png
  4. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 29 Jan 2014 Link to this post

    Hello Joe,

    Thank you for contacting us.

    At this stage, there isn't an easier way for doing this. However, please submit this as a feature request in our Ideas and Feedback portal and we will be happy to consider it for future releases.

    Regards,
    Kaloyan
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top