ruboto 1.2.0 → 1.3.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 +5 -3
- data/README.md +1 -1
- data/RELEASE_CANDICATE_DOC.md +22 -5
- data/RELEASE_DOC.md +58 -26
- data/Rakefile +68 -163
- data/Vagrantfile +46 -0
- data/assets/rakelib/ruboto.device.rb +170 -0
- data/assets/rakelib/ruboto.rake +121 -239
- data/assets/rakelib/ruboto.stdlib.rake +1 -1
- data/assets/src/org/ruboto/JRubyAdapter.java +1 -0
- data/lib/ruboto/sdk_versions.rb +5 -4
- data/lib/ruboto/util/emulator.rb +6 -4
- data/lib/ruboto/util/setup.rb +40 -23
- data/lib/ruboto/util/update.rb +61 -13
- data/lib/ruboto/version.rb +1 -1
- data/test/activity/dir_and_file_activity_test.rb +3 -3
- data/test/activity/json_activity.rb +11 -0
- data/test/activity/navigation_activity_test.rb +2 -1
- data/test/activity/stack_activity_test.rb +16 -12
- data/test/app_test_methods.rb +4 -4
- data/test/arjdbc_test.rb +18 -7
- data/test/broadcast_receiver_test.rb +1 -1
- data/test/gem_test.rb +1 -1
- data/test/git_based_gem_test.rb +1 -1
- data/test/minimal_app_test.rb +7 -5
- data/test/rake_test.rb +3 -3
- data/test/ruboto_activity_test.rb +1 -1
- data/test/ruboto_gen_test.rb +25 -11
- data/test/ruboto_setup_test.rb +1 -1
- data/test/ruboto_update_test.rb +3 -3
- data/test/sample_broadcast_receiver_test.rb +1 -1
- data/test/service_block_test.rb +1 -1
- data/test/service_gen_class_test.rb +1 -1
- data/test/service_infile_class_test.rb +1 -1
- data/test/splash_test.rb +1 -1
- data/test/sqldroid_test.rb +1 -1
- data/test/test_helper.rb +22 -18
- data/test/update_test_methods.rb +1 -1
- data/test/updated_example_test_methods.rb +1 -1
- data/test/uppercase_package_name_test.rb +3 -3
- metadata +20 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43fc738a51f8ba87d63a71d6c03d1447aec6d18e
|
4
|
+
data.tar.gz: c7bd31a0ef13ceac40d6f615bb5a0778d7be6e41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fdfa5f49fca5364727e1d11d32110c24920a3ecd9f5c9d1bde869e6208da4efde2c7ba8b8ad98111fbad3eb844e29b8f72bb6890d5af5961bff29fe66785ef0
|
7
|
+
data.tar.gz: 125ad2e435f8d0f9cb9a8dca47a88106efba9b58d39368f40e36727169ed47456adb9d13f00475e00a6ade494a02a489418b4feec6ee68fe37ec142257dfa998
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruboto (1.
|
4
|
+
ruboto (1.3.0.dev)
|
5
5
|
main (~> 5.2)
|
6
6
|
rake (~> 10.0)
|
7
7
|
rubyzip (~> 1.0)
|
@@ -21,16 +21,18 @@ GEM
|
|
21
21
|
pry (>= 0.9)
|
22
22
|
map (6.5.5)
|
23
23
|
method_source (0.8.2)
|
24
|
+
minitest (5.5.1)
|
24
25
|
pry (0.10.1)
|
25
26
|
coderay (~> 1.1.0)
|
26
27
|
method_source (~> 0.8.1)
|
27
28
|
slop (~> 3.4)
|
28
|
-
rake (10.
|
29
|
-
rubyzip (1.1.
|
29
|
+
rake (10.4.2)
|
30
|
+
rubyzip (1.1.7)
|
30
31
|
slop (3.6.0)
|
31
32
|
|
32
33
|
PLATFORMS
|
33
34
|
ruby
|
34
35
|
|
35
36
|
DEPENDENCIES
|
37
|
+
minitest (~> 5.5)
|
36
38
|
ruboto!
|
data/README.md
CHANGED
@@ -45,7 +45,7 @@ Before you can use Ruboto, you need the following tools installed:
|
|
45
45
|
Ruboto offers a setup command to help you with the component installation and
|
46
46
|
configuration:
|
47
47
|
|
48
|
-
$ ruboto setup
|
48
|
+
$ ruboto setup -y
|
49
49
|
|
50
50
|
* Generate an [Emulator](http://developer.android.com/guide/developing/tools/emulator.html)
|
51
51
|
image unless you want to develop using your phone.
|
data/RELEASE_CANDICATE_DOC.md
CHANGED
@@ -1,12 +1,29 @@
|
|
1
|
-
Subject: [ANN] Ruboto 1.
|
1
|
+
Subject: [ANN] Ruboto 1.3.0 release candidate
|
2
2
|
|
3
3
|
Hi all!
|
4
4
|
|
5
|
-
The Ruboto 1.
|
5
|
+
The Ruboto 1.3.0 release candidate is now available.
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
It's been a long time since the last release. We have had some problems
|
8
|
+
getting the test matrix green at https://travis-ci.org/ruboto/ruboto and
|
9
|
+
as there are still some combinations failing, we need help to fix them.
|
10
|
+
If you have experience debugging on Android, please contribute.
|
11
|
+
|
12
|
+
In the meantime, we have added support for JRuby up to 1.7.19 and Android
|
13
|
+
up to 5.1. There are still some bugs to sort out, but we are getting
|
14
|
+
there :) Testing with JRuby 9000 has begun, but is currently failing.
|
15
|
+
|
16
|
+
A new feature is the running of "src/environment.rb" if it is present
|
17
|
+
right after JRuby initialization. This enables loading of gems and code
|
18
|
+
common across activities, broadcast receivers, and services.
|
19
|
+
|
20
|
+
Use of Bundler has improved to allow gems that duplicate files in Ruby
|
21
|
+
Stdlib like JSON, and allow local gems using the "path" option in the
|
22
|
+
Gemfile. Support for ActiveRecord has been updated to 4.1.
|
23
|
+
|
24
|
+
Finally we have updated the homepage and wiki with a few changes.
|
25
|
+
|
26
|
+
Thanks to all who have contributed!
|
10
27
|
|
11
28
|
As always we need your help and feedback to ensure the quality of the release. Please install the release candidate using
|
12
29
|
|
data/RELEASE_DOC.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
Subject: [ANN] Ruboto 1.
|
1
|
+
Subject: [ANN] Ruboto 1.3.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.3.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,45 +8,77 @@ 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.3.0:
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
It's been a long time since the last release. We have had some problems
|
14
|
+
getting the test matrix green at https://travis-ci.org/ruboto/ruboto and
|
15
|
+
as there are still some combinations failing, we need help to fix them.
|
16
|
+
If you have experience debugging on Android, please contribute.
|
17
|
+
|
18
|
+
In the meantime, we have added support for JRuby up to 1.7.19 and Android
|
19
|
+
up to 5.1. There are still some bugs to sort out, but we are getting
|
20
|
+
there :) Testing with JRuby 9000 has begun, but is currently failing.
|
21
|
+
|
22
|
+
A new feature is the running of "src/environment.rb" if it is present
|
23
|
+
right after JRuby initialization. This enables loading of gems and code
|
24
|
+
common across activities, broadcast receivers, and services.
|
25
|
+
|
26
|
+
Use of Bundler has improved to allow gems that duplicate files in Ruby
|
27
|
+
Stdlib like JSON, and allow local gems using the "path" option in the
|
28
|
+
Gemfile. Support for ActiveRecord has been updated to 4.1.
|
29
|
+
|
30
|
+
Finally we have updated the homepage and wiki with a few changes.
|
31
|
+
|
32
|
+
Thanks to all who have contributed!
|
33
|
+
|
34
|
+
API Changes:
|
35
|
+
|
36
|
+
* Issue #689 Add support for Android 5 Lollipop
|
37
|
+
* Issue #690 Update to JRuby 1.7.19
|
16
38
|
|
17
39
|
Features:
|
18
40
|
|
19
|
-
* Issue #
|
20
|
-
* Issue #
|
21
|
-
* Issue #
|
22
|
-
|
23
|
-
* Issue #654 Access android.R inner classes like android.R.id and
|
24
|
-
android.R.attr directly
|
25
|
-
* Issue #656 Add support for Android L developer preview
|
41
|
+
* Issue #647 Run environment.rb after JRuby initialization
|
42
|
+
* Issue #696 Add support for local gems
|
43
|
+
* Issue #699 Add support for ActiveRecord 4 and the thread_safe gem
|
44
|
+
* Issue #701 Add support for ActiveRecord 4.1
|
26
45
|
|
27
46
|
Bugfixes:
|
28
47
|
|
29
|
-
* Issue #
|
30
|
-
* Issue #
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
* Issue #
|
35
|
-
* Issue #
|
36
|
-
* Issue #
|
48
|
+
* Issue #627 Fix HTTPS access to GitHub
|
49
|
+
* Issue #678 Update setup.rb (sardaukar)
|
50
|
+
* Issue #679 Fix for finding the Platform SDK on OS X when using
|
51
|
+
homebrew
|
52
|
+
* Issue #681 Warning after ruboto setup
|
53
|
+
* Issue #700 Allow non-utf8 output in "rake log"
|
54
|
+
* Issue #702 Exception running "ruboto setup -t 19 -y" on OS X 10.10
|
55
|
+
* Issue #706 Avoid duplicate files in bundle vs stdlib
|
56
|
+
* Issue #707 Choose the latest build-tools in "ruboto setup"
|
57
|
+
|
58
|
+
Documentation:
|
59
|
+
|
60
|
+
* Issue #676 Modification to Wiki for Mac OS Guide
|
61
|
+
* Issue #677 Ruboto Main Page - misinformation?
|
37
62
|
|
38
63
|
Support:
|
39
64
|
|
40
|
-
* Issue #
|
65
|
+
* Issue #590 Cannot open apk in emulator
|
66
|
+
* Issue #680 Android SDK Command dx : Not found
|
67
|
+
* Issue #682 ruboto gen app only works if sdk api level 15 installed
|
68
|
+
|
69
|
+
Community:
|
70
|
+
|
71
|
+
* Issue #578 How can I help? (jaunesarmiento)
|
72
|
+
* Issue #581 How can I help? (bobquest33)
|
41
73
|
|
42
|
-
|
74
|
+
Internal:
|
43
75
|
|
44
|
-
* Issue #
|
45
|
-
|
76
|
+
* Issue #709 Remove swap manipulation and sudo (BanzaiMan)
|
77
|
+
* Issue #711 Test JRuby 1.7.20.dev, 1.7.19, 1.7.15, and 1.7.13. (donv)
|
46
78
|
|
47
79
|
You can find a complete list of issues here:
|
48
80
|
|
49
|
-
* https://github.com/ruboto/ruboto/issues?state=closed&milestone=
|
81
|
+
* https://github.com/ruboto/ruboto/issues?state=closed&milestone=36
|
50
82
|
|
51
83
|
|
52
84
|
Installation:
|
data/Rakefile
CHANGED
@@ -11,9 +11,10 @@ require 'net/http'
|
|
11
11
|
require 'net/https'
|
12
12
|
require 'openssl'
|
13
13
|
require 'yaml'
|
14
|
+
require_relative 'assets/rakelib/ruboto.device'
|
14
15
|
|
15
|
-
PROJECT_DIR = File.expand_path(File.dirname(__FILE__))
|
16
16
|
PLATFORM_PROJECT = File.expand_path('tmp/RubotoCore', File.dirname(__FILE__))
|
17
|
+
PLATFORM_PACKAGE = 'org.ruboto.core'
|
17
18
|
PLATFORM_DEBUG_APK = "#{PLATFORM_PROJECT}/bin/RubotoCore-debug.apk"
|
18
19
|
PLATFORM_DEBUG_APK_BAK = "#{PLATFORM_PROJECT}/bin/RubotoCore-debug.apk.bak"
|
19
20
|
PLATFORM_RELEASE_APK = "#{PLATFORM_PROJECT}/bin/RubotoCore-release.apk"
|
@@ -22,7 +23,7 @@ MANIFEST_FILE = 'AndroidManifest.xml'
|
|
22
23
|
GEM_FILE = "ruboto-#{Ruboto::VERSION}.gem"
|
23
24
|
GEM_SPEC_FILE = 'ruboto.gemspec'
|
24
25
|
README_FILE = 'README.md'
|
25
|
-
WEB_DIR =
|
26
|
+
WEB_DIR = File.expand_path('../ruboto.github.com', File.dirname(__FILE__))
|
26
27
|
BLOG_DIR = '_posts'
|
27
28
|
RELEASE_BLOG = "#{BLOG_DIR}/#{Date.today}-Ruboto-#{Ruboto::VERSION}-release-doc.md"
|
28
29
|
RELEASE_BLOG_GLOB = "#{BLOG_DIR}/*-Ruboto-#{Ruboto::VERSION}-release-doc.md"
|
@@ -118,16 +119,6 @@ end
|
|
118
119
|
desc 'Generate release docs for a given milestone'
|
119
120
|
|
120
121
|
def get_github_issues
|
121
|
-
puts 'GitHub login:'
|
122
|
-
begin
|
123
|
-
require 'rubygems'
|
124
|
-
require 'highline/import'
|
125
|
-
user = ask('login : ') { |q| q.echo = true }
|
126
|
-
pass = ask('password: ') { |q| q.echo = '*' }
|
127
|
-
rescue Exception
|
128
|
-
print 'user name: '; user = STDIN.gets.chomp
|
129
|
-
print ' password: '; pass = STDIN.gets.chomp
|
130
|
-
end
|
131
122
|
host = 'api.github.com'
|
132
123
|
base_uri = "https://#{host}/repos/ruboto/ruboto"
|
133
124
|
https = Net::HTTP.new(host, 443)
|
@@ -136,7 +127,6 @@ def get_github_issues
|
|
136
127
|
|
137
128
|
milestone_uri = URI("#{base_uri}/milestones")
|
138
129
|
req = Net::HTTP::Get.new(milestone_uri.request_uri)
|
139
|
-
req.basic_auth(user, pass)
|
140
130
|
res = https.start { |http| http.request(req) }
|
141
131
|
milestones = YAML.load(res.body).sort_by { |i| Date.parse(i['due_on']) }
|
142
132
|
milestone_entry = milestones.find { |m| m['title'] == Ruboto::VERSION.chomp('.dev') }
|
@@ -145,18 +135,17 @@ def get_github_issues
|
|
145
135
|
|
146
136
|
uri = URI("#{base_uri}/issues?milestone=#{milestone}&state=closed&per_page=1000")
|
147
137
|
req = Net::HTTP::Get.new(uri.request_uri)
|
148
|
-
req.basic_auth(user, pass)
|
149
138
|
res = https.start { |http| http.request(req) }
|
150
139
|
issues = YAML.load(res.body).sort_by { |i| i['number'] }
|
151
140
|
milestone_name = issues[0] ? issues[0]['milestone']['title'] : "No issues for milestone #{milestone}"
|
152
141
|
milestone_description = issues[0] ? issues[0]['milestone']['description'] : "No issues for milestone #{milestone}"
|
153
|
-
milestone_description = milestone_description.split("\r\n").map(&:wrap).join("\
|
142
|
+
milestone_description = milestone_description.split("\r\n").map(&:wrap).join("\n")
|
154
143
|
categories = {
|
155
|
-
'
|
156
|
-
'
|
157
|
-
'
|
158
|
-
'
|
159
|
-
'Rejected' => 'rejected', 'Other' => nil
|
144
|
+
'API Changes' => 'API change', 'Features' => 'feature',
|
145
|
+
'Bugfixes' => 'bug', 'Performance' => 'performance',
|
146
|
+
'Documentation' => 'documentation', 'Support' => 'support',
|
147
|
+
'Community' => 'community', 'Pull requests' => nil,
|
148
|
+
'Internal' => 'internal', 'Rejected' => 'rejected', 'Other' => nil
|
160
149
|
}
|
161
150
|
grouped_issues = issues.group_by do |i|
|
162
151
|
labels = i['labels'].map { |l| l['name'] }
|
@@ -492,8 +481,8 @@ namespace :platform do
|
|
492
481
|
end
|
493
482
|
|
494
483
|
desc 'Install the current RubotoCore platform release apk'
|
495
|
-
task :
|
496
|
-
install_apk
|
484
|
+
task current: PLATFORM_CURRENT_RELEASE_APK do
|
485
|
+
install_apk PLATFORM_PACKAGE, PLATFORM_CURRENT_RELEASE_APK
|
497
486
|
end
|
498
487
|
|
499
488
|
desc 'Install the Ruboto Core platform debug apk'
|
@@ -505,126 +494,7 @@ namespace :platform do
|
|
505
494
|
|
506
495
|
desc 'Uninstall the Ruboto Core platform debug apk'
|
507
496
|
task :uninstall do
|
508
|
-
uninstall_apk
|
509
|
-
end
|
510
|
-
|
511
|
-
private
|
512
|
-
|
513
|
-
def package
|
514
|
-
'org.ruboto.core'
|
515
|
-
end
|
516
|
-
|
517
|
-
def wait_for_valid_device
|
518
|
-
while `adb shell echo "ping"`.strip != 'ping'
|
519
|
-
`adb kill-server`
|
520
|
-
`adb devices`
|
521
|
-
sleep 5
|
522
|
-
end
|
523
|
-
end
|
524
|
-
|
525
|
-
def install_apk
|
526
|
-
wait_for_valid_device
|
527
|
-
|
528
|
-
failure_pattern = /^Failure \[(.*)\]/
|
529
|
-
success_pattern = /^Success/
|
530
|
-
install_timeout = 300
|
531
|
-
case package_installed?
|
532
|
-
when true
|
533
|
-
puts "Package #{package} already installed."
|
534
|
-
return
|
535
|
-
when false
|
536
|
-
puts "Package #{package} already installed, but of different size or timestamp. Replacing package."
|
537
|
-
sh "adb shell date -s #{Time.now.strftime '%Y%m%d.%H%M%S'}"
|
538
|
-
output = nil
|
539
|
-
install_retry_count = 0
|
540
|
-
begin
|
541
|
-
timeout install_timeout do
|
542
|
-
output = `adb install -r "#{PLATFORM_CURRENT_RELEASE_APK}" 2>&1`
|
543
|
-
end
|
544
|
-
rescue Timeout::Error
|
545
|
-
puts "Installing package #{package} timed out."
|
546
|
-
install_retry_count += 1
|
547
|
-
if install_retry_count <= 3
|
548
|
-
puts 'Retrying install...'
|
549
|
-
retry
|
550
|
-
end
|
551
|
-
puts 'Trying one final time to install the package:'
|
552
|
-
output = `adb install -r "#{PLATFORM_CURRENT_RELEASE_APK}" 2>&1`
|
553
|
-
end
|
554
|
-
if $? == 0 && output !~ failure_pattern && output =~ success_pattern
|
555
|
-
return
|
556
|
-
end
|
557
|
-
case $1
|
558
|
-
when 'INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES'
|
559
|
-
puts 'Found package signed with different certificate. Uninstalling it and retrying install.'
|
560
|
-
else
|
561
|
-
puts "'adb install' returned an unknown error: (#$?) #{$1 ? "[#$1}]" : output}."
|
562
|
-
puts "Uninstalling #{package} and retrying install."
|
563
|
-
end
|
564
|
-
uninstall_apk
|
565
|
-
else
|
566
|
-
# Package not installed.
|
567
|
-
sh "adb shell date -s #{Time.now.strftime '%Y%m%d.%H%M%S'}"
|
568
|
-
end
|
569
|
-
puts "Installing package #{package}"
|
570
|
-
output = nil
|
571
|
-
install_retry_count = 0
|
572
|
-
begin
|
573
|
-
timeout install_timeout do
|
574
|
-
output = `adb install "#{PLATFORM_CURRENT_RELEASE_APK}" 2>&1`
|
575
|
-
end
|
576
|
-
rescue Timeout::Error
|
577
|
-
puts "Installing package #{package} timed out."
|
578
|
-
install_retry_count += 1
|
579
|
-
if install_retry_count <= 3
|
580
|
-
puts 'Retrying install...'
|
581
|
-
retry
|
582
|
-
end
|
583
|
-
puts 'Trying one final time to install the package:'
|
584
|
-
install_start = Time.now
|
585
|
-
output = `adb install "#{PLATFORM_CURRENT_RELEASE_APK}" 2>&1`
|
586
|
-
puts "Install took #{(Time.now - install_start).to_i}s."
|
587
|
-
end
|
588
|
-
puts output
|
589
|
-
raise "Install failed (#{$?}) #{$1 ? "[#$1}]" : output}" if $? != 0 || output =~ failure_pattern || output !~ success_pattern
|
590
|
-
end
|
591
|
-
|
592
|
-
def uninstall_apk
|
593
|
-
return if package_installed?.nil?
|
594
|
-
puts "Uninstalling package #{package}"
|
595
|
-
system "adb uninstall #{package}"
|
596
|
-
if $? != 0 && package_installed?
|
597
|
-
puts "Uninstall failed exit code #{$?}"
|
598
|
-
exit $?
|
599
|
-
end
|
600
|
-
end
|
601
|
-
|
602
|
-
def package_installed?
|
603
|
-
package_name = package
|
604
|
-
%w( -0 -1 -2).each do |i|
|
605
|
-
path = "/data/app/#{package_name}#{i}.apk"
|
606
|
-
o = `adb shell ls -l #{path}`.chomp
|
607
|
-
if o =~ /^-rw-r--r-- system\s+system\s+(\d+) \d{4}-\d{2}-\d{2} \d{2}:\d{2} #{File.basename(path)}$/
|
608
|
-
apk_file = PLATFORM_CURRENT_RELEASE_APK
|
609
|
-
if !File.exists?(apk_file) || $1.to_i == File.size(apk_file)
|
610
|
-
return true
|
611
|
-
else
|
612
|
-
return false
|
613
|
-
end
|
614
|
-
end
|
615
|
-
|
616
|
-
sdcard_path = "/mnt/asec/#{package_name}#{i}/pkg.apk"
|
617
|
-
o = `adb shell ls -l #{sdcard_path}`.chomp
|
618
|
-
if o =~ /^-r-xr-xr-x system\s+root\s+(\d+) \d{4}-\d{2}-\d{2} \d{2}:\d{2} #{File.basename(sdcard_path)}$/
|
619
|
-
apk_file = PLATFORM_CURRENT_RELEASE_APK
|
620
|
-
if !File.exists?(apk_file) || $1.to_i == File.size(apk_file)
|
621
|
-
return true
|
622
|
-
else
|
623
|
-
return false
|
624
|
-
end
|
625
|
-
end
|
626
|
-
end
|
627
|
-
return nil
|
497
|
+
uninstall_apk(PLATFORM_PACKAGE, PLATFORM_CURRENT_RELEASE_APK)
|
628
498
|
end
|
629
499
|
|
630
500
|
end
|
@@ -633,53 +503,88 @@ desc 'Download the latest jruby-jars snapshot'
|
|
633
503
|
task :get_jruby_jars_snapshots do
|
634
504
|
download_host = 'lafo.ssw.uni-linz.ac.at'
|
635
505
|
index = Net::HTTP.get(download_host, "/graalvm/")
|
636
|
-
|
506
|
+
all_gems = index.scan(%r{(jruby-jars-.*?.gem).*?</td>\s*<td.*?</td>\s*<td.*?>\s*(.*?)</td>})
|
507
|
+
current_gems = [all_gems.select{|a| a[1].to_i > 0}.map{|a| a[0]}.
|
508
|
+
uniq.sort_by{|v| Gem::Version.new(v[11..-5])}.last]
|
509
|
+
current_gems << index.scan(/jruby-jars-1\.7\..*?.gem/).uniq.
|
510
|
+
sort_by{|v| Gem::Version.new(v[11..-5])}.last
|
511
|
+
FileUtils.rm_rf Dir['jruby-jars-*.gem']
|
637
512
|
current_gems.each do |gem|
|
638
513
|
print "Downloading #{gem}: \r"
|
639
514
|
uri = URI("http://#{download_host}/graalvm/#{gem}")
|
640
515
|
done = 0
|
641
516
|
body = ''
|
642
517
|
Net::HTTP.new(uri.host, uri.port).request_get(uri.path) do |response|
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
518
|
+
if response.code == '200'
|
519
|
+
length = response['Content-Length'].to_i
|
520
|
+
response.read_body do |fragment|
|
521
|
+
body << fragment
|
522
|
+
done += fragment.length
|
523
|
+
unless length == 0
|
524
|
+
progress = (done * 100) / length
|
525
|
+
print "Downloading #{gem}: #{done / 1024}/#{length / 1024}KB #{progress}%\r"
|
526
|
+
end
|
527
|
+
end
|
528
|
+
puts
|
529
|
+
else
|
530
|
+
raise "Unexpected HTTP response code: #{response.code.inspect}"
|
649
531
|
end
|
650
|
-
puts
|
651
532
|
end
|
652
|
-
File.open(gem, 'wb') { |f| f << body }
|
533
|
+
File.open(gem, 'wb') { |f| f << body } unless body.empty?
|
653
534
|
end
|
654
535
|
end
|
655
536
|
|
656
537
|
task '.travis.yml' do
|
657
538
|
puts "Regenerating #{'.travis.yml'}"
|
658
539
|
source = File.read('.travis.yml')
|
540
|
+
test_parts = 5
|
659
541
|
matrix = ''
|
660
542
|
allow_failures = ''
|
543
|
+
# FIXME(uwe): Test the newest api levels
|
544
|
+
# [21, 19, 18, 17, 16, 15].each.with_index do |api, i|
|
661
545
|
[19, 17, 16, 15].each.with_index do |api, i|
|
662
546
|
n = i
|
663
|
-
|
547
|
+
# FIXME(uwe): JRuby 1.7.13 works for Nettbuss
|
548
|
+
# FIXME(uwe): JRuby 1.7.14 has a malformed gem
|
549
|
+
# FIXME(uwe): JRuby 1.7.15 looks OK!
|
550
|
+
# FIXME(uwe): JRuby 1.7.16: RaiseException: (ENOENT) No such file or directory - /.gem/jruby/1.9
|
551
|
+
# https://github.com/jruby/jruby/issues/2040
|
552
|
+
# FIXME(uwe): JRuby 1.7.17: RSS? => RubotoGenTest#test_activity_tests => Native crash
|
553
|
+
# FIXME(uwe): JRuby 1.7.18: RSS? => RubotoGenTest#test_activity_tests => Process crashed
|
554
|
+
# FIXME(uwe): JRuby 1.7.19: RSS? => RubotoGenTest#test_activity_tests => Native crash
|
555
|
+
# FIXME(uwe): JRuby 1.7.20: Fails on RSS and upper case package names
|
556
|
+
# FIXME(uwe): RubotoCore (CURRENT) is missing thread_safe
|
557
|
+
# FIXME(uwe): Test all of these that work
|
558
|
+
# [['CURRENT', [nil]], ['FROM_GEM', [:MASTER, :STABLE]], ['STANDALONE', [:MASTER, :STABLE, '1.7.19', '1.7.18', '1.7.17', '1.7.16', '1.7.15', '1.7.13']]].each do |platform, versions|
|
559
|
+
[
|
560
|
+
['STANDALONE', [
|
561
|
+
*(['1.7.13']*test_parts),
|
562
|
+
*(['1.7.15']*test_parts),
|
563
|
+
*(['1.7.19']*test_parts),
|
564
|
+
*([:STABLE]*test_parts),
|
565
|
+
]
|
566
|
+
],
|
567
|
+
# ['FROM_GEM', ['1.7.13', :STABLE, ]],
|
568
|
+
# ['CURRENT', [nil]],
|
569
|
+
].each do |platform, versions|
|
664
570
|
versions.each do |v|
|
665
|
-
n = (n %
|
666
|
-
line = " - ANDROID_TARGET=#{api} RUBOTO_PLATFORM=#{platform.ljust(10)} TEST_PART=#{n}
|
571
|
+
n = (n % test_parts) + 1
|
572
|
+
line = " - ANDROID_TARGET=#{api} RUBOTO_PLATFORM=#{platform.ljust(10)} TEST_PART=#{n}of#{test_parts}#{" JRUBY_JARS_VERSION=#{v}" if v}\n"
|
667
573
|
matrix << line
|
668
|
-
if
|
669
|
-
# FIXME(uwe): Remove when
|
670
|
-
|
671
|
-
# FIXME(uwe): Remove when
|
672
|
-
|
673
|
-
|
574
|
+
if v == :MASTER || # FIXME(uwe): Remove when master branch is green.
|
575
|
+
v == :STABLE || # FIXME(uwe): Remove when 1.7.20 supports RSS and upper case package names.
|
576
|
+
api == 21 || # FIXME(uwe): Remove when Android 5 is green.
|
577
|
+
api == 17 || # FIXME(uwe): Remove when Android 4.2 is green.
|
578
|
+
api == 16 || # FIXME(uwe): Remove when Android 4.1 is green.
|
579
|
+
api == 15 # FIXME(uwe): Remove when Android 4.0 is green.
|
674
580
|
allow_failures << line.gsub('-', '- env:')
|
675
581
|
end
|
676
582
|
end
|
677
583
|
end
|
678
584
|
matrix << "\n"
|
679
585
|
end
|
680
|
-
|
681
|
-
|
682
|
-
allow_failures_str = <<EOF
|
586
|
+
matrix_str = " matrix:\n#{matrix}"
|
587
|
+
allow_failures_str = <<EOF # FIXME(uwe)
|
683
588
|
allow_failures:
|
684
589
|
# Current master is failing: https://github.com/jruby/jruby/issues/1741
|
685
590
|
# Current JRuby 1.7.x gem is failing. Why?
|