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
12311943
Commit
12311943
authored
Apr 08, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UserProjectIntegrator::TargetIngtegrator] Prepend sandbox check in a safe way (see Xcodeproj API)
parent
0ae92183
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
34 deletions
+27
-34
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+17
-11
integration_spec.rb
spec/integration_spec.rb
+0
-13
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+10
-10
No files found.
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
12311943
require
'active_support'
module
Pod
module
Pod
class
Installer
class
Installer
class
UserProjectIntegrator
class
UserProjectIntegrator
...
@@ -134,22 +136,26 @@ module Pod
...
@@ -134,22 +136,26 @@ module Pod
# locked in the Pods/Manifest.lock file are in sync with the Pods defined
# locked in the Pods/Manifest.lock file are in sync with the Pods defined
# in the Podfile.lock.
# in the Podfile.lock.
#
#
# @note The build phase is appended to the front because to fail
# fast.
#
# @return [void]
# @return [void]
#
#
def
add_check_manifest_lock_script_phase
def
add_check_manifest_lock_script_phase
targets
.
each
do
|
target
|
targets
.
each
do
|
target
|
phase
=
target
.
new_shell_script_build_phase
(
'Check Pods Manifest.lock'
)
phase
=
target
.
project
.
new
(
Xcodeproj
::
Project
::
Object
::
PBXShellScriptBuildPhase
)
phase
.
shell_script
=
<<-
EOS
target
.
build_phases
.
unshift
(
phase
)
diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
phase
.
name
=
'Check Pods Manifest.lock'
if [[ $? != 0 ]] ; then
phase
.
shell_script
=
<<-
EOS
.
strip_heredoc
cat << EOM
diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
Podfile.lock and Manifest.lock are not in sync.
if [[ $? != 0 ]] ; then
You might need to run a
\`
pod install
\`
.
cat << EOM
EOM
Podfile.lock and Manifest.lock are not in sync.
exit 1
You might need to run a
\`
pod install
\`
.
fi
EOM
exit 1
fi
EOS
EOS
target
.
build_phases
.
rotate!
(
-
1
)
# if we fail, let's fail early
end
end
end
end
...
...
spec/integration_spec.rb
View file @
12311943
...
@@ -302,8 +302,6 @@ module Pod
...
@@ -302,8 +302,6 @@ module Pod
#--------------------------------------#
#--------------------------------------#
# @note The shell script should be the last phase.
#
it
"sets up an existing project with pods"
do
it
"sets up an existing project with pods"
do
config
.
integrate_targets
=
true
config
.
integrate_targets
=
true
...
@@ -331,17 +329,6 @@ module Pod
...
@@ -331,17 +329,6 @@ module Pod
config
.
base_configuration_reference
.
path
.
should
==
'Pods/Pods.xcconfig'
config
.
base_configuration_reference
.
path
.
should
==
'Pods/Pods.xcconfig'
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
.
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
#--------------------------------------#
#--------------------------------------#
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
12311943
...
@@ -83,16 +83,16 @@ module Pod
...
@@ -83,16 +83,16 @@ module Pod
it
'adds a Check Manifest.lock build phase to each target'
do
it
'adds a Check Manifest.lock build phase to each target'
do
target
=
@target_integrator
.
targets
.
first
target
=
@target_integrator
.
targets
.
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
"Check Pods Manifest.lock"
}
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
"Check Pods Manifest.lock"
}
phase
.
shell_script
.
should
==
<<-
EOS
phase
.
shell_script
.
should
==
<<-
EOS
.
strip_heredoc
diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
if [[ $? != 0 ]] ; then
if [[ $? != 0 ]] ; then
cat << EOM
cat << EOM
Podfile.lock and Manifest.lock are not in sync.
Podfile.lock and Manifest.lock are not in sync.
You might need to run a
\`
pod install
\`
.
You might need to run a
\`
pod install
\`
.
EOM
EOM
exit 1
exit 1
fi
fi
EOS
EOS
end
end
it
'adds the Check Manifest.lock build phase as the first build phase'
do
it
'adds the Check Manifest.lock build phase as the first build phase'
do
...
...
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