Proper dependency management in a Xamarin project

I am currently trying to improve dependency management in our project. We have a typical Xamarin project for Android / iOS and use Xamarin-Studio as an IDE. For common code, we use one PCL and two common projects (introduced with Xamarin 3).

So far, we just had a folder with DLLs for processing third-party libraries ... due to the wrong path. Now we will try to make some efforts to improve this problem.

For me, there is one big question: Xamarin.Components or NuGet? . Where is the difference between these approaches? And what do you use for what type of dependency?

From my point of view, NuGet is the right way to handle dependencies ... A simple definition file for dependencies, automatic updating, handling transitive dependencies, I only need to check one file, and NuGet automatically downloads all the necessary files, and so on ... C on the other hand, it seems that Xamarin.Components is more mature in the xamarin world ... I find not only libraries like json.net and sqlite.NET, but also interface components, for example, for example. ZXing.Net or BTProgressHUD ...

It would be very helpful to know how you handle dependencies in your cross-platform projects!

+1
source share
1 answer

Use both options. You will not be able to find many things in Nuget in the Xamarin Components store and vice versa.

Xamarin components are restored, and you can configure it on your build server to run xpkg.exe restore in your solution so that you can have CI.

It should be noted that right now, Xamarin components cannot depend on other Xamari components, which is why NuGet is better here. Xamarin also has a loooooooooooong process for accepting new and updating existing components, which may make NuGets more preferred since you can release newer versions faster.

Therefore, as a rule, my opinion is to keep most of the dependencies like NuGets due to the limitations of the Xamarin components.

+2
source

All Articles