Sharing Code Options + Project Linker

The one thing that bothers me the most about developing for multiple platforms is how much of a pain it is to have to manually add files to each project as described in the following documentation.

Xamarin's Sharing Code Options

Every single code sharing option described says

"Whenever a new file is added, or existing files are moved or deleted, the linked projects must be manually kept synchronized."

I can't possibly be the only person that finds this a ridiculous process. I mean, that's why we have computers, to do things like this for us. So I propose we come up with some way to make our lives a little easier. Here are a couple of options I can think of:

  1. Add native support to Xamarin Studio for "folder" sharing such that when a folder is shared and new files are added to it all the projects are updated automatically.

  2. Create an add-in for Xamarin Studio similar to Microsoft's Project Linker

  3. I've heard that there is a simple hack you can do in Visual Studio to the project files that will get the desired behaviour, like so:

  
    <Compile Include="..\[base project PATH]\*\*.cs">
      <Link>%(RecursiveDir)%(FileName)</Link>
    </Compile>
  

I tried this hack in Xamarin Studio tonight and it didn't work. I can't say I'm surprised, but perhaps it's the easiest to implement.

This feature would mean a lot to me and I would be willing to implement it if there is no other option. What do you think?

Posts

  • LluisSanchezLluisSanchez ESXamarin Team Xamurai

    Option #3 will be supported in Xamarin Studio 4.0.9, to some extent (the trick won't work, but the wildcard include will)

  • Excellent to hear. I'm interested to know to what extent you mean? Is it going to be supported in the user interface somehow? In any case, I'm glad to hear it's coming and looking forward to using it.

    Thank you.

  • jacobandersonjacobanderson USMember

    It's June 2014 and the very-useful path variable expansions do not work. The globber in Xamarin Studio can pickup the **/* glob rule, but you get that for free with simple globbing libraries. When are we going to see the variable expansions supported in projects? otherwise, Xamarin Studio isn't really compatible with VS project files.

  • mhutchmhutch USMember, Xamarin Team Xamurai

    We would like to improve MSBuild support in XS but we do not have a timeline for it.

  • JohnCakesJohnCakes AUMember

    So how do I manually synchronise new files I have added to the shared source code section? I could not find any information on how to do that?

  • JohnCakesJohnCakes AUMember

    Ok, found out how to do it, though I could not find it in the documentation anywhere. Seems this was taken out of the shared code section, despite the fact it is still needed.

    You right click on the folder you want the file to appear, click add new file, find the file in the folder structure, and then click link on the final screen.

    This is way more complicated than it should be. And not intuitive at all (hiding link on the last screen is great!)

Sign In or Register to comment.