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
Hide 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
...
@@ -132,7 +132,8 @@ module Pod
file
=
file
.
relative_path_from
(
config
.
project_pods_root
)
file
=
file
.
relative_path_from
(
config
.
project_pods_root
)
project
.
add_source_file
(
file
)
project
.
add_source_file
(
file
)
end
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
)
project
.
create_in
(
config
.
project_pods_root
)
end
end
...
...
lib/cocoa_pods/xcode_project.rb
View file @
44030731
...
@@ -13,7 +13,6 @@ module Pod
...
@@ -13,7 +13,6 @@ module Pod
@template_dir
=
template_dir
@template_dir
=
template_dir
file
=
template_dir
+
template_file
file
=
template_dir
+
template_file
@template
=
NSMutableDictionary
.
dictionaryWithContentsOfFile
(
file
.
to_s
)
@template
=
NSMutableDictionary
.
dictionaryWithContentsOfFile
(
file
.
to_s
)
pretty_print
end
end
def
template_file
def
template_file
...
@@ -28,7 +27,7 @@ module Pod
...
@@ -28,7 +27,7 @@ module Pod
"sourceTree"
=>
"SOURCE_ROOT"
,
"sourceTree"
=>
"SOURCE_ROOT"
,
"path"
=>
file
.
to_s
,
"path"
=>
file
.
to_s
,
}
}
add_file_to_
files_group
(
file_ref_uuid
)
add_file_to_
group
(
file_ref_uuid
,
'Pods'
)
if
file
.
extname
==
'.h'
if
file
.
extname
==
'.h'
add_header
(
file
,
file_ref_uuid
)
add_header
(
file
,
file_ref_uuid
)
...
@@ -52,13 +51,37 @@ module Pod
...
@@ -52,13 +51,37 @@ module Pod
add_file_to_list
(
'PBXHeadersBuildPhase'
,
build_file_uuid
)
add_file_to_list
(
'PBXHeadersBuildPhase'
,
build_file_uuid
)
end
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
def
to_hash
@template
@template
end
end
def
create_in
(
pods_root
)
def
create_in
(
pods_root
)
@template_dir
.
children
.
each
do
|
child
|
@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
))
FileUtils
.
cp_r
(
child
,
pods_root
+
child
.
relative_path_from
(
@template_dir
))
end
end
pbxproj
=
pods_root
+
template_file
pbxproj
=
pods_root
+
template_file
...
@@ -68,27 +91,25 @@ module Pod
...
@@ -68,27 +91,25 @@ module Pod
private
private
def
add_file_to_list
(
isa
,
build_file_uuid
)
def
add_file_to_list
(
isa
,
build_file_uuid
)
object_uuid
,
object
=
object_by_isa
(
isa
)
object_uuid
,
object
=
objects_by_isa
(
isa
).
first
#object['files'] ||= []
object
[
'files'
]
<<
build_file_uuid
object
[
'files'
]
<<
build_file_uuid
objects
[
object_uuid
]
=
object
#
objects[object_uuid] = object
end
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_uuid
,
object
=
objects
.
find
do
|
_
,
object
|
object
[
'isa'
]
==
'PBXGroup'
&&
object
[
'name'
]
==
'Pods'
object
[
'isa'
]
==
'PBXGroup'
&&
object
[
'name'
]
==
name
end
end
#object['children'] ||= []
object
[
'children'
]
<<
file_ref_uuid
object
[
'children'
]
<<
file_ref_uuid
objects
[
object_uuid
]
=
object
#
objects[object_uuid] = object
end
end
def
objects
def
objects
@template
[
'objects'
]
@template
[
'objects'
]
end
end
def
object_by_isa
(
isa
)
def
object
s
_by_isa
(
isa
)
objects
.
find
{
|
_
,
object
|
object
[
'isa'
]
==
isa
}
objects
.
select
{
|
_
,
object
|
object
[
'isa'
]
==
isa
}
end
end
def
generate_uuid
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 @@
...
@@ -3,5 +3,5 @@
//
//
#ifdef __OBJC__
#ifdef __OBJC__
#import <
Foundation/Foundation
.h>
#import <
UIKit/UIKit
.h>
#endif
#endif
xcode-project-templates/cocoa-touch-static-library/Pods.xcodeproj/project.pbxproj
View file @
44030731
...
@@ -8,15 +8,12 @@
...
@@ -8,15 +8,12 @@
/* Begin PBXBuildFile section */
/* Begin PBXBuildFile section */
515B0FB9141D52E0001DC3E6
/* Foundation.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
515B0FB8141D52E0001DC3E6
/* Foundation.framework */
;
};
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 */
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
/* Begin PBXFileReference section */
515B0FB5141D52E0001DC3E6
/* libPods.a */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
archive.ar
;
includeInIndex
=
0
;
path
=
libPods.a
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
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
;
};
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
;
};
515B0FBC141D52E0001DC3E6
/* Pods-Prefix.pch */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"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
;
};
/* End PBXFileReference section */
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
/* Begin PBXFrameworksBuildPhase section */
...
@@ -68,8 +65,6 @@
...
@@ -68,8 +65,6 @@
515B0FC9141D5FBE001DC3E6
/* Pods */
=
{
515B0FC9141D5FBE001DC3E6
/* Pods */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
515B0FBD141D52E0001DC3E6
/* Pods.h */
,
515B0FBE141D52E0001DC3E6
/* Pods.m */
,
515B0FBB141D52E0001DC3E6
/* Supporting Files */
,
515B0FBB141D52E0001DC3E6
/* Supporting Files */
,
);
);
name
=
Pods
;
name
=
Pods
;
...
@@ -132,7 +127,6 @@
...
@@ -132,7 +127,6 @@
isa
=
PBXSourcesBuildPhase
;
isa
=
PBXSourcesBuildPhase
;
buildActionMask
=
2147483647
;
buildActionMask
=
2147483647
;
files
=
(
files
=
(
515B0FBF141D52E0001DC3E6
/* Pods.m in Sources */
,
);
);
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
};
};
...
@@ -184,7 +178,7 @@
...
@@ -184,7 +178,7 @@
buildSettings
=
{
buildSettings
=
{
DSTROOT
=
/tmp/Pods.dst
;
DSTROOT
=
/tmp/Pods.dst
;
GCC_PRECOMPILE_PREFIX_HEADER
=
YES
;
GCC_PRECOMPILE_PREFIX_HEADER
=
YES
;
GCC_PREFIX_HEADER
=
"Pods
/Pods
-Prefix.pch"
;
GCC_PREFIX_HEADER
=
"Pods-Prefix.pch"
;
OTHER_LDFLAGS
=
"-ObjC"
;
OTHER_LDFLAGS
=
"-ObjC"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SKIP_INSTALL
=
YES
;
SKIP_INSTALL
=
YES
;
...
@@ -196,7 +190,7 @@
...
@@ -196,7 +190,7 @@
buildSettings
=
{
buildSettings
=
{
DSTROOT
=
/tmp/Pods.dst
;
DSTROOT
=
/tmp/Pods.dst
;
GCC_PRECOMPILE_PREFIX_HEADER
=
YES
;
GCC_PRECOMPILE_PREFIX_HEADER
=
YES
;
GCC_PREFIX_HEADER
=
"Pods
/Pods
-Prefix.pch"
;
GCC_PREFIX_HEADER
=
"Pods-Prefix.pch"
;
OTHER_LDFLAGS
=
"-ObjC"
;
OTHER_LDFLAGS
=
"-ObjC"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
SKIP_INSTALL
=
YES
;
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