ruboto 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/RELEASE_CANDICATE_DOC.md +8 -3
- data/RELEASE_DOC.md +52 -56
- data/Rakefile +40 -48
- data/assets/rakelib/ruboto.rake +2 -2
- data/assets/src/org/ruboto/DexDex.java +3 -2
- data/assets/src/org/ruboto/FrameworkHack.java +7 -3
- data/assets/src/org/ruboto/JRubyAdapter.java +0 -1
- data/lib/ruboto/commands/base.rb +5 -1
- data/lib/ruboto/sdk_versions.rb +3 -2
- data/lib/ruboto/util/emulator.rb +85 -67
- data/lib/ruboto/util/setup.rb +76 -17
- data/lib/ruboto/util/update.rb +56 -10
- data/lib/ruboto/version.rb +1 -1
- data/test/activity/stack_activity_test.rb +4 -2
- data/test/app_test_methods.rb +5 -0
- data/test/arjdbc_test.rb +18 -21
- data/test/ruboto_gen_test.rb +4 -0
- data/test/ruboto_setup_test.rb +31 -2
- data/test/test_helper.rb +1 -0
- 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: 10adce79aa0f610f28d87071ec839fd64a270c73
|
4
|
+
data.tar.gz: fb2cfe8130c054372ae42ce7b65528fe3796857d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdcb7a76b98f60f06f00009d80b9e128dc9b909c99e8f4d665a98954de4252db738472d44ea1961d923385b27db06d3a3471eb2bf256802400a12b0b641acdca
|
7
|
+
data.tar.gz: 60142ca6e0daf809b78e29ca3bb70cded944651c75e05fe17731a83d9fc4b695717b75aebaeb97f97f3aa6da4cc802bbdbef36a697ef2fefaa91ad052ced667e
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruboto (1.
|
4
|
+
ruboto (1.4.0)
|
5
5
|
main (~> 5.2)
|
6
6
|
rake (~> 10.0)
|
7
7
|
rubyzip (~> 1.0)
|
@@ -22,7 +22,7 @@ GEM
|
|
22
22
|
map (6.5.5)
|
23
23
|
method_source (0.8.2)
|
24
24
|
minitest (5.5.1)
|
25
|
-
pry (0.10.
|
25
|
+
pry (0.10.3)
|
26
26
|
coderay (~> 1.1.0)
|
27
27
|
method_source (~> 0.8.1)
|
28
28
|
slop (~> 3.4)
|
@@ -38,4 +38,4 @@ DEPENDENCIES
|
|
38
38
|
ruboto!
|
39
39
|
|
40
40
|
BUNDLED WITH
|
41
|
-
1.10.
|
41
|
+
1.10.6
|
data/RELEASE_CANDICATE_DOC.md
CHANGED
@@ -1,10 +1,15 @@
|
|
1
|
-
Subject: [ANN] Ruboto 1.
|
1
|
+
Subject: [ANN] Ruboto 1.4.0 release candidate
|
2
2
|
|
3
3
|
Hi all!
|
4
4
|
|
5
|
-
The Ruboto 1.
|
5
|
+
The Ruboto 1.4.0 release candidate is now available.
|
6
6
|
|
7
|
-
|
7
|
+
This release adds support for JRuby 1.7.22 and improves the installation
|
8
|
+
of HAXM. `ruboto setup --update` will now update an existing HAXM
|
9
|
+
installation if a new version is available for download.
|
10
|
+
|
11
|
+
Support for Android 2.3 has been dropped, and Android 4.1 is now the
|
12
|
+
default api level when creating new apps.
|
8
13
|
|
9
14
|
As always we need your help and feedback to ensure the quality of the release. Please install the release candidate using
|
10
15
|
|
data/RELEASE_DOC.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
Subject: [ANN] Ruboto 1.
|
1
|
+
Subject: [ANN] Ruboto 1.4.0 released!
|
2
2
|
|
3
|
-
The Ruboto team is pleased to announce the release of Ruboto 1.
|
3
|
+
The Ruboto team is pleased to announce the release of Ruboto 1.4.0.
|
4
4
|
|
5
5
|
Ruboto (JRuby on Android) is a platform for developing full stand-alone
|
6
6
|
apps for Android using the Ruby language and libraries. It includes
|
@@ -8,82 +8,78 @@ support libraries and generators for creating projects, classes, tests,
|
|
8
8
|
and more. The complete APIs of Android, Java, and Ruby are available to
|
9
9
|
you using the Ruby language.
|
10
10
|
|
11
|
-
New in version 1.
|
11
|
+
New in version 1.4.0:
|
12
12
|
|
13
|
-
|
13
|
+
This release adds support for JRuby 1.7.22 and improves the installation
|
14
|
+
of HAXM. `ruboto setup --update` will now update an existing HAXM
|
15
|
+
installation if a new version is available for download.
|
16
|
+
|
17
|
+
Support for Android 2.3 has been dropped, and Android 4.1 is now the
|
18
|
+
default api level when creating new apps.
|
14
19
|
|
15
20
|
API Changes:
|
16
21
|
|
17
|
-
* Issue #
|
22
|
+
* Issue #687 Drop support for Android 2.3 api level 10
|
23
|
+
* Issue #688 Set Android 4.1 api level 16 as default api level for new
|
24
|
+
apps
|
25
|
+
* Issue #770 Support jruby 1.7.22 (donv)
|
18
26
|
|
19
27
|
Features:
|
20
28
|
|
21
|
-
* Issue #
|
22
|
-
* Issue #
|
23
|
-
|
24
|
-
* Issue #741 Make setup accept build tools rc (danielpassos)
|
29
|
+
* Issue #722 Start emulator without skin for "ruboto emulator"
|
30
|
+
* Issue #756 Allow "ruboto setup --update" to update HAXM if a new
|
31
|
+
version is available
|
25
32
|
|
26
33
|
Bugfixes:
|
27
34
|
|
28
|
-
* Issue #
|
29
|
-
|
30
|
-
* Issue #
|
31
|
-
|
32
|
-
|
33
|
-
* Issue #
|
34
|
-
* Issue #
|
35
|
-
|
36
|
-
* Issue #
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
* Issue #
|
41
|
-
|
35
|
+
* Issue #634 Can't add jar files to proyect. Can't start the proyect
|
36
|
+
with jars added
|
37
|
+
* Issue #638 Extra installs to build on Ubuntu 64 bit
|
38
|
+
* Issue #655 "--with-jruby" seems to do its job, but then I still need
|
39
|
+
to download and install Ruboto Core on device
|
40
|
+
* Issue #663 Minimal Gosu code fails.
|
41
|
+
* Issue #664 Bundler can't see personal gems/Locally installed gems do
|
42
|
+
not get put on projects(only global).
|
43
|
+
* Issue #669 Keep on restarting new emulator
|
44
|
+
* Issue #686 Can't run on Real device with Android 5.0
|
45
|
+
* Issue #703 The HAXM installer for OS X has changed name
|
46
|
+
* Issue #712 can´t install ruboto
|
47
|
+
* Issue #716 New App with no custom code terminates directly after start
|
48
|
+
(java.lang.NoSuchMethodException: makeDexElements).
|
49
|
+
* Issue #717 ruboto setup -y - FATAL -- : undefined method 'slice' for
|
50
|
+
nil:NilClass
|
51
|
+
* Issue #742 Accept Android plataform tools rc in setup
|
52
|
+
* Issue #747 Running the emulator often hangs when run without
|
53
|
+
"--no-snapshot"
|
54
|
+
* Issue #759 "ruboto gen jruby" should install jruby-jars ~>1.7
|
55
|
+
* Issue #765 'rake boing' fails for multiple updated files
|
42
56
|
|
43
57
|
Support:
|
44
58
|
|
45
|
-
* Issue #
|
46
|
-
* Issue #
|
47
|
-
* Issue #
|
48
|
-
* Issue #
|
49
|
-
* Issue #
|
50
|
-
(Java::JavaLang::OutOfMemoryError)
|
59
|
+
* Issue #670 emulator
|
60
|
+
* Issue #736 rake install error
|
61
|
+
* Issue #739 Game Frameworks?
|
62
|
+
* Issue #750 Deploy ruboto within Gnuroot debian linux under Android OS
|
63
|
+
* Issue #752 can't install ruboto with ruby gems in windows 10.
|
51
64
|
|
52
65
|
Community:
|
53
66
|
|
54
|
-
* Issue #
|
55
|
-
* Issue #
|
56
|
-
* Issue #
|
57
|
-
* Issue #659 How can I help?
|
58
|
-
* Issue #662 How can I help? (aripoya)
|
59
|
-
* Issue #665 How can I help?
|
60
|
-
* Issue #683 How can I help?
|
61
|
-
* Issue #684 How can I help?
|
62
|
-
* Issue #685 How can I help?
|
63
|
-
* Issue #694 How can I help?
|
64
|
-
* Issue #704 How can I help?
|
65
|
-
* Issue #725 How can I help?
|
66
|
-
* Issue #730 How can I help?
|
67
|
-
|
68
|
-
Pull requests:
|
69
|
-
|
70
|
-
* Issue #740 rake log task detects activity start on lollipop (gfowley)
|
67
|
+
* Issue #762 How can I help? (juanjogeta)
|
68
|
+
* Issue #766 Reduce noise on #ruboto channel from travis
|
69
|
+
* Issue #771 How can I help? (ChaosCat)
|
71
70
|
|
72
71
|
Internal:
|
73
72
|
|
74
|
-
* Issue #
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
Other:
|
81
|
-
|
82
|
-
* Issue #692 --with-jruby argument not working correctly
|
73
|
+
* Issue #757 Release 1.4.0
|
74
|
+
* Issue #767 TypeError: can't convert nil into String when running
|
75
|
+
Ruboto tests
|
76
|
+
* Issue #769 Fetch jruby-jars snapshots from http://ci.jruby.org/ for
|
77
|
+
testing
|
78
|
+
* Issue #772 Db haxm dark (daneb)
|
83
79
|
|
84
80
|
You can find a complete list of issues here:
|
85
81
|
|
86
|
-
* https://github.com/ruboto/ruboto/issues?state=closed&milestone=
|
82
|
+
* https://github.com/ruboto/ruboto/issues?state=closed&milestone=39
|
87
83
|
|
88
84
|
|
89
85
|
Installation:
|
data/Rakefile
CHANGED
@@ -24,7 +24,7 @@ GEM_FILE = "ruboto-#{Ruboto::VERSION}.gem"
|
|
24
24
|
GEM_SPEC_FILE = 'ruboto.gemspec'
|
25
25
|
README_FILE = 'README.md'
|
26
26
|
WEB_DIR = File.expand_path('../ruboto.github.com', File.dirname(__FILE__))
|
27
|
-
BLOG_DIR =
|
27
|
+
BLOG_DIR = '_posts'
|
28
28
|
RELEASE_BLOG = "#{BLOG_DIR}/#{Date.today}-Ruboto-#{Ruboto::VERSION}-release-doc.md"
|
29
29
|
RELEASE_BLOG_GLOB = "#{BLOG_DIR}/*-Ruboto-#{Ruboto::VERSION}-release-doc.md"
|
30
30
|
RELEASE_CANDIDATE_DOC = 'RELEASE_CANDICATE_DOC.md'
|
@@ -132,7 +132,7 @@ def get_github_issues
|
|
132
132
|
raise "Milestone for version #{Ruboto::VERSION} not found." unless milestone_entry
|
133
133
|
milestone = milestone_entry['number']
|
134
134
|
|
135
|
-
uri = URI("#{base_uri}/issues?milestone=#{milestone}&state=
|
135
|
+
uri = URI("#{base_uri}/issues?milestone=#{milestone}&state=all&per_page=1000")
|
136
136
|
req = Net::HTTP::Get.new(uri.request_uri)
|
137
137
|
res = https.start { |http| http.request(req) }
|
138
138
|
issues = YAML.load(res.body).sort_by { |i| i['number'] }
|
@@ -167,11 +167,8 @@ task :release_docs do
|
|
167
167
|
raise "\n This task requires Ruby 1.9 or newer to parse JSON as YAML.\n\n" if RUBY_VERSION == '1.8.7'
|
168
168
|
categories, grouped_issues, milestone, milestone_description, milestone_name = get_github_issues
|
169
169
|
|
170
|
-
|
171
|
-
#puts
|
172
|
-
|
170
|
+
puts '=' * 80
|
173
171
|
puts
|
174
|
-
puts "Generanting release candidate doc ..."
|
175
172
|
release_candidate_doc = <<EOF
|
176
173
|
Subject: [ANN] Ruboto #{milestone_name} release candidate
|
177
174
|
|
@@ -206,16 +203,13 @@ The Ruboto Team
|
|
206
203
|
http://ruboto.org/
|
207
204
|
EOF
|
208
205
|
|
209
|
-
|
206
|
+
puts release_candidate_doc
|
210
207
|
File.write(RELEASE_CANDIDATE_DOC, release_candidate_doc)
|
211
208
|
sh "git add -f #{RELEASE_CANDIDATE_DOC}"
|
212
209
|
|
213
|
-
#puts
|
214
|
-
#puts '=' * 80
|
215
|
-
#puts
|
216
|
-
|
217
210
|
puts
|
218
|
-
puts
|
211
|
+
puts '=' * 80
|
212
|
+
puts
|
219
213
|
release_doc = <<EOF
|
220
214
|
Subject: [ANN] Ruboto #{milestone_name} released!
|
221
215
|
|
@@ -274,12 +268,10 @@ The Ruboto Team
|
|
274
268
|
http://ruboto.org/
|
275
269
|
EOF
|
276
270
|
|
271
|
+
puts release_doc
|
272
|
+
puts
|
273
|
+
puts '=' * 80
|
277
274
|
File.write(RELEASE_DOC, release_doc)
|
278
|
-
sh "git add -f #{RELEASE_DOC}"
|
279
|
-
|
280
|
-
#puts release_doc
|
281
|
-
#puts
|
282
|
-
#puts '=' * 80
|
283
275
|
|
284
276
|
unless Gem::Version.new(Ruboto::VERSION).prerelease?
|
285
277
|
header = <<EOF
|
@@ -369,17 +361,15 @@ end
|
|
369
361
|
|
370
362
|
desc 'Push the gem to RubyGems'
|
371
363
|
task :release => [:clean, README_FILE, :release_docs, :gem] do
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
end
|
382
|
-
end
|
364
|
+
output = `git status --porcelain`
|
365
|
+
raise "Workspace not clean!\n#{output}" unless output.empty?
|
366
|
+
Dir.chdir WEB_DIR do
|
367
|
+
output = `git status --porcelain`
|
368
|
+
raise "Web workspace not clean!\n#{output}" unless output.empty?
|
369
|
+
sh "git add -f #{RELEASE_BLOG}"
|
370
|
+
`git commit -m "* Added release blog for Ruboto #{Ruboto::VERSION}"`
|
371
|
+
sh 'git push'
|
372
|
+
end
|
383
373
|
sh "git tag #{Ruboto::VERSION}"
|
384
374
|
sh 'git push --tags'
|
385
375
|
sh "gem push #{GEM_FILE}"
|
@@ -420,7 +410,7 @@ namespace :platform do
|
|
420
410
|
end
|
421
411
|
|
422
412
|
desc 'Generate the Ruboto Core platform project'
|
423
|
-
task :
|
413
|
+
task project: PLATFORM_PROJECT
|
424
414
|
|
425
415
|
file PLATFORM_PROJECT do
|
426
416
|
sh "git clone --depth 1 https://github.com/ruboto/ruboto-core.git #{PLATFORM_PROJECT}"
|
@@ -430,7 +420,7 @@ namespace :platform do
|
|
430
420
|
end
|
431
421
|
|
432
422
|
desc 'Generate a Ruboto Core platform debug apk'
|
433
|
-
task :
|
423
|
+
task debug: PLATFORM_DEBUG_APK
|
434
424
|
|
435
425
|
task PLATFORM_DEBUG_APK do
|
436
426
|
Rake::Task[PLATFORM_PROJECT].invoke
|
@@ -445,7 +435,7 @@ namespace :platform do
|
|
445
435
|
end
|
446
436
|
|
447
437
|
desc 'Generate a Ruboto Core platform release apk'
|
448
|
-
task :
|
438
|
+
task release: PLATFORM_RELEASE_APK
|
449
439
|
|
450
440
|
file PLATFORM_RELEASE_APK => PLATFORM_PROJECT do
|
451
441
|
Dir.chdir(PLATFORM_PROJECT) do
|
@@ -496,7 +486,7 @@ namespace :platform do
|
|
496
486
|
end
|
497
487
|
|
498
488
|
desc 'Install the Ruboto Core platform debug apk'
|
499
|
-
task :
|
489
|
+
task install: PLATFORM_PROJECT do
|
500
490
|
Dir.chdir(PLATFORM_PROJECT) do
|
501
491
|
sh 'rake install'
|
502
492
|
end
|
@@ -511,17 +501,16 @@ end
|
|
511
501
|
|
512
502
|
desc 'Download the latest jruby-jars snapshot'
|
513
503
|
task :get_jruby_jars_snapshots do
|
514
|
-
download_host = '
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
sort_by{|v| Gem::Version.new(v[11..-5])}.last
|
504
|
+
download_host = 's3.amazonaws.com'
|
505
|
+
download_dir = "/ci.jruby.org"
|
506
|
+
index = Net::HTTP.get(download_host, download_dir)
|
507
|
+
all_gems = index.scan(%r{jruby-jars-.*?.gem}).sort_by{|v| Gem::Version.new(v[11..-5])}
|
508
|
+
master_gem = all_gems.last
|
509
|
+
stable_gem = all_gems.first
|
521
510
|
FileUtils.rm_rf Dir['jruby-jars-*.gem']
|
522
|
-
|
511
|
+
[[master_gem, 'master'], [stable_gem, 'jruby-1_7']].each do |gem, branch|
|
523
512
|
print "Downloading #{gem}: \r"
|
524
|
-
uri = URI("http://#{download_host}/
|
513
|
+
uri = URI("http://#{download_host}#{download_dir}/snapshots/#{branch}/#{gem}")
|
525
514
|
done = 0
|
526
515
|
body = ''
|
527
516
|
Net::HTTP.new(uri.host, uri.port).request_get(uri.path) do |response|
|
@@ -551,33 +540,36 @@ task '.travis.yml' do
|
|
551
540
|
matrix = ''
|
552
541
|
allow_failures = ''
|
553
542
|
|
554
|
-
# FIXME(uwe): JRuby 1.7.13 works for Nettbuss
|
543
|
+
# FIXME(uwe): JRuby 1.7.13 works for Nettbuss. Keep for 2016.
|
555
544
|
# FIXME(uwe): JRuby 1.7.19: RSS? => RubotoGenTest#test_activity_tests => Native crash
|
556
|
-
# FIXME(uwe): JRuby 1.7.
|
545
|
+
# FIXME(uwe): JRuby 1.7.22: OK except https://github.com/jruby/jruby/issues/3401
|
557
546
|
# FIXME(uwe): RubotoCore (CURRENT) is missing thread_safe
|
558
547
|
# FIXME(uwe): Test all of these that work
|
559
548
|
[
|
560
549
|
['CURRENT', [nil]],
|
561
550
|
['FROM_GEM', [:MASTER, :STABLE]],
|
562
|
-
['STANDALONE', [:MASTER, :STABLE, '1.7.19', '1.7.13']],
|
551
|
+
['STANDALONE', [:MASTER, :STABLE, '1.7.22', '1.7.19', '1.7.13']],
|
563
552
|
].each do |platform, versions|
|
564
553
|
versions.each do |v|
|
565
554
|
# FIXME(uwe): Test the newest and most common api levels
|
566
555
|
# FIXME(uwe): Nettbuss uses api level 15.
|
567
556
|
# FIXME(uwe): https://github.com/ruboto/ruboto/issues/426
|
568
|
-
[22, 19, 17, 16, 15].each do |api|
|
557
|
+
[23, 22, 21, 19, 17, 16, 15].each do |api|
|
569
558
|
(1..test_parts).each do |n|
|
570
559
|
line = " - ANDROID_TARGET=#{api} RUBOTO_PLATFORM=#{platform.ljust(10)} TEST_PART=#{n}of#{test_parts}#{" JRUBY_JARS_VERSION=#{v}" if v}\n"
|
571
560
|
if v == :MASTER || # FIXME(uwe): Remove when master branch is green.
|
561
|
+
(v == :STABLE && platform != 'FROM_GEM' && api != 15) || # FIXME(uwe): Remove when 1.7 branch is green.
|
572
562
|
v == '1.7.13' || # FIXME(uwe): Remove when 1.7.13 is green.
|
573
|
-
api ==
|
563
|
+
api == 23 || # FIXME(uwe): Remove when Android 6.0 is green. Unable to start emulator on travis.
|
564
|
+
api == 22 || # FIXME(uwe): Remove when Android 5.1 is green. Must use slow ARM emulator due to missing HAXM.
|
574
565
|
api == 21 || # FIXME(uwe): Remove when Android 5.0 is green.
|
575
566
|
api == 17 || # FIXME(uwe): Remove when Android 4.2 is green.
|
576
567
|
api == 16 || # FIXME(uwe): Remove when Android 4.1 is green.
|
577
568
|
false
|
578
569
|
next
|
579
|
-
elsif
|
580
|
-
|
570
|
+
elsif platform == 'FROM_GEM' || # FIXME(uwe): Remove when new RubotoCore is green.
|
571
|
+
(v == '1.7.22' && api != 15) || # FIXME(uwe): Remove when jruby-jars 1.7.22 is green.
|
572
|
+
false
|
581
573
|
allow_failures << line.gsub('-', '- env:')
|
582
574
|
end
|
583
575
|
matrix << line
|
data/assets/rakelib/ruboto.rake
CHANGED
@@ -470,7 +470,7 @@ file BUILD_XML_FILE => RUBOTO_CONFIG_FILE do
|
|
470
470
|
|
471
471
|
ant_script.gsub!(/\s*#{start_marker}.*?#{end_marker}\s*/m, '')
|
472
472
|
# FIXME(uwe): Remove condition when we stop supporting Android 4.0 and older.
|
473
|
-
if sdk_level >=
|
473
|
+
if sdk_level >= 15
|
474
474
|
unless ant_script.gsub!(/\s*(<\/project>)/, "\n\n#{dx_override}\n\n\\1")
|
475
475
|
raise 'Bad ANT script'
|
476
476
|
end
|
@@ -984,7 +984,7 @@ end
|
|
984
984
|
|
985
985
|
# Triggers reload of updated scripts and restart of the current activity
|
986
986
|
def reload_scripts(scripts)
|
987
|
-
s = scripts.map { |s| s.gsub(/[&;]/) { |m| "&#{m[0]}" } }.join('
|
987
|
+
s = scripts.map { |s| s.gsub(/[&;]/) { |m| "&#{m[0]}" } }.join(';')
|
988
988
|
cmd = %Q{adb shell am broadcast -a android.intent.action.VIEW -e reload '#{s}'}
|
989
989
|
puts cmd
|
990
990
|
system cmd
|
@@ -50,8 +50,8 @@ public class DexDex {
|
|
50
50
|
private static final String TAG = "DexDex";
|
51
51
|
|
52
52
|
private static final int SDK_INT_ICS = 14;
|
53
|
-
|
54
53
|
private static final int SDK_INT_KITKAT = 19;
|
54
|
+
private static final int SDK_INT_MARSHMALLOW = 23;
|
55
55
|
|
56
56
|
private static final int BUF_SIZE = 8 * 1024;
|
57
57
|
public static final int PROGRESS_COMPLETE = 100;
|
@@ -256,8 +256,9 @@ public class DexDex {
|
|
256
256
|
FrameworkHack.appendDexListImplUnderICS(jarsOfDex, pcl, dexDir);
|
257
257
|
} else { // ICS+
|
258
258
|
boolean kitkatPlus = Build.VERSION.SDK_INT >= SDK_INT_KITKAT;
|
259
|
+
boolean marshmallowPlus = Build.VERSION.SDK_INT >= SDK_INT_MARSHMALLOW;
|
259
260
|
ArrayList<File> jarFiles = DexDex.strings2Files(jarsOfDex);
|
260
|
-
FrameworkHack.appendDexListImplICS(jarFiles, pcl, dexDir, kitkatPlus);
|
261
|
+
FrameworkHack.appendDexListImplICS(jarFiles, pcl, dexDir, kitkatPlus, marshmallowPlus);
|
261
262
|
}
|
262
263
|
// update theAppended if succeeded to prevent duplicated classpath entry
|
263
264
|
for (String jarName : names) {
|
@@ -26,6 +26,7 @@ import java.lang.reflect.Field;
|
|
26
26
|
import java.lang.reflect.Method;
|
27
27
|
import java.util.ArrayList;
|
28
28
|
import java.util.Arrays;
|
29
|
+
import java.util.List;
|
29
30
|
import java.util.zip.ZipFile;
|
30
31
|
|
31
32
|
/**
|
@@ -114,7 +115,7 @@ public class FrameworkHack {
|
|
114
115
|
// https://android.googlesource.com/platform/libcore/+/master/libdvm/src/main/java/dalvik/system/BaseDexClassLoader.java
|
115
116
|
// https://android.googlesource.com/platform/libcore/+/master/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java
|
116
117
|
public static void appendDexListImplICS(ArrayList<File> jarFiles, PathClassLoader pcl, File optDir,
|
117
|
-
boolean kitkatPlus) throws Exception {
|
118
|
+
boolean kitkatPlus, boolean marshmallowPlus) throws Exception {
|
118
119
|
if(debug) {
|
119
120
|
Log.d(TAG, "appendDexListImplICS(" + jarFiles);
|
120
121
|
}
|
@@ -139,8 +140,11 @@ public class FrameworkHack {
|
|
139
140
|
int jarCount = jarFiles.size();
|
140
141
|
Object newDexElemArray = Array.newInstance(clazzElement, orgDexCount + jarCount);
|
141
142
|
System.arraycopy(objOrgDexElements, 0, newDexElemArray, 0, orgDexCount);
|
142
|
-
Method mMakeDexElements
|
143
|
-
if (
|
143
|
+
final Method mMakeDexElements;
|
144
|
+
if (marshmallowPlus) {
|
145
|
+
mMakeDexElements =
|
146
|
+
dplClass.getDeclaredMethod("makePathElements", List.class, File.class, List.class);
|
147
|
+
} else if (kitkatPlus) {
|
144
148
|
mMakeDexElements =
|
145
149
|
dplClass.getDeclaredMethod("makeDexElements", ArrayList.class, File.class, ArrayList.class);
|
146
150
|
} else {
|
@@ -306,7 +306,6 @@ public class JRubyAdapter {
|
|
306
306
|
// TODO(uwe): Add a way to display startup progress.
|
307
307
|
put("$application_context", appContext.getApplicationContext());
|
308
308
|
runScriptlet("begin\n require 'environment'\nrescue LoadError => e\n puts e\nend");
|
309
|
-
// runScriptlet("begin\n require 'environment'\nrescue LoadError => e\n java.lang.System.out.println(e)\nend");
|
310
309
|
|
311
310
|
initialized = true;
|
312
311
|
} catch (ClassNotFoundException e) {
|
data/lib/ruboto/commands/base.rb
CHANGED
@@ -449,8 +449,12 @@ module Ruboto
|
|
449
449
|
description 'answer "yes" to all interactive questions. Will automatically install needed components.'
|
450
450
|
}
|
451
451
|
|
452
|
+
option('upgrade', 'u') {
|
453
|
+
description 'upgrades intel haxm'
|
454
|
+
}
|
455
|
+
|
452
456
|
def run
|
453
|
-
setup_ruboto(params['yes'].value, params['target'].values)
|
457
|
+
setup_ruboto(params['yes'].value, params['target'].values, params['upgrade'].values)
|
454
458
|
end
|
455
459
|
end
|
456
460
|
|
data/lib/ruboto/sdk_versions.rb
CHANGED
@@ -6,12 +6,13 @@ module Ruboto
|
|
6
6
|
'2.3.3' => 10, '2.3.4' => 10, '2.3.5' => 10, '2.3.6' => 10, '2.3.7' => 10,
|
7
7
|
'3.0' => 11, '3.1' => 12, '3.2' => 13, '4.0.1' => 14, '4.0.3' => 15,
|
8
8
|
'4.0.4' => 15, '4.1' => 16, '4.1.1' => 16, '4.1.2' => 16, '4.2' => 17,
|
9
|
-
'4.2.2' => 17, '4.3' => 18, '4.3.1' => 18, '4.4.2' => 19, '5.0.1' => 21,
|
9
|
+
'4.2.2' => 17, '4.3' => 18, '4.3.1' => 18, '4.4.2' => 19, '5.0.1' => 21,
|
10
|
+
'5.1' => 22, '6.0' => 23
|
10
11
|
}
|
11
12
|
API_LEVEL_TO_VERSION = {
|
12
13
|
10 => '2.3.3', 11 => '3.0', 12 => '3.1', 13 => '3.2', 14 => '4.0',
|
13
14
|
15 => '4.0.3', 16 => '4.1.2', 17 => '4.2.2', 18 => '4.3.1',
|
14
|
-
19 => '4.4.2', 21 => '5.0.1', 22 => '5.1'
|
15
|
+
19 => '4.4.2', 21 => '5.0.1', 22 => '5.1', 23 => '6.0'
|
15
16
|
}
|
16
17
|
|
17
18
|
MINIMUM_SUPPORTED_SDK_LEVEL = 15
|
data/lib/ruboto/util/emulator.rb
CHANGED
@@ -8,6 +8,7 @@ module Ruboto
|
|
8
8
|
ON_WINDOWS = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw/i)
|
9
9
|
ON_MAC_OS_X = RbConfig::CONFIG['host_os'] =~ /^darwin/
|
10
10
|
ON_LINUX = RbConfig::CONFIG['host_os'] =~ /linux/
|
11
|
+
ON_TRAVIS = ENV['TRAVIS'] == 'true'
|
11
12
|
|
12
13
|
def sdk_level_name(sdk_level)
|
13
14
|
Ruboto::SdkVersions::API_LEVEL_TO_VERSION[sdk_level.to_i] || sdk_level
|
@@ -32,8 +33,8 @@ module Ruboto
|
|
32
33
|
new_snapshot = false
|
33
34
|
|
34
35
|
if `adb devices` =~ /emulator-5554/
|
35
|
-
t = Net::Telnet.new('Host' => 'localhost', 'Port' => 5554, 'Prompt' => /^OK\n
|
36
|
-
t.waitfor(
|
36
|
+
t = Net::Telnet.new('Host' => 'localhost', 'Port' => 5554, 'Prompt' => /^OK\n|^KO:/)
|
37
|
+
t.waitfor(/Android Console:/)
|
37
38
|
output = ''
|
38
39
|
t.cmd('avd name') { |c| output << c }
|
39
40
|
t.close
|
@@ -46,7 +47,8 @@ module Ruboto
|
|
46
47
|
puts "Emulator #{running_avd_name} is running."
|
47
48
|
end
|
48
49
|
else
|
49
|
-
|
50
|
+
puts "Unexpected response from emulator: #{output.inspect}"
|
51
|
+
puts "Assuming wrong emulator is running."
|
50
52
|
end
|
51
53
|
else
|
52
54
|
puts 'No emulator is running.'
|
@@ -55,6 +57,7 @@ module Ruboto
|
|
55
57
|
# FIXME(uwe): Change use of "killall" to use the Ruby Process API
|
56
58
|
loop do
|
57
59
|
emulator_opts = '-partition-size 256'
|
60
|
+
emulator_opts << ' -noskin'
|
58
61
|
emulator_opts << ' -no-snapshot-load' if no_snapshot
|
59
62
|
if !ON_MAC_OS_X && !ON_WINDOWS && ENV['DISPLAY'].nil?
|
60
63
|
emulator_opts << ' -no-window -no-audio'
|
@@ -90,73 +93,14 @@ module Ruboto
|
|
90
93
|
heap_size = large_heap ? 256 : 48
|
91
94
|
|
92
95
|
unless File.exists? avd_home
|
93
|
-
|
94
|
-
|
95
|
-
target = `android list target`.split(/----------\n/).
|
96
|
-
find { |l| l =~ /android-#{sdk_level}/ }
|
97
|
-
|
98
|
-
if target.nil?
|
99
|
-
puts "Target android-#{sdk_level} not found. You should run"
|
100
|
-
puts "\n ruboto setup -y -t #{sdk_level}\n\nto install it."
|
101
|
-
exit 3
|
102
|
-
end
|
103
|
-
|
104
|
-
abis = target.slice(/(?<=ABIs : ).*/).split(', ')
|
105
|
-
has_x86 = abis.find { |a| a =~ /x86/ }
|
106
|
-
has_x86_64 = has_x86 && abis.find { |a| a =~ /x86_64/ }
|
107
|
-
|
108
|
-
# FIXME(uwe): The x86 emulator does not respect the heap setting and
|
109
|
-
# restricts to a 16MB heap on Android 2.3 which will crash any
|
110
|
-
# Ruboto app. Remove the first "if" below when heap setting works
|
111
|
-
# on x86 emulator.
|
112
|
-
# https://code.google.com/p/android/issues/detail?id=37597
|
113
|
-
# https://code.google.com/p/android/issues/detail?id=61596
|
114
|
-
if sdk_level.to_i == 10
|
115
|
-
abi_opt = '--abi armeabi'
|
116
|
-
elsif has_x86
|
117
|
-
if has_x86_64
|
118
|
-
abi_opt = '--abi x86_64'
|
119
|
-
else
|
120
|
-
abi_opt = '--abi x86'
|
121
|
-
end
|
122
|
-
else
|
123
|
-
abi_opt = '--abi armeabi-v7a'
|
124
|
-
end
|
125
|
-
# EMXIF
|
126
|
-
|
127
|
-
skin_filename = "#{Ruboto::SdkLocations::ANDROID_HOME}/platforms/android-#{sdk_level}/skins/HVGA/hardware.ini"
|
128
|
-
if File.exists?(skin_filename)
|
129
|
-
old_skin_config = File.read(skin_filename)
|
130
|
-
new_skin_config = old_skin_config.gsub(/vm.heapSize=([0-9]*)/) { |m| $1.to_i < heap_size ? "vm.heapSize=#{heap_size}" : m }
|
131
|
-
File.write(skin_filename, new_skin_config) if new_skin_config != old_skin_config
|
132
|
-
end
|
133
|
-
|
134
|
-
puts `echo no | android create avd -a -n #{avd_name} -t android-#{sdk_level} #{abi_opt} -c 64M -s HVGA -d "Nexus One"`
|
135
|
-
|
136
|
-
if $? != 0
|
137
|
-
puts 'Failed to create AVD.'
|
138
|
-
exit 3
|
139
|
-
end
|
140
|
-
# avd_config_file_name = "#{avd_home}/config.ini"
|
141
|
-
# old_avd_config = File.read(avd_config_file_name)
|
142
|
-
# new_avd_config = old_avd_config.dup
|
143
|
-
# new_avd_config.gsub!(/vm.heapSize=([0-9]*)/) { |m| $1.to_i < heap_size ? "vm.heapSize=#{heap_size}" : m }
|
144
|
-
# add_property(new_avd_config, 'hw.device.manufacturer', 'Generic')
|
145
|
-
# add_property(new_avd_config, 'hw.device.name', '3.2" HVGA slider (ADP1)')
|
146
|
-
# add_property(new_avd_config, 'hw.mainKeys', 'no')
|
147
|
-
# add_property(new_avd_config, 'hw.sdCard', 'yes')
|
148
|
-
# File.write(avd_config_file_name, new_avd_config) if new_avd_config != old_avd_config
|
149
|
-
|
96
|
+
create_avd(avd_home, avd_name, heap_size, sdk_level)
|
150
97
|
new_snapshot = true
|
98
|
+
else
|
99
|
+
# FIXME(uwe): Patch old emulator AVDs. Remove December 2016.
|
100
|
+
patch_config_ini(avd_home, heap_size)
|
101
|
+
# EMXIF
|
151
102
|
end
|
152
103
|
|
153
|
-
# hw_config_file_name = "#{avd_home}/hardware-qemu.ini"
|
154
|
-
# if File.exists?(hw_config_file_name)
|
155
|
-
# old_hw_config = File.read(hw_config_file_name)
|
156
|
-
# new_hw_config = old_hw_config.gsub(/vm.heapSize=([0-9]*)/) { |m| $1.to_i < heap_size ? "vm.heapSize=#{heap_size}" : m }
|
157
|
-
# File.write(hw_config_file_name, new_hw_config) if new_hw_config != old_hw_config
|
158
|
-
# end
|
159
|
-
|
160
104
|
puts "Start emulator #{avd_name}#{' without snapshot' if no_snapshot}"
|
161
105
|
system "emulator -avd #{avd_name} #{emulator_opts} #{'&' unless ON_WINDOWS}"
|
162
106
|
return if ON_WINDOWS
|
@@ -210,6 +154,7 @@ module Ruboto
|
|
210
154
|
end
|
211
155
|
else
|
212
156
|
puts 'Unable to start the emulator.'
|
157
|
+
exit 1 if ON_TRAVIS
|
213
158
|
end
|
214
159
|
end
|
215
160
|
|
@@ -246,6 +191,79 @@ EOF
|
|
246
191
|
puts "Emulator #{avd_name} started OK."
|
247
192
|
end
|
248
193
|
|
194
|
+
def create_avd(avd_home, avd_name, heap_size, sdk_level)
|
195
|
+
puts "Creating AVD #{avd_name}"
|
196
|
+
|
197
|
+
target = `android list target`.split(/----------\n/).
|
198
|
+
find { |l| l =~ /android-#{sdk_level}/ }
|
199
|
+
|
200
|
+
if target.nil?
|
201
|
+
puts "Target android-#{sdk_level} not found. You should run"
|
202
|
+
puts "\n ruboto setup -y -t #{sdk_level}\n\nto install it."
|
203
|
+
exit 3
|
204
|
+
end
|
205
|
+
|
206
|
+
abis = target.slice(/(?<=ABIs : ).*/).split(', ')
|
207
|
+
has_x86 = abis.find { |a| a =~ /x86/ }
|
208
|
+
has_x86_64 = has_x86 && abis.find { |a| a =~ /x86_64/ }
|
209
|
+
|
210
|
+
# FIXME(uwe): Remove this check when HAXM is available on travis
|
211
|
+
# FIXME(uwe): or the x86(_64) emulators don't require HAXM anymore
|
212
|
+
# Newer Android SDK tools (V24) require HAXM to run x86 emulators.
|
213
|
+
# HAXM is not available on travis-ci.
|
214
|
+
if ON_TRAVIS && sdk_level.to_i >= 22
|
215
|
+
abi_opt = '--abi armeabi-v7a'
|
216
|
+
# EMXIF
|
217
|
+
elsif has_x86
|
218
|
+
if has_x86_64
|
219
|
+
abi_opt = '--abi x86_64'
|
220
|
+
else
|
221
|
+
abi_opt = '--abi x86'
|
222
|
+
end
|
223
|
+
else
|
224
|
+
abi_opt = '--abi armeabi-v7a'
|
225
|
+
end
|
226
|
+
|
227
|
+
skin = 'HVGA'
|
228
|
+
# skin_filename = "#{Ruboto::SdkLocations::ANDROID_HOME}/platforms/android-#{sdk_level}/skins/#{skin}/hardware.ini"
|
229
|
+
# if File.exists?(skin_filename)
|
230
|
+
# old_skin_config = File.read(skin_filename)
|
231
|
+
# new_skin_config = old_skin_config.gsub(/vm.heapSize=([0-9]*)/) { |m| $1.to_i < heap_size ? "vm.heapSize=#{heap_size}" : m }
|
232
|
+
# add_property(new_skin_config, 'hw.mainKeys', 'no')
|
233
|
+
# add_property(new_skin_config, 'hw.lcd.density', '160')
|
234
|
+
# File.write(skin_filename, new_skin_config) if new_skin_config != old_skin_config
|
235
|
+
# end
|
236
|
+
|
237
|
+
puts `echo no | android create avd -a -n #{avd_name} -t android-#{sdk_level} #{abi_opt} -c 64M -s #{skin} -d "Nexus One"`
|
238
|
+
|
239
|
+
if $? != 0
|
240
|
+
puts 'Failed to create AVD.'
|
241
|
+
exit 3
|
242
|
+
end
|
243
|
+
patch_config_ini(avd_home, heap_size)
|
244
|
+
|
245
|
+
# hw_config_file_name = "#{avd_home}/hardware-qemu.ini"
|
246
|
+
# if File.exists?(hw_config_file_name)
|
247
|
+
# old_hw_config = File.read(hw_config_file_name)
|
248
|
+
# new_hw_config = old_hw_config.gsub(/vm.heapSize=([0-9]*)/) { |m| $1.to_i < heap_size ? "vm.heapSize=#{heap_size}" : m }
|
249
|
+
# File.write(hw_config_file_name, new_hw_config) if new_hw_config != old_hw_config
|
250
|
+
# end
|
251
|
+
end
|
252
|
+
|
253
|
+
def patch_config_ini(avd_home, heap_size)
|
254
|
+
avd_config_file_name = "#{avd_home}/config.ini"
|
255
|
+
old_avd_config = File.read(avd_config_file_name)
|
256
|
+
new_avd_config = old_avd_config.dup
|
257
|
+
new_avd_config.gsub!(/vm.heapSize=([0-9]*)/) { |m| $1.to_i < heap_size ? "vm.heapSize=#{heap_size}" : m }
|
258
|
+
# add_property(new_avd_config, 'hw.device.manufacturer', 'Generic')
|
259
|
+
# add_property(new_avd_config, 'hw.device.name', '3.2" HVGA slider (ADP1)')
|
260
|
+
# add_property(new_avd_config, 'hw.keyboard.lid', 'no')
|
261
|
+
add_property(new_avd_config, 'hw.lcd.density', '160')
|
262
|
+
add_property(new_avd_config, 'hw.mainKeys', 'no')
|
263
|
+
# add_property(new_avd_config, 'hw.sdCard', 'yes')
|
264
|
+
File.write(avd_config_file_name, new_avd_config) if new_avd_config != old_avd_config
|
265
|
+
end
|
266
|
+
|
249
267
|
def device_ready?
|
250
268
|
`adb get-state`.gsub(/^WARNING:.*$/, '').chomp == 'device'
|
251
269
|
end
|
data/lib/ruboto/util/setup.rb
CHANGED
@@ -8,6 +8,7 @@ module Ruboto
|
|
8
8
|
REPOSITORY_BASE = 'http://dl-ssl.google.com/android/repository'
|
9
9
|
REPOSITORY_URL = "#{REPOSITORY_BASE}/repository-10.xml"
|
10
10
|
SDK_DOWNLOAD_PAGE = 'http://developer.android.com/sdk/index.html?hl=sk'
|
11
|
+
ADDONS_URL = "#{REPOSITORY_BASE}/extras/intel/addon.xml"
|
11
12
|
|
12
13
|
RUBOTO_GEM_ROOT = File.expand_path '../../../..', __FILE__
|
13
14
|
WINDOWS_ELEVATE_CMD = "#{RUBOTO_GEM_ROOT}/bin/elevate_32.exe -c -w"
|
@@ -17,10 +18,10 @@ module Ruboto
|
|
17
18
|
# Core Set up Method
|
18
19
|
#
|
19
20
|
|
20
|
-
def setup_ruboto(accept_all, api_levels = [SdkVersions::DEFAULT_TARGET_SDK])
|
21
|
+
def setup_ruboto(accept_all, api_levels = [SdkVersions::DEFAULT_TARGET_SDK], upgrade_haxm = false)
|
21
22
|
@platform_sdk_loc = {}
|
22
23
|
api_levels = [project_api_level, *api_levels].compact.uniq
|
23
|
-
install_all(accept_all, api_levels) unless check_all(api_levels)
|
24
|
+
install_all(accept_all, api_levels, upgrade_haxm) unless check_all(api_levels)
|
24
25
|
config_path(accept_all)
|
25
26
|
end
|
26
27
|
|
@@ -80,6 +81,10 @@ module Ruboto
|
|
80
81
|
File.join File.expand_path('~'), windows? ? 'AppData/Local/Android/android-sdk' : "android-sdk-#{android_package_os_id}"
|
81
82
|
end
|
82
83
|
|
84
|
+
def android_haxm_directory
|
85
|
+
Dir[File.join(android_package_directory, 'extras', 'intel', 'Hardware_Accelerated_Execution_Manager')][0]
|
86
|
+
end
|
87
|
+
|
83
88
|
def package_installer
|
84
89
|
case android_package_os_id
|
85
90
|
when LINUX
|
@@ -105,11 +110,11 @@ module Ruboto
|
|
105
110
|
end
|
106
111
|
end
|
107
112
|
|
108
|
-
def get_tools_version(type='tool')
|
113
|
+
def get_tools_version(type='tool', repo_url = REPOSITORY_URL)
|
109
114
|
require 'rexml/document'
|
110
115
|
require 'open-uri'
|
111
116
|
|
112
|
-
doc = REXML::Document.new(open(
|
117
|
+
doc = REXML::Document.new(open(repo_url))
|
113
118
|
doc.root.elements.to_a("sdk:#{type}/sdk:revision").map do |t|
|
114
119
|
major = t.elements['sdk:major']
|
115
120
|
minor = t.elements['sdk:minor']
|
@@ -272,7 +277,7 @@ module Ruboto
|
|
272
277
|
# Install Methods
|
273
278
|
#
|
274
279
|
|
275
|
-
def install_all(accept_all, api_levels)
|
280
|
+
def install_all(accept_all, api_levels, upgrade_haxm)
|
276
281
|
install_java(accept_all) unless @java_loc && @javac_loc
|
277
282
|
install_ant(accept_all) unless @ant_loc
|
278
283
|
install_android_sdk(accept_all) unless @android_loc
|
@@ -280,6 +285,7 @@ module Ruboto
|
|
280
285
|
# build-tools, platform-tools, tools, and haxm
|
281
286
|
install_android_tools(accept_all) unless @dx_loc && @adb_loc && @emulator_loc && @haxm_installer_loc
|
282
287
|
install_haxm(accept_all) unless @haxm_kext_loc
|
288
|
+
download_and_upgrade_haxm(true) unless upgrade_haxm.empty?
|
283
289
|
|
284
290
|
if @android_loc
|
285
291
|
api_levels.each do |api_level|
|
@@ -484,6 +490,7 @@ module Ruboto
|
|
484
490
|
response
|
485
491
|
end
|
486
492
|
|
493
|
+
|
487
494
|
def install_android_sdk(accept_all)
|
488
495
|
unless @android_loc
|
489
496
|
puts 'Android package installer not found.'
|
@@ -537,27 +544,39 @@ module Ruboto
|
|
537
544
|
end
|
538
545
|
end
|
539
546
|
|
540
|
-
def
|
541
|
-
print "Downloading #{
|
542
|
-
uri = URI("
|
547
|
+
def download_third_party(filename, uri)
|
548
|
+
print "Downloading #{uri}/#{filename} \r"
|
549
|
+
uri = URI("#{uri}/#{filename}")
|
550
|
+
puts "File will be saved to #{android_haxm_directory}/#{filename}"
|
551
|
+
process_download("#{android_haxm_directory}/#{filename}", uri)
|
552
|
+
end
|
553
|
+
|
554
|
+
def process_download(filename, uri)
|
543
555
|
body = ''
|
544
|
-
Net::HTTP.
|
556
|
+
Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https').request_get(uri.path) do |response|
|
545
557
|
length = response['Content-Length'].to_i
|
546
558
|
response.read_body do |fragment|
|
547
559
|
body << fragment
|
548
|
-
print "Downloading #{
|
560
|
+
print "Downloading #{filename}: #{body.length / 1024**2}MB/#{length / 1024**2}MB #{(body.length * 100) / length}%\r"
|
549
561
|
end
|
550
|
-
puts
|
551
562
|
end
|
552
|
-
File.open(
|
563
|
+
File.open(filename, 'wb') { |f| f << body }
|
553
564
|
end
|
554
565
|
|
555
|
-
|
566
|
+
|
567
|
+
def download(asdk_file_name)
|
568
|
+
print "Downloading #{asdk_file_name}: \r"
|
569
|
+
uri = URI("http://dl.google.com/android/#{asdk_file_name}")
|
570
|
+
process_download(asdk_file_name, uri)
|
571
|
+
end
|
572
|
+
|
573
|
+
|
574
|
+
def unzip(accept_all, asdk_file_name, extract_to='.')
|
556
575
|
require 'zip'
|
557
576
|
Zip::File.open(asdk_file_name) do |zipfile|
|
558
577
|
zipfile.each do |f|
|
559
578
|
f.restore_permissions = true
|
560
|
-
f.extract { accept_all }
|
579
|
+
f.extract("#{extract_to}/#{f.name}") { accept_all }
|
561
580
|
end
|
562
581
|
end
|
563
582
|
end
|
@@ -581,7 +600,42 @@ module Ruboto
|
|
581
600
|
end
|
582
601
|
end
|
583
602
|
|
584
|
-
def
|
603
|
+
def get_new_haxm_filename
|
604
|
+
version = get_tools_version('extra', ADDONS_URL)
|
605
|
+
zip_version = version.gsub(/\./, '_')
|
606
|
+
haxm_file_name = ''
|
607
|
+
|
608
|
+
case android_package_os_id
|
609
|
+
when MAC_OS_X
|
610
|
+
haxm_file_name = "haxm-macosx_v#{zip_version}.zip"
|
611
|
+
when WINDOWS
|
612
|
+
haxm_file_name = "haxm-windows_v#{zip_version}.zip"
|
613
|
+
when LINUX
|
614
|
+
puts 'HAXM installation on Linux is not supported, yet.'
|
615
|
+
version = ''
|
616
|
+
else
|
617
|
+
raise "Unknown host os: #{RbConfig::CONFIG['host_os']}"
|
618
|
+
end
|
619
|
+
return haxm_file_name, version
|
620
|
+
end
|
621
|
+
|
622
|
+
def download_haxm(accept_all, haxm_file_name)
|
623
|
+
uri = 'https://software.intel.com/sites/default/files/managed/dd/21'
|
624
|
+
download_third_party(haxm_file_name, uri)
|
625
|
+
unzip(accept_all, "#{android_haxm_directory}/#{haxm_file_name}", "#{android_haxm_directory}")
|
626
|
+
FileUtils.rm_f "#{android_haxm_directory}/#{haxm_file_name}"
|
627
|
+
end
|
628
|
+
|
629
|
+
def download_and_upgrade_haxm(accept_all)
|
630
|
+
print "Downloading Intel HAXM... \r"
|
631
|
+
filename, version = get_new_haxm_filename
|
632
|
+
download_haxm(accept_all, filename)
|
633
|
+
install_haxm(accept_all, version)
|
634
|
+
end
|
635
|
+
|
636
|
+
def install_haxm(accept_all, custom_version=nil)
|
637
|
+
filename = nil
|
638
|
+
haxm_file_override = "IntelHAXM_#{custom_version}.dmg" unless custom_version.nil?
|
585
639
|
if @haxm_installer_loc && @haxm_kext_loc.nil?
|
586
640
|
puts 'HAXM not installed.'
|
587
641
|
unless accept_all
|
@@ -592,8 +646,13 @@ module Ruboto
|
|
592
646
|
case android_package_os_id
|
593
647
|
when MAC_OS_X
|
594
648
|
puts "Mounting the HAXM install image"
|
595
|
-
|
596
|
-
|
649
|
+
if custom_version.nil?
|
650
|
+
system "hdiutil attach #{@haxm_installer_loc}"
|
651
|
+
fileName = Dir['/Volumes/IntelHAXM*/IntelHAXM*.mpkg'][0]
|
652
|
+
else
|
653
|
+
system "hdiutil attach #{android_haxm_directory}/#{haxm_file_override}"
|
654
|
+
fileName = Dir["/Volumes/IntelHAXM_#{custom_version}/IntelHAXM_#{custom_version}.mpkg"][0]
|
655
|
+
end
|
597
656
|
puts "Starting the HAXM installer. Sudo password required."
|
598
657
|
system "sudo -S installer -pkg #{fileName} -target /"
|
599
658
|
when LINUX
|
data/lib/ruboto/util/update.rb
CHANGED
@@ -168,6 +168,10 @@ module Ruboto
|
|
168
168
|
return false
|
169
169
|
end
|
170
170
|
|
171
|
+
# FIXME(uwe): Remove when JRuby 9000 works with Ruboto
|
172
|
+
version ||= ENV['JRUBY_JARS_VERSION'] || '~>1.7.13'
|
173
|
+
# EMXIF
|
174
|
+
|
171
175
|
install_jruby_jars_gem(version)
|
172
176
|
begin
|
173
177
|
gem('jruby-jars', version) if version
|
@@ -213,7 +217,7 @@ module Ruboto
|
|
213
217
|
|
214
218
|
def install_jruby_jars_gem(jruby_jars_version = ENV['JRUBY_JARS_VERSION'])
|
215
219
|
if jruby_jars_version
|
216
|
-
version_requirement = " -v #{jruby_jars_version}"
|
220
|
+
version_requirement = " -v '#{jruby_jars_version}'"
|
217
221
|
end
|
218
222
|
`gem query -i -n jruby-jars#{version_requirement}`
|
219
223
|
unless $? == 0
|
@@ -467,7 +471,7 @@ module Ruboto
|
|
467
471
|
raise "Unpacking jruby-core jar failed: #$?" unless $? == 0
|
468
472
|
File.delete jruby_core
|
469
473
|
gem_version = Gem::Version.new(jruby_core_version.to_s.tr('-', '.'))
|
470
|
-
if gem_version >= Gem::Version.new('9.0.
|
474
|
+
if gem_version >= Gem::Version.new('9.0.5.0.SNAPSHOT')
|
471
475
|
#noinspection RubyLiteralArrayInspection
|
472
476
|
excluded_core_packages = [
|
473
477
|
|
@@ -488,6 +492,7 @@ module Ruboto
|
|
488
492
|
'com/martiansoftware',
|
489
493
|
'com/oracle/nfi',
|
490
494
|
'com/oracle/truffle',
|
495
|
+
'java',
|
491
496
|
'jni',
|
492
497
|
'jnr/constants/platform/darwin',
|
493
498
|
'jnr/constants/platform/fake',
|
@@ -534,22 +539,64 @@ module Ruboto
|
|
534
539
|
'org/jruby/truffle/runtime/*.class',
|
535
540
|
'org/jruby/truffle/translator',
|
536
541
|
]
|
537
|
-
elsif gem_version >= Gem::Version.new('
|
538
|
-
|
542
|
+
elsif gem_version >= Gem::Version.new('9.0.0.0.SNAPSHOT')
|
543
|
+
raise "Unsupported jruby-jars version: #{gem_version}"
|
544
|
+
elsif gem_version >= Gem::Version.new('1.7.23.dev')
|
545
|
+
# TODO(uwe): Remove when we stop supporting jruby-jars 1.7.23
|
546
|
+
excluded_core_packages = [
|
547
|
+
'**/*Aix*',
|
548
|
+
'**/*Darwin*',
|
549
|
+
'**/*FreeBSD*',
|
550
|
+
'**/*MacOS*',
|
551
|
+
'**/*OpenBSD*',
|
552
|
+
'**/*Solaris*',
|
553
|
+
'**/*sunos*',
|
554
|
+
'**/*Windows*',
|
555
|
+
'META-INF',
|
556
|
+
'com/headius/invokebinder',
|
557
|
+
'com/headius/options/example',
|
558
|
+
'com/kenai/constantine',
|
559
|
+
'com/kenai/jffi',
|
560
|
+
'com/kenai/jnr/x86asm',
|
561
|
+
'com/martiansoftware',
|
562
|
+
'java',
|
563
|
+
'jni',
|
564
|
+
'jnr/constants/platform/fake',
|
565
|
+
'jnr/enxio',
|
566
|
+
'jnr/ffi/annotations',
|
567
|
+
'jnr/ffi/byref',
|
568
|
+
'jnr/ffi/mapper',
|
569
|
+
'jnr/ffi/provider',
|
570
|
+
'jnr/ffi/util',
|
571
|
+
'jnr/ffi/Struct$*',
|
572
|
+
'jnr/ffi/types',
|
573
|
+
'jnr/x86asm',
|
574
|
+
'org/jruby/ant',
|
575
|
+
'org/jruby/cext',
|
576
|
+
'org/jruby/compiler/impl/BaseBodyCompiler*',
|
577
|
+
'org/jruby/compiler/util',
|
578
|
+
'org/jruby/demo',
|
579
|
+
'org/jruby/embed/bsf',
|
580
|
+
'org/jruby/embed/jsr223',
|
581
|
+
'org/jruby/embed/osgi',
|
582
|
+
'org/jruby/ext/ffi/AbstractMemory*',
|
583
|
+
'org/jruby/ext/ffi/Enums*',
|
584
|
+
'org/jruby/ext/ffi/io',
|
585
|
+
'org/jruby/ext/ffi/jffi',
|
586
|
+
'org/jruby/javasupport/bsf',
|
587
|
+
'org/yecht',
|
588
|
+
]
|
589
|
+
elsif gem_version >= Gem::Version.new('1.7.22')
|
590
|
+
# TODO(uwe): Remove when we stop supporting jruby-jars 1.7.22
|
539
591
|
excluded_core_packages = [
|
540
|
-
'**/*.sh',
|
541
592
|
'**/*Aix*',
|
542
593
|
'**/*Darwin*',
|
543
|
-
'**/*darwin*',
|
544
594
|
'**/*FreeBSD*',
|
545
|
-
'**/*freebsd*',
|
546
595
|
'**/*MacOS*',
|
547
596
|
'**/*OpenBSD*',
|
548
|
-
'**/*openbsd*',
|
549
597
|
'**/*Solaris*',
|
550
598
|
'**/*sunos*',
|
551
599
|
'**/*Windows*',
|
552
|
-
'**/*windows*',
|
553
600
|
'META-INF',
|
554
601
|
'com/headius/invokebinder',
|
555
602
|
'com/headius/options/example',
|
@@ -582,7 +629,6 @@ module Ruboto
|
|
582
629
|
'org/jruby/ext/ffi/jffi',
|
583
630
|
'org/jruby/javasupport/bsf',
|
584
631
|
'org/yecht',
|
585
|
-
'yaml.rb',
|
586
632
|
]
|
587
633
|
elsif gem_version >= Gem::Version.new('1.7.19')
|
588
634
|
# TODO(uwe): Remove when we stop supporting jruby-jars 1.7.19
|
data/lib/ruboto/version.rb
CHANGED
@@ -15,15 +15,17 @@ end
|
|
15
15
|
# ANDROID: 15, PLATFORM: STANDALONE, JRuby: 1.7.0 '[28, 33, 51, 68]' expected, but got '[28, 33, 47, 64]'
|
16
16
|
# ANDROID: 16, PLATFORM: 0.5.6, JRuby: 1.7.3 '[28, 33, 45, 62]' expected, but got '[28, 33, 44, 61]'
|
17
17
|
# ANDROID: 16, PLATFORM: 0.6.0, JRuby: 9000.dev '[28, 33, 45, 62]' expected, but got '[28, 33, 45, 63]'
|
18
|
-
# ANDROID: 19, PLATFORM: STANDALONE, JRuby: 1.7.20
|
18
|
+
# ANDROID: 19, PLATFORM: STANDALONE, JRuby: 1.7.20 '[28, 33, 43, 60]' expected, but got '[28, 33, 44, 61]'
|
19
19
|
# ANDROID: 20, PLATFORM: 1.0.2, JRuby: 1.7.12 '[28, 33, 44, 61]' expected, but got '[28, 33, 43, 60]'
|
20
20
|
# ANDROID: 21, PLATFORM: 1.0.2, JRuby: 1.7.12 '[28, 33, 44, 61]' expected, but got '[28, 33, 43, 60]'
|
21
|
-
# ANDROID: 22, PLATFORM: STANDALONE, JRuby: 1.7.20
|
21
|
+
# ANDROID: 22, PLATFORM: STANDALONE, JRuby: 1.7.20 '[28, 33, 44, 61]' expected, but got '[28, 33, 43, 60]'
|
22
|
+
# ANDROID: 23, PLATFORM: STANDALONE, JRuby: 1.7.19 '[28, 33, 43, 60]' expected, but got '[26, 31, 40, 57]'
|
22
23
|
test('stack depth') do |activity|
|
23
24
|
os_offset =
|
24
25
|
case android.os.Build::VERSION::SDK_INT
|
25
26
|
when 13 then [1, 1, 1, 1]
|
26
27
|
when (15..19) then [0, 0, 1, 1]
|
28
|
+
when 23 then [-2, -2, -3, -3]
|
27
29
|
else [0, 0, 0, 0]
|
28
30
|
end
|
29
31
|
jruby_offset =
|
data/test/app_test_methods.rb
CHANGED
@@ -38,6 +38,11 @@ module AppTestMethods
|
|
38
38
|
|
39
39
|
def run_activity_tests(activity_dir)
|
40
40
|
Dir[File.expand_path("#{activity_dir}/*", File.dirname(__FILE__))].each do |file|
|
41
|
+
# FIXME(uwe): Remove when we stop testing JRuby 1.7.22 or api level 19
|
42
|
+
next if file =~ /rss/ && (JRUBY_JARS_VERSION == Gem::Version.new('1.7.22')) &&
|
43
|
+
RUBOTO_PLATFORM == 'STANDALONE' && ANDROID_OS == 19
|
44
|
+
# EMXIF
|
45
|
+
|
41
46
|
# FIXME(uwe): Remove when we stop testing JRuby < 1.7.20.dev
|
42
47
|
next if file =~ /rss/ && (JRUBY_JARS_VERSION < Gem::Version.new('1.7.20.dev'))
|
43
48
|
# EMXIF
|
data/test/arjdbc_test.rb
CHANGED
@@ -3,25 +3,19 @@ require_relative 'test_helper'
|
|
3
3
|
class ArjdbcTest < Minitest::Test
|
4
4
|
def setup
|
5
5
|
generate_app bundle: [
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
[:activerecord, '<4.2.0'],
|
7
|
+
:'activerecord-jdbc-adapter',
|
8
|
+
:sqldroid,
|
9
|
+
]
|
10
10
|
end
|
11
11
|
|
12
12
|
def teardown
|
13
13
|
cleanup_app
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
unless RubotoTest::ANDROID_OS <= 15 || has_stupid_crash
|
20
|
-
# EMXIF
|
21
|
-
|
22
|
-
def test_arjdbc
|
23
|
-
Dir.chdir APP_DIR do
|
24
|
-
File.open('src/ruboto_test_app_activity.rb', 'w') { |f| f << <<EOF }
|
16
|
+
def test_arjdbc
|
17
|
+
Dir.chdir APP_DIR do
|
18
|
+
File.open('src/ruboto_test_app_activity.rb', 'w') { |f| f << <<EOF }
|
25
19
|
require 'ruboto/widget'
|
26
20
|
require 'ruboto/util/stack'
|
27
21
|
|
@@ -94,7 +88,7 @@ class RubotoTestAppActivity
|
|
94
88
|
end
|
95
89
|
EOF
|
96
90
|
|
97
|
-
|
91
|
+
File.open('test/src/ruboto_test_app_activity_test.rb', 'w') { |f| f << <<EOF }
|
98
92
|
activity Java::org.ruboto.test_app.RubotoTestAppActivity
|
99
93
|
|
100
94
|
setup do |activity|
|
@@ -114,14 +108,17 @@ test("activity starts") do |activity|
|
|
114
108
|
end
|
115
109
|
EOF
|
116
110
|
|
117
|
-
end
|
118
|
-
|
119
|
-
run_app_tests
|
120
111
|
end
|
121
112
|
|
122
|
-
|
123
|
-
|
124
|
-
|
113
|
+
run_app_tests
|
114
|
+
end unless
|
115
|
+
# FIXME(uwe): Weird total app crash when running these tests together
|
116
|
+
# FIXME(uwe): Remove when we stop testing api level <= 15
|
117
|
+
# FIXME(uwe): or the stupid crash has been resolved
|
118
|
+
RubotoTest::ANDROID_OS <= 15 || has_stupid_crash ||
|
119
|
+
# EMXIF
|
120
|
+
# FIXME(uwe): remove when we stop supporting JRuby 1.7.22
|
121
|
+
# https://github.com/jruby/jruby/issues/3401
|
122
|
+
JRUBY_JARS_VERSION == Gem::Version.new('1.7.22')
|
125
123
|
# EMXIF
|
126
|
-
|
127
124
|
end
|
data/test/ruboto_gen_test.rb
CHANGED
@@ -91,6 +91,8 @@ class RubotoGenTest < Minitest::Test
|
|
91
91
|
# APK was 7126.9KB. PLATFORM: STANDALONE, ANDROID_TARGET: 15, JRuby: 9.0.0.0.pre1
|
92
92
|
# APK was 8571.4KB. PLATFORM: STANDALONE, ANDROID_TARGET: 21, JRuby: 9.0.0.0.pre1
|
93
93
|
# APK was 4633.2KB. PLATFORM: STANDALONE, ANDROID_TARGET: 22, JRuby: 9.0.0.0.SNAPSHOT
|
94
|
+
# APK was 6999.2KB. PLATFORM: STANDALONE, ANDROID_TARGET: 15, JRuby: 1.7.22
|
95
|
+
# APK was 7006.1KB. PLATFORM: STANDALONE, ANDROID_TARGET: 15, JRuby: 1.7.23.dev
|
94
96
|
def test_new_apk_size_is_within_limits
|
95
97
|
apk_size = BigDecimal(File.size("#{APP_DIR}/bin/RubotoTestApp-debug.apk").to_s) / 1024
|
96
98
|
version = " PLATFORM: #{RUBOTO_PLATFORM}"
|
@@ -112,6 +114,8 @@ class RubotoGenTest < Minitest::Test
|
|
112
114
|
'1.7.18' => 10100.0,
|
113
115
|
'1.7.19' => 8000.0,
|
114
116
|
'1.7.20.dev' => ANDROID_TARGET <= 15 ? 8000 : 9000.0,
|
117
|
+
'1.7.22' => ANDROID_TARGET <= 15 ? 7200 : 9000.0,
|
118
|
+
'1.7.23.dev' => ANDROID_TARGET <= 15 ? 7200 : 9000.0,
|
115
119
|
'9.0.0.0.dev' => 8300.0,
|
116
120
|
'9.0.0.0.pre1' => 8600.0,
|
117
121
|
'9.0.0.0.SNAPSHOT' => 5000.0,
|
data/test/ruboto_setup_test.rb
CHANGED
@@ -2,21 +2,50 @@ require File.expand_path('test_helper', File.dirname(__FILE__))
|
|
2
2
|
require 'net/http'
|
3
3
|
|
4
4
|
class RubotoSetupTest < Minitest::Test
|
5
|
+
include Ruboto::Util::Setup
|
6
|
+
|
5
7
|
SDK_DOWNLOAD_PAGE = 'http://developer.android.com/sdk/index.html?hl=sk'
|
8
|
+
REPOSITORY_BASE = 'http://dl-ssl.google.com/android/repository'
|
9
|
+
ADDONS_URL = "#{REPOSITORY_BASE}/extras/intel/addon.xml"
|
10
|
+
HAXM_URL = 'https://software.intel.com/sites/default/files/managed/dd/21'
|
6
11
|
|
7
|
-
def
|
12
|
+
def test_if_sdk_page_still_exists?
|
8
13
|
uri = URI.parse(SDK_DOWNLOAD_PAGE)
|
9
14
|
res = Net::HTTP.get_response(uri)
|
15
|
+
assert_equal 200, res.code.to_i
|
16
|
+
end
|
10
17
|
|
18
|
+
def test_if_haxm_version_page_still_exists?
|
19
|
+
uri = URI.parse(ADDONS_URL)
|
20
|
+
res = Net::HTTP.get_response(uri)
|
11
21
|
assert_equal 200, res.code.to_i
|
12
22
|
end
|
13
23
|
|
24
|
+
def test_if_haxm_download_still_exists?
|
25
|
+
filename, version = get_new_haxm_filename
|
26
|
+
unless (filename.empty? || version.empty?)
|
27
|
+
uri = URI.parse("#{HAXM_URL}/#{filename}")
|
28
|
+
res = Net::HTTP.get_response(uri)
|
29
|
+
assert_equal 200, res.code.to_i
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
14
33
|
def test_if_regex_still_applies_to_sdk
|
15
34
|
regex = '(\>installer_.*.exe)'
|
16
35
|
page_content = Net::HTTP.get(URI.parse(SDK_DOWNLOAD_PAGE))
|
17
36
|
link = page_content.scan(/#{regex}/).to_s
|
37
|
+
assert_match /\d+(\.\d+)?(\.\d+)?/, link
|
38
|
+
end
|
18
39
|
|
19
|
-
|
40
|
+
describe 'Upgrade HAXM' do
|
41
|
+
include Ruboto::Util::Setup
|
42
|
+
it 'should get the new HAXM file name and version' do
|
43
|
+
filename, version = get_new_haxm_filename
|
44
|
+
unless (filename.empty? || version.empty?)
|
45
|
+
filename.must_match /haxm-(.*)\.zip/
|
46
|
+
version.must_match /\d\.\d\.\d/
|
47
|
+
end
|
48
|
+
end
|
20
49
|
end
|
21
50
|
|
22
51
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Jackoway
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-
|
14
|
+
date: 2015-12-24 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: main
|
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
256
|
version: '0'
|
257
257
|
requirements: []
|
258
258
|
rubyforge_project: ruboto/ruboto
|
259
|
-
rubygems_version: 2.4.
|
259
|
+
rubygems_version: 2.4.5
|
260
260
|
signing_key:
|
261
261
|
specification_version: 4
|
262
262
|
summary: A platform for developing apps using JRuby on Android.
|