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
e238edee
Commit
e238edee
authored
Jul 24, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3640 from mglidden/mglidden-only-lock-source
parents
b259fa7c
fdfcf455
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
39 deletions
+26
-39
CHANGELOG.md
CHANGELOG.md
+6
-1
installer.rb
lib/cocoapods/installer.rb
+4
-1
pod_source_installer.rb
lib/cocoapods/installer/pod_source_installer.rb
+16
-20
pod_source_installer_spec.rb
spec/unit/installer/pod_source_installer_spec.rb
+0
-17
No files found.
CHANGELOG.md
View file @
e238edee
...
@@ -24,10 +24,15 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -24,10 +24,15 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Jonathan MacMillan
](
https://github.com/perotinus
)
[
Jonathan MacMillan
](
https://github.com/perotinus
)
*
Only link public headers in the sandbox for Pods that are not being built
*
Only link public headers in the sandbox for Pods that are not being built
into dynamic frameworks, when integrating Pods as frameworks
into dynamic frameworks, when integrating Pods as frameworks
.
[
#3867
](
https://github.com/CocoaPods/CocoaPods/issues/3867
)
[
#3867
](
https://github.com/CocoaPods/CocoaPods/issues/3867
)
[
Jonathan MacMillan
](
https://github.com/perotinus
)
[
Jonathan MacMillan
](
https://github.com/perotinus
)
*
Don't lock resource files, only source files.
[
Mason Glidden
](
https://github.com/mglidden
)
.
[
#3557
](
https://github.com/CocoaPods/CocoaPods/issues/3557
)
## 0.38.0
## 0.38.0
##### Enhancements
##### Enhancements
...
...
lib/cocoapods/installer.rb
View file @
e238edee
...
@@ -346,7 +346,10 @@ module Pod
...
@@ -346,7 +346,10 @@ module Pod
def
lock_pod_sources
def
lock_pod_sources
return
unless
config
.
lock_pod_source?
return
unless
config
.
lock_pod_source?
return
unless
@pod_installers
return
unless
@pod_installers
@pod_installers
.
each
(
&
:lock_files!
)
@pod_installers
.
each
do
|
installer
|
pod_target
=
pod_targets
.
find
{
|
target
|
target
.
pod_name
==
installer
.
name
}
installer
.
lock_files!
(
pod_target
.
file_accessors
)
end
end
end
# Determines if the dependencies need to be built as dynamic frameworks or
# Determines if the dependencies need to be built as dynamic frameworks or
...
...
lib/cocoapods/installer/pod_source_installer.rb
View file @
e238edee
...
@@ -33,6 +33,12 @@ module Pod
...
@@ -33,6 +33,12 @@ module Pod
"<
#{
self
.
class
}
sandbox=
#{
sandbox
.
root
}
pod=
#{
root_spec
.
name
}
"
"<
#{
self
.
class
}
sandbox=
#{
sandbox
.
root
}
pod=
#{
root_spec
.
name
}
"
end
end
# @return [String] The name of the pod this installer is installing.
#
def
name
root_spec
.
name
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
public
public
...
@@ -66,8 +72,16 @@ module Pod
...
@@ -66,8 +72,16 @@ module Pod
#
#
# @return [void]
# @return [void]
#
#
def
lock_files!
def
lock_files!
(
file_accessors
)
lock_installation
unless
local?
return
if
local?
file_accessors
.
each
do
|
file_accessor
|
file_accessor
.
source_files
.
each
do
|
source_file
|
next
unless
source_file
.
exist?
new_permissions
=
source_file
.
stat
.
mode
&
~
0222
source_file
.
chmod
(
new_permissions
)
end
end
end
end
# @return [Hash] @see Downloader#checkout_options
# @return [Hash] @see Downloader#checkout_options
...
@@ -102,24 +116,6 @@ module Pod
...
@@ -102,24 +116,6 @@ module Pod
)
)
end
end
# Locks all of the files in this pod (source, license, etc). This will
# cause Xcode to warn you if you try to accidently edit one of the files.
#
# @return [void]
#
def
lock_installation
# We don't want to lock diretories, as that forces you to override
# those permissions if you decide to delete the Pods folder.
Dir
.
glob
(
root
+
'**/*'
).
each
do
|
file
|
if
File
.
file?
(
file
)
# Only remove write permission, since some pods (like Crashlytics)
# have executable files.
new_permissions
=
File
.
stat
(
file
).
mode
&
~
0222
File
.
chmod
(
new_permissions
,
file
)
end
end
end
# Removes all the files not needed for the installation according to the
# Removes all the files not needed for the installation according to the
# specs by platform.
# specs by platform.
#
#
...
...
spec/unit/installer/pod_source_installer_spec.rb
View file @
e238edee
...
@@ -132,23 +132,6 @@ module Pod
...
@@ -132,23 +132,6 @@ module Pod
end
end
#--------------------------------------#
#--------------------------------------#
describe
'Locking'
do
it
'locks the source files for each Pod'
do
File
.
expects
(
:chmod
).
at_least_once
@installer
.
install!
@installer
.
lock_files!
end
it
"doesn't lock local pods"
do
@installer
.
stubs
(
:local?
).
returns
(
true
)
File
.
expects
(
:chmod
).
never
@installer
.
install!
@installer
.
lock_files!
end
end
#--------------------------------------#
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