Integrate a build phase that checks if Manifest.lock is in sync #946

Merged
merged 2 commits into from Apr 8, 2013

Projects

None yet

3 participants

@stigi
stigi commented Apr 7, 2013

As discussed on the mailing list.

This adds a build phase to the Applications target that checks if Pods/Manifest.lock is in sync with Podfile.lock. This helps to inform developers of updating their Pods when the Pods directory is not tracked by version control.

@stigi
stigi commented Apr 7, 2013

Started this PR of the 0.17.2 tag since master specs would fail all over me.

@fabiopelosin fabiopelosin merged commit ab5f46c into CocoaPods:master Apr 8, 2013

1 check failed

Details default The Travis build failed
@fabiopelosin
Member

Solid work! Thanks.

@fabiopelosin
Member

@stigi Please, let me know if you would like to be more involved with CP and would like to have commit access.

@stigi
stigi commented Apr 8, 2013

@irrationalfab will continue opening pull requests for now. Maybe at a later point in time. Thanks!

@fabiopelosin
Member

For those reading this thread. Projects which already have been integrated with CocoaPods will not be upgraded automatically (for the time being). To implement this feature manually you can:

  1. Create for your target a shell script build phase named Check Pods Manifest.lock

  2. Configure it to run the following bash script:

    diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
    if [[ $? != 0 ]] ; then
        cat << EOM
    Podfile.lock and Manifest.lock are not in sync.
    You might need to run a \`pod install\`.
    EOM
        exit 1
    fi
    
@nikolaykasyanov

Shouldn't message be changed from "You might need to run a pod install" to "You might need to run a pod install or to update your CocoaPods"? because CocoaPods version saved in lockfiles too.

@fabiopelosin
Member

@corristo 👍 Will you submit a pull request?

@nikolaykasyanov

@irrationalfab I'll try ;)

@fabiopelosin
Member

@corristo This is awesome! Please let me know if you need any support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment