ecb 0.0.26 → 0.0.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ecb +1 -1
- data/lib/commands.rb +1 -1
- data/lib/commands/promote.rb +1 -1
- data/lib/commands/randombranch.rb +1 -1
- data/lib/commands/shell.rb +1 -1
- data/lib/commands/update_plist.rb +1 -1
- data/lib/commands/verify_provision.rb +1 -1
- data/lib/commands/version.rb +1 -1
- data/lib/commands/xcode_build.rb +58 -27
- data/lib/ebmsharedlib/utilities.rb +5 -1
- data/lib/ecb.rb +1 -1
- data/lib/info.rb +2 -2
- data/lib/printer.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d77ae2e396638399c3353b73e6895870d5700d80
|
4
|
+
data.tar.gz: d8705b10e49c6b706d1ace9b1a093b898202d24c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c539085227247bfcaa31e3acc1ffd794ca8ab0de741b5f6a7065f2f825ebef821a8abb385aa5f1613bc3e965b6543c3b3a5279a7aca001424449b175eff14a7
|
7
|
+
data.tar.gz: a3af658e11075128c494105707977e18000cabb2f6b6bba333ddfaa92e78a78ba25838e7f1f6dc2196d8f02b2fd5d9fc700066097bf7e94ae29ff1da5f1971c8
|
data/bin/ecb
CHANGED
data/lib/commands.rb
CHANGED
data/lib/commands/promote.rb
CHANGED
data/lib/commands/shell.rb
CHANGED
data/lib/commands/version.rb
CHANGED
data/lib/commands/xcode_build.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
#
|
2
|
+
# Rick Hoiberg
|
3
3
|
#
|
4
4
|
# Copyright 2013, eBay Inc.
|
5
5
|
# All rights reserved.
|
@@ -19,6 +19,7 @@ module Commands
|
|
19
19
|
def required_options
|
20
20
|
@required_options ||= Set.new [
|
21
21
|
:config,
|
22
|
+
:deliverables,
|
22
23
|
]
|
23
24
|
end
|
24
25
|
|
@@ -30,17 +31,47 @@ module Commands
|
|
30
31
|
options[:config] = v
|
31
32
|
end
|
32
33
|
|
33
|
-
opts.on('-
|
34
|
-
options[:
|
34
|
+
opts.on('-d', "--deliverables deliverablesPath", "Path to build the deliverables") do |v|
|
35
|
+
options[:deliverables] = v
|
36
|
+
end
|
37
|
+
|
38
|
+
opts.on('-a', "--archive-build", "Do archive build") do |v|
|
39
|
+
options[:archive_build] = true
|
40
|
+
end
|
41
|
+
|
42
|
+
opts.on('-a', "--branch config branch name", "Use build config branch") do |v|
|
43
|
+
options[:branch] = v
|
35
44
|
end
|
36
45
|
|
37
46
|
end
|
38
47
|
|
48
|
+
def builddistribtion(target_file, build_dir, artwork, exportName, deliverablesPath)
|
49
|
+
cmd = "mkdir -p tmp/PayLoad"
|
50
|
+
EcbSharedLib::CL.do_cmd(cmd, "#{build_dir}")
|
51
|
+
cmd = "cp -Rp '#{target_file}' tmp/PayLoad"
|
52
|
+
EcbSharedLib::CL.do_cmd(cmd, "#{build_dir}")
|
53
|
+
export_name = exportName.split(".").first
|
54
|
+
sym_file = "#{export_name}_dSYM.zip"
|
55
|
+
unless "#{artwork}".nil?
|
56
|
+
if (File.exist?("#{artwork}"))
|
57
|
+
cmd = "cp '#{artwork}' #{build_dir}/tmp/PayLoad"
|
58
|
+
EcbSharedLib::CL.do_cmd(cmd, '.')
|
59
|
+
paths = artwork.split("/")
|
60
|
+
cmd = "mv 'tmp/PayLoad/#{paths.last}' tmp/PayLoad/iTunesArtwork"
|
61
|
+
EcbSharedLib::CL.do_cmd(cmd, "#{build_dir}")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
cmd = "ditto -c -k --norsrc #{build_dir}/tmp/PayLoad \"#{deliverablesPath}/#{exportName}\""
|
65
|
+
EcbSharedLib::CL.do_cmd(cmd, '.')
|
66
|
+
cmd = "ditto -c -k --norsrc --keepParent '#{build_dir}/#{target_file}.dSYM' '#{deliverablesPath}/#{sym_file}'";
|
67
|
+
EcbSharedLib::CL.do_cmd(cmd, '.')
|
68
|
+
end
|
69
|
+
|
39
70
|
# prepare a single repo and create a local and tracking branch if it should have one
|
40
71
|
# if the repo specifies a branch then we will do the initial fetch from that branch
|
41
72
|
# if the create_dev_branch flag is set, we will create a local and tracking branch with
|
42
73
|
# the developer initials prepended
|
43
|
-
def do_build(build,
|
74
|
+
def do_build(build, deliverablesPath, archive_build)
|
44
75
|
workspace = build[:workspace]
|
45
76
|
scheme = build[:scheme]
|
46
77
|
xcconfig = build[:xcconfig]
|
@@ -49,25 +80,29 @@ module Commands
|
|
49
80
|
configuration = build[:configuration]
|
50
81
|
extra_configs = build[:extra_configs]
|
51
82
|
provisioning_file = build[:provisioning_file]
|
52
|
-
|
53
|
-
|
83
|
+
build_dir = build[:build_dir]
|
84
|
+
itunes_artwork = build[:itunes_artwork]
|
85
|
+
target_file = build[:target_file]
|
86
|
+
|
87
|
+
if archive_build then
|
54
88
|
archive = 'archive'
|
55
89
|
else
|
56
90
|
archive = ''
|
57
91
|
end
|
58
|
-
|
59
|
-
cmd = "xcodebuild #{archive} -workspace #{workspace} -scheme #{scheme} -xcconfig '#{xcconfig}' -configuration #{configuration} -
|
92
|
+
|
93
|
+
cmd = "xcodebuild #{archive} -workspace #{workspace} -scheme #{scheme} -xcconfig '#{xcconfig}' -configuration #{configuration} -archivePath '#{deliverablesPath}/#{archiveName}' #{extra_configs}"
|
60
94
|
if EcbSharedLib::CL.do_cmd_result(cmd, '.') != 0
|
61
95
|
raise "Xcode Build failed."
|
62
96
|
end
|
63
|
-
|
64
|
-
|
65
|
-
cmd = "xcodebuild -exportArchive -exportFormat IPA -archivePath '#{archivePath}/#{archiveName}' -exportPath '#{archivePath}/#{exportName}' -exportProvisioningProfile '#{provisioning_file}'"
|
97
|
+
if archive_build then
|
98
|
+
cmd = "xcodebuild -exportArchive -exportFormat IPA -archivePath '#{deliverablesPath}/#{archiveName}' -exportPath '#{deliverablesPath}/#{exportName}' -exportProvisioningProfile '#{provisioning_file}'"
|
66
99
|
if EcbSharedLib::CL.do_cmd_result(cmd, '.') != 0
|
67
100
|
raise "Xcode Export Archive failed."
|
68
101
|
end
|
69
102
|
cmd = "ditto -c -k --norsrc #{archiveName} #{archiveName}.zip"
|
70
|
-
EcbSharedLib::CL.do_cmd(cmd, "#{
|
103
|
+
EcbSharedLib::CL.do_cmd(cmd, "#{deliverablesPath}")
|
104
|
+
else
|
105
|
+
builddistribtion(target_file, build_dir, itunes_artwork, exportName, deliverablesPath)
|
71
106
|
end
|
72
107
|
end
|
73
108
|
|
@@ -75,9 +110,11 @@ module Commands
|
|
75
110
|
# see if we can open the config file - we append the .config suffix
|
76
111
|
# the file is expected to be in JSON format
|
77
112
|
config_name = options[:config]
|
78
|
-
|
79
|
-
|
80
|
-
|
113
|
+
config_branch = options[:branch]
|
114
|
+
deliverablesPath = options[:deliverables]
|
115
|
+
archive_build = options[:archive_build]
|
116
|
+
|
117
|
+
config_repo_url = EcbSharedLib.prepare_config_repo(nil, config_branch)
|
81
118
|
info = EcbSharedLib.read_repo_config(config_repo_url, config_name)
|
82
119
|
build_config = EcbSharedLib.read_build_config(config_repo_url)
|
83
120
|
|
@@ -87,20 +124,14 @@ module Commands
|
|
87
124
|
cmd = "security unlock-keychain -p #{build_config[:login_password]} ~/Library/Keychains/login.keychain"
|
88
125
|
EcbSharedLib::CL.do_cmd(cmd, '.')
|
89
126
|
|
90
|
-
|
91
|
-
cmd = "rm -Rf build"
|
127
|
+
cmd = "rm -Rf #{deliverablesPath}"
|
92
128
|
EcbSharedLib::CL.do_cmd(cmd, '.')
|
93
|
-
|
94
|
-
if !archivePath.empty? then
|
95
|
-
cmd = "rm -Rf #{archivePath}"
|
96
|
-
EcbSharedLib::CL.do_cmd(cmd, '.')
|
97
|
-
end
|
98
|
-
|
129
|
+
|
99
130
|
xcode_version = info[:xcode_version]
|
100
|
-
if xcode_version.nil? then
|
101
|
-
cmd = "xcode-select --switch /Applications/Xcode.app/Contents/Developer"
|
131
|
+
if xcode_version.nil? or xcode_version == 'latest-released' then
|
132
|
+
cmd = "sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer"
|
102
133
|
else
|
103
|
-
cmd = "xcode-select --switch /Applications/Xcode#{xcode_version}.app/Contents/Developer"
|
134
|
+
cmd = "sudo xcode-select --switch /Applications/Xcode#{xcode_version}.app/Contents/Developer"
|
104
135
|
end
|
105
136
|
EcbSharedLib::CL.do_cmd(cmd, '.')
|
106
137
|
|
@@ -115,7 +146,7 @@ module Commands
|
|
115
146
|
cmd = "cp #{enterprise_info_plist} #{info_plist}"
|
116
147
|
EcbSharedLib::CL.do_cmd(cmd, '.')
|
117
148
|
end
|
118
|
-
do_build(build,
|
149
|
+
do_build(build, deliverablesPath, archive_build)
|
119
150
|
cmd = "git checkout ."
|
120
151
|
EcbSharedLib::CL.do_cmd(cmd, '.')
|
121
152
|
end
|
@@ -126,7 +126,7 @@ module EcbSharedLib
|
|
126
126
|
# takes the repo name (shortcut or full url)
|
127
127
|
# and fetches config into appropriate location
|
128
128
|
# returns the full repo_url
|
129
|
-
def self.prepare_config_repo(config_repo_url)
|
129
|
+
def self.prepare_config_repo(config_repo_url, config_branch)
|
130
130
|
# get the full url
|
131
131
|
repo_url = EcbSharedLib.get_config_repo_url(config_repo_url)
|
132
132
|
|
@@ -148,6 +148,10 @@ module EcbSharedLib
|
|
148
148
|
raise "Unable to clone #{CONFIG_DIR} repo into #{base_config_path}"
|
149
149
|
end
|
150
150
|
end
|
151
|
+
unless config_branch.nil?
|
152
|
+
cmd = "git checkout #{config_branch}"
|
153
|
+
EcbSharedLib::CL.do_cmd(cmd, config_path)
|
154
|
+
end
|
151
155
|
repo_url
|
152
156
|
end
|
153
157
|
|
data/lib/ecb.rb
CHANGED
data/lib/info.rb
CHANGED
data/lib/printer.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rick Hoiberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: subcommand
|
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
version: '1.3'
|
149
149
|
requirements: []
|
150
150
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.2.
|
151
|
+
rubygems_version: 2.2.1
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: Core Builder
|