motion-testflight 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +22 -0
- data/README.rdoc +74 -0
- data/lib/motion-testflight.rb +25 -0
- data/lib/motion/project/testflight.rb +111 -0
- metadata +67 -0
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012, Laurent Sansonetti <lrz@hipbyte.com>
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
8
|
+
list of conditions and the following disclaimer.
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
11
|
+
and/or other materials provided with the distribution.
|
12
|
+
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
14
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
15
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
16
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
17
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
18
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
19
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
20
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
21
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
22
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
= motion-testflight
|
2
|
+
|
3
|
+
motion-testflight allows RubyMotion projects to easily embed the TestFlight
|
4
|
+
SDK and be submitted to the TestFlight platform.
|
5
|
+
|
6
|
+
== Requirements
|
7
|
+
|
8
|
+
* RubyMotion 1.0 or greater (see http://www.rubymotion.com).
|
9
|
+
* A TestFlight account, can be obtained for free at http://testflightapp.com.
|
10
|
+
|
11
|
+
== Installation
|
12
|
+
|
13
|
+
$ sudo gem install motion-testflight
|
14
|
+
|
15
|
+
== Setup
|
16
|
+
|
17
|
+
1. Download the TestFlight SDK package from https://testflightapp.com/sdk/download/ and unpack it into the +vendor/TestFlightSDK+ directory of your RubyMotion project. Create the +vendor+ directory if it does not exist. You should have something like this.
|
18
|
+
|
19
|
+
$ ls vendor/TestFlightSDK
|
20
|
+
README.txt libTestFlight.a
|
21
|
+
TestFlight.h release_notes.txt
|
22
|
+
|
23
|
+
2. Edit the +Rakefile+ of your RubyMotion project and add the following require line.
|
24
|
+
|
25
|
+
require 'motion-testflight'
|
26
|
+
|
27
|
+
3. Still in the +Rakefile+, set up the +sdk+, +api_token+ and +team_token+ variables in your application configuration block.
|
28
|
+
|
29
|
+
Motion::Project::App.setup do |app|
|
30
|
+
# ...
|
31
|
+
app.testflight.sdk = 'vendor/TestFlight'
|
32
|
+
app.testflight.api_token = '<insert your API token here>'
|
33
|
+
app.testflight.team_token = '<insert your team token here>'
|
34
|
+
end
|
35
|
+
|
36
|
+
You can retrieve the values for +api_token+ and +team_token+ in your TestFlight account page.
|
37
|
+
|
38
|
+
4. (Optional) You can also set up distribution lists, if needed.
|
39
|
+
|
40
|
+
Motion::Project::App.setup do |app|
|
41
|
+
# ...
|
42
|
+
app.testflight.distribution_lists = ['CoolKids']
|
43
|
+
end
|
44
|
+
|
45
|
+
== Usage
|
46
|
+
|
47
|
+
motion-testflight introduces a +testflight+ Rake task to your project, which can be used to submit a development build. The +notes+ parameter must be provided, and its content will be used as the submission release notes.
|
48
|
+
|
49
|
+
$ rake testflight notes="zomg!"
|
50
|
+
|
51
|
+
== License
|
52
|
+
|
53
|
+
Copyright (c) 2012, Laurent Sansonetti <lrz@hipbyte.com>
|
54
|
+
All rights reserved.
|
55
|
+
|
56
|
+
Redistribution and use in source and binary forms, with or without
|
57
|
+
modification, are permitted provided that the following conditions are met:
|
58
|
+
|
59
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
60
|
+
list of conditions and the following disclaimer.
|
61
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
62
|
+
this list of conditions and the following disclaimer in the documentation
|
63
|
+
and/or other materials provided with the distribution.
|
64
|
+
|
65
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
66
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
67
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
68
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
69
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
70
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
71
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
72
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
73
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
74
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Copyright (c) 2012, Laurent Sansonetti <lrz@hipbyte.com>
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# 1. Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
10
|
+
# this list of conditions and the following disclaimer in the documentation
|
11
|
+
# and/or other materials provided with the distribution.
|
12
|
+
#
|
13
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
14
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
15
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
16
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
17
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
18
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
19
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
20
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
21
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
22
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
23
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
24
|
+
|
25
|
+
require 'motion/project/testflight'
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# Copyright (c) 2012, Laurent Sansonetti <lrz@hipbyte.com>
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# 1. Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
10
|
+
# this list of conditions and the following disclaimer in the documentation
|
11
|
+
# and/or other materials provided with the distribution.
|
12
|
+
#
|
13
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
14
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
15
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
16
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
17
|
+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
18
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
19
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
20
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
21
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
22
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
23
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
24
|
+
|
25
|
+
unless defined?(Motion::Project::Config)
|
26
|
+
raise "This file must be required within a RubyMotion project Rakefile."
|
27
|
+
end
|
28
|
+
|
29
|
+
class TestFlightConfig
|
30
|
+
attr_accessor :sdk, :api_token, :team_token, :distribution_lists
|
31
|
+
|
32
|
+
def initialize(config)
|
33
|
+
@config = config
|
34
|
+
end
|
35
|
+
|
36
|
+
def sdk=(sdk)
|
37
|
+
if @sdk != sdk
|
38
|
+
@config.unvendor_project(@sdk)
|
39
|
+
@sdk = sdk
|
40
|
+
@config.vendor_project(sdk, :static)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def team_token=(team_token)
|
45
|
+
@team_token = team_token
|
46
|
+
create_launcher
|
47
|
+
end
|
48
|
+
|
49
|
+
def inspect
|
50
|
+
{:sdk => sdk, :api_token => api_token, :team_token => team_token, :distribution_lists => distribution_lists}.inspect
|
51
|
+
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
def create_launcher
|
56
|
+
return unless team_token
|
57
|
+
launcher_code = <<EOF
|
58
|
+
# This file is automatically generated. Do not edit.
|
59
|
+
|
60
|
+
if Object.const_defined?('TestFlight') and !UIDevice.currentDevice.model.include?('Simulator')
|
61
|
+
NSNotificationCenter.defaultCenter.addObserverForName(UIApplicationDidBecomeActiveNotification, object:nil, queue:nil, usingBlock:lambda do |notification|
|
62
|
+
TestFlight.takeOff('#{team_token}')
|
63
|
+
end)
|
64
|
+
end
|
65
|
+
EOF
|
66
|
+
launcher_file = './app/testflight_launcher.rb'
|
67
|
+
if !File.exist?(launcher_file) or File.read(launcher_file) != launcher_code
|
68
|
+
File.open(launcher_file, 'w') { |io| io.write(launcher_code) }
|
69
|
+
end
|
70
|
+
files = @config.files
|
71
|
+
files << launcher_file unless files.find { |x| File.expand_path(x) == File.expand_path(launcher_file) }
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
module Motion; module Project; class Config
|
76
|
+
variable :testflight
|
77
|
+
|
78
|
+
def testflight
|
79
|
+
@testflight ||= TestFlightConfig.new(self)
|
80
|
+
end
|
81
|
+
end; end; end
|
82
|
+
|
83
|
+
namespace 'testflight' do
|
84
|
+
desc "Submit a development archive to TestFlight"
|
85
|
+
task :submit => 'archive:development' do
|
86
|
+
# Retrieve configuration settings.
|
87
|
+
prefs = App.config.testflight
|
88
|
+
App.fail "A value for app.testflight.api_token is mandatory" unless prefs.api_token
|
89
|
+
App.fail "A value for app.testflight.team_token is mandatory" unless prefs.team_token
|
90
|
+
distribution_lists = (prefs.distribution_lists ? prefs.distribution_lists.join(',') : nil)
|
91
|
+
notes = ENV['notes']
|
92
|
+
App.fail "Submission notes must be provided via the `notes' environment variable. Example: rake testflight notes='w00t'" unless notes
|
93
|
+
|
94
|
+
# An archived version of the .dSYM bundle is needed.
|
95
|
+
app_dsym = App.config.app_bundle('iPhoneOS').sub(/\.app$/, '.dSYM')
|
96
|
+
app_dsym_zip = app_dsym + '.zip'
|
97
|
+
if !File.exist?(app_dsym_zip) or File.mtime(app_dsym) > File.mtime(app_dsym_zip)
|
98
|
+
Dir.chdir(File.dirname(app_dsym)) do
|
99
|
+
sh "/usr/bin/zip -q -r \"#{File.basename(app_dsym)}.zip\" \"#{File.basename(app_dsym)}\""
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
curl = "/usr/bin/curl http://testflightapp.com/api/builds.json -F file=@\"#{App.config.archive}\" -F dsym=@\"#{app_dsym_zip}\" -F api_token='#{prefs.api_token}' -F team_token='#{prefs.team_token}' -F notes=\"#{notes}\" -F notify=True"
|
104
|
+
curl << " -F distribution_lists='#{distribution_lists}'" if distribution_lists
|
105
|
+
App.info 'Run', curl
|
106
|
+
sh curl
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
desc 'Same as testflight:submit'
|
111
|
+
task 'testflight' => 'testflight:submit'
|
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: motion-testflight
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
version: "1.0"
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Laurent Sansonetti
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2012-05-03 00:00:00 Z
|
18
|
+
dependencies: []
|
19
|
+
|
20
|
+
description: motion-testflight allows RubyMotion projects to easily embed the TestFlight SDK and be submitted to the TestFlight platform.
|
21
|
+
email: lrz@hipbyte.com
|
22
|
+
executables: []
|
23
|
+
|
24
|
+
extensions: []
|
25
|
+
|
26
|
+
extra_rdoc_files: []
|
27
|
+
|
28
|
+
files:
|
29
|
+
- README.rdoc
|
30
|
+
- LICENSE
|
31
|
+
- lib/motion/project/testflight.rb
|
32
|
+
- lib/motion-testflight.rb
|
33
|
+
homepage: http://www.rubymotion.com
|
34
|
+
licenses: []
|
35
|
+
|
36
|
+
post_install_message:
|
37
|
+
rdoc_options: []
|
38
|
+
|
39
|
+
require_paths:
|
40
|
+
- lib
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
hash: 3
|
47
|
+
segments:
|
48
|
+
- 0
|
49
|
+
version: "0"
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
hash: 3
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
version: "0"
|
59
|
+
requirements: []
|
60
|
+
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 1.8.21
|
63
|
+
signing_key:
|
64
|
+
specification_version: 3
|
65
|
+
summary: TestFlight integration for RubyMotion projects
|
66
|
+
test_files: []
|
67
|
+
|