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
44030731
Commit
44030731
authored
Sep 11, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include UIKit by default and add a way to add frameworks and search paths to the xcodeproj.
parent
bbbce5aa
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
59 deletions
+39
-59
specification.rb
lib/cocoa_pods/specification.rb
+2
-1
xcode_project.rb
lib/cocoa_pods/xcode_project.rb
+33
-12
Pods-Prefix.pch
...ject-templates/cocoa-touch-static-library/Pods-Prefix.pch
+1
-1
project.pbxproj
...cocoa-touch-static-library/Pods.xcodeproj/project.pbxproj
+3
-9
Pods.h
...-project-templates/cocoa-touch-static-library/Pods/Pods.h
+0
-13
Pods.m
...-project-templates/cocoa-touch-static-library/Pods/Pods.m
+0
-23
No files found.
lib/cocoa_pods/specification.rb
View file @
44030731
...
...
@@ -132,7 +132,8 @@ module Pod
file
=
file
.
relative_path_from
(
config
.
project_pods_root
)
project
.
add_source_file
(
file
)
end
#project.pretty_print
project
.
add_framework
(
Pathname
.
new
(
'usr/lib/libxml2.2.7.3.dylib'
))
project
.
add_header_search_paths
(
%w{ $(SDKROOT)/usr/include/libxml2 }
)
project
.
create_in
(
config
.
project_pods_root
)
end
...
...
lib/cocoa_pods/xcode_project.rb
View file @
44030731
...
...
@@ -13,7 +13,6 @@ module Pod
@template_dir
=
template_dir
file
=
template_dir
+
template_file
@template
=
NSMutableDictionary
.
dictionaryWithContentsOfFile
(
file
.
to_s
)
pretty_print
end
def
template_file
...
...
@@ -28,7 +27,7 @@ module Pod
"sourceTree"
=>
"SOURCE_ROOT"
,
"path"
=>
file
.
to_s
,
}
add_file_to_
files_group
(
file_ref_uuid
)
add_file_to_
group
(
file_ref_uuid
,
'Pods'
)
if
file
.
extname
==
'.h'
add_header
(
file
,
file_ref_uuid
)
...
...
@@ -52,13 +51,37 @@ module Pod
add_file_to_list
(
'PBXHeadersBuildPhase'
,
build_file_uuid
)
end
def
add_framework
(
path
)
file_ref_uuid
=
generate_uuid
objects
[
file_ref_uuid
]
=
{
"name"
=>
path
.
basename
.
to_s
,
"isa"
=>
"PBXFileReference"
,
"sourceTree"
=>
"SDKROOT"
,
"path"
=>
path
.
to_s
,
}
add_file_to_group
(
file_ref_uuid
,
'Frameworks'
)
build_file_uuid
=
generate_uuid
objects
[
build_file_uuid
]
=
{
"isa"
=>
"PBXBuildFile"
,
"fileRef"
=>
file_ref_uuid
}
add_file_to_list
(
'PBXFrameworksBuildPhase'
,
build_file_uuid
)
end
def
add_header_search_paths
(
paths
)
objects_by_isa
(
'XCBuildConfiguration'
).
each
do
|
uuid
,
object
|
existing_paths
=
object
[
'buildSettings'
][
'HEADER_SEARCH_PATHS'
]
||=
[]
existing_paths
.
concat
(
paths
)
end
end
def
to_hash
@template
end
def
create_in
(
pods_root
)
@template_dir
.
children
.
each
do
|
child
|
puts
"Copy
#{
child
}
to
#{
pods_root
+
child
.
relative_path_from
(
@template_dir
)
}
"
FileUtils
.
cp_r
(
child
,
pods_root
+
child
.
relative_path_from
(
@template_dir
))
end
pbxproj
=
pods_root
+
template_file
...
...
@@ -68,27 +91,25 @@ module Pod
private
def
add_file_to_list
(
isa
,
build_file_uuid
)
object_uuid
,
object
=
object_by_isa
(
isa
)
#object['files'] ||= []
object_uuid
,
object
=
objects_by_isa
(
isa
).
first
object
[
'files'
]
<<
build_file_uuid
objects
[
object_uuid
]
=
object
#
objects[object_uuid] = object
end
def
add_file_to_
files_group
(
file_ref_uuid
)
def
add_file_to_
group
(
file_ref_uuid
,
name
)
object_uuid
,
object
=
objects
.
find
do
|
_
,
object
|
object
[
'isa'
]
==
'PBXGroup'
&&
object
[
'name'
]
==
'Pods'
object
[
'isa'
]
==
'PBXGroup'
&&
object
[
'name'
]
==
name
end
#object['children'] ||= []
object
[
'children'
]
<<
file_ref_uuid
objects
[
object_uuid
]
=
object
#
objects[object_uuid] = object
end
def
objects
@template
[
'objects'
]
end
def
object_by_isa
(
isa
)
objects
.
find
{
|
_
,
object
|
object
[
'isa'
]
==
isa
}
def
object
s
_by_isa
(
isa
)
objects
.
select
{
|
_
,
object
|
object
[
'isa'
]
==
isa
}
end
def
generate_uuid
...
...
xcode-project-templates/cocoa-touch-static-library/Pods
/Pods
-Prefix.pch
→
xcode-project-templates/cocoa-touch-static-library/Pods-Prefix.pch
View file @
44030731
...
...
@@ -3,5 +3,5 @@
//
#ifdef __OBJC__
#import <
Foundation/Foundation
.h>
#import <
UIKit/UIKit
.h>
#endif
xcode-project-templates/cocoa-touch-static-library/Pods.xcodeproj/project.pbxproj
View file @
44030731
...
...
@@ -8,15 +8,12 @@
/* Begin PBXBuildFile section */
515B0FB9141D52E0001DC3E6
/* Foundation.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
515B0FB8141D52E0001DC3E6
/* Foundation.framework */
;
};
515B0FBF141D52E0001DC3E6
/* Pods.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
515B0FBE141D52E0001DC3E6
/* Pods.m */
;
};
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
515B0FB5141D52E0001DC3E6
/* libPods.a */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
archive.ar
;
includeInIndex
=
0
;
path
=
libPods.a
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
515B0FB8141D52E0001DC3E6
/* Foundation.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
Foundation.framework
;
path
=
System/Library/Frameworks/Foundation.framework
;
sourceTree
=
SDKROOT
;
};
515B0FBC141D52E0001DC3E6
/* Pods-Prefix.pch */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
"Pods-Prefix.pch"
;
path
=
"Pods/Pods-Prefix.pch"
;
sourceTree
=
SOURCE_ROOT
;
};
515B0FBD141D52E0001DC3E6
/* Pods.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
Pods.h
;
path
=
Pods/Pods.h
;
sourceTree
=
SOURCE_ROOT
;
};
515B0FBE141D52E0001DC3E6
/* Pods.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
Pods.m
;
path
=
Pods/Pods.m
;
sourceTree
=
SOURCE_ROOT
;
};
515B0FBC141D52E0001DC3E6
/* Pods-Prefix.pch */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"Pods-Prefix.pch"
;
sourceTree
=
SOURCE_ROOT
;
};
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
...
...
@@ -68,8 +65,6 @@
515B0FC9141D5FBE001DC3E6
/* Pods */
=
{
isa
=
PBXGroup
;
children
=
(
515B0FBD141D52E0001DC3E6
/* Pods.h */
,
515B0FBE141D52E0001DC3E6
/* Pods.m */
,
515B0FBB141D52E0001DC3E6
/* Supporting Files */
,
);
name
=
Pods
;
...
...
@@ -132,7 +127,6 @@
isa
=
PBXSourcesBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
515B0FBF141D52E0001DC3E6
/* Pods.m in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
@@ -184,7 +178,7 @@
buildSettings
=
{
DSTROOT
=
/tmp/Pods.dst
;
GCC_PRECOMPILE_PREFIX_HEADER
=
YES
;
GCC_PREFIX_HEADER
=
"Pods
/Pods
-Prefix.pch"
;
GCC_PREFIX_HEADER
=
"Pods-Prefix.pch"
;
OTHER_LDFLAGS
=
"-ObjC"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SKIP_INSTALL
=
YES
;
...
...
@@ -196,7 +190,7 @@
buildSettings
=
{
DSTROOT
=
/tmp/Pods.dst
;
GCC_PRECOMPILE_PREFIX_HEADER
=
YES
;
GCC_PREFIX_HEADER
=
"Pods
/Pods
-Prefix.pch"
;
GCC_PREFIX_HEADER
=
"Pods-Prefix.pch"
;
OTHER_LDFLAGS
=
"-ObjC"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SKIP_INSTALL
=
YES
;
...
...
xcode-project-templates/cocoa-touch-static-library/Pods/Pods.h
deleted
100644 → 0
View file @
bbbce5aa
//
// Pods.h
// Pods
//
// Created by Eloy Duran on 11-09-11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface
Pods
:
NSObject
@end
xcode-project-templates/cocoa-touch-static-library/Pods/Pods.m
deleted
100644 → 0
View file @
bbbce5aa
//
// Pods.m
// Pods
//
// Created by Eloy Duran on 11-09-11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "Pods.h"
@implementation
Pods
-
(
id
)
init
{
self
=
[
super
init
];
if
(
self
)
{
// Initialization code here.
}
return
self
;
}
@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