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
661ab69b
Commit
661ab69b
authored
Apr 09, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TargetEnvironmentHeader] Refine implementation
parent
fdd6195f
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
66 additions
and
51 deletions
+66
-51
cocoapods.rb
lib/cocoapods.rb
+21
-21
target_environment_header.rb
lib/cocoapods/generator/target_environment_header.rb
+13
-3
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+3
-3
Pods-environment.h
...integration/install_add_pod/after/Pods/Pods-environment.h
+2
-2
Pods-SampleApp_1-environment.h
...ustom_workspace/after/Pods/Pods-SampleApp_1-environment.h
+1
-1
Pods-SampleApp_2-environment.h
...ustom_workspace/after/Pods/Pods-SampleApp_2-environment.h
+1
-1
Pods-environment.h
...ion/install_external_source/after/Pods/Pods-environment.h
+3
-3
Pods-environment.h
...ration/install_local_source/after/Pods/Pods-environment.h
+1
-1
Pods-SampleApp_2-environment.h
...ultiple_targets/after/Pods/Pods-SampleApp_2-environment.h
+2
-2
Pods-environment.h
...on/install_multiple_targets/after/Pods/Pods-environment.h
+1
-1
Pods-test-environment.h
...stall_multiple_targets/after/Pods/Pods-test-environment.h
+1
-1
Pods-environment.h
spec/integration/install_new/after/Pods/Pods-environment.h
+1
-1
Pods-environment.h
...n/install_podfile_callbacks/after/Pods/Pods-environment.h
+1
-1
Pods-environment.h
...integration/install_podspec/after/Pods/Pods-environment.h
+1
-1
Pods-environment.h
...egration/install_remove_pod/after/Pods/Pods-environment.h
+1
-1
Pods-environment.h
...tion/install_spec_callbacks/after/Pods/Pods-environment.h
+1
-1
Pods-OS X App-environment.h
...n/install_subspecs/after/Pods/Pods-OS X App-environment.h
+1
-1
Pods-iOS App-environment.h
...on/install_subspecs/after/Pods/Pods-iOS App-environment.h
+1
-1
Pods-environment.h
spec/integration/update/after/Pods/Pods-environment.h
+1
-1
target_environment_header_spec.rb
spec/unit/generator/target_environment_header_spec.rb
+8
-3
target_installer_spec.rb
spec/unit/installer/target_installer_spec.rb
+1
-1
No files found.
lib/cocoapods.rb
View file @
661ab69b
...
...
@@ -38,29 +38,29 @@ module Pod
#
STATISTICS_CACHE_FILE
=
CACHE_ROOT
+
'statistics.yml'
autoload
:Command
,
'cocoapods/command'
autoload
:Executable
,
'cocoapods/executable'
autoload
:ExternalSources
,
'cocoapods/external_sources'
autoload
:Installer
,
'cocoapods/installer'
autoload
:SourcesManager
,
'cocoapods/sources_manager'
autoload
:Library
,
'cocoapods/library'
autoload
:Project
,
'cocoapods/project'
autoload
:Resolver
,
'cocoapods/resolver'
autoload
:Sandbox
,
'cocoapods/sandbox'
autoload
:UI
,
'cocoapods/user_interface'
autoload
:Validator
,
'cocoapods/validator'
autoload
:Command
,
'cocoapods/command'
autoload
:Executable
,
'cocoapods/executable'
autoload
:ExternalSources
,
'cocoapods/external_sources'
autoload
:Installer
,
'cocoapods/installer'
autoload
:SourcesManager
,
'cocoapods/sources_manager'
autoload
:Library
,
'cocoapods/library'
autoload
:Project
,
'cocoapods/project'
autoload
:Resolver
,
'cocoapods/resolver'
autoload
:Sandbox
,
'cocoapods/sandbox'
autoload
:UI
,
'cocoapods/user_interface'
autoload
:Validator
,
'cocoapods/validator'
module
Generator
autoload
:Acknowledgements
,
'cocoapods/generator/acknowledgements'
autoload
:BridgeSupport
,
'cocoapods/generator/bridge_support'
autoload
:CopyResourcesScript
,
'cocoapods/generator/copy_resources_script'
autoload
:Documentation
,
'cocoapods/generator/documentation'
autoload
:DummySource
,
'cocoapods/generator/dummy_source'
autoload
:Markdown
,
'cocoapods/generator/acknowledgements/markdown'
autoload
:Plist
,
'cocoapods/generator/acknowledgements/plist'
autoload
:PrefixHeader
,
'cocoapods/generator/prefix_header'
autoload
:Target
Header
,
'cocoapods/generator/targe
t_header'
autoload
:XCConfig
,
'cocoapods/generator/xcconfig'
autoload
:Acknowledgements
,
'cocoapods/generator/acknowledgements'
autoload
:BridgeSupport
,
'cocoapods/generator/bridge_support'
autoload
:CopyResourcesScript
,
'cocoapods/generator/copy_resources_script'
autoload
:Documentation
,
'cocoapods/generator/documentation'
autoload
:DummySource
,
'cocoapods/generator/dummy_source'
autoload
:Markdown
,
'cocoapods/generator/acknowledgements/markdown'
autoload
:Plist
,
'cocoapods/generator/acknowledgements/plist'
autoload
:PrefixHeader
,
'cocoapods/generator/prefix_header'
autoload
:Target
EnvironmentHeader
,
'cocoapods/generator/target_environmen
t_header'
autoload
:XCConfig
,
'cocoapods/generator/xcconfig'
end
module
Hooks
...
...
lib/cocoapods/generator/target_header.rb
→
lib/cocoapods/generator/target_
environment_
header.rb
View file @
661ab69b
...
...
@@ -21,7 +21,7 @@ module Pod
# // Non CocoaPods code
# #endif
#
class
TargetHeader
class
Target
Environment
Header
# @return [Array<LocalPod>] the specifications installed for the target.
#
...
...
@@ -51,9 +51,9 @@ module Pod
source
.
puts
source
.
puts
specs
.
each
do
|
spec
|
spec_name
=
s
pec
.
name
.
gsub
(
/[^\w]/
,
'_'
)
spec_name
=
s
afe_spec_name
(
spec
.
name
)
source
.
puts
"//
#{
spec
.
name
}
"
source
.
puts
"#define COCOAPODS_POD_AVAILABLE_
#{
spec_name
}
TRUE
"
source
.
puts
"#define COCOAPODS_POD_AVAILABLE_
#{
spec_name
}
"
if
spec
.
version
.
semantic?
source
.
puts
"#define COCOAPODS_VERSION_MAJOR_
#{
spec_name
}
#{
spec
.
version
.
major
}
"
source
.
puts
"#define COCOAPODS_VERSION_MINOR_
#{
spec_name
}
#{
spec
.
version
.
minor
}
"
...
...
@@ -71,6 +71,16 @@ module Pod
#-----------------------------------------------------------------------#
private
# !@group Private Helpers
def
safe_spec_name
(
spec_name
)
spec_name
.
gsub
(
/[^\w]/
,
'_'
)
end
#-----------------------------------------------------------------------#
end
end
end
lib/cocoapods/installer/target_installer.rb
View file @
661ab69b
...
...
@@ -35,7 +35,7 @@ module Pod
create_suport_files_group
create_xcconfig_file
create_target_environ
e
ment_header
create_target_environment_header
create_prefix_header
create_bridge_support_file
create_copy_resources_script
...
...
@@ -158,10 +158,10 @@ module Pod
# Generates a header which allows to inspect at compile time the installed
# pods and the installed specifications of a pod.
#
def
create_target_environ
e
ment_header
def
create_target_environment_header
path
=
library
.
target_environment_header_path
UI
.
message
"- Generating target environment header at
#{
UI
.
path
(
path
)
}
"
do
generator
=
Generator
::
TargetHeader
.
new
(
library
.
specs
)
generator
=
Generator
::
Target
Environment
Header
.
new
(
library
.
specs
)
generator
.
save_as
(
path
)
add_file_to_support_group
(
path
)
end
...
...
spec/integration/install_add_pod/after/Pods/Pods-environment.h
View file @
661ab69b
...
...
@@ -7,14 +7,14 @@
// JSONKit
#define COCOAPODS_POD_AVAILABLE_JSONKit
TRUE
#define COCOAPODS_POD_AVAILABLE_JSONKit
// This library does not follow semantic-versioning,
// so we were not able to define version macros.
// Please contact the author.
// Version: 1.5pre.
// Reachability
#define COCOAPODS_POD_AVAILABLE_Reachability
TRUE
#define COCOAPODS_POD_AVAILABLE_Reachability
#define COCOAPODS_VERSION_MAJOR_Reachability 3
#define COCOAPODS_VERSION_MINOR_Reachability 1
#define COCOAPODS_VERSION_PATCH_Reachability 0
...
...
spec/integration/install_custom_workspace/after/Pods/Pods-SampleApp_1-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// Reachability
#define COCOAPODS_POD_AVAILABLE_Reachability
TRUE
#define COCOAPODS_POD_AVAILABLE_Reachability
#define COCOAPODS_VERSION_MAJOR_Reachability 3
#define COCOAPODS_VERSION_MINOR_Reachability 1
#define COCOAPODS_VERSION_PATCH_Reachability 0
...
...
spec/integration/install_custom_workspace/after/Pods/Pods-SampleApp_2-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// Reachability
#define COCOAPODS_POD_AVAILABLE_Reachability
TRUE
#define COCOAPODS_POD_AVAILABLE_Reachability
#define COCOAPODS_VERSION_MAJOR_Reachability 3
#define COCOAPODS_VERSION_MINOR_Reachability 1
#define COCOAPODS_VERSION_PATCH_Reachability 0
...
...
spec/integration/install_external_source/after/Pods/Pods-environment.h
View file @
661ab69b
...
...
@@ -7,19 +7,19 @@
// PodTest
#define COCOAPODS_POD_AVAILABLE_PodTest
TRUE
#define COCOAPODS_POD_AVAILABLE_PodTest
#define COCOAPODS_VERSION_MAJOR_PodTest 1
#define COCOAPODS_VERSION_MINOR_PodTest 0
#define COCOAPODS_VERSION_PATCH_PodTest 0
// PodTest/subspec_1
#define COCOAPODS_POD_AVAILABLE_PodTest_subspec_1
TRUE
#define COCOAPODS_POD_AVAILABLE_PodTest_subspec_1
#define COCOAPODS_VERSION_MAJOR_PodTest_subspec_1 1
#define COCOAPODS_VERSION_MINOR_PodTest_subspec_1 0
#define COCOAPODS_VERSION_PATCH_PodTest_subspec_1 0
// PodTest/subspec_2
#define COCOAPODS_POD_AVAILABLE_PodTest_subspec_2
TRUE
#define COCOAPODS_POD_AVAILABLE_PodTest_subspec_2
#define COCOAPODS_VERSION_MAJOR_PodTest_subspec_2 1
#define COCOAPODS_VERSION_MINOR_PodTest_subspec_2 0
#define COCOAPODS_VERSION_PATCH_PodTest_subspec_2 0
...
...
spec/integration/install_local_source/after/Pods/Pods-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// Reachability
#define COCOAPODS_POD_AVAILABLE_Reachability
TRUE
#define COCOAPODS_POD_AVAILABLE_Reachability
#define COCOAPODS_VERSION_MAJOR_Reachability 3
#define COCOAPODS_VERSION_MINOR_Reachability 1
#define COCOAPODS_VERSION_PATCH_Reachability 0
...
...
spec/integration/install_multiple_targets/after/Pods/Pods-SampleApp_2-environment.h
View file @
661ab69b
...
...
@@ -7,14 +7,14 @@
// JSONKit
#define COCOAPODS_POD_AVAILABLE_JSONKit
TRUE
#define COCOAPODS_POD_AVAILABLE_JSONKit
// This library does not follow semantic-versioning,
// so we were not able to define version macros.
// Please contact the author.
// Version: 1.5pre.
// Reachability
#define COCOAPODS_POD_AVAILABLE_Reachability
TRUE
#define COCOAPODS_POD_AVAILABLE_Reachability
#define COCOAPODS_VERSION_MAJOR_Reachability 3
#define COCOAPODS_VERSION_MINOR_Reachability 1
#define COCOAPODS_VERSION_PATCH_Reachability 0
...
...
spec/integration/install_multiple_targets/after/Pods/Pods-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// Reachability
#define COCOAPODS_POD_AVAILABLE_Reachability
TRUE
#define COCOAPODS_POD_AVAILABLE_Reachability
#define COCOAPODS_VERSION_MAJOR_Reachability 3
#define COCOAPODS_VERSION_MINOR_Reachability 1
#define COCOAPODS_VERSION_PATCH_Reachability 0
...
...
spec/integration/install_multiple_targets/after/Pods/Pods-test-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// JSONKit
#define COCOAPODS_POD_AVAILABLE_JSONKit
TRUE
#define COCOAPODS_POD_AVAILABLE_JSONKit
// This library does not follow semantic-versioning,
// so we were not able to define version macros.
// Please contact the author.
...
...
spec/integration/install_new/after/Pods/Pods-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// Reachability
#define COCOAPODS_POD_AVAILABLE_Reachability
TRUE
#define COCOAPODS_POD_AVAILABLE_Reachability
#define COCOAPODS_VERSION_MAJOR_Reachability 3
#define COCOAPODS_VERSION_MINOR_Reachability 1
#define COCOAPODS_VERSION_PATCH_Reachability 0
...
...
spec/integration/install_podfile_callbacks/after/Pods/Pods-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// Reachability
#define COCOAPODS_POD_AVAILABLE_Reachability
TRUE
#define COCOAPODS_POD_AVAILABLE_Reachability
#define COCOAPODS_VERSION_MAJOR_Reachability 3
#define COCOAPODS_VERSION_MINOR_Reachability 1
#define COCOAPODS_VERSION_PATCH_Reachability 0
...
...
spec/integration/install_podspec/after/Pods/Pods-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// Reachability
#define COCOAPODS_POD_AVAILABLE_Reachability
TRUE
#define COCOAPODS_POD_AVAILABLE_Reachability
#define COCOAPODS_VERSION_MAJOR_Reachability 3
#define COCOAPODS_VERSION_MINOR_Reachability 1
#define COCOAPODS_VERSION_PATCH_Reachability 0
...
...
spec/integration/install_remove_pod/after/Pods/Pods-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// Reachability
#define COCOAPODS_POD_AVAILABLE_Reachability
TRUE
#define COCOAPODS_POD_AVAILABLE_Reachability
#define COCOAPODS_VERSION_MAJOR_Reachability 3
#define COCOAPODS_VERSION_MINOR_Reachability 1
#define COCOAPODS_VERSION_PATCH_Reachability 0
...
...
spec/integration/install_spec_callbacks/after/Pods/Pods-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// Reachability
#define COCOAPODS_POD_AVAILABLE_Reachability
TRUE
#define COCOAPODS_POD_AVAILABLE_Reachability
#define COCOAPODS_VERSION_MAJOR_Reachability 3
#define COCOAPODS_VERSION_MINOR_Reachability 1
#define COCOAPODS_VERSION_PATCH_Reachability 0
...
...
spec/integration/install_subspecs/after/Pods/Pods-OS X App-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// PodTest/subspec_2
#define COCOAPODS_POD_AVAILABLE_PodTest_subspec_2
TRUE
#define COCOAPODS_POD_AVAILABLE_PodTest_subspec_2
#define COCOAPODS_VERSION_MAJOR_PodTest_subspec_2 1
#define COCOAPODS_VERSION_MINOR_PodTest_subspec_2 0
#define COCOAPODS_VERSION_PATCH_PodTest_subspec_2 0
...
...
spec/integration/install_subspecs/after/Pods/Pods-iOS App-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// PodTest/subspec_1
#define COCOAPODS_POD_AVAILABLE_PodTest_subspec_1
TRUE
#define COCOAPODS_POD_AVAILABLE_PodTest_subspec_1
#define COCOAPODS_VERSION_MAJOR_PodTest_subspec_1 1
#define COCOAPODS_VERSION_MINOR_PodTest_subspec_1 0
#define COCOAPODS_VERSION_PATCH_PodTest_subspec_1 0
...
...
spec/integration/update/after/Pods/Pods-environment.h
View file @
661ab69b
...
...
@@ -7,7 +7,7 @@
// Reachability
#define COCOAPODS_POD_AVAILABLE_Reachability
TRUE
#define COCOAPODS_POD_AVAILABLE_Reachability
#define COCOAPODS_VERSION_MAJOR_Reachability 3
#define COCOAPODS_VERSION_MINOR_Reachability 1
#define COCOAPODS_VERSION_PATCH_Reachability 0
...
...
spec/unit/generator/target_header_spec.rb
→
spec/unit/generator/target_
environment_
header_spec.rb
View file @
661ab69b
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
Pod
::
Generator
::
TargetHeader
do
describe
Pod
::
Generator
::
Target
Environment
Header
do
before
do
specification
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
@gen
=
Pod
::
Generator
::
TargetHeader
.
new
([
specification
])
@gen
=
Pod
::
Generator
::
Target
Environment
Header
.
new
([
specification
])
end
it
"generates a header files which include macro definitions for installed Pods"
do
...
...
@@ -20,12 +20,17 @@ describe Pod::Generator::TargetHeader do
// BananaLib
#define COCOAPODS_POD_AVAILABLE_BananaLib
TRUE
#define COCOAPODS_POD_AVAILABLE_BananaLib
#define COCOAPODS_VERSION_MAJOR_BananaLib 1
#define COCOAPODS_VERSION_MINOR_BananaLib 0
#define COCOAPODS_VERSION_PATCH_BananaLib 0
EOS
end
it
"handles specifications with special characters"
do
name
=
@gen
.
send
(
:safe_spec_name
,
'AppleCoreAudioUtilityClasses@thehtb'
)
name
.
should
==
'AppleCoreAudioUtilityClasses_thehtb'
end
end
spec/unit/installer/target_installer_spec.rb
View file @
661ab69b
...
...
@@ -151,7 +151,7 @@ module Pod
@installer
.
install!
file
=
config
.
sandbox
.
root
+
'Pods-environment.h'
contents
=
file
.
read
contents
.
should
.
include?
(
'#define COCOAPODS_POD_AVAILABLE_BananaLib
TRUE
'
)
contents
.
should
.
include?
(
'#define COCOAPODS_POD_AVAILABLE_BananaLib'
)
contents
.
should
.
include?
(
'#define COCOAPODS_VERSION_MAJOR_BananaLib 1'
)
contents
.
should
.
include?
(
'#define COCOAPODS_VERSION_MINOR_BananaLib 0'
)
contents
.
should
.
include?
(
'#define COCOAPODS_VERSION_PATCH_BananaLib 0'
)
...
...
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