high_five 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/high_five.gemspec +1 -0
- data/lib/high_five/android_helper.rb +7 -0
- data/lib/high_five/ios_helper.rb +34 -1
- data/lib/high_five/thor/task.rb +1 -0
- data/lib/high_five/thor/tasks/android_tasks.rb +8 -2
- data/lib/high_five/thor/tasks/development.rb +33 -0
- data/lib/high_five/thor/tasks/distribution.rb +15 -15
- data/lib/high_five/thor/tasks/ios_tasks.rb +43 -10
- data/lib/high_five/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f86f1d189b6004fcf4d9a7789cbd3bc0122508b1
|
4
|
+
data.tar.gz: 4aeb3bcac8a145dc620e470bfe1b3aaa2cf3e5d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b346f72f41ca7c65591307782e91a81f590f605479526ea2661bb8ae8b539a87577440a6a9957caa57ed690c43fc3e4d1b50503b3fadc0f73b4eb1d76982c81
|
7
|
+
data.tar.gz: db63e4acb6a6e52ad9b51061fd7b5068817b01c7ecdf0493cdfd864b41bd7e6439ab5ad16cbac1d974ac50ce8a7cdf3c9e75742697d4aae701ec95b88eb51cf8
|
data/Gemfile.lock
CHANGED
data/high_five.gemspec
CHANGED
@@ -10,7 +10,14 @@ module HighFive
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def android_manifest_path
|
13
|
+
if options[:platform_path]
|
14
|
+
platform_path = File.join(options[:platform_path], "AndroidManifest.xml")
|
15
|
+
return platform_path if File.exists?(platform_path)
|
16
|
+
end
|
17
|
+
|
13
18
|
platform_config = base_config.build_platform_config(:android)
|
19
|
+
return platform_config.android_manifest if platform_config.android_manifest
|
20
|
+
|
14
21
|
destination_dir = platform_config.destination
|
15
22
|
root_dir = destination_dir
|
16
23
|
while true
|
data/lib/high_five/ios_helper.rb
CHANGED
@@ -12,8 +12,23 @@ module HighFive
|
|
12
12
|
nil
|
13
13
|
end
|
14
14
|
|
15
|
+
|
16
|
+
def ios_path
|
17
|
+
if options[:platform_path]
|
18
|
+
ios_path = options[:platform_path]
|
19
|
+
else
|
20
|
+
ios_path = File.dirname xcodeproj_path
|
21
|
+
end
|
22
|
+
|
23
|
+
if !ios_path
|
24
|
+
raise "Couldn't find the path of the xcodeproj."
|
25
|
+
end
|
26
|
+
|
27
|
+
ios_path
|
28
|
+
end
|
29
|
+
|
15
30
|
def info_plist_path(target=nil)
|
16
|
-
root_dir =
|
31
|
+
root_dir = ios_path
|
17
32
|
target = "*" if target.nil?
|
18
33
|
info = Dir["#{root_dir}/**/#{target}-Info.plist"].first
|
19
34
|
raise "Couldn't find infoplist" if info.nil?
|
@@ -31,5 +46,23 @@ module HighFive
|
|
31
46
|
raise "Couldn't find xcodeproj near #{destination_dir}" if root_dir == '/'
|
32
47
|
end
|
33
48
|
end
|
49
|
+
|
50
|
+
def ios_icon_sizes
|
51
|
+
{
|
52
|
+
old_iphone: 57,
|
53
|
+
old_iphone_retina: 114,
|
54
|
+
iphone_retina: 120,
|
55
|
+
old_ipad: 72,
|
56
|
+
old_ipad_retina: 177,
|
57
|
+
ipad: 76,
|
58
|
+
ipad_retina: 152,
|
59
|
+
old_spotlight: 29,
|
60
|
+
old_spotlight_retina: 58,
|
61
|
+
spotlight: 40,
|
62
|
+
spotlight_retina: 80,
|
63
|
+
spotlight_ipad: 50,
|
64
|
+
spotlight_ipad_retina: 100
|
65
|
+
}
|
66
|
+
end
|
34
67
|
end
|
35
68
|
end
|
data/lib/high_five/thor/task.rb
CHANGED
@@ -26,10 +26,10 @@ module HighFive
|
|
26
26
|
method_option :version, :aliases => "-v", :desc => "Set main version"
|
27
27
|
method_option :build_number, :aliases => '-b', :desc => "set build number"
|
28
28
|
method_option :environment, :aliases => '-e', :desc => "Set environment"
|
29
|
+
method_option :platform_path, desc: "Path to the ios or android directory"
|
29
30
|
def set_version
|
30
|
-
config = base_config.build_platform_config(:android).build_platform_config(options[:environment])
|
31
31
|
# read and parse the old file
|
32
|
-
file = File.read(
|
32
|
+
file = File.read(android_manifest_path)
|
33
33
|
xml = Nokogiri::XML(file)
|
34
34
|
|
35
35
|
# replace \n and any additional whitespace with a space
|
@@ -53,6 +53,7 @@ module HighFive
|
|
53
53
|
end
|
54
54
|
|
55
55
|
desc "set_icon", "Generate app icons from base png image"
|
56
|
+
method_option :platform_path, desc: "Path to the ios or android directory"
|
56
57
|
def set_icon(path)
|
57
58
|
image = ChunkyPNG::Image.from_file(path)
|
58
59
|
|
@@ -67,6 +68,11 @@ module HighFive
|
|
67
68
|
puts "Writing #{size}x#{size} -> #{File.join(dir, icon_name)}"
|
68
69
|
end
|
69
70
|
end
|
71
|
+
|
72
|
+
private
|
73
|
+
def config
|
74
|
+
base_config.build_platform_config(:android).build_platform_config(options[:environment])
|
75
|
+
end
|
70
76
|
end
|
71
77
|
end
|
72
78
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'webrick'
|
2
|
+
module HighFive
|
3
|
+
module Thor
|
4
|
+
module Tasks
|
5
|
+
class Development < ::HighFive::Thor::Task
|
6
|
+
include ::Thor::Actions
|
7
|
+
|
8
|
+
desc "server", "Run a web server for a specific environment or path"
|
9
|
+
method_option :platform, :aliases => "-e", :desc => "Environemnt [production|development]", :default => "development"
|
10
|
+
method_option :platform_path, :desc => "Path to ios or android directory for the platform we want to serve"
|
11
|
+
def server(platform="web")
|
12
|
+
root = nil
|
13
|
+
if options[:platform_path]
|
14
|
+
[File.join(options[:platform_path], 'www'), File.join(options[:platform_path], 'assets', 'www')].each do |path|
|
15
|
+
if File.exist? path
|
16
|
+
root = path
|
17
|
+
break
|
18
|
+
end
|
19
|
+
end
|
20
|
+
else
|
21
|
+
root = base_config.build_platform_config(platform).destination_root
|
22
|
+
end
|
23
|
+
|
24
|
+
puts "Starting server with root=#{root}"
|
25
|
+
|
26
|
+
server = WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => root)
|
27
|
+
trap 'INT' do server.shutdown end
|
28
|
+
server.start
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -18,22 +18,22 @@ module HighFive
|
|
18
18
|
method_option :install, :aliases => "-i", type: :boolean, :desc => "Install on device after building"
|
19
19
|
method_option :environment, :aliases => "-e", :desc => "Environemnt [production|development]", :default => "development"
|
20
20
|
method_option :"ant-flags", :desc => "Additional flags to pass directly to ant (android only)"
|
21
|
-
|
21
|
+
method_option :platform_path, :desc => "Path to ios or android directory"
|
22
22
|
def dist(platform)
|
23
23
|
@environment = options[:environment]
|
24
24
|
@output_file_name = options[:output_file_name]
|
25
25
|
@sign_identity = options[:sign_identity]
|
26
26
|
@provisioning_profile = options[:provisioning_profile]
|
27
|
+
@platform_path = options[:platform_path]
|
27
28
|
@platform = platform
|
28
|
-
@config = base_config.build_platform_config(@platform).build_platform_config(@environment)
|
29
|
-
@config_root = File.join("config", "high_five")
|
30
|
-
|
31
|
-
raise "Please set config.destination" if @config.destination.nil?
|
32
|
-
self.destination_root = @config.destination
|
33
29
|
|
34
30
|
if @platform == "android" || @platform == "amazon"
|
35
|
-
|
36
|
-
|
31
|
+
if @platform_path
|
32
|
+
android_path = @platform_path
|
33
|
+
else
|
34
|
+
manifest_path = config.android_manifest || android_manifest_path
|
35
|
+
android_path = File.dirname(manifest_path)
|
36
|
+
end
|
37
37
|
|
38
38
|
dist_android(android_path)
|
39
39
|
if options[:install]
|
@@ -43,14 +43,8 @@ module HighFive
|
|
43
43
|
raise "Please pass in the code sign identity to build an ios app. -s [sign_identity]" if @sign_identity.nil?
|
44
44
|
raise "Please pass in the path to the provisioning profile to build an ios app. -p [provisioning_profile]" if @provisioning_profile.nil?
|
45
45
|
|
46
|
-
ios_path = File.dirname(xcodeproj_path())
|
47
|
-
|
48
|
-
if !ios_path
|
49
|
-
raise "Couldn't find the path of the xcodeproj."
|
50
|
-
end
|
51
|
-
|
52
46
|
ios_project_name = File.basename(Dir[ios_path + "/*.xcodeproj"].first, '.xcodeproj')
|
53
|
-
ios_target = options[:target] ||
|
47
|
+
ios_target = options[:target] || config.ios_target || ios_project_name
|
54
48
|
keychain = ios_project_name.gsub(/\s/, '').gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').gsub(/([a-z\d])([A-Z])/,'\1_\2').tr("-", "_").downcase + '-ios.keychain'
|
55
49
|
|
56
50
|
@output_file_name ||= ios_target
|
@@ -83,6 +77,12 @@ module HighFive
|
|
83
77
|
def install_android(android_path)
|
84
78
|
system("ant -file '#{android_path}/build.xml' installr")
|
85
79
|
end
|
80
|
+
|
81
|
+
private
|
82
|
+
|
83
|
+
def config
|
84
|
+
base_config.build_platform_config(@platform).build_platform_config(@environment)
|
85
|
+
end
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
@@ -14,13 +14,8 @@ module HighFive
|
|
14
14
|
method_option :build_number, :aliases => '-b', :desc => "set build number"
|
15
15
|
method_option :environment, :aliases => '-e', :desc => "environment"
|
16
16
|
method_option :target, :aliases => '-t', :desc => "Use a specific target (i.e. <Target>.plist"
|
17
|
+
method_option :platform_path, :desc => "Path to ios or android directory"
|
17
18
|
def set_version
|
18
|
-
config = base_config.build_platform_config(:ios).build_platform_config(options[:environment])
|
19
|
-
target = options[:target] || config.ios_target
|
20
|
-
info = info_plist_path(target)
|
21
|
-
puts "Using #{info}"
|
22
|
-
plist = Plist::parse_xml(info)
|
23
|
-
|
24
19
|
if (options[:version])
|
25
20
|
puts "Changing version from #{plist["CFBundleShortVersionString"]} => #{options[:version]}"
|
26
21
|
plist["CFBundleShortVersionString"] = options[:version]
|
@@ -30,15 +25,53 @@ module HighFive
|
|
30
25
|
puts "Changind build number from #{plist["CFBundleVersion"]} => #{options[:build_number]}"
|
31
26
|
plist["CFBundleVersion"] = options[:build_number]
|
32
27
|
end
|
33
|
-
File.open(
|
28
|
+
File.open(plist_path, 'w') do |f|
|
34
29
|
f.write(Plist::Emit.dump(plist))
|
35
30
|
end
|
36
31
|
puts "Wrote Info.plist succesfully"
|
37
32
|
end
|
38
33
|
|
39
|
-
desc "
|
40
|
-
|
41
|
-
|
34
|
+
desc "set_icon", "Generate app icons from base png image"
|
35
|
+
method_option :target, :aliases => '-t', :desc => "Use a specific target (i.e. <Target>.plist"
|
36
|
+
method_option :platform_path, :desc => "Path to ios or android directory"
|
37
|
+
def set_icon(path)
|
38
|
+
image = ChunkyPNG::Image.from_file(path)
|
39
|
+
|
40
|
+
icon_files = plist['CFBundleIcons']["CFBundlePrimaryIcon"]["CFBundleIconFiles"]
|
41
|
+
icon_files += [ plist['CFBundleIconFile'] ]
|
42
|
+
icon_files += plist['CFBundleIcons~ipad']["CFBundlePrimaryIcon"]["CFBundleIconFiles"]
|
43
|
+
|
44
|
+
icon_files.each do |icon_entry|
|
45
|
+
icon_file_name = icon_entry
|
46
|
+
unless icon_entry.end_with? ".png"
|
47
|
+
icon_file_name += ".png"
|
48
|
+
end
|
49
|
+
|
50
|
+
old_icon_path = Dir[File.join(ios_path, "**/#{icon_file_name}")].first
|
51
|
+
if old_icon_path.nil?
|
52
|
+
puts "Skipping #{icon_entry} because the file is missing. This will cause problems with app store submission"
|
53
|
+
next
|
54
|
+
end
|
55
|
+
print "Replacing #{old_icon_path}..."
|
56
|
+
old_image = ChunkyPNG::Image.from_file(old_icon_path)
|
57
|
+
puts "#{old_image.width}x#{old_image.height}"
|
58
|
+
|
59
|
+
image.resize(old_image.height, old_image.width).save(old_icon_path)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def target
|
66
|
+
options[:target] || base_config.build_platform_config(:ios).build_platform_config(options[:environment]).ios_target
|
67
|
+
end
|
68
|
+
|
69
|
+
def plist_path
|
70
|
+
info_plist_path(target)
|
71
|
+
end
|
72
|
+
|
73
|
+
def plist
|
74
|
+
@plist ||= Plist::parse_xml(plist_path)
|
42
75
|
end
|
43
76
|
end
|
44
77
|
end
|
data/lib/high_five/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: high_five
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Samson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: webrick
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: rspec
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,6 +212,7 @@ files:
|
|
198
212
|
- lib/high_five/thor/tasks.rb
|
199
213
|
- lib/high_five/thor/tasks/android_tasks.rb
|
200
214
|
- lib/high_five/thor/tasks/deploy.rb
|
215
|
+
- lib/high_five/thor/tasks/development.rb
|
201
216
|
- lib/high_five/thor/tasks/distribution.rb
|
202
217
|
- lib/high_five/thor/tasks/initialization.rb
|
203
218
|
- lib/high_five/thor/tasks/ios_tasks.rb
|