cocoaseeds 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +76 -26
- data/lib/cocoaseeds/core.rb +7 -2
- data/lib/cocoaseeds/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7b7c7e9ba1648abcf345126718302e6e7e18d5a
|
4
|
+
data.tar.gz: 1be8ba937ae30e52329fa3d574812a6157082486
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1130b8aeecc8701e208ad470c8da79ca17659a1022a58db0695819bbb29fb9ffb42a9c23237b75e77fe6260b95e2ed1eb5611558f894caca54bc0de1414b0d3
|
7
|
+
data.tar.gz: dd5279c4d9f457e24fbd94842338624490d447cda07c64390c96884da04e5be0c85e4e70b6264cca26b676ab752c9bb04b73ae7a1c42034b7e92905ac03059f2
|
data/README.md
CHANGED
@@ -21,59 +21,105 @@ Why?
|
|
21
21
|
Installation
|
22
22
|
------------
|
23
23
|
|
24
|
+
You can get CocoaSeeds from [RubyGems](https://rubygems.org).
|
25
|
+
|
24
26
|
```bash
|
25
27
|
$ [sudo] gem install cocoaseeds
|
26
28
|
```
|
27
29
|
|
28
30
|
|
29
|
-
|
30
|
-
|
31
|
+
Using CocoaSeeds
|
32
|
+
----------------
|
31
33
|
|
32
|
-
|
34
|
+
### 1. Write Seedfile
|
33
35
|
|
34
|
-
|
35
|
-
MyProject/
|
36
|
-
|-- MyProject/
|
37
|
-
| |-- AppDelegate.swift
|
38
|
-
| `-- ...
|
39
|
-
|-- MyProject.xcodeproj
|
40
|
-
|-- <b><i>Seedfile</i></b>
|
41
|
-
`-- ...
|
42
|
-
</pre>
|
36
|
+
*Seedfile* is a ruby script that demonstrates dependencies. You can specify third party libraries from GitHub repository with simple expressions. CocoaSeeds currently supports GitHub only, but supporting many other sources are in our future roadmap.
|
43
37
|
|
38
|
+
Let's make an empty file named **Seedfile** in the same directory with your Xcode project file. Then open it with your preferred editor.
|
39
|
+
|
40
|
+
Here is a sample Seedfile:
|
44
41
|
|
45
42
|
**Seedfile**
|
46
43
|
|
47
44
|
```ruby
|
48
|
-
# seeds for all targets
|
49
45
|
github "Alamofire/Alamofire", "1.2.1", :files => "Source/*.{swift,h}"
|
50
|
-
github "devxoul/JLToast", "1.2.
|
51
|
-
github "devxoul/SwipeBack", "1.0.4"
|
46
|
+
github "devxoul/JLToast", "1.2.5", :files => "JLToast/*.{swift,h}"
|
47
|
+
github "devxoul/SwipeBack", "1.0.4"
|
52
48
|
github "Masonry/SnapKit", "0.10.0", :files => "Source/*.{swift,h}"
|
53
49
|
|
54
|
-
# seeds for specific target
|
55
50
|
target :MyAppTest do
|
56
51
|
github "Quick/Quick", "v0.3.1", :files => "Quick/**.{swift,h}"
|
57
52
|
github "Quick/Nimble", "v0.4.2", :files => "Nimble/**.{swift,h}"
|
58
53
|
end
|
59
54
|
```
|
60
55
|
|
61
|
-
|
62
|
-
|
56
|
+
Can you guess what each lines do? Seedfile has only basic information about third party libraries. Let's look at the single line. Each expressions are made with sections: source, tag and files.
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
github "devxoul/JLToast", "1.2.5", :files => "JLToast/*.{swift,h}"
|
60
|
+
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
61
|
+
(Source) (Tag) (Files)
|
62
|
+
```
|
63
|
+
|
64
|
+
| Section | Example | Required | Default |
|
65
|
+
|---------|-----------------------------------|:--------:|:---------------------:|
|
66
|
+
| Source | `github "devxoul/SwipeBack"` | Required | - |
|
67
|
+
| Tag | `1.0.4` | Required | - |
|
68
|
+
| Files | `:files => "JLToast/*.{swift,h}"` | Optional | `*/**.{h,m,mm,swift}` |
|
69
|
+
|
70
|
+
Looking for using branches instead of tags? See the [Branch support](#branch-support) section.
|
71
|
+
|
72
|
+
|
73
|
+
#### Specifying targets
|
74
|
+
|
75
|
+
Third party libraries can be added specific targets by using target block. For example, you'd like to add some testing libraries such as Quick and Nimble to your test target, you can specify it in Seedfile:
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
target :MyAppTest do
|
79
|
+
github "Quick/Quick", "v0.3.1", :files => "Quick/**.{swift,h}"
|
80
|
+
github "Quick/Nimble", "v0.4.2", :files => "Nimble/**.{swift,h}"
|
81
|
+
end
|
82
|
+
```
|
83
|
+
|
84
|
+
Source files in the target block will only be added to target.
|
85
|
+
|
86
|
+
|
87
|
+
### 2. Install dependencies
|
88
|
+
|
89
|
+
After you done with Seedfile, it's time to add those third party libraries into your project. This is pretty simple. Just open the terminal, cd to your project directory and execute `seed install` command.
|
63
90
|
|
64
91
|
```bash
|
65
92
|
$ seed install
|
66
93
|
```
|
67
94
|
|
68
|
-
Then all the source files will be automatically added to your Xcode project with group named 'Seeds'.
|
95
|
+
Then all the source files will be automatically downloaded and added to your Xcode project with group named 'Seeds'.
|
69
96
|
|
70
97
|
![Seeds-in-Xcode](https://cloud.githubusercontent.com/assets/931655/7502414/cbe45ecc-f476-11e4-9564-450e8887a054.png)
|
71
98
|
|
72
99
|
|
73
|
-
|
74
|
-
|
100
|
+
### 3. Enjoy
|
101
|
+
|
102
|
+
Build your project and enjoy!
|
103
|
+
|
104
|
+
|
105
|
+
Beta Features
|
106
|
+
-------------
|
75
107
|
|
76
|
-
|
108
|
+
There are some beta features in CocoaSeeds which mean 'seemed to work but not fully tested in real world'. Please take care of using those features. (Don't be worry. I'm using these in my company project.)
|
109
|
+
|
110
|
+
|
111
|
+
#### Branch support
|
112
|
+
|
113
|
+
CocoaSeeds originally supports git tags only. For some reasons, such as using experimental feature branches like `swift-2.0`, you can use branches instead of tags. What you need to do is just replacing the tag with branch name. Anything else is same.
|
114
|
+
|
115
|
+
```ruby
|
116
|
+
github 'devxoul/SwiftyImage', 'swift-2.0', :files => 'SwiftyImage/SwiftyImage.swift'
|
117
|
+
```
|
118
|
+
|
119
|
+
|
120
|
+
#### Resolving filename conflicts
|
121
|
+
|
122
|
+
Since CocoaSeeds uses including source files directly than linking dynamic frameworks, it is important to make sure that all sources have different file names. CocoaSeeds provides a way to do this:
|
77
123
|
|
78
124
|
**Seedfile**
|
79
125
|
|
@@ -84,9 +130,9 @@ github "thoughtbot/Argo", "v1.0.3", :files => "Argo/*/*.swift"
|
|
84
130
|
github "thoughtbot/Runes", "v2.0.0", :files => "Source/*.swift"
|
85
131
|
</pre>
|
86
132
|
|
87
|
-
Then all of source files installed via CocoasSeeds will have
|
133
|
+
Then all of source files installed via CocoasSeeds will have names with the seed names as prefix.
|
88
134
|
|
89
|
-
| Before (filename) | After (seedname_filename) |
|
135
|
+
| Before *(filename)* | After *(seedname_filename)* |
|
90
136
|
|---|---|
|
91
137
|
| `Seeds/Alamofire/Alamofire.swift` | `Seeds/Alamofire/Alamofire_Alamofire.swift` |
|
92
138
|
| `Seeds/Argo/Operators/Operators.swift` | `Seeds/Argo/Operators/Argo_Operators.swift` |
|
@@ -96,10 +142,14 @@ Then all of source files installed via CocoasSeeds will have file names with see
|
|
96
142
|
FAQ
|
97
143
|
---
|
98
144
|
|
99
|
-
|
145
|
+
* Are you using this in your real-world project? (Does Apple allows the apps to be submitted on AppStore using CocoaSeeds?)
|
146
|
+
* Of course I am. I'm developing the social media service that 1.6 million users are using. It's on AppStore without any complaints from Apple.
|
147
|
+
|
148
|
+
* Can I ignore **Seeds** folder in VCS *(version control system)*?
|
149
|
+
* Yes, you can make **Seeds** folder to be ignored.
|
100
150
|
|
101
151
|
|
102
152
|
License
|
103
153
|
-------
|
104
154
|
|
105
|
-
CocoaSeeds is under MIT license. See the LICENSE file for more info.
|
155
|
+
**CocoaSeeds** is under MIT license. See the LICENSE file for more info.
|
data/lib/cocoaseeds/core.rb
CHANGED
@@ -258,17 +258,22 @@ module Seeds
|
|
258
258
|
def install_seeds
|
259
259
|
self.seeds.sort.each do |name, seed|
|
260
260
|
dirname = File.join(self.root_path, "Seeds", name)
|
261
|
+
|
262
|
+
if lock = self.locks[name]
|
263
|
+
old_version = lock.version
|
264
|
+
end
|
265
|
+
|
261
266
|
if File.exist?(dirname)
|
262
267
|
tag = `cd #{dirname} && git describe --tags --abbrev=0 2>&1`
|
263
268
|
tag.strip!
|
264
|
-
if tag == seed.version
|
269
|
+
if tag == seed.version and (not old_version or tag == old_version)
|
265
270
|
say "Using #{name} (#{seed.version})"
|
266
271
|
`cd #{dirname} 2>&1 &&\
|
267
272
|
git reset HEAD --hard 2>&1 &&\
|
268
273
|
git checkout . 2>&1 &&\
|
269
274
|
git clean -fd 2>&1`
|
270
275
|
else
|
271
|
-
say "Installing #{name} #{seed.version} (was #{
|
276
|
+
say "Installing #{name} #{seed.version} (was #{old_version})".green
|
272
277
|
`cd #{dirname} 2>&1 &&\
|
273
278
|
git reset HEAD --hard 2>&1 &&\
|
274
279
|
git checkout . 2>&1 &&\
|
data/lib/cocoaseeds/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoaseeds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Suyeol Jeon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcodeproj
|