I'm looking at configuring SwiftyJSON. The docs state you can configure the library using any of these methods:
CocoaPods
Carthage
Swift Package Manager
Manual
What are the pros and cons of these approaches when configuring external libraries?
Here is some points about each of them
1. CocoaPods
Pros
Most widely used dependency manager.
Almost every popular libraries, framework vendors provide pod for their library/framework.
You can try the library and its usage without manually downloading it manually. pod try command
Cons
You should manage your project with a workspace.
If any vendor is not adding or updating their library's pod spec, it will be difficult to maintain.
2. Carthage
Pros
No need to keep the project in a workspace.
It's not a centralized system, that is no need to wait for the vendor to update/add the library to any centralized repo.
Cons
Need to add your frameworks to project for the first time.
3. Swift Package Manager
Pros
Product from creators/maintainers of swift itself.
No extra workspace created.
Super easy to integrate.
Cons
Not very popular.
Still, need to be adopted by the developer community.
4. Manual
Pros
You have full control.
You can edit(if the license allows to..).
Cons
Need manual work to add dependencies.
Difficult to update libraries.
Not sure whether we can add Objective-C libs to project using Swift Package Manager.
I would suggest using CocoaPods because its very simple to use and will get enough help and resources from the internet.
In WWDC 2019, Apple introduced Xcode 11 with the built-in feature to use SPM. So it would be easy to use SPM as Cocoapods.
Related
I have a iOS framework for which I don't have the source and the authors have not provided a podspec for it. I'm already using CocoaPods for multiple other libs and would love to keep this one along with them.
Is it possible to create a podspec file that will simply reuse the existing framework binary?
I have:
xxx.embeddedframework/
xxx.framework
Resources/
yyyy.momd
I know all the details like what system frameworks it depends on.
I suspect vendored_frameworks may be an answer, but I'm not sure how to write one. For example, s.source is mandatory parameter and I don't have any source files so pod spec lint fails.
I want to develop Chat Application on Xamarin Cross Platform using Firebase Cloud Messaging. But Xamarin.Forms 2.3.3.180 has dependency to Xamarin.Android.Support.v4 23.3.0 and Xamarin.GooglePlayServices.Basement 32.961 has a dependency to Xamarin.Android.Support.v4 24.2.1.
How can this be resolved?
Or
Is there another way to do it?
This can be resolved in a couple of ways
Use a version of Firebase that has the same Android Support dependency
Go to Xamarin.Forms github, check out the repository and upgrade this dependency. Then build your own version or make a Pull Request and wait for it to be released
Don't use Firebase directly in your App, but use your own backend, which in turn talks to Firebase.
Wait for the Xamarin.Forms team to fix this dependency
Which one you pick is entirely up to you. It is your task to weigh the pros and cons about these approaches. Some take more time than others.
I personally think, either 1. or 2. might be your best options. Xamarin.Forms is open source and you can do whatever you want with the source. Including upgrading dependencies etc. Of course Pull Requests for the project are welcome and I encourage you to make one if you have a fix that benefits all others. Make sure to talk to the Xamarin.Forms team before you start a big task, so you don't waste your time doing something that they don't want or is not on the roadmap.
The options from Cheesebaron are a good summary. I'm assuming you're using Xamarin.Firebase.Messaging.
If you want to go with option #1, the Xamarin.Firebase.Messaging component version 32.940.0-beta3 is the most recent one whose dependencies still allow the various Xamarin.Android.Support 23.3.0 libraries that Xamarin.Forms needs. In order to see the 32.940.0-beta3 version, you'll have to enable "Prerelease" versions.
While it is marked as a beta release, it has worked for me, and hopefully Forms will allow upgrading the Android support libraries soon...
What would be the best practice to have custom code (library of functions) in a project using userfrosting?
As of now, I modify existing userfrosting controllers, which bloats the nice concise code.
I guess there is a nice way to keep custom functions in a place, which will not interfere with Userfrosting's code and thereby not be affected much during userfrosting upgrades.
At the moment, i'd like to have some custom functions for notifications, barcode etc.
Guess using a vendor folder under composer would be ideal? If so, how to go about it?
Does userfrosting have any extensibility like symfony?
Any help / pointer is appreciated!
Thanks!
As of version 0.3.1, there is no clean way to separate the core shipped code from developer-implemented code. For minor updates within a version (so, hotfixes to 0.3.1), the best way to keep up-to-date is by using git to make your project a fork of the UserFrosting repository.
So for example, you might have spurgeon/brood-crm (your project repo) as a fork of userfrosting/UserFrosting. You can then set userfrosting/UserFrosting as an upstream remote for your repo. Whenever a hotfix is released for userfrosting/UserFrosting, you can sync your fork with the upstream. This will pull changes to the main repo into your project, and give you a chance to resolve any merge conflicts (hopefully, there won't be any).
For people who are not familiar with the distinction between git and GitHub, I should point out that you can do all of this locally, without publishing your fork on GitHub.
UserFrosting 4 will (finally) have a modular, fully extendable design. Rather than having to directly modify the shipped code, you will be able to override the core routes, templates, schema, assets, etc in a separate directory. Upgrading from version 0.3.x to version 4, however, will probably need to be done manually.
I've read a whole bunch of articles and SO questions on importing 3rd party go packages which all seems straight forward, but what I don't understand is that none that I have read make any references to versioning. In Dartlang there's the pubspec file that defines your package including its version and its dependencies including their required versions. What if I do a go get github.com/gorilla/sessions and write my app then 6 months later I have to clear my directories and re get everything again, in which time that package has been update and broken backwards compatibility with my code that was using the older version?
The official version, from the GO FAQ:
If you're using an externally supplied package and worry that it might change in unexpected ways, the simplest solution is to copy it to your local repository. (This is the approach Google takes internally.) Store the copy under a new import path that identifies it as a local copy.
There are many alternative to that approach, mainly based on declaring the exact version of those projects you are using.
See for instance "Dead Simple Dependencies in Go -- Keep it simple and keep your sanity." (based on emil2k/vend)
The main different options for Go Dependency Management are listed at:
"Go Package Management -- A summary of dependency management in Go"
(And its associate GOPM mailing list)
Update July 2015:
the official vendoring approach from Go team is discussed here.
an alternative go build tool called "gb" is proposed at getgb.io by Dave Cheney.
Update Q4 2017: as mentioned below, go dep is the official tool for pinning version of dependencies (even though that pinning approach is not without criticism: see "The cargo cult of versioning").
It should be merged into the toolchain when Go 1.10 development begins, according to its roadmap.
Update Q2 2018: go dep has been replaced by go mod (modules) in Go 1.11, following works on vgo.
I use dep as a dependency management tool for golang project. Please use the following link dep tool for more info.
dep is a dependency management tool for Go. It requires Go 1.9 or newer to compile.
dep was the "official experiment." The Go toolchain, as of 1.11, has (experimentally) adopted an approach that sharply diverges from dep. As a result, we are continuing development of dep, but gearing work primarily towards the development of an alternative prototype for versioning behavior in the toolchain.
Current status: January 2019
dep is safe for production use.
I know Package Manager like NuGet help us when we want to use third party components.
From Nuget Codeplex Page:
NuGet is a free, open source developer focused package management
system for the .NET platform intent on simplifying the process of
incorporating third party libraries into a .NET application during
development.
There are a large number of useful 3rd party open source libraries out
there for the .NET platform, but for those not familiar with the OSS
ecosystem, it can be a pain to pull these libraries into a project.
Let’s take ELMAH as an example. It’s a fine error logging utility
which has no dependencies on other libraries, but is still a challenge
to integrate into a project. These are the steps it takes:
Find ELMAH
Download the correct zip package.
“Unblock” the package.
Verify its hash against the one provided by the hosting environment.
Unzip the package contents into a specific location in the solution.
Add an assembly reference to the assembly.
Update web.config with the correct settings which a developer needs to search for.
And this is for a library that has no dependencies. Imagine doing this
for NHibernate.Linq which has multiple dependencies each needing
similar steps. We can do much better!
NuGet automates all these common and tedious tasks for a package as
well as its dependencies. It removes nearly all of the challenges of
incorporating a third party open source library into a project’s
source tree
these steps are simple tasks that we do when we want to setup a project. its only for automation of adding 3rd party components and decrees chance of Error in configuration files? or it has much more responsibilities !?
It's value is hidden in the open: a package manager such as NuGet helps you dealing with software dependencies using automation. Many make the assumption that it's only meant for open source or third party components, but you could equally as well use it for your own internal packages.
The great thing about NuGet is (to name a few benefits):
NuGet encourages reuse of components because you implicitly rely on actual "releases" (even if pre-release), instead of branching sources
you can get rid of binaries bloating your VCS repositories (package restore feature)
it forces package creators to think about the way the package will be consumed and leaves them dealing with configuration of the component during package installation (who knows best how to configure the package than the package creators?). Think about ELMAH as an example.
automating package creation and publication on a package repository effectively is a form of continuous delivery (for software components). OctopusDeploy even takes it a step further and enables packaging entire Web sites ready for deployment.
NuGet encourages and sometimes enforces you to follow some ALM best practices. E.g. a package has a version, so you have to think about your versioning strategy (e.g. SemVer.org)
NuGet integrates with SymbolSource.org (which also has a Community edition to set up your own): this allows one to easily debug released packages without having to ship this info all the time
having one or more package repositories makes it easy for the organization to maintain a dependency matrix, or even build an inventory of OSS licenses that are in use by several projects
NuGet notifies you about available package updates
Creating packages makes people think about component architecture (all dependencies should be packaged as well)
Dependencies of a package are automatically resolved (so you can't forget any)
NuGet is smart enough to add assembly binding redirects when required
The above list is non-exhaustive, but I hope I covered the key benefits in this answer. I'm sure there are more.
Cheers,
Xavier
Reason to use NuGet is you don't have to ship all the libraries in your project, reducing the project size. With NuGet Power Tools, by specifying the package versions in the Packages.config file, you will be able to download all the required libraries the first time you run the project.
Live Exapmle : Reduced project size matters while deployment of project.Like if solution
have 500Mb of code and 200Mb of packages size then extra 200mb really
cost to upload project each time.Instead of uploading concrete
dll files we need to just set their reference in packages.config file.