ipa_install_plist_generator 0.1.0 → 0.2.0

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: 46b71d4621854f2d4708bd124eb4427808ac953c
4
- data.tar.gz: d2d26944ebe0129b1b0892fad985e1ab628e1429
3
+ metadata.gz: 31edc89e8d250cca4ad93e14b33996ca65cd1e3d
4
+ data.tar.gz: c325e37535fb8494d4291f53cedea40bbf0e7c72
5
5
  SHA512:
6
- metadata.gz: 4985fd2480fa12d8d26b0e564482af2b6ccbeed8cc05708dad83769839a3a4e9e0df32b1a4573a2c0acbe44d8f243e26e1510ff4a10ed1f2860b23cc27115cd5
7
- data.tar.gz: f61a9531165c62415150f362c1b7af95c457200d4ac3538a634216ced5e2a8f6ab47269ee9a03eac6fe2615444191862cb5b884ef3c59f6289fac2c81afadddd
6
+ metadata.gz: 17a0c78d5c0d2f48c1173c4e8ba2d399f78a4290d6af324bc73cb0af93a8a139db4fb32e207f12f76d12bce30796cdf30bef7c06bfcb84e35d00bc2b8813ecc5
7
+ data.tar.gz: 25876f12f4c2ffbd8aa4216074b93a6595303e5a04b1200dcc608f5bf5b33a025c3892a6d228b2a34be03f334edcd67153cd9f00251df9897fb2560c6075dd0b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ipa_install_plist_generator (0.1.0)
4
+ ipa_install_plist_generator (0.2.0)
5
5
  plist (~> 3.1, >= 3.1.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,6 +1,83 @@
1
- # ipa_install_plist_generator
1
+ # IPA install Plist and link generator
2
2
 
3
- Generates a .plist which can be used for an IPA install
3
+ Ruby GEM to generate a .plist which can be used for an IPA install.
4
4
 
5
- **This code will be converted to a Ruby Gem
6
- once the basic functionality is implemented**
5
+ This GEM can be used in your Ruby project directly or
6
+ you can install it and use it in your Command Line / Terminal.
7
+
8
+ You can use this GEM as a CLI in two modes:
9
+
10
+ 1. To generate a .plist file which you can save to your server to install an iOS app .ipa. Use the `ipa_plist_gen` command in your Command Line / Terminal.
11
+ 2. Once you have an install .plist file and you uploaded it to your server (the URL have to be HTTPS, starting with iOS 8 a normal HTTP URL is not valid for app install!) you can generate an install link by providing the URL of the .plist file. You can then include this link in an email or on your website. A user (who's device is in the Provisioning Profile the .ipa was built with) can then open this special itms link to install the app (.ipa) on an iOS device. Use the `ipa_install_link_gen` command in your Command Line / Terminal.
12
+
13
+
14
+ ## Generate the install .plist
15
+
16
+ To generate a .plist file you can call the gem from your Command Line / Terminal:
17
+
18
+ $ ipa_plist_gen -i 'https://my-server/ipa-path.ipa' -b 'bundle.id' -t 'App Title'
19
+
20
+ This will print the .plist file to the standard output, you can redirect it to save it to a file or just copy-paste it into a .plist file.
21
+
22
+ At the moment a valid install .plist file have to contain the .ipa file's download url, a bundle ID and the app's title. You can define additional information if you want to.
23
+
24
+ Calling the `ipa_plist_gen` with every parameter looks like this:
25
+
26
+ $ ipa_plist_gen -i 'https://my-server/ipa-path.ipa' -b 'bundle.id' -t 'App Title' --bundle-version '1.0.0' --display-image 'disp.img' --full-size-image 'full.img'
27
+
28
+ And it generated the .plist:
29
+
30
+ <?xml version="1.0" encoding="UTF-8"?>
31
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
32
+ <plist version="1.0">
33
+ <dict>
34
+ <key>items</key>
35
+ <array>
36
+ <dict>
37
+ <key>assets</key>
38
+ <array>
39
+ <dict>
40
+ <key>kind</key>
41
+ <string>software-package</string>
42
+ <key>url</key>
43
+ <string>https://my-server/ipa-path.ipa</string>
44
+ </dict>
45
+ <dict>
46
+ <key>kind</key>
47
+ <string>display-image</string>
48
+ <key>needs-shine</key>
49
+ <false/>
50
+ <key>url</key>
51
+ <string>disp.img</string>
52
+ </dict>
53
+ <dict>
54
+ <key>kind</key>
55
+ <string>full-size-image</string>
56
+ <key>needs-shine</key>
57
+ <false/>
58
+ <key>url</key>
59
+ <string>full.img</string>
60
+ </dict>
61
+ </array>
62
+ <key>metadata</key>
63
+ <dict>
64
+ <key>bundle-identifier</key>
65
+ <string>bundle.id</string>
66
+ <key>bundle-version</key>
67
+ <string>1.0.0</string>
68
+ <key>kind</key>
69
+ <string>software</string>
70
+ <key>title</key>
71
+ <string>App Title</string>
72
+ </dict>
73
+ </dict>
74
+ </array>
75
+ </dict>
76
+ </plist>
77
+
78
+
79
+ ## Generate an install link for the .plist file
80
+
81
+ Once you uploaded this .plist file to your server you can generate the special `itms-services` link in the Command Line / Terminal:
82
+
83
+ $ ipa_install_link_gen -l 'https://my-server/install.plist'
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+
5
+ $:.push File.expand_path("../../lib", __FILE__)
6
+ require 'ipa_install_plist_generator'
7
+
8
+
9
+ # -------------------------
10
+ # --- Options
11
+
12
+ options = {
13
+ install_plist_url: nil,
14
+ # utils
15
+ is_verbose: false
16
+ }
17
+
18
+ opt_parser = OptionParser.new do |opt|
19
+ opt.banner = "Usage: ipa_install_plist_generator.rb [OPTIONS]"
20
+ opt.separator ""
21
+ opt.separator "Options, the ones marked with * are required"
22
+
23
+ opt.on("-l","--link LINK_URL", "*Plist download URL. It will print an install-url (to the Plist's URL you provide) which can be opened on an iOS device to install the app (itms-services://?action=download-manifest&url=https://path/to/app.plist).") do |value|
24
+ options[:install_plist_url] = value
25
+ end
26
+
27
+ opt.on("-v","--verbose","Verbose output") do
28
+ options[:is_verbose] = true
29
+ end
30
+
31
+ opt.on("-h","--help","Shows this help message") do
32
+ puts opt_parser
33
+ exit 0
34
+ end
35
+ end
36
+
37
+ opt_parser.parse!
38
+ $options = options
39
+
40
+
41
+ # -------------------------
42
+ # --- Utils
43
+
44
+ def vputs(msg="")
45
+ if $options[:is_verbose]
46
+ puts msg
47
+ end
48
+ end
49
+
50
+
51
+ # -------------------------
52
+ # --- Main
53
+
54
+ vputs "options: #{options}"
55
+
56
+ raise "No .plist URL specified" unless options[:install_plist_url]
57
+
58
+ inst_url = options[:install_plist_url]
59
+ full_itms_install_url = IpaInstallPlistGenerator::LinkGenerator.new.generate_install_link(inst_url)
60
+ puts full_itms_install_url
61
+ exit 0
data/bin/ipa_plist_gen ADDED
@@ -0,0 +1,99 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+
5
+ $:.push File.expand_path("../../lib", __FILE__)
6
+ require 'ipa_install_plist_generator'
7
+
8
+
9
+ # -------------------------
10
+ # --- Options
11
+
12
+ options = {
13
+ ipa_download_url: nil,
14
+ bundle_identifier: nil,
15
+ app_title: nil,
16
+ bundle_version: nil,
17
+ display_image: nil,
18
+ full_size_image: nil,
19
+ # utils
20
+ is_verbose: false
21
+ }
22
+
23
+ opt_parser = OptionParser.new do |opt|
24
+ opt.banner = "Usage: ipa_install_plist_generator.rb [OPTIONS]"
25
+ opt.separator ""
26
+ opt.separator "Options, the ones marked with * are required"
27
+
28
+ opt.on("-i","--ipa IPA_DOWNLOAD_URL", "*IPA download url") do |value|
29
+ options[:ipa_download_url] = value
30
+ end
31
+
32
+ opt.on("-b", "--bundle-identifier BUNDLE_ID", "*Metadata: Bundle ID") do |value|
33
+ options[:bundle_identifier] = value
34
+ end
35
+
36
+ opt.on("-t", "--app-title APP_TITLE", "*Metadata: App Title") do |value|
37
+ options[:app_title] = value
38
+ end
39
+
40
+ opt.on("--bundle-version BUNDLE_VERSION", "Metadata: Bundle Version") do |value|
41
+ options[:bundle_version] = value
42
+ end
43
+
44
+ opt.on("--display-image DISPLAY_IMAGE", "Assets: Display Image") do |value|
45
+ options[:display_image] = value
46
+ end
47
+
48
+ opt.on("--full-size-image FULL_SIZE_IMAGE", "Assets: Full Size Image") do |value|
49
+ options[:full_size_image] = value
50
+ end
51
+
52
+ opt.on("-v","--verbose","Verbose output") do
53
+ options[:is_verbose] = true
54
+ end
55
+
56
+ opt.on("-h","--help","Shows this help message") do
57
+ puts opt_parser
58
+ exit 0
59
+ end
60
+ end
61
+
62
+ opt_parser.parse!
63
+ $options = options
64
+
65
+
66
+ # -------------------------
67
+ # --- Utils
68
+
69
+ def vputs(msg="")
70
+ if $options[:is_verbose]
71
+ puts msg
72
+ end
73
+ end
74
+
75
+
76
+ # -------------------------
77
+ # --- Main
78
+
79
+ vputs "options: #{options}"
80
+
81
+
82
+ raise "No IPA download URL specified" unless options[:ipa_download_url]
83
+ raise "No Bundle Identifier specified" unless options[:bundle_identifier]
84
+ raise "No App Title specified" unless options[:app_title]
85
+
86
+ exit_code = 0
87
+
88
+ plist_string = IpaInstallPlistGenerator::PlistGenerator.new.generate_plist_string(
89
+ options[:ipa_download_url],
90
+ options[:bundle_identifier],
91
+ options[:app_title],
92
+ # optional
93
+ options[:bundle_version],
94
+ options[:display_image],
95
+ options[:full_size_image])
96
+
97
+ puts plist_string
98
+
99
+ exit exit_code
@@ -21,6 +21,6 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.files = Dir["./**/*"].reject { |file| file =~ /\.\/(bin|log|pkg|script|spec|test|vendor)/ }
23
23
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
24
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
24
+ s.executables = ['ipa_plist_gen', 'ipa_install_link_gen']
25
25
  s.require_paths = ["lib"]
26
26
  end
@@ -2,7 +2,8 @@ require 'plist'
2
2
 
3
3
  module IpaInstallPlistGenerator
4
4
  class PlistGenerator
5
- def generate_plist_string(ipa_download_url, bundle_identifier, app_title, bundle_version=nil)
5
+ def generate_plist_string(ipa_download_url, bundle_identifier, app_title,
6
+ bundle_version=nil, display_image=nil, full_size_image=nil)
6
7
 
7
8
  raise "No IPA download URL specified" unless ipa_download_url
8
9
  raise "No Bundle Identifier specified" unless bundle_identifier
@@ -25,6 +26,20 @@ module IpaInstallPlistGenerator
25
26
  kind: 'software-package',
26
27
  url: ipa_download_url
27
28
  }
29
+ if display_image
30
+ asset_items << {
31
+ 'kind' => 'display-image',
32
+ 'needs-shine' => false,
33
+ 'url' => display_image
34
+ }
35
+ end
36
+ if full_size_image
37
+ asset_items << {
38
+ 'kind' => 'full-size-image',
39
+ 'needs-shine' => false,
40
+ 'url' => full_size_image
41
+ }
42
+ end
28
43
 
29
44
  # - create the Plist
30
45
  plist_content_item = {
@@ -1,3 +1,3 @@
1
1
  module IpaInstallPlistGenerator
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipa_install_plist_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bitrise
@@ -61,7 +61,9 @@ dependencies:
61
61
  version: '0'
62
62
  description: Generate iOS .ipa (app) install Plist file and link
63
63
  email: letsconnect@bitrise.io
64
- executables: []
64
+ executables:
65
+ - ipa_plist_gen
66
+ - ipa_install_link_gen
65
67
  extensions: []
66
68
  extra_rdoc_files: []
67
69
  files:
@@ -76,6 +78,8 @@ files:
76
78
  - "./lib/ipa_install_plist_generator/install_link_generator.rb"
77
79
  - "./lib/ipa_install_plist_generator/install_plist_generator.rb"
78
80
  - "./lib/ipa_install_plist_generator/version.rb"
81
+ - bin/ipa_install_link_gen
82
+ - bin/ipa_plist_gen
79
83
  homepage:
80
84
  licenses:
81
85
  - MIT