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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15b890f2091a15f90d16603f447e5a39f80e956e
4
- data.tar.gz: 3b0228c5b11428c6aa92e66bbc3f6665ee0c5457
3
+ metadata.gz: d77ae2e396638399c3353b73e6895870d5700d80
4
+ data.tar.gz: d8705b10e49c6b706d1ace9b1a093b898202d24c
5
5
  SHA512:
6
- metadata.gz: f1c37182fdd72b23a248e2fccbc9f88db8b3b3e9247d5682966262985bb1a3116bea7e629ee7bba90798c57f3e00dc13ac607f29a4ace775cc836f9fe1b5b3ba
7
- data.tar.gz: 39d6ca512348f52970ced43e16acaac8393fc1694dc3f61de9a151e9c1065f48559334d17196d2999ec19daa4ee4a4d862910e3d64e8e17c4bc0fabff71367b9
6
+ metadata.gz: 4c539085227247bfcaa31e3acc1ffd794ca8ab0de741b5f6a7065f2f825ebef821a8abb385aa5f1613bc3e965b6543c3b3a5279a7aca001424449b175eff14a7
7
+ data.tar.gz: a3af658e11075128c494105707977e18000cabb2f6b6bba333ddfaa92e78a78ba25838e7f1f6dc2196d8f02b2fd5d9fc700066097bf7e94ae29ff1da5f1971c8
data/bin/ecb CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Greg Seitz
3
+ # Rick Hoiberg
4
4
  #
5
5
  # Copyright 2013, eBay Inc.
6
6
  # All rights reserved.
data/lib/commands.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #
2
- # Greg Seitz
2
+ # Rick Hoiberg
3
3
  #
4
4
  # Copyright 2013, eBay Inc.
5
5
  # All rights reserved.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Greg Seitz
2
+ # Rick Hoiberg
3
3
  #
4
4
  # Copyright 2013, eBay Inc.
5
5
  # All rights reserved.
@@ -1,6 +1,6 @@
1
1
 
2
2
  #
3
- # Greg Seitz
3
+ # Rick Hoiberg
4
4
  #
5
5
  # Copyright 2013, eBay Inc.
6
6
  # All rights reserved.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Greg Seitz
2
+ # Rick Hoiberg
3
3
  #
4
4
  # Copyright 2013, eBay Inc.
5
5
  # All rights reserved.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Greg Seitz
2
+ # Rick Hoiberg
3
3
  #
4
4
  # Copyright 2013, eBay Inc.
5
5
  # All rights reserved.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Greg Seitz
2
+ # Rick Hoiberg
3
3
  #
4
4
  # Copyright 2013, eBay Inc.
5
5
  # All rights reserved.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Greg Seitz
2
+ # Rick Hoiberg
3
3
  #
4
4
  # Copyright 2013, eBay Inc.
5
5
  # All rights reserved.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Greg Seitz
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('-a', "--archive archivePath", "Path to build the archive") do |v|
34
- options[:archive] = v
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, archivePath)
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
- if !archivePath.empty? then
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} -derivedDataPath build -archivePath '#{archivePath}/#{archiveName}' #{extra_configs}"
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
- if !archivePath.empty? then
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, "#{archivePath}")
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
- archivePath = options[:archive]
79
-
80
- config_repo_url = EcbSharedLib.prepare_config_repo(nil)
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
- #/Applications/Xcode.app/Contents/Developer
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, archivePath)
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
@@ -1,5 +1,5 @@
1
1
  #
2
- # Greg Seitz
2
+ # Rick Hoiberg
3
3
  #
4
4
  # Copyright 2013, eBay Inc.
5
5
  # All rights reserved.
data/lib/info.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #
2
- # Greg Seitz
2
+ # Rick Hoiberg
3
3
  #
4
4
  # Copyright 2013, eBay Inc.
5
5
  # All rights reserved.
@@ -7,6 +7,6 @@
7
7
  #
8
8
  class Info
9
9
  def self.version
10
- "0.0.26"
10
+ "0.0.27"
11
11
  end
12
12
  end
data/lib/printer.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #
2
- # Greg Seitz
2
+ # Rick Hoiberg
3
3
  #
4
4
  # Copyright 2013, eBay Inc.
5
5
  # All rights reserved.
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.26
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-16 00:00:00.000000000 Z
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.0
151
+ rubygems_version: 2.2.1
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: Core Builder