fwtoolkit 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fwtoolkit/tasks/build_tasks.rb +45 -4
- data/lib/fwtoolkit/version.rb +1 -1
- metadata +2 -2
@@ -3,6 +3,28 @@ require 'rubygems'
|
|
3
3
|
require 'xcodebuild'
|
4
4
|
require 'cucumber/rake/task'
|
5
5
|
|
6
|
+
module XcodeBuild
|
7
|
+
def self.run(args = "", output_buffer = STDOUT)
|
8
|
+
command = "xcodebuild #{args} DSTROOT=/tmp/artifacts 2>&1"
|
9
|
+
#puts command
|
10
|
+
IO.popen(command) do |io|
|
11
|
+
begin
|
12
|
+
while line = io.readline
|
13
|
+
begin
|
14
|
+
output_buffer << line
|
15
|
+
rescue StandardError => e
|
16
|
+
puts "Error from output buffer: #{e.inspect}"
|
17
|
+
puts e.backtrace
|
18
|
+
end
|
19
|
+
end
|
20
|
+
rescue EOFError
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
$?.exitstatus
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
6
28
|
module FWToolkit
|
7
29
|
module Tasks
|
8
30
|
class BuildTask < ::Rake::TaskLib
|
@@ -11,6 +33,8 @@ module FWToolkit
|
|
11
33
|
attr_accessor :workspace
|
12
34
|
attr_accessor :scheme
|
13
35
|
attr_accessor :bundle_identifier
|
36
|
+
attr_accessor :certificate
|
37
|
+
attr_accessor :provisioning_profile
|
14
38
|
|
15
39
|
def initialize(&block)
|
16
40
|
yield self if block_given?
|
@@ -30,15 +54,32 @@ module FWToolkit
|
|
30
54
|
t.formatter = XcodeBuild::Formatters::ProgressFormatter.new
|
31
55
|
end
|
32
56
|
|
57
|
+
XcodeBuild::Tasks::BuildTask.new :release_iphoneos do |t|
|
58
|
+
t.invoke_from_within = '.'
|
59
|
+
t.configuration = "Release"
|
60
|
+
t.sdk = "iphoneos"
|
61
|
+
t.workspace = @workspace
|
62
|
+
t.scheme = @scheme
|
63
|
+
t.formatter = XcodeBuild::Formatters::ProgressFormatter.new
|
64
|
+
end
|
65
|
+
|
66
|
+
desc 'Build IPA file'
|
67
|
+
task :ipa do
|
68
|
+
command = "xcrun -sdk 'iphoneos' PackageApplication -v '/tmp/artifacts/Applications/#{scheme}.app' -o '/tmp/artifacts/Applications/#{scheme}.ipa' --sign '#{certificate}' --embed '#{provisioning_profile}'"
|
69
|
+
sh command
|
70
|
+
end
|
71
|
+
|
33
72
|
desc 'Upload IPA to FWBuild'
|
34
|
-
task :upload
|
35
|
-
file = args.file
|
73
|
+
task :upload do
|
36
74
|
auth_token=ENV['FWBUILD_AUTH_TOKEN']
|
37
|
-
file_name =
|
75
|
+
file_name = "#{scheme}.ipa"
|
38
76
|
key = File.join('uploads', file_name)
|
39
|
-
sh("curl -X POST -F 'key=#{key}' -F 'acl=bucket-owner-full-control' -F 'file
|
77
|
+
sh("curl -X POST -F 'key=#{key}' -F 'acl=bucket-owner-full-control' -F 'file=@/tmp/artifacts/Applications/#{scheme}.ipa' https://fw.fwbuild.production.s3.amazonaws.com/ --progress-bar")
|
40
78
|
sh("curl 'http://fwbuild.futureworkshops.com/apps/builds.json?bundle_identifier=#{@bundle_identifier}&s3_upload_name=#{file_name}&auth_token=#{auth_token}'")
|
41
79
|
end
|
80
|
+
|
81
|
+
desc 'Build and Upload IPA'
|
82
|
+
task :build_upload => ['release_iphoneos:archive', :ipa, :upload]
|
42
83
|
end
|
43
84
|
|
44
85
|
namespace :frank do
|
data/lib/fwtoolkit/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fwtoolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cucumber
|