ruboto 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +28 -0
- data/Gemfile.lock +12 -10
- data/README.md +3 -24
- data/RELEASE_CANDICATE_DOC.md +4 -3
- data/RELEASE_DOC.md +38 -23
- data/Rakefile +18 -18
- data/Vagrantfile +1 -0
- data/assets/rakelib/ruboto.device.rb +25 -18
- data/assets/rakelib/ruboto.rake +18 -8
- data/assets/rakelib/ruboto.stdlib.rake +26 -2
- data/assets/ruboto.yml +32 -2
- data/assets/src/org/jruby/ext/openssl/OpenSSL.java +320 -0
- data/assets/src/ruboto/util/stack.rb +2 -0
- data/lib/ruboto/util/emulator.rb +54 -32
- data/lib/ruboto/util/setup.rb +21 -23
- data/lib/ruboto/util/update.rb +18 -32
- data/lib/ruboto/version.rb +1 -1
- data/test/app_test_methods.rb +23 -15
- data/test/arjdbc_test.rb +1 -1
- data/test/rake_test.rb +22 -12
- data/test/ruboto_setup_test.rb +2 -7
- data/test/test_helper.rb +4 -3
- metadata +23 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cf1877943572ab84d12119768dd14f3f78974f0
|
4
|
+
data.tar.gz: 2ae6f50b354303637f7b7cd5274f74de10648182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34824bba9512f51cd583fd61e51e018b636d24a12ed39923d128b2f45ddb6c86aaa5e3fdd1a3ccb5511a459e6f9bb19973279e8be2233a87a4da67a416c46a9e
|
7
|
+
data.tar.gz: ef88fdcd111e94f71a4c88509b98c7e5bbdb342a736350539b1b5cff4bf3b7f8cf2c30a5d5c0eddd265f9249e1522c9d87aee2e2f22e0aa487d6bde6a5da94c4
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
Contributing
|
2
|
+
============
|
3
|
+
|
4
|
+
Want to contribute? Great! Meet us in #ruboto on irc.freenode.net, fork the
|
5
|
+
project and start coding!
|
6
|
+
|
7
|
+
"But I don't understand it well enough to contribute by forking the project!"
|
8
|
+
That's fine. Equally helpful:
|
9
|
+
|
10
|
+
* Use Ruboto and tell us how it could be better.
|
11
|
+
Report [issues](http://github.com/ruboto/ruboto/issues).
|
12
|
+
* Browse http://ruboto.org/ and the documentation, and let us know how to make
|
13
|
+
it better.
|
14
|
+
* As you gain wisdom, contribute it to
|
15
|
+
[the wiki](http://github.com/ruboto/ruboto/wiki).
|
16
|
+
* When you gain enough wisdom, reconsider whether you could fork the project.
|
17
|
+
|
18
|
+
If contributing code to the project, please run the existing tests and add tests
|
19
|
+
for your changes. You run the tests using rake:
|
20
|
+
|
21
|
+
$ rake test
|
22
|
+
|
23
|
+
We have set up a matrix test that tests multiple configuations on the emulator:
|
24
|
+
|
25
|
+
$ ./matrix_tests.sh
|
26
|
+
|
27
|
+
All branches and pull requests on GitHub are also tested on
|
28
|
+
[https://travis-ci.org/ruboto/ruboto](https://travis-ci.org/ruboto/ruboto).
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruboto (1.
|
4
|
+
ruboto (1.5.0.dev)
|
5
5
|
main (~> 5.2)
|
6
|
-
|
6
|
+
net-telnet (~> 0.1.1)
|
7
|
+
rake (~> 11.3)
|
7
8
|
rubyzip (~> 1.0)
|
8
9
|
|
9
10
|
GEM
|
@@ -11,23 +12,24 @@ GEM
|
|
11
12
|
specs:
|
12
13
|
arrayfields (4.9.2)
|
13
14
|
chronic (0.10.2)
|
14
|
-
coderay (1.1.
|
15
|
-
fattr (2.
|
15
|
+
coderay (1.1.1)
|
16
|
+
fattr (2.3.0)
|
16
17
|
main (5.3.2)
|
17
18
|
arrayfields (>= 4.7.4)
|
18
19
|
chronic (>= 0.6.2)
|
19
20
|
fattr (>= 2.2.0)
|
20
21
|
map (>= 5.1.0)
|
21
22
|
pry (>= 0.9)
|
22
|
-
map (6.
|
23
|
+
map (6.6.0)
|
23
24
|
method_source (0.8.2)
|
24
|
-
minitest (5.8.
|
25
|
-
|
25
|
+
minitest (5.8.4)
|
26
|
+
net-telnet (0.1.1)
|
27
|
+
pry (0.10.4)
|
26
28
|
coderay (~> 1.1.0)
|
27
29
|
method_source (~> 0.8.1)
|
28
30
|
slop (~> 3.4)
|
29
|
-
rake (
|
30
|
-
rubyzip (1.
|
31
|
+
rake (11.3.0)
|
32
|
+
rubyzip (1.2.0)
|
31
33
|
slop (3.6.0)
|
32
34
|
|
33
35
|
PLATFORMS
|
@@ -38,4 +40,4 @@ DEPENDENCIES
|
|
38
40
|
ruboto!
|
39
41
|
|
40
42
|
BUNDLED WITH
|
41
|
-
1.
|
43
|
+
1.13.6
|
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
[](https://travis-ci.org/ruboto/ruboto)
|
3
3
|
[](https://codeclimate.com/github/ruboto/ruboto)
|
4
4
|
|
5
|
+
<a href="https://gratipay.com/ruboto/" class="rich-diff-level-one"><img src="https://camo.githubusercontent.com/dcd1e367172f3fa649a334e1ee6fb334f16ed8d8/68747470733a2f2f63646e2e7261776769742e636f6d2f67726174697061792f67726174697061792d62616467652f322e782e782f646973742f67726174697061792e706e67" alt="Support via Gratipay" data-canonical-src="https://cdn.rawgit.com/gratipay/gratipay-badge/2.x.x/dist/gratipay.png" align="right" style="max-width:100%;"></a>
|
6
|
+
|
5
7
|
Ruboto (JRuby on Android) is a platform for developing full stand-alone apps for
|
6
8
|
Android using the Ruby language and libraries. It includes support libraries
|
7
9
|
and generators for creating projects, classes, tests, and more. The complete
|
@@ -288,30 +290,7 @@ You can run the tests for your app using ant or rake:
|
|
288
290
|
Contributing
|
289
291
|
------------
|
290
292
|
|
291
|
-
|
292
|
-
project and start coding!
|
293
|
-
|
294
|
-
"But I don't understand it well enough to contribute by forking the project!"
|
295
|
-
That's fine. Equally helpful:
|
296
|
-
|
297
|
-
* Use Ruboto and tell us how it could be better.
|
298
|
-
* Browse http://ruboto.org/ and the documentation, and let us know how to make
|
299
|
-
it better.
|
300
|
-
* As you gain wisdom, contribute it to
|
301
|
-
[the wiki](http://github.com/ruboto/ruboto/wiki/)
|
302
|
-
* When you gain enough wisdom, reconsider whether you could fork the project.
|
303
|
-
|
304
|
-
If contributing code to the project, please run the existing tests and add tests
|
305
|
-
for your changes. You run the tests using rake:
|
306
|
-
|
307
|
-
$ rake test
|
308
|
-
|
309
|
-
We have set up a matrix test that tests multiple configuations on the emulator:
|
310
|
-
|
311
|
-
$ ./matrix_tests.sh
|
312
|
-
|
313
|
-
All branches and pull requests on GitHub are also tested on
|
314
|
-
[https://travis-ci.org/ruboto/ruboto](https://travis-ci.org/ruboto/ruboto).
|
293
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
315
294
|
|
316
295
|
Getting Help
|
317
296
|
------------
|
data/RELEASE_CANDICATE_DOC.md
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
Subject: [ANN] Ruboto 1.
|
1
|
+
Subject: [ANN] Ruboto 1.5.0 release candidate
|
2
2
|
|
3
3
|
Hi all!
|
4
4
|
|
5
|
-
The Ruboto 1.
|
5
|
+
The Ruboto 1.5.0 release candidate is now available.
|
6
6
|
|
7
|
-
|
7
|
+
We now have properly working Ruby SSL and HTTPS! You need jruby-jars
|
8
|
+
1.7.25 and Android 4.4 or better :)
|
8
9
|
|
9
10
|
As always we need your help and feedback to ensure the quality of the release. Please install the release candidate using
|
10
11
|
|
data/RELEASE_DOC.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
Subject: [ANN] Ruboto 1.
|
1
|
+
Subject: [ANN] Ruboto 1.5.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.5.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,44 +8,59 @@ 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.5.0:
|
12
12
|
|
13
|
-
|
13
|
+
We now have properly working Ruby SSL and HTTPS! You need jruby-jars
|
14
|
+
1.7.25 and Android 4.4 or better :)
|
15
|
+
|
16
|
+
API Changes:
|
17
|
+
|
18
|
+
* Issue #713 Add support for Android 5.1 Lollipop
|
19
|
+
* Issue #768 Add support for Android 6.0 Marshmallow
|
14
20
|
|
15
21
|
Features:
|
16
22
|
|
17
|
-
* Issue #
|
18
|
-
* Issue #
|
19
|
-
* Issue #
|
20
|
-
* Issue #
|
23
|
+
* Issue #791 Update RubotoCore to ActiveRecord 4.2
|
24
|
+
* Issue #792 Set emulator name in ruboto.yml
|
25
|
+
* Issue #795 Set emulator device name in ruboto.yml
|
26
|
+
* Issue #797 Set emulator skin name in ruboto.yml
|
27
|
+
* Issue #798 ruboto.yml emulator config (donv)
|
28
|
+
* Issue #805 Add support for the new emulator 2.0
|
21
29
|
|
22
30
|
Bugfixes:
|
23
31
|
|
24
|
-
* Issue #
|
25
|
-
|
26
|
-
* Issue #
|
27
|
-
|
28
|
-
|
29
|
-
* Issue #
|
30
|
-
|
31
|
-
|
32
|
+
* Issue #726 Any reference to net/https throws LoadError for
|
33
|
+
org/bouncycastle/bcpkix-jdk15on/1.47/bcpkix-jdk15on-1.47
|
34
|
+
* Issue #793 Fix OpenSSL
|
35
|
+
* Issue #796 Adds a setting in "ruboto.yml" for the desired
|
36
|
+
dex_heap_size (lucasallan)
|
37
|
+
* Issue #807 Fix SDK_DOWNLOAD_PAGE link (LucianoPC)
|
38
|
+
|
39
|
+
Support:
|
32
40
|
|
33
|
-
|
41
|
+
* Issue #802 java.lang.UnsupportedOperationException: can't load this
|
42
|
+
type of class file
|
43
|
+
* Issue #803 (NoMethodError) undefined method 'current' for
|
44
|
+
Java::JavaLang::Thread:Class
|
34
45
|
|
35
|
-
|
46
|
+
Community:
|
36
47
|
|
37
|
-
|
48
|
+
* Issue #666 Set up donations and sponsoring of the Ruboto project
|
49
|
+
|
50
|
+
Pull requests:
|
38
51
|
|
39
|
-
* Issue #
|
40
|
-
* Issue #
|
52
|
+
* Issue #794 Test ssl (donv)
|
53
|
+
* Issue #812 Set ANDROID_EMULATOR_FORCE_32BIT to fix broken build
|
54
|
+
(celeduc)
|
41
55
|
|
42
56
|
Internal:
|
43
57
|
|
44
|
-
* Issue #
|
58
|
+
* Issue #775 Release 1.5.0
|
59
|
+
* Issue #808 Bug fixes (donv)
|
45
60
|
|
46
61
|
You can find a complete list of issues here:
|
47
62
|
|
48
|
-
* https://github.com/ruboto/ruboto/issues?state=closed&milestone=
|
63
|
+
* https://github.com/ruboto/ruboto/issues?state=closed&milestone=41
|
49
64
|
|
50
65
|
|
51
66
|
Installation:
|
data/Rakefile
CHANGED
@@ -364,10 +364,10 @@ task :release => [:clean, README_FILE, :release_docs, :gem] do
|
|
364
364
|
output = `git status --porcelain`
|
365
365
|
raise "Workspace not clean!\n#{output}" unless output.empty?
|
366
366
|
Dir.chdir WEB_DIR do
|
367
|
+
sh "git add -f #{RELEASE_BLOG}"
|
368
|
+
`git commit -m "* Added release blog for Ruboto #{Ruboto::VERSION}" -- #{RELEASE_BLOG}`
|
367
369
|
output = `git status --porcelain`
|
368
370
|
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
371
|
sh 'git push'
|
372
372
|
end
|
373
373
|
sh "git tag #{Ruboto::VERSION}"
|
@@ -512,11 +512,12 @@ task :get_jruby_jars_snapshots do
|
|
512
512
|
[[master_gem, 'master'], [stable_gem, 'jruby-1_7']].each do |gem, branch|
|
513
513
|
print "Downloading #{gem}: \r"
|
514
514
|
uri = URI("http://#{download_host}#{download_dir}/snapshots/#{branch}/#{gem}")
|
515
|
-
done = 0
|
516
|
-
body = ''
|
517
515
|
Net::HTTP.new(uri.host, uri.port).request_get(uri.path) do |response|
|
518
516
|
if response.code == '200'
|
519
517
|
length = response['Content-Length'].to_i
|
518
|
+
timestamp = response['Last-Modified'] # Sat, 23 Jan 2016 05:52:03 GMT'
|
519
|
+
body = ''
|
520
|
+
done = 0
|
520
521
|
response.read_body do |fragment|
|
521
522
|
body << fragment
|
522
523
|
done += fragment.length
|
@@ -525,50 +526,49 @@ task :get_jruby_jars_snapshots do
|
|
525
526
|
print "Downloading #{gem}: #{done / 1024}/#{length / 1024}KB #{progress}%\r"
|
526
527
|
end
|
527
528
|
end
|
529
|
+
unless body.empty?
|
530
|
+
File.write(gem, body)
|
531
|
+
FileUtils.touch gem, mtime: Time.parse(timestamp)
|
532
|
+
end
|
528
533
|
puts
|
529
534
|
else
|
530
535
|
raise "Unexpected HTTP response code: #{response.code.inspect}"
|
531
536
|
end
|
532
537
|
end
|
533
|
-
File.open(gem, 'wb') { |f| f << body } unless body.empty?
|
534
538
|
end
|
535
539
|
end
|
536
540
|
|
537
541
|
task '.travis.yml' do
|
538
542
|
puts "Regenerating #{'.travis.yml'}"
|
539
543
|
source = File.read('.travis.yml')
|
540
|
-
test_parts =
|
544
|
+
test_parts = 3
|
541
545
|
matrix = ''
|
542
546
|
allow_failures = ''
|
543
547
|
|
544
548
|
# FIXME(uwe): JRuby 1.7.13 works for Nettbuss. Keep for 2016.
|
545
549
|
# FIXME(uwe): Test all of these that work
|
546
550
|
[
|
547
|
-
['CURRENT', [nil]],
|
548
|
-
['FROM_GEM', [:MASTER, :STABLE]],
|
549
|
-
['STANDALONE', [:MASTER, :STABLE, '1.7.
|
551
|
+
# ['CURRENT', [nil]], # Running standalone is the most important way now
|
552
|
+
# ['FROM_GEM', [:MASTER, :STABLE]], # Running standalone is the most important way now
|
553
|
+
['STANDALONE', [:MASTER, :STABLE, '1.7.25', '1.7.13']],
|
550
554
|
].each do |platform, versions|
|
551
555
|
versions.each do |v|
|
552
556
|
# FIXME(uwe): Test the newest and most common api levels
|
553
|
-
# FIXME(uwe): Nettbuss uses api level 15. Keep for
|
557
|
+
# FIXME(uwe): Nettbuss uses api level 15. Keep for 2017.
|
554
558
|
# FIXME(uwe): https://github.com/ruboto/ruboto/issues/426
|
555
|
-
[23, 22, 21, 19, 17,
|
559
|
+
[23, 22, 21, 19, 17, 15].each do |api|
|
556
560
|
(1..test_parts).each do |n|
|
557
561
|
line = " - ANDROID_TARGET=#{api} RUBOTO_PLATFORM=#{platform.ljust(10)} TEST_PART=#{n}of#{test_parts}#{" JRUBY_JARS_VERSION=#{v}" if v}\n"
|
558
562
|
|
559
|
-
next if v == :MASTER # FIXME(uwe): Remove when master branch is green.
|
560
563
|
next if api == 23 # FIXME(uwe): Remove when Android 6.0 is green. Unable to start emulator on travis.
|
561
564
|
next if api == 22 # FIXME(uwe): Remove when Android 5.1 is green. Must use slow ARM emulator due to missing HAXM.
|
562
565
|
next if api == 22 && platform == 'STANDALONE' && v == :STABLE # FIXME(uwe): Remove when Android 5.1 is green. Must use slow ARM emulator due to missing HAXM.
|
563
566
|
next if api == 21 # FIXME(uwe): Remove when Android 5.0 is green.
|
564
567
|
next if api == 17 # FIXME(uwe): Remove when Android 4.2 is green.
|
565
|
-
next if api == 16 # FIXME(uwe): Remove when Android 4.1 is green.
|
566
568
|
|
567
|
-
if
|
568
|
-
|
569
|
-
|
570
|
-
false
|
571
|
-
allow_failures << line.gsub('-', '- env:')
|
569
|
+
if v == :MASTER || v == :STABLE
|
570
|
+
# allow_failures << line.gsub('-', '- env:')
|
571
|
+
next
|
572
572
|
end
|
573
573
|
matrix << line
|
574
574
|
end
|
data/Vagrantfile
CHANGED
@@ -35,6 +35,7 @@ Vagrant.configure(2) do |config|
|
|
35
35
|
su - vagrant -c 'curl -sSL https://get.rvm.io | bash -s stable --ruby'
|
36
36
|
su - vagrant -c 'mkdir -p ruboto'
|
37
37
|
su - vagrant -c 'rsync -acPuv --exclude adb_logcat.log --exclude /tmp /vagrant/* ruboto/'
|
38
|
+
sudo apt-get -y autoremove
|
38
39
|
SHELL
|
39
40
|
end
|
40
41
|
|
@@ -29,8 +29,19 @@ def package_installed?(package_name, apk_file)
|
|
29
29
|
installed_timestamp >= File.mtime(apk_file))
|
30
30
|
end
|
31
31
|
|
32
|
+
# the scripts path is different on different Android versions and devices...
|
32
33
|
def scripts_path(package)
|
33
|
-
|
34
|
+
external_storage = `adb shell 'echo $EXTERNAL_STORAGE'`.chomp
|
35
|
+
app_data_path = "#{external_storage}/Android/data/#{package}"
|
36
|
+
if external_storage.empty?
|
37
|
+
puts "external storage not found: #{app_data_path.inspect}"
|
38
|
+
app_data_path = `adb shell run-as #{package} pwd`
|
39
|
+
if app_data_path =~ /Permission denied/
|
40
|
+
puts "internal storage not found: #{app_data_path.inspect}"
|
41
|
+
app_data_path = "/mnt/sdcard/Android/data/#{package}"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
"#{app_data_path}/files/scripts"
|
34
45
|
end
|
35
46
|
|
36
47
|
def mark_update(time = Time.now)
|
@@ -75,7 +86,7 @@ def install_apk(package, apk_file)
|
|
75
86
|
output = nil
|
76
87
|
install_retry_count = 0
|
77
88
|
begin
|
78
|
-
timeout install_timeout do
|
89
|
+
Timeout.timeout install_timeout do
|
79
90
|
output = `adb install -r "#{apk_file}" 2>&1`
|
80
91
|
end
|
81
92
|
rescue Timeout::Error
|
@@ -108,7 +119,7 @@ def install_apk(package, apk_file)
|
|
108
119
|
output = nil
|
109
120
|
install_retry_count = 0
|
110
121
|
begin
|
111
|
-
timeout install_timeout do
|
122
|
+
Timeout.timeout install_timeout do
|
112
123
|
output = `adb install "#{apk_file}" 2>&1`
|
113
124
|
end
|
114
125
|
rescue Timeout::Error
|
@@ -138,22 +149,18 @@ def uninstall_apk(package_name, apk_file)
|
|
138
149
|
end
|
139
150
|
end
|
140
151
|
|
152
|
+
def make_device_path(package, path)
|
153
|
+
puts `adb shell #{"run-as #{package}" if sdk_level >= 23} mkdir -p #{path}`
|
154
|
+
device_path_exists?(path)
|
155
|
+
end
|
156
|
+
|
141
157
|
def update_scripts(package)
|
142
|
-
|
143
|
-
if
|
144
|
-
|
145
|
-
parts.size.times do |i|
|
146
|
-
path = parts[0..i].join('/')
|
147
|
-
puts(`adb shell mkdir #{path}`) unless device_path_exists?(path)
|
148
|
-
end
|
149
|
-
end
|
150
|
-
else
|
151
|
-
puts(`adb shell mkdir -p #{scripts_path(package)}`) unless device_path_exists?(scripts_path(package))
|
158
|
+
scripts_path = scripts_path(package)
|
159
|
+
if !device_path_exists?(scripts_path) && !make_device_path(package, scripts_path)
|
160
|
+
raise "Unable to create device scripts dir: #{scripts_path}"
|
152
161
|
end
|
153
|
-
|
154
|
-
|
155
|
-
raise "Unable to create device scripts dir: #{scripts_path(package)}" unless device_path_exists?(scripts_path(package))
|
156
|
-
last_update = File.exists?(UPDATE_MARKER_FILE) ? Time.parse(File.read(UPDATE_MARKER_FILE)) : Time.parse('1970-01-01T00:00:00')
|
162
|
+
mark_time = File.exists?(UPDATE_MARKER_FILE) ? File.read(UPDATE_MARKER_FILE) : '1970-01-01T00:00:00'
|
163
|
+
last_update = Time.parse(mark_time)
|
157
164
|
Dir.chdir('src') do
|
158
165
|
source_files = Dir['**/*.rb']
|
159
166
|
changed_files = source_files.select { |f| !File.directory?(f) && File.mtime(f) >= last_update && f !~ /~$/ }
|
@@ -161,7 +168,7 @@ def update_scripts(package)
|
|
161
168
|
puts 'Pushing files to apk public file area:'
|
162
169
|
changed_files.each do |script_file|
|
163
170
|
print "#{script_file}: "; $stdout.flush
|
164
|
-
system "adb push #{script_file} #{scripts_path
|
171
|
+
system "adb push #{script_file} #{scripts_path}/#{script_file}"
|
165
172
|
end
|
166
173
|
mark_update
|
167
174
|
return changed_files
|
data/assets/rakelib/ruboto.rake
CHANGED
@@ -555,18 +555,14 @@ file APK_FILE => APK_DEPENDENCIES do |t|
|
|
555
555
|
build_apk(t, false)
|
556
556
|
end
|
557
557
|
|
558
|
-
# FIXME(uwe): Simplify when we stop supporting 32-bit development environments
|
559
|
-
DEFAULT_MIN_DX_HEAP_SIZE = RbConfig::CONFIG['host_cpu'] =~ /86/ ? 3072 : 4096
|
560
|
-
# EMXIF
|
561
|
-
MINIMUM_DX_HEAP_SIZE = (ENV['DX_HEAP_SIZE'] && ENV['DX_HEAP_SIZE'].to_i) || DEFAULT_MIN_DX_HEAP_SIZE
|
562
558
|
task :patch_dex do
|
563
559
|
DX_FILENAMES.each do |dx_filename|
|
564
560
|
new_dx_content = File.read(dx_filename).dup
|
565
561
|
xmx_pattern = ON_WINDOWS ? /^set defaultXmx=-Xmx(\d+)(M|m|G|g|T|t)/ : /^defaultMx="-Xmx(\d+)(M|m|G|g|T|t)"/
|
566
562
|
if new_dx_content =~ xmx_pattern &&
|
567
|
-
($1.to_i * 1024 ** {M: 2, G: 3, T: 4}[$2.upcase.to_sym]) <
|
568
|
-
puts "Increasing max heap space from #{$1}#{$2} to #{
|
569
|
-
new_xmx_value = ON_WINDOWS ? %Q{set defaultXmx=-Xmx#{
|
563
|
+
($1.to_i * 1024 ** {M: 2, G: 3, T: 4}[$2.upcase.to_sym]) < dex_heap_size*1024**2
|
564
|
+
puts "Increasing max heap space from #{$1}#{$2} to #{dex_heap_size}M in #{dx_filename}"
|
565
|
+
new_xmx_value = ON_WINDOWS ? %Q{set defaultXmx=-Xmx#{dex_heap_size}M} : %Q{defaultMx="-Xmx#{dex_heap_size}M"}
|
570
566
|
new_dx_content.sub!(xmx_pattern, new_xmx_value)
|
571
567
|
File.open(dx_filename, 'w') { |f| f << new_dx_content } rescue puts "\n!!! Unable to increase dx heap size !!!\n\n"
|
572
568
|
end
|
@@ -683,6 +679,7 @@ file BUNDLE_JAR => [GEM_FILE, GEM_LOCK_FILE] do
|
|
683
679
|
old_verbose, $VERBOSE = $VERBOSE, nil
|
684
680
|
begin
|
685
681
|
Object.const_set('RUBY_ENGINE', 'jruby')
|
682
|
+
Object.const_set('JRUBY_VERSION', '7.7.7') unless defined?(JRUBY_VERSION)
|
686
683
|
ensure
|
687
684
|
$VERBOSE = old_verbose
|
688
685
|
end
|
@@ -988,7 +985,7 @@ end
|
|
988
985
|
# Triggers reload of updated scripts and restart of the current activity
|
989
986
|
def reload_scripts(scripts)
|
990
987
|
s = scripts.map { |s| s.gsub(/[&;]/) { |m| "&#{m[0]}" } }.join(';')
|
991
|
-
cmd = %Q{adb shell am broadcast -a android.intent.action.VIEW -e reload '#{s}'}
|
988
|
+
cmd = %Q{adb shell "am broadcast -a android.intent.action.VIEW -e reload '#{s}'"}
|
992
989
|
puts cmd
|
993
990
|
system cmd
|
994
991
|
end
|
@@ -997,3 +994,16 @@ def stop_app
|
|
997
994
|
output = `adb shell ps | grep #{package} | awk '{print $2}' | xargs adb shell kill`
|
998
995
|
output !~ /Operation not permitted/
|
999
996
|
end
|
997
|
+
|
998
|
+
def dex_heap_size
|
999
|
+
# FIXME(uwe): Simplify when we stop supporting 32-bit development environments
|
1000
|
+
default = RbConfig::CONFIG['host_cpu'] =~ /86/ ? 3072 : 4096
|
1001
|
+
heap_size = ruboto_config_file[:dex_heap_size]
|
1002
|
+
# EMXIF
|
1003
|
+
@heap_size ||= (ENV['DX_HEAP_SIZE'] && ENV['DX_HEAP_SIZE'].to_i) || (heap_size && heap_size.to_i) || default
|
1004
|
+
end
|
1005
|
+
|
1006
|
+
def ruboto_config_file
|
1007
|
+
return {} unless File.exist? RUBOTO_CONFIG_FILE
|
1008
|
+
@ruboto_config_file ||= (YAML.load(File.read(RUBOTO_CONFIG_FILE)) || {})
|
1009
|
+
end
|