carthage_remote_cache 0.0.3 → 0.0.4

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
- SHA1:
3
- metadata.gz: 99a24b3d5f791bcaeb20e54585407e069cef1315
4
- data.tar.gz: f2142c1579c0be86a434b7145d6d0598724bb29d
2
+ SHA256:
3
+ metadata.gz: 419b8edd1e39136269db80965bcffb2fe4e6207f7b83459e549a37f4beac9f7c
4
+ data.tar.gz: 0c83197b67a7e6b5ef504a1811a533a082c98152e07315414d346eb97049a9fc
5
5
  SHA512:
6
- metadata.gz: 959084abe1f980e686068760c818f4b138e03075cc88667fc47ea875dab38ab7eb21c5e5a94bb775654e2558a2aa98ed07126e89c4cbadfbb02b456d604494fb
7
- data.tar.gz: 4469e11a247c273fc956ed1afac2d6f76a3404d6ee7a24ab387c9d2a1c0145868255b5af2c68f9417b0b1f1c222e5ebe27bfe65704133f118bd2cc48d0561052
6
+ metadata.gz: 5b4aaad19ca7a53f5ce85fa801c22fe019c66a3281ecb6d239516d8d0c94418201b1974d149ff44fc2e22b6a5085227f9280680b0aef1bc0700ea480fa4a1310
7
+ data.tar.gz: 5fd1d49c2c75c9ffa64fc36cad248ee4cb670abab779f821582cdfc8b656ba175ece52608a6017022d2ffabd1997bda53c442229d14b876041f557929396bbc9
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.5.0
4
+ script:
5
+ - bundle exec rake test
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carthage_remote_cache (0.0.3)
4
+ carthage_remote_cache (0.0.4)
5
5
  concurrent-ruby (~> 1.0.5)
6
6
  rack (~> 2.0.4)
7
7
  rest-client (~> 2.0.2)
@@ -10,25 +10,53 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
+ coderay (1.1.2)
13
14
  concurrent-ruby (1.0.5)
14
15
  domain_name (0.5.20170404)
15
16
  unf (>= 0.0.5, < 1.0.0)
16
- ffi (1.9.18)
17
+ ffi (1.9.21)
18
+ formatador (0.2.5)
19
+ guard (2.14.2)
20
+ formatador (>= 0.2.4)
21
+ listen (>= 2.7, < 4.0)
22
+ lumberjack (>= 1.0.12, < 2.0)
23
+ nenv (~> 0.1)
24
+ notiffany (~> 0.0)
25
+ pry (>= 0.9.12)
26
+ shellany (~> 0.0)
27
+ thor (>= 0.18.1)
28
+ guard-compat (1.2.1)
29
+ guard-test (2.0.8)
30
+ guard-compat (~> 1.2)
31
+ test-unit (~> 3.0)
17
32
  http-cookie (1.0.3)
18
33
  domain_name (~> 0.5)
19
34
  listen (3.1.5)
20
35
  rb-fsevent (~> 0.9, >= 0.9.4)
21
36
  rb-inotify (~> 0.9, >= 0.9.7)
22
37
  ruby_dep (~> 1.2)
38
+ lumberjack (1.0.12)
39
+ metaclass (0.0.4)
40
+ method_source (0.9.0)
23
41
  mime-types (3.1)
24
42
  mime-types-data (~> 3.2015)
25
43
  mime-types-data (3.2016.0521)
44
+ mocha (1.3.0)
45
+ metaclass (~> 0.0.1)
26
46
  mustermann (1.0.1)
47
+ nenv (0.3.0)
27
48
  netrc (0.11.0)
49
+ notiffany (0.1.1)
50
+ nenv (~> 0.1)
51
+ shellany (~> 0.0)
52
+ power_assert (1.1.1)
53
+ pry (0.11.3)
54
+ coderay (~> 1.1.0)
55
+ method_source (~> 0.9.0)
28
56
  rack (2.0.4)
29
57
  rack-protection (2.0.0)
30
58
  rack
31
- rake (10.4.2)
59
+ rake (10.5.0)
32
60
  rb-fsevent (0.10.2)
33
61
  rb-inotify (0.9.10)
34
62
  ffi (>= 0.5.0, < 2)
@@ -39,11 +67,16 @@ GEM
39
67
  mime-types (>= 1.16, < 4.0)
40
68
  netrc (~> 0.8)
41
69
  ruby_dep (1.5.0)
70
+ rufo (0.2.0)
71
+ shellany (0.0.1)
42
72
  sinatra (2.0.0)
43
73
  mustermann (~> 1.0)
44
74
  rack (~> 2.0)
45
75
  rack-protection (= 2.0.0)
46
76
  tilt (~> 2.0)
77
+ test-unit (3.2.7)
78
+ power_assert
79
+ thor (0.20.0)
47
80
  tilt (2.0.8)
48
81
  unf (0.1.4)
49
82
  unf_ext
@@ -55,8 +88,13 @@ PLATFORMS
55
88
  DEPENDENCIES
56
89
  bundler (~> 1.16)
57
90
  carthage_remote_cache!
91
+ guard (~> 2.14.2)
92
+ guard-test (~> 2.0.8)
93
+ mocha (~> 1.3.0)
58
94
  rake (~> 10.0)
59
95
  rerun
96
+ rufo
97
+ test-unit (~> 3.2.7)
60
98
 
61
99
  BUNDLED WITH
62
100
  1.16.1
data/Guardfile ADDED
@@ -0,0 +1,6 @@
1
+ guard :test do
2
+ watch(%r{^test/.+_tests\.rb$})
3
+ watch('test/test_helper.rb') { 'test' }
4
+ watch('test/fixtures.rb') { 'test' }
5
+ watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_tests.rb" }
6
+ end
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # CarthageRemoteCache
2
2
 
3
+ [![Build Status](https://travis-ci.org/kayak/carthage_remote_cache.svg?branch=master)](https://travis-ci.org/kayak/carthage_remote_cache)
4
+ [![Gem Version](https://badge.fury.io/rb/carthage_remote_cache.svg)](https://badge.fury.io/rb/carthage_remote_cache)
5
+
3
6
  Centralized cache to serve Carthage frameworks. Useful for distributed CI setup with several build machines. It's aware of your `xcodebuild` and `swift` versions and builds on top of Carthage's `.xyz.version` file mechanism.
4
7
 
5
8
  ## Installation
@@ -8,6 +11,8 @@ The gem is published at [rubygems.org](https://rubygems.org/gems/carthage_remote
8
11
 
9
12
  $ gem install carthage_remote_cache
10
13
 
14
+ _Note: Installing ri documentation for sinatra can be quite slow. Install with_ `--no-rdoc --no-ri` _if you don't want to wait._
15
+
11
16
  ## Quickstart
12
17
 
13
18
  1. Run `carthagerc server` to start the cache on a remote server
@@ -28,7 +33,7 @@ Before running any other commands, it's required to initialize `carthagerc` in y
28
33
  Which produces a `Cartrcfile`. Configuration is done via plain `ruby` code, so it is as simple as:
29
34
 
30
35
  Configuration.setup do |c|
31
- c.server = "http://localhost:9292/"
36
+ c.server = "http://localhost:9292/"
32
37
  end
33
38
 
34
39
  `Cartrcfile` is supposed to be version controlled (e.g. included in git repository), so that it lives along your code and all consumers of the repository have access to same configuration.
@@ -45,15 +50,15 @@ Start the upload with:
45
50
 
46
51
  After couple of seconds you should be able to see confirmation in terminal:
47
52
 
48
- Uploaded 53 archives, skipped 0.
53
+ Uploaded 53 archives (97.2 MB), skipped 0.
49
54
 
50
55
  #### Overwriting Existing Cache
51
56
 
52
57
  Attempting to run `carthagerc upload` again will not upload any framework binaries, since all of them are already present on the cache server:
53
58
 
54
- Uploaded 53 archives, skipped 53.
59
+ Uploaded 0 archives (0.0 MB), skipped 53.
55
60
 
56
- If your cache happen to be tainted by invalid framework binaries, you can overwrite existing cache with
61
+ If your cache happens to be tainted by invalid framework binaries, you can overwrite existing cache with
57
62
 
58
63
  $ carthagerc upload --force
59
64
 
@@ -69,7 +74,7 @@ Once cache server has been populated with framework binaries, it's time to fetch
69
74
 
70
75
  You should expect to see following output on a machine with empty `Carthage` folder:
71
76
 
72
- Downloaded and extracted 53 archives, skipped 0 archives.
77
+ Downloaded and extracted 53 archives (97.2 MB), skipped 0 archives.
73
78
 
74
79
  Your project should be ready for building.
75
80
 
@@ -117,6 +122,30 @@ Server is bound to port 9292 by default. If you need to use different port, spec
117
122
 
118
123
  Don't forget to change port number in your version controlled `Cartrcfile`.
119
124
 
125
+ #### Directory Structure
126
+
127
+ Cache server stores version files and framework archives in following directory structure:
128
+
129
+ .carthagerc_server/
130
+ 9C40b/ # Xcode version
131
+ 4.0.3/ # Swift version
132
+ Framework1/
133
+ 1.0.0/ # Framework1 version
134
+ .Framework1.version # Carthage .version file
135
+ Framework1-iOS.zip # Framework binary, dSYM and bcsymbolmap files
136
+ Framework1-macOS.zip
137
+ Framework1-tvOS.zip
138
+ Framework1-watchOS.zip
139
+ 2.0.3/ # Framework1 version
140
+ .Framework1.version
141
+ Framework1-iOS.zip
142
+ Framework2/
143
+ v3.2/ # Framework2 version
144
+ .Framework2.version
145
+ Framework2-iOS.zip
146
+
147
+ It's safe to delete whole directories since no other metadata is stored.
148
+
120
149
  #### Launch Agent
121
150
 
122
151
  You can also run the cache server as a launch agent. Copy the template [com.kayak.carthagerc.server.plist](https://github.com/kayak/carthage_remote_cache/blob/master/com.kayak.carthagerc.server.plist) file to `~/Library/LaunchAgents`, change log
@@ -128,7 +157,11 @@ If you want to stop the agent, run:
128
157
 
129
158
  $ launchctl unload ~/Library/LaunchAgents/com.kayak.carthagerc.server.plist
130
159
 
131
- Check out official documentation on [Launch Agents](https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html) for more info.
160
+ Check out official documentation on [Launch Agents](https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html) for more info.
161
+
162
+ ### Version
163
+
164
+ $ carthagerc version
132
165
 
133
166
  ### Help
134
167
 
@@ -140,7 +173,7 @@ Documentation is also available when running `carthagerc` or `carthagerc --help`
140
173
 
141
174
  COMMANDS
142
175
  config
143
- prints environment information and Cartrcfile configuration
176
+ print environment information and Cartrcfile configuration
144
177
 
145
178
  download [-f|--force] [-v|--verbose]
146
179
  fetch missing frameworks into Carthage/Build
@@ -154,6 +187,9 @@ Documentation is also available when running `carthagerc` or `carthagerc --help`
154
187
  server [-pPORT|--port=PORT]
155
188
  start cache server
156
189
 
190
+ version
191
+ print current version number
192
+
157
193
  OPTIONS
158
194
  -f, --force Force upload/download of framework archives even if local and server .version files match
159
195
  -h, --help Show help
@@ -162,15 +198,27 @@ Documentation is also available when running `carthagerc` or `carthagerc --help`
162
198
 
163
199
  ## Development
164
200
 
201
+ ### Setup
202
+
165
203
  After checking out the repo, run `dev/setup` to install dependencies. You can also run `dev/console` for an interactive prompt that will allow you to experiment.
166
204
 
205
+ ### Development Server
206
+
167
207
  To start development server, run `dev/start_server`, which utilizes `rerun` for automatic reloading of source code and resources.
168
208
 
169
- Execute unit tests with `rake test`.
209
+ ### Tests
210
+
211
+ Execute unit tests with `rake test` or start monitoring directories for changes with `bundle exec guard`.
212
+
213
+ ### Source Code Format
214
+
215
+ Before committing, make sure to auto-format source code wit `rake format`.
216
+
217
+ ### Gem Lifecycle
170
218
 
171
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `carthage_remote_cache.gemspec`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org/gems/carthage_remote_cache).
219
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org/gems/carthage_remote_cache).
172
220
 
173
- ### Example Folder
221
+ ### Experiments With Example Folder
174
222
 
175
223
  Repository is bundled with an example Carthage setup for your experiments. Open the [example](https://github.com/kayak/carthage_remote_cache/blob/master/example) folder, where you should be able to see following files, which are preconfigured to bring in a couple of frameworks:
176
224
  - Cartfile
data/Rakefile CHANGED
@@ -1,10 +1,14 @@
1
1
  require "bundler/gem_tasks"
2
- require 'rake/testtask'
2
+ require "rake/testtask"
3
3
 
4
4
  task :default => :spec
5
5
 
6
6
  Rake::TestTask.new do |t|
7
- t.libs << "test"
8
- t.test_files = FileList['test/*_tests.rb']
9
- t.verbose = true
7
+ t.libs << "test"
8
+ t.test_files = FileList['test/*_tests.rb']
9
+ t.verbose = true
10
+ end
11
+
12
+ task :format do
13
+ system('rufo bin/carthagerc lib test Gemfile Guardfile Rakefile carthage_remote_cache.gemspec')
10
14
  end
data/bin/carthagerc CHANGED
@@ -8,78 +8,83 @@ require 'commands'
8
8
 
9
9
  ARGV << '-h' if ARGV.empty?
10
10
  options = {
11
- :force => false,
12
- :server_port => SERVER_DEFAULT_PORT,
13
- :verbose => false,
11
+ :force => false,
12
+ :server_port => SERVER_DEFAULT_PORT,
13
+ :verbose => false,
14
14
  }
15
15
  opt_parser = OptionParser.new do |opt|
16
- opt.banner = "carthagerc COMMAND [OPTIONS]"
17
- opt.separator ""
18
- opt.separator "DESCRIPTION"
19
- opt.separator " carthagerc is a centralized remote cache for Carthage framework artifacts. Check out project information at https://github.com/kayak/carthage_remote_cache"
20
- opt.separator ""
21
- opt.separator "QUICKSTART"
22
- opt.separator " 1. Run `carthagerc server` to start the cache on a remote server"
23
- opt.separator " 2. `cd` to your project's root folder"
24
- opt.separator " 3. Run `carthagerc init` to create `Cartrcfile` and point the server property to your running server URL"
25
- opt.separator " 4. Assuming your `Carthage` directory is already built, run `carthagerc upload` to populate remote cache"
26
- opt.separator " 5. Push your `Cartrcfile` and from a different machine run `cartrcfile download` to fetch frameworks into `Carthage/Build/` folder"
27
- opt.separator " 6. Build your app without having to wait for `carthage bootstrap`"
28
- opt.separator ""
29
- opt.separator "COMMANDS"
30
- opt.separator " config"
31
- opt.separator " prints environment information and #{CARTRCFILE} configuration"
32
- opt.separator ""
33
- opt.separator " download [-f|--force] [-v|--verbose]"
34
- opt.separator " fetch missing frameworks into Carthage/Build"
35
- opt.separator ""
36
- opt.separator " init"
37
- opt.separator " create initial #{CARTRCFILE} in current directory"
38
- opt.separator ""
39
- opt.separator " upload [-f|--force] [-v|--verbose]"
40
- opt.separator " archive frameworks in Carthage/Build and upload them to the server"
41
- opt.separator ""
42
- opt.separator " server [-pPORT|--port=PORT]"
43
- opt.separator " start cache server"
44
- opt.separator ""
45
- opt.separator "OPTIONS"
16
+ opt.banner = "carthagerc COMMAND [OPTIONS]"
17
+ opt.separator ""
18
+ opt.separator "DESCRIPTION"
19
+ opt.separator " carthagerc is a centralized remote cache for Carthage framework artifacts. Check out project information at https://github.com/kayak/carthage_remote_cache"
20
+ opt.separator ""
21
+ opt.separator "QUICKSTART"
22
+ opt.separator " 1. Run `carthagerc server` to start the cache on a remote server"
23
+ opt.separator " 2. `cd` to your project's root folder"
24
+ opt.separator " 3. Run `carthagerc init` to create `Cartrcfile` and point the server property to your running server URL"
25
+ opt.separator " 4. Assuming your `Carthage` directory is already built, run `carthagerc upload` to populate remote cache"
26
+ opt.separator " 5. Push your `Cartrcfile` and from a different machine run `cartrcfile download` to fetch frameworks into `Carthage/Build/` folder"
27
+ opt.separator " 6. Build your app without having to wait for `carthage bootstrap`"
28
+ opt.separator ""
29
+ opt.separator "COMMANDS"
30
+ opt.separator " config"
31
+ opt.separator " print environment information and #{CARTRCFILE} configuration"
32
+ opt.separator ""
33
+ opt.separator " download [-f|--force] [-v|--verbose]"
34
+ opt.separator " fetch missing frameworks into Carthage/Build"
35
+ opt.separator ""
36
+ opt.separator " init"
37
+ opt.separator " create initial #{CARTRCFILE} in current directory"
38
+ opt.separator ""
39
+ opt.separator " upload [-f|--force] [-v|--verbose]"
40
+ opt.separator " archive frameworks in Carthage/Build and upload them to the server"
41
+ opt.separator ""
42
+ opt.separator " server [-pPORT|--port=PORT]"
43
+ opt.separator " start cache server"
44
+ opt.separator ""
45
+ opt.separator " version"
46
+ opt.separator " print current version number"
47
+ opt.separator ""
48
+ opt.separator "OPTIONS"
46
49
 
47
- opt.on("-f", "--force", "Force upload/download of framework archives even if local and server .version files match") do
48
- options[:force] = true
49
- end
50
+ opt.on("-f", "--force", "Force upload/download of framework archives even if local and server .version files match") do
51
+ options[:force] = true
52
+ end
50
53
 
51
- opt.on("-h", "--help", "Show help") do
52
- puts opt_parser
53
- exit
54
- end
54
+ opt.on("-h", "--help", "Show help") do
55
+ puts opt_parser
56
+ exit
57
+ end
55
58
 
56
- opt.on("-pPORT", "--port=PORT", "Server application port used when starting server, default port is #{SERVER_DEFAULT_PORT}") do |port|
57
- options[:server_port] = port
58
- end
59
+ opt.on("-pPORT", "--port=PORT", "Server application port used when starting server, default port is #{SERVER_DEFAULT_PORT}") do |port|
60
+ options[:server_port] = port
61
+ end
59
62
 
60
- opt.on("-v", "--verbose", "Show extra runtime information") do
61
- $LOG.level = Logger::DEBUG
62
- end
63
+ opt.on("-v", "--verbose", "Show extra runtime information") do
64
+ $LOG.level = Logger::DEBUG
65
+ end
63
66
  end
64
67
 
65
68
  opt_parser.parse!
66
69
 
67
70
  begin
68
- command = ARGV[0]
69
- case command
70
- when "config"
71
- puts Configuration.new
72
- when "download"
73
- DownloadCommand.new(options).run
74
- when "init"
75
- InitCommand.new(options).run
76
- when "upload"
77
- UploadCommand.new(options).run
78
- when "server"
79
- ServerCommand.new(options).run
80
- else
81
- bail("Unsupported command #{command}, run with --help to show available commands")
82
- end
71
+ command = ARGV[0]
72
+ case command
73
+ when "config"
74
+ puts Configuration.new_with_defaults
75
+ when "download"
76
+ DownloadCommand.new_with_defaults(options).run
77
+ when "init"
78
+ InitCommand.new(options).run
79
+ when "upload"
80
+ UploadCommand.new_with_defaults(options).run
81
+ when "server"
82
+ ServerCommand.new(options).run
83
+ when "version"
84
+ puts VERSION
85
+ else
86
+ bail("Unsupported command #{command}, run with --help to show available commands")
87
+ end
83
88
  rescue AppError => e
84
- bail(e.message)
89
+ bail(e.message)
85
90
  end
@@ -1,24 +1,33 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "version"
4
+
1
5
  Gem::Specification.new do |spec|
2
- spec.name = "carthage_remote_cache"
3
- spec.version = "0.0.3"
6
+ spec.name = "carthage_remote_cache"
7
+ spec.version = VERSION
4
8
 
5
- spec.summary = %q{Centralized cache to serve carthage frameworks. Useful for distributed CI setup with several build machines.}
6
- spec.description = spec.summary
7
- spec.homepage = "https://github.com/kayak/carthage_remote_cache"
8
- spec.license = "Apache-2.0"
9
- spec.authors = ["Juraj Blahunka"]
10
- spec.email = ["jblahunka@kayak.com"]
9
+ spec.summary = %q{Centralized cache to serve carthage frameworks. Useful for distributed CI setup with several build machines.}
10
+ spec.description = spec.summary
11
+ spec.homepage = "https://github.com/kayak/carthage_remote_cache"
12
+ spec.license = "Apache-2.0"
13
+ spec.authors = ["Juraj Blahunka"]
14
+ spec.email = ["jblahunka@kayak.com"]
11
15
 
12
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
16
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
13
17
  f.match(%r{^(test|spec|features|example)/})
14
18
  end
15
- spec.bindir = "bin"
16
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.bindir = "bin"
20
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
21
  spec.require_paths = ["lib"]
18
22
 
19
23
  spec.add_development_dependency "bundler", "~> 1.16"
24
+ spec.add_development_dependency "guard", "~> 2.14.2"
25
+ spec.add_development_dependency "guard-test", "~> 2.0.8"
26
+ spec.add_development_dependency "mocha", "~> 1.3.0"
20
27
  spec.add_development_dependency "rake", "~> 10.0"
21
28
  spec.add_development_dependency "rerun"
29
+ spec.add_development_dependency "rufo"
30
+ spec.add_development_dependency "test-unit", "~> 3.2.7"
22
31
 
23
32
  spec.add_runtime_dependency "concurrent-ruby", "~> 1.0.5"
24
33
  spec.add_runtime_dependency "rack", "~> 2.0.4"
data/lib/api.rb CHANGED
@@ -1,40 +1,45 @@
1
1
  class API
2
+ def initialize(shell, networking, options)
3
+ @shell = shell
4
+ @networking = networking
5
+ @options = options
6
+ end
2
7
 
3
- def initialize(networking, options)
4
- @networking = networking
5
- @options = options
8
+ def version_file_matches_server?(carthage_dependency, version_file)
9
+ if @options[:force]
10
+ false
11
+ else
12
+ server_version_file = @networking.download_version_file(carthage_dependency)
13
+ result = version_file.same_content?(server_version_file)
14
+ server_version_file.remove unless server_version_file.nil?
15
+ result
6
16
  end
17
+ end
7
18
 
8
- def version_file_matches_server?(carthage_dependency, version_file)
9
- if @options[:force]
10
- false
11
- else
12
- server_version_file = @networking.download_version_file(carthage_dependency)
13
- result = version_file.same_content?(server_version_file)
14
- server_version_file.remove unless server_version_file.nil?
15
- result
16
- end
19
+ # @return zip archive size in Bytes
20
+ def create_and_upload_archive(carthage_dependency, framework_name, platform)
21
+ archive = CarthageArchive.new(framework_name, platform)
22
+ archive.create_archive(@shell, carthage_dependency.should_include_dsym)
23
+ archive_size = archive.archive_size
24
+ begin
25
+ @networking.upload_framework_archive(archive.archive_path, carthage_dependency, framework_name, platform)
26
+ ensure
27
+ archive.delete_archive
17
28
  end
29
+ archive_size
30
+ end
18
31
 
19
- def create_and_upload_archive(carthage_dependency, framework_name, platform)
20
- archive = CarthageArchive.new(framework_name, platform)
21
- archive.create_archive
22
- begin
23
- @networking.upload_framework_archive(archive.archive_path, carthage_dependency, framework_name, platform)
24
- ensure
25
- archive.delete_archive
26
- end
32
+ # @return zip archive size in Bytes or nil if archive download failed
33
+ def download_and_unpack_archive(carthage_dependency, framework_name, platform)
34
+ archive = @networking.download_framework_archive(carthage_dependency, framework_name, platform)
35
+ return nil if archive.nil?
36
+ archive_size = archive.archive_size
37
+ begin
38
+ $LOG.debug("Downloaded #{archive.archive_path}")
39
+ archive.unpack_archive(@shell)
40
+ ensure
41
+ archive.delete_archive
27
42
  end
28
-
29
- def download_and_unpack_archive(carthage_dependency, framework_name, platform)
30
- archive = @networking.download_framework_archive(carthage_dependency, framework_name, platform)
31
- return nil if archive.nil?
32
- begin
33
- $LOG.debug("Downloaded #{archive.archive_path}")
34
- archive.unpack_archive
35
- ensure
36
- archive.delete_archive
37
- end
38
- end
39
-
43
+ archive_size
44
+ end
40
45
  end