xcody 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +8 -0
- data/lib/xcody.rb +48 -37
- data/lib/xcody/version.rb +1 -1
- data/test/xcody_test.rb +20 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 913cd3c45104ffe09284c8eb93d62e64309d390b
|
4
|
+
data.tar.gz: 7588ff817fe323c5d82dfe51d153233f50b5bb95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f12812d6c082a04adb275d05ed1ed271945070e15bf34d2a0b876394ef5bc8eb12a2f759887d3a72654c13d8544d1c05fbd5f42dd08d1048d2794e6d0e17ef24
|
7
|
+
data.tar.gz: 77286876bb05290d97658f1288f75bc5fb9903150d7176548e9d339d028f0114e1d08192a37cd0e3537ccfadda24e21e2e7a00ff066555fb6f1d1d1133a3f73c
|
data/Rakefile
CHANGED
data/lib/xcody.rb
CHANGED
@@ -1,26 +1,28 @@
|
|
1
1
|
require "xcody/version"
|
2
2
|
require "pathname"
|
3
3
|
require "fileutils"
|
4
|
-
require "
|
4
|
+
require "open3"
|
5
5
|
|
6
6
|
class Xcody
|
7
|
+
attr_reader :xcode_build_cmd
|
8
|
+
|
7
9
|
def initialize
|
8
10
|
xcode = `xcode-select -v`
|
9
11
|
fail "Should install xcode commands from Apple Developer Center." if xcode.include?("command not found")
|
10
|
-
@xcode_build_cmd =
|
12
|
+
@xcode_build_cmd = []
|
11
13
|
end
|
12
14
|
|
13
15
|
def xcode_build
|
14
|
-
@xcode_build_cmd.
|
16
|
+
@xcode_build_cmd.push(Pathname.new(xcode_path).join("Contents", "Developer", "usr", "bin", "xcodebuild").to_s)
|
15
17
|
self
|
16
18
|
end
|
17
19
|
|
18
20
|
def project(project_path)
|
19
21
|
case File.extname(project_path)
|
20
22
|
when ".xcodeproj"
|
21
|
-
@xcode_build_cmd.
|
23
|
+
@xcode_build_cmd.push("-project", project_path)
|
22
24
|
when ".xcworkspace"
|
23
|
-
@xcode_build_cmd.
|
25
|
+
@xcode_build_cmd.push("-workspace", project_path)
|
24
26
|
else
|
25
27
|
fail "#{project_path} has no project."
|
26
28
|
end
|
@@ -28,153 +30,162 @@ class Xcody
|
|
28
30
|
end
|
29
31
|
|
30
32
|
def target(name)
|
31
|
-
@xcode_build_cmd.
|
33
|
+
@xcode_build_cmd.push("-target", name)
|
32
34
|
self
|
33
35
|
end
|
34
36
|
|
35
37
|
def alltargets
|
36
|
-
@xcode_build_cmd.
|
38
|
+
@xcode_build_cmd.push("-alltargets")
|
37
39
|
self
|
38
40
|
end
|
39
41
|
|
40
42
|
def arch(architecture)
|
41
|
-
@xcode_build_cmd.
|
43
|
+
@xcode_build_cmd.push("-arch", architecture)
|
42
44
|
self
|
43
45
|
end
|
44
46
|
|
45
47
|
def scheme(scheme)
|
46
|
-
@xcode_build_cmd.
|
48
|
+
@xcode_build_cmd.push("-scheme", scheme)
|
47
49
|
self
|
48
50
|
end
|
49
51
|
|
50
52
|
def sdk(sdk_name)
|
51
|
-
@xcode_build_cmd.
|
53
|
+
@xcode_build_cmd.push("-sdk", sdk_name)
|
52
54
|
self
|
53
55
|
end
|
54
56
|
|
55
57
|
def destination(destination)
|
56
|
-
@xcode_build_cmd.
|
58
|
+
@xcode_build_cmd.push("-destination", destination)
|
57
59
|
self
|
58
60
|
end
|
59
61
|
|
60
62
|
def configuration(config)
|
61
|
-
@xcode_build_cmd.
|
63
|
+
@xcode_build_cmd.push("-configuration", config)
|
62
64
|
self
|
63
65
|
end
|
64
66
|
|
65
67
|
def derive_data_path(data_path)
|
66
|
-
@xcode_build_cmd.
|
68
|
+
@xcode_build_cmd.push("-derivedDataPath", data_path)
|
67
69
|
self
|
68
70
|
end
|
69
71
|
|
70
72
|
def result_bundle_path(path)
|
71
|
-
@xcode_build_cmd.
|
73
|
+
@xcode_build_cmd.push("-resultBundlePath", path)
|
72
74
|
self
|
73
75
|
end
|
74
76
|
|
75
77
|
def export_archive
|
76
|
-
@xcode_build_cmd.
|
78
|
+
@xcode_build_cmd.push("-exportArchive")
|
77
79
|
self
|
78
80
|
end
|
79
81
|
|
80
82
|
def export_format(format)
|
81
|
-
@xcode_build_cmd.
|
83
|
+
@xcode_build_cmd.push("-exportFormat", format)
|
82
84
|
self
|
83
85
|
end
|
84
86
|
|
85
87
|
def archive_path(xcarchivepath)
|
86
|
-
@xcode_build_cmd.
|
88
|
+
@xcode_build_cmd.push("-archivePath", xcarchivepath)
|
87
89
|
self
|
88
90
|
end
|
89
91
|
|
90
92
|
def export_path(destinationpath)
|
91
|
-
@xcode_build_cmd.
|
93
|
+
@xcode_build_cmd.push("-exportPath", destinationpath)
|
92
94
|
self
|
93
95
|
end
|
94
96
|
|
95
97
|
def export_provisioning_profile(profilename)
|
96
|
-
@xcode_build_cmd.
|
98
|
+
@xcode_build_cmd.push("-exportProvisioningProfile", profilename)
|
97
99
|
self
|
98
100
|
end
|
99
101
|
|
100
102
|
def export_signing_identity(identityname)
|
101
|
-
@xcode_build_cmd.
|
103
|
+
@xcode_build_cmd.push("-exportSigningIdentity", identityname)
|
102
104
|
self
|
103
105
|
end
|
104
106
|
|
105
107
|
def export_installer_identity(identityname)
|
106
|
-
@xcode_build_cmd.
|
108
|
+
@xcode_build_cmd.push("-exportInstallerIdentity", identityname)
|
107
109
|
self
|
108
110
|
end
|
109
111
|
|
110
112
|
def exportWith_original_signing_identity
|
111
|
-
@xcode_build_cmd.
|
113
|
+
@xcode_build_cmd.push("-exportWithOriginalSigningIdentity")
|
112
114
|
self
|
113
115
|
end
|
114
116
|
|
115
117
|
def skip_unavailable_actions
|
116
|
-
@xcode_build_cmd.
|
118
|
+
@xcode_build_cmd.push("-skipUnavailableActions")
|
117
119
|
self
|
118
120
|
end
|
119
121
|
|
120
122
|
def xcconfig(filename)
|
121
|
-
@xcode_build_cmd.
|
123
|
+
@xcode_build_cmd.push("-xcconfig", filename)
|
122
124
|
self
|
123
125
|
end
|
124
126
|
|
125
127
|
# Build actions
|
126
128
|
|
127
129
|
def clean
|
128
|
-
@xcode_build_cmd.
|
130
|
+
@xcode_build_cmd.push("clean")
|
129
131
|
self
|
130
132
|
end
|
131
133
|
|
132
134
|
def analyze
|
133
|
-
@xcode_build_cmd.
|
135
|
+
@xcode_build_cmd.push("analyze")
|
134
136
|
self
|
135
137
|
end
|
136
138
|
|
137
139
|
def archive
|
138
|
-
@xcode_build_cmd.
|
140
|
+
@xcode_build_cmd.push("archive")
|
139
141
|
self
|
140
142
|
end
|
141
143
|
|
144
|
+
def external_attributes(attributes)
|
145
|
+
@xcode_build_cmd.push(attributes)
|
146
|
+
end
|
147
|
+
|
142
148
|
def test
|
143
|
-
@xcode_build_cmd.
|
149
|
+
@xcode_build_cmd.push("test")
|
144
150
|
self
|
145
151
|
end
|
146
152
|
|
147
153
|
def installsrc
|
148
|
-
@xcode_build_cmd.
|
154
|
+
@xcode_build_cmd.push("installsrc")
|
149
155
|
self
|
150
156
|
end
|
151
157
|
|
152
158
|
def install
|
153
|
-
@xcode_build_cmd.
|
159
|
+
@xcode_build_cmd.push("install")
|
154
160
|
self
|
155
161
|
end
|
156
162
|
|
157
163
|
# @return [String] xcode build command
|
158
164
|
def build
|
159
|
-
@xcode_build_cmd.
|
165
|
+
@xcode_build_cmd.push("build")
|
160
166
|
self
|
161
167
|
end
|
162
168
|
|
163
169
|
def clear_cmd
|
164
|
-
@xcode_build_cmd =
|
170
|
+
@xcode_build_cmd = []
|
171
|
+
end
|
172
|
+
|
173
|
+
def command
|
174
|
+
@xcode_build_cmd.join(" ")
|
165
175
|
end
|
166
176
|
|
167
177
|
def run(log_file = "./tmp/build_log.txt", verb = false)
|
168
|
-
|
178
|
+
cmd = command
|
179
|
+
puts "running with #{cmd.inspect}"
|
169
180
|
|
170
|
-
run_command
|
181
|
+
run_command cmd, log_file, verb
|
171
182
|
end
|
172
183
|
|
173
184
|
def xcpretty(log_file = "./tmp/build_log.txt", option = [], verb = false)
|
174
|
-
|
175
|
-
puts "running with #{
|
185
|
+
cmd = command.concat(%( | xcpretty )).concat(option.join(" "))
|
186
|
+
puts "running with #{cmd}"
|
176
187
|
|
177
|
-
run_command
|
188
|
+
run_command cmd, log_file, verb
|
178
189
|
end
|
179
190
|
|
180
191
|
private
|
data/lib/xcody/version.rb
CHANGED
data/test/xcody_test.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'minitest'
|
2
|
+
require 'minitest/unit'
|
3
|
+
require 'minitest/autorun'
|
4
|
+
|
5
|
+
require './lib/xcody'
|
6
|
+
|
7
|
+
class XcodyTest < Minitest::Test
|
8
|
+
def setup
|
9
|
+
@xcody = Xcody.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_with_default
|
13
|
+
assert_equal [], @xcody.xcode_build_cmd
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_with_some_values
|
17
|
+
@xcody.xcode_build.project("project.xcworkspace").target("target").build
|
18
|
+
assert_equal %(/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace project.xcworkspace -target target build), @xcody.command
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcody
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuaki MATSUO
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcpretty
|
@@ -33,12 +33,12 @@ extra_rdoc_files: []
|
|
33
33
|
files:
|
34
34
|
- ".gitignore"
|
35
35
|
- Gemfile
|
36
|
-
- Gemfile.lock
|
37
36
|
- LICENSE.txt
|
38
37
|
- README.md
|
39
38
|
- Rakefile
|
40
39
|
- lib/xcody.rb
|
41
40
|
- lib/xcody/version.rb
|
41
|
+
- test/xcody_test.rb
|
42
42
|
- xcody.gemspec
|
43
43
|
homepage: https://github.com/KazuCocoa/xcody
|
44
44
|
licenses:
|
@@ -64,4 +64,5 @@ rubygems_version: 2.6.6
|
|
64
64
|
signing_key:
|
65
65
|
specification_version: 4
|
66
66
|
summary: Simple Xcode command wrapper
|
67
|
-
test_files:
|
67
|
+
test_files:
|
68
|
+
- test/xcody_test.rb
|