Keeping third-party source code up to date

iosopen sourcethird-party-librariesupgrade

What is the best way to keep third-party source code up to date?

For instance in my app, I'm using third-party source code from an open GitHub repository. What I've done is that I have downloaded the zip of the source code, unpacked it and imported it in my iOS app and then started modifying this source code to my hearts content.

So this third-party source code has been working great for me, but now some months later the developer of the third-party source code released an update to his code from 1.0 -> 2.0. Now of course I want to have this update as well in my iOS app. What would be the easiest way to migrate my 1.0 third-party source code (together with all my additions to the code) to 2.0?

Best Answer

While you are using any code repository from github there is possibility of you 'forking' it. By forking it means that you can make your version of the repository. Then if you make changes(e.g. bug fixes) then you can send the original creator a 'merge` request. If the original creator accepts your changes will also be made into his repository.

In case your changes aren't something that original creator would accept then you can maintain your app in modular form. Try not to change the original interface of the 3rd party lib. That should make it possible for an update to take place.

If that isn't possible either than you can use diff to find the difference between the 2 versions and then manually make the changes. You can also find the difference by 'cloning' the git repo on your computer. Then going through the commits you can figure out the difference. That would be a longer path. I'd suggest using diff to find the difference between the 2 versions.

As MichaelT has pointed out diff3 can be more suitable for such a comparison.