Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
52775a47
Commit
52775a47
authored
Apr 07, 2013
by
Ullrich Schäfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate a build phase that checks if Manifest.lock is in sync
parent
6215ab0d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+24
-0
integration_spec.rb
spec/integration_spec.rb
+10
-0
No files found.
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
52775a47
...
@@ -29,6 +29,7 @@ module Pod
...
@@ -29,6 +29,7 @@ module Pod
add_xcconfig_base_configuration
add_xcconfig_base_configuration
add_pods_library
add_pods_library
add_copy_resources_script_phase
add_copy_resources_script_phase
add_check_manifest_lock_script_phase
save_user_project
save_user_project
end
end
end
end
...
@@ -129,6 +130,29 @@ module Pod
...
@@ -129,6 +130,29 @@ module Pod
end
end
end
end
# Adds a shell script build phase responsible for checking if the Pods
# locked in the Pods/Manifest.lock file are in sync with the Pods defined
# in the Podfile.lock.
#
# @return [void]
#
def
add_check_manifest_lock_script_phase
targets
.
each
do
|
target
|
phase
=
target
.
new_shell_script_build_phase
(
'Check Pods Manifest.lock'
)
phase
.
shell_script
=
<<-
EOS
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
EOS
target
.
build_phases
.
rotate!
(
-
1
)
# if we fail, let's fail early
end
end
# Saves the changes to the user project to the disk.
# Saves the changes to the user project to the disk.
#
#
# @return [void]
# @return [void]
...
...
spec/integration_spec.rb
View file @
52775a47
...
@@ -332,6 +332,16 @@ module Pod
...
@@ -332,6 +332,16 @@ module Pod
end
end
target
.
frameworks_build_phase
.
files
.
should
.
include
libPods
.
build_files
.
first
target
.
frameworks_build_phase
.
files
.
should
.
include
libPods
.
build_files
.
first
target
.
build_phases
.
last
.
shell_script
.
should
==
%{"${SRCROOT}/Pods/Pods-resources.sh"\n}
target
.
build_phases
.
last
.
shell_script
.
should
==
%{"${SRCROOT}/Pods/Pods-resources.sh"\n}
target
.
build_phases
.
first
.
shell_script
.
should
==
<<-
EOS
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
EOS
end
end
#--------------------------------------#
#--------------------------------------#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment