high_five 0.3.17 → 0.3.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/high_five/thor/tasks/android.rb +15 -12
- data/lib/high_five/thor/tasks/dist.rb +49 -8
- data/lib/high_five/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8202946d48fdbaaa511d60c60e0125316af76eb5
|
4
|
+
data.tar.gz: b453e7da8d2f6668b7232943af63d8552ff149d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8df8b070ad2b59c0e5edcbf65bd6f5e18fd6c69ace3f2d35cc09b335ec21f60172a97ec71ac3103ab22c7a03e4a44f5c118b0b6ec7395869f84dfc02b857fbf
|
7
|
+
data.tar.gz: b0fe438022e55aab408c3825d6f67055bc970d9868e3ff729cc342eff2051b1bbba99b75975643137ec4a5b95b3d5d6460f83c1f58dbc623e62157f52a23c5b8
|
@@ -50,21 +50,24 @@ module HighFive
|
|
50
50
|
end
|
51
51
|
|
52
52
|
if gradle_file_path
|
53
|
-
puts "========================================="
|
54
|
-
puts "#{gradle_file_path}"
|
55
|
-
puts "========================================="
|
56
53
|
gradle_file = File.read(gradle_file_path)
|
54
|
+
match = gradle_file.match(/versionName\s"(.+)"$/)
|
55
|
+
if match
|
56
|
+
puts "========================================="
|
57
|
+
puts "#{gradle_file_path}"
|
58
|
+
puts "========================================="
|
59
|
+
|
60
|
+
old = match[1]
|
61
|
+
gradle_file.gsub!(/versionName\s"(.+)"$/, "versionName \"#{options[:version]}\"")
|
62
|
+
puts "Setting version #{old} => #{options[:version]}"
|
57
63
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
old = gradle_file.match(/versionCode\s(\d+)$/)[1]
|
63
|
-
gradle_file.gsub!(/versionCode\s\d+$/, "versionCode #{options[:build_number]}")
|
64
|
-
puts "Setting versionCode #{old} => #{options[:build_number]}"
|
64
|
+
old = gradle_file.match(/versionCode\s(\d+)$/)[1]
|
65
|
+
gradle_file.gsub!(/versionCode\s\d+$/, "versionCode #{options[:build_number]}")
|
66
|
+
puts "Setting versionCode #{old} => #{options[:build_number]}"
|
65
67
|
|
66
|
-
|
67
|
-
|
68
|
+
File.open(gradle_file_path, "w") do |f|
|
69
|
+
f.write gradle_file
|
70
|
+
end
|
68
71
|
end
|
69
72
|
end
|
70
73
|
|
@@ -21,6 +21,7 @@ module HighFive
|
|
21
21
|
method_option :"ant-flags", :desc => "Additional flags to pass directly to ant (android only)"
|
22
22
|
method_option :platform_path, :desc => "Path to ios or android directory"
|
23
23
|
method_option :ant, type: :boolean, :desc => "Force using ant to build"
|
24
|
+
method_option :debug, type: :boolean, :desc => "Create debug version of app (android only)"
|
24
25
|
def dist(platform)
|
25
26
|
@environment = options[:environment]
|
26
27
|
@output_file_name = options[:output_file_name]
|
@@ -70,29 +71,69 @@ module HighFive
|
|
70
71
|
system_or_die("android update project --path #{android_path} --subprojects")
|
71
72
|
gradle_file = File.join(android_path, "build.gradle")
|
72
73
|
gradle = File.exists?(gradle_file) && !options[:ant]
|
74
|
+
debug = options[:debug]
|
73
75
|
if gradle
|
74
|
-
|
76
|
+
if debug
|
77
|
+
system_or_die("gradle -b #{gradle_file} clean assembleDebug")
|
78
|
+
else
|
79
|
+
system_or_die("gradle -b #{gradle_file} clean assembleRelease")
|
80
|
+
end
|
75
81
|
else
|
76
|
-
|
82
|
+
if debug
|
83
|
+
system_or_die("ant -file '#{android_path}/build.xml' clean debug")
|
84
|
+
else
|
85
|
+
system_or_die("ant -file '#{android_path}/build.xml' clean release #{ant_flags}")
|
86
|
+
end
|
77
87
|
end
|
78
88
|
|
79
89
|
android_name = HighFive::AndroidHelper.project_name_from_build_xml("#{android_path}/build.xml")
|
80
90
|
|
81
91
|
if @output_file_name
|
82
92
|
if gradle
|
83
|
-
|
84
|
-
|
85
|
-
|
93
|
+
if debug
|
94
|
+
apk = Dir["#{android_path}/build/outputs/apk/*-release.apk"][0]
|
95
|
+
else
|
96
|
+
apk = Dir["#{android_path}/build/outputs/apk/*-debug.apk"][0]
|
97
|
+
end
|
98
|
+
@final_apk_path = "#{android_path}/build/outputs/apk/#{@output_file_name}.apk"
|
99
|
+
say "copying final build #{apk} -> #{@final_apk_path}"
|
100
|
+
FileUtils.cp("#{apk}", @final_apk_path)
|
86
101
|
else
|
87
|
-
|
88
|
-
|
102
|
+
if debug
|
103
|
+
apk = Dir["#{android_path}/bin/#{android_name}-debug.apk"][0]
|
104
|
+
else
|
105
|
+
apk = Dir["#{android_path}/bin/#{android_name}-release.apk"][0]
|
106
|
+
end
|
107
|
+
@final_apk_path = "#{android_path}/bin/#{@output_file_name}.apk"
|
108
|
+
say "copying final build #{apk} -> #{@final_apk_path}"
|
109
|
+
FileUtils.cp("#{apk}", @final_apk_path)
|
89
110
|
end
|
90
111
|
end
|
91
112
|
end
|
92
113
|
|
93
114
|
desc "install_android [ANDROID_PATH]", "Install the distribution package on the connected android device or emulator"
|
94
115
|
def install_android(android_path)
|
95
|
-
|
116
|
+
@output_file_name = options[:output_file_name]
|
117
|
+
gradle_file = File.join(android_path, "build.gradle")
|
118
|
+
gradle = File.exists?(gradle_file) && !options[:ant]
|
119
|
+
debug = options[:debug]
|
120
|
+
if debug
|
121
|
+
if @output_file_name
|
122
|
+
if gradle
|
123
|
+
system_or_die("adb install -r #{android_path}/build/outputs/apk/#{@output_file_name}.apk")
|
124
|
+
else
|
125
|
+
system_or_die("adb install -r #{android_path}/bin/#{@output_file_name}.apk")
|
126
|
+
end
|
127
|
+
else
|
128
|
+
if gradle
|
129
|
+
system_or_die("adb install -r #{Dir["#{android_path}/build/outputs/apk/*-debug.apk"][0]}")
|
130
|
+
else
|
131
|
+
system_or_die("adb install -r #{Dir["#{android_path}/bin/#{android_name}-debug.apk"][0]}")
|
132
|
+
end
|
133
|
+
end
|
134
|
+
else
|
135
|
+
system_or_die("ant -file '#{android_path}/build.xml' installr")
|
136
|
+
end
|
96
137
|
end
|
97
138
|
|
98
139
|
private
|
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.3.
|
4
|
+
version: 0.3.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Samson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -282,7 +282,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
282
|
version: '0'
|
283
283
|
requirements: []
|
284
284
|
rubyforge_project:
|
285
|
-
rubygems_version: 2.4.
|
285
|
+
rubygems_version: 2.4.8
|
286
286
|
signing_key:
|
287
287
|
specification_version: 4
|
288
288
|
summary: HighFive is a set of build scripts and tools for packing HTML5 apps both
|