JetBrains / resharper-unity

Unity support for both ReSharper and Rider
Apache License 2.0
1.21k stars 134 forks source link

Shared External Annotation file #28

Closed bigbadtrumpet closed 8 years ago

bigbadtrumpet commented 8 years ago

Right now in order to share an ExternalAnnotation.xml file across my team we have to add the Library/UnityAssemblies/UnityEngine.ExternalAnnotations.xml file to version control. Is there any way we can add an external annotation file to this without having to add my Library folder to the repo?

citizenmatt commented 8 years ago

Do you mean add it to the extension? That would be awesome! You can fork the project and send a PR, or just send me a copy of the file, and I'll include it into the extension.

ghost commented 8 years ago

Im in the process of doing this but i can't figure out how to build the NuGet package locally to install it and test that the changes worked. Any advice on how to do that? I've run nuget pack resharper-unity.nuspec and i got an error about version name being empty, so i edited the file and added that and i still cant get resharper to recognize the nupkg that gets created.

citizenmatt commented 8 years ago

Cool! You can build the package with:

nuget pack resharper-unity.csproj

It will take the last built output from Debug and build the package. You can also pass -Build to make sure the project is up to date before packaging. It will use the version number of the assembly, set in AssemblyInfo.cs. If you want to package the release build, you can use this:

nuget pack resharper-unity.csproj -Properties Configuration=Release

You'll probably need to add the external annotations file to the nuspec file, in order to get it installed (see the last paragraph on this page). I'm not sure if adding the one file to the nuspec means you'll need to also add the .dll explicitly, too.

And if you've already got the plugin installed, you can just recompile and drop the changed binary into the ReSharper install folder (e.g. %LOCALAPPDATA%\JetBrains\installations\ReSharperPlatformVs12 (or ReSharperPlatformVs14 for VS2015). It needs to have exactly the same version number, though (e.g. 1.2.1.0)

You can also manually copy the external annotations to a subfolder there, too - Extensions\JetBrains.Unity\annotations\{assemblyName}.dll (swap {assemblyName} for the name(s) of the unity .dlls).

bigbadtrumpet commented 8 years ago

Awesome! Thanks so much for the quick reply!

bigbadtrumpet commented 8 years ago

I think i got it to work! Just submitted the pull request First time ever committing to an open source project so let me know if there is anything I need to change :)

citizenmatt commented 8 years ago

Very cool! Congrats on your first pull request! 😄 👍 🎉

I'll get it merged on Monday, and push with these changes (and some of the other outstanding PRs and issues) very soon.

Cheers!