ruboto 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -6
  3. data/RELEASE_CANDICATE_DOC.md +5 -3
  4. data/RELEASE_DOC.md +32 -11
  5. data/Rakefile +86 -36
  6. data/assets/rakelib/ruboto.rake +33 -14
  7. data/assets/rakelib/ruboto.stdlib.rake +1 -1
  8. data/assets/res/layout/get_ruboto_core.xml +1 -2
  9. data/assets/src/RubotoService.java +19 -2
  10. data/assets/src/org/ruboto/JRubyAdapter.java +4 -0
  11. data/assets/src/org/ruboto/SplashActivity.java +17 -17
  12. data/assets/src/ruboto/base.rb +13 -4
  13. data/assets/src/ruboto/package.rb +12 -3
  14. data/assets/src/ruboto/service.rb +45 -8
  15. data/assets/src/ruboto/widget.rb +82 -39
  16. data/assets/test/src/test_helper.rb +4 -0
  17. data/lib/ruboto/commands/base.rb +29 -17
  18. data/lib/ruboto/sdk_versions.rb +1 -1
  19. data/lib/ruboto/util/emulator.rb +49 -33
  20. data/lib/ruboto/util/setup.rb +5 -1
  21. data/lib/ruboto/util/update.rb +68 -22
  22. data/lib/ruboto/util/xml_element.rb +5 -3
  23. data/lib/ruboto/version.rb +1 -1
  24. data/test/activity/call_super_activity.rb +2 -2
  25. data/test/activity/constants_activity.rb +51 -0
  26. data/test/activity/constants_activity_test.rb +18 -0
  27. data/test/activity/margins_activity.rb +12 -7
  28. data/test/activity/margins_activity_test.rb +10 -6
  29. data/test/activity/padding_activity.rb +15 -0
  30. data/test/activity/padding_activity_test.rb +41 -0
  31. data/test/activity/rss_activity.rb +42 -0
  32. data/test/activity/rss_activity_test.rb +35 -0
  33. data/test/activity/spinner_activity.rb +5 -5
  34. data/test/activity/spinner_activity_test.rb +6 -6
  35. data/test/activity/stack_activity.rb +7 -8
  36. data/test/activity/stack_activity_test.rb +7 -5
  37. data/test/activity/subclass_activity.rb +5 -5
  38. data/test/activity/subclass_activity_test.rb +8 -6
  39. data/test/app_test_methods.rb +8 -0
  40. data/test/arjdbc_test.rb +1 -1
  41. data/test/minimal_app_test.rb +12 -10
  42. data/test/rake_test.rb +2 -4
  43. data/test/ruboto_gen_test.rb +11 -9
  44. data/test/service_block_test.rb +112 -0
  45. data/test/{service_test.rb → service_gen_class_test.rb} +9 -4
  46. data/test/service_infile_class_test.rb +114 -0
  47. data/test/sqldroid_test.rb +1 -1
  48. data/test/test_helper.rb +39 -21
  49. metadata +11 -7
@@ -4,6 +4,10 @@ def assert(value, message = nil)
4
4
  raise "#{"#{message}\n" if message}#{value.inspect} expected to be true" unless value
5
5
  end
6
6
 
7
+ def fail(message = nil)
8
+ assert false, message || 'Failure'
9
+ end
10
+
7
11
  def assert_equal(expected, actual, message = nil)
8
12
  raise "#{"#{message}\n" if message}'#{expected}' expected, but got '#{actual}'" unless expected == actual
9
13
  end
@@ -19,6 +19,11 @@ module Ruboto
19
19
  include Ruboto::SdkVersions
20
20
  include Ruboto::Util::Verify
21
21
 
22
+ # FIXME(uwe): Remove "L" special case
23
+ API_LEVEL_PATTERN = /^android-(\d+|L)$/
24
+ API_NUMBER_PATTERN = /(\d+|L)/
25
+ # EMXIF
26
+
22
27
  def self.main
23
28
  Main do
24
29
  mode 'gen' do
@@ -51,14 +56,14 @@ module Ruboto
51
56
  argument :required
52
57
  defaults DEFAULT_TARGET_SDK
53
58
  description "Android version to target (e.g., 'android-19' or '19' for kitkat)"
54
- cast { |t| t =~ /^(\d+)$/ ? "android-#$1" : t }
55
- validate { |t| t =~ /^android-\d+$/ }
59
+ cast { |t| t =~ API_NUMBER_PATTERN ? "android-#$1" : t }
60
+ validate { |t| t =~ API_LEVEL_PATTERN }
56
61
  }
57
62
  option('min-sdk') {
58
63
  argument :required
59
64
  description "Minimum android version supported. (e.g., 'android-19' or '19' for kitkat)"
60
- cast { |t| t =~ /^(\d+)$/ ? "android-#$1" : t }
61
- validate { |t| t =~ /^android-\d+$/ }
65
+ cast { |t| t =~ API_NUMBER_PATTERN ? "android-#$1" : t }
66
+ validate { |t| t =~ API_LEVEL_PATTERN }
62
67
  }
63
68
  option('with-jruby') {
64
69
  description 'Install the JRuby jars in your libs directory. Optionally set the JRuby version to install. Otherwise the latest available version is installed.'
@@ -90,8 +95,11 @@ module Ruboto
90
95
  force = params['force'].value
91
96
 
92
97
  abort "Path (#{path}) must be to a directory that does not yet exist. It will be created." if !force && File.exists?(path)
93
- abort "Target must match android-<number>: got #{target}" unless target =~ /^android-(\d+)$/
94
- abort "Minimum Android api level is #{MINIMUM_SUPPORTED_SDK}: got #{target}" unless $1.to_i >= MINIMUM_SUPPORTED_SDK_LEVEL
98
+ abort "Target must match android-<number>: got #{target}" unless target =~ API_LEVEL_PATTERN
99
+
100
+ # FIXME(uwe): Remove the 'L' special case when Android L has been released
101
+ abort "Minimum Android api level is #{MINIMUM_SUPPORTED_SDK}: got #{target}" unless $1 == 'L' || $1.to_i >= MINIMUM_SUPPORTED_SDK_LEVEL
102
+ # EMXIF
95
103
 
96
104
  root = File.expand_path(path)
97
105
  puts "\nGenerating Android app #{name} in #{root}..."
@@ -112,8 +120,8 @@ module Ruboto
112
120
  puts 'Done'
113
121
 
114
122
  Dir.chdir root do
115
- update_manifest min_sdk[/\d+/], target[/\d+/], true
116
- update_test true, target[/\d+/].to_i
123
+ update_manifest min_sdk[API_NUMBER_PATTERN], target[API_NUMBER_PATTERN], true
124
+ update_test true, target[API_NUMBER_PATTERN]
117
125
  update_assets
118
126
 
119
127
  if ruby_version
@@ -352,8 +360,8 @@ module Ruboto
352
360
  option('target', 't') {
353
361
  argument :required
354
362
  description "Android version to target (e.g., 'android-19' or '19' for kitkat)"
355
- cast { |t| t =~ /^(\d+)$/ ? "android-#$1" : t }
356
- validate { |t| t =~ /^android-\d+$/ }
363
+ cast { |t| t =~ API_NUMBER_PATTERN ? "android-#$1" : t }
364
+ validate { |t| t =~ API_LEVEL_PATTERN }
357
365
  }
358
366
  option('with-jruby') {
359
367
  description 'Install the JRuby jars in your libs directory. Optionally set the JRuby version to install. Otherwise the latest available version is installed. If the JRuby jars are already present in your project, this option is implied.'
@@ -379,9 +387,13 @@ module Ruboto
379
387
  end
380
388
 
381
389
  if (target = params['target'].value)
382
- abort "Target must match android-<number>: got #{target}" unless target =~ /^android-(\d+)$/
383
- abort "Minimum Android api level is #{MINIMUM_SUPPORTED_SDK}: got #{target}" unless $1.to_i >= MINIMUM_SUPPORTED_SDK_LEVEL
384
- target_level = target[/\d+/].to_i
390
+ abort "Target must match android-<number>: got #{target}" unless target =~ API_LEVEL_PATTERN
391
+
392
+ # FIXME(uwe): Remove the 'L' special case when Android L has been released.
393
+ abort "Minimum Android api level is #{MINIMUM_SUPPORTED_SDK}: got #{target}" unless $1 == 'L' || $1.to_i >= MINIMUM_SUPPORTED_SDK_LEVEL
394
+ # EMXIF
395
+
396
+ target_level = target[API_NUMBER_PATTERN]
385
397
  update_android(target_level)
386
398
  update_test force, target_level
387
399
  else
@@ -429,8 +441,8 @@ module Ruboto
429
441
  argument :required
430
442
  default DEFAULT_TARGET_SDK
431
443
  arity -1
432
- cast { |t| t =~ /^(\d+)$/ ? "android-#$1" : t }
433
- validate { |t| t =~ /^android-\d+$/ }
444
+ cast { |t| t =~ API_NUMBER_PATTERN ? "android-#$1" : t }
445
+ validate { |t| t =~ API_LEVEL_PATTERN }
434
446
  }
435
447
 
436
448
  option('yes', 'y') {
@@ -455,8 +467,8 @@ module Ruboto
455
467
  required unless api_level
456
468
  argument :required
457
469
  default(api_level) if api_level
458
- cast { |t| t =~ /^(\d+)$/ ? "android-#$1" : t }
459
- validate { |t| t =~ /^android-(\d+)$/ && sdk_level_name($1.to_i) }
470
+ cast { |t| t =~ API_NUMBER_PATTERN ? "android-#$1" : t }
471
+ validate { |t| t =~ API_LEVEL_PATTERN && sdk_level_name($1.to_i) }
460
472
  }
461
473
 
462
474
  option('no-snapshot', 's') {
@@ -3,7 +3,7 @@ require 'pathname'
3
3
  module Ruboto
4
4
  module SdkVersions
5
5
  VERSION_TO_API_LEVEL = {
6
- '2.3' => 9, '2.3.1' => 9, '2.3.2' => 9, '2.3.3' => 10, '2.3.4' => 10,
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
9
  '4.2.2' => 17, '4.3' => 18, '4.4.2' => 19,
@@ -1,22 +1,26 @@
1
1
  require 'net/telnet'
2
2
  require 'ruboto/sdk_versions'
3
+ require 'ruboto/sdk_locations'
3
4
 
4
5
  module Ruboto
5
6
  module Util
6
7
  module Emulator
7
8
  ON_WINDOWS = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw/i)
8
- ON_MAC_OS_X = RbConfig::CONFIG['host_os'] =~ /^darwin(.*)/
9
+ ON_MAC_OS_X = RbConfig::CONFIG['host_os'] =~ /^darwin/
10
+ ON_LINUX = RbConfig::CONFIG['host_os'] =~ /linux/
9
11
 
10
12
  def sdk_level_name(sdk_level)
11
- Ruboto::SdkVersions::API_LEVEL_TO_VERSION[sdk_level] || "api_#{sdk_level}"
13
+ Ruboto::SdkVersions::API_LEVEL_TO_VERSION[sdk_level.to_i] || sdk_level
12
14
  end
13
15
 
14
16
  def start_emulator(sdk_level, no_snapshot)
15
- sdk_level = sdk_level.gsub(/^android-/, '').to_i
17
+ sdk_level = sdk_level.gsub(/^android-/, '')
16
18
  STDOUT.sync = true
17
19
  if RbConfig::CONFIG['host_cpu'] == 'x86_64'
18
20
  if ON_MAC_OS_X
19
21
  emulator_cmd = '-m "emulator64-(arm|x86)"'
22
+ elsif ON_LINUX
23
+ emulator_cmd = '-r "emulator64-(arm|x86)"'
20
24
  else
21
25
  emulator_cmd = 'emulator64-arm'
22
26
  end
@@ -81,6 +85,9 @@ module Ruboto
81
85
  end
82
86
 
83
87
  avd_home = "#{ENV['HOME'].gsub('\\', '/')}/.android/avd/#{avd_name}.avd"
88
+ manifest_file = 'AndroidManifest.xml'
89
+ large_heap = (!File.exists?(manifest_file)) || (File.read(manifest_file) =~ /largeHeap/)
90
+ heap_size = large_heap ? 256 : 48
84
91
 
85
92
  unless File.exists? avd_home
86
93
  puts "Creating AVD #{avd_name}"
@@ -94,10 +101,8 @@ module Ruboto
94
101
  exit 3
95
102
  end
96
103
 
97
- if ON_MAC_OS_X || ON_WINDOWS
98
- abis = target.slice(/(?<=ABIs : ).*/).split(', ')
99
- has_haxm = abis.find { |a| a =~ /x86/ }
100
- end
104
+ abis = target.slice(/(?<=ABIs : ).*/).split(', ')
105
+ has_x86 = abis.find { |a| a =~ /x86/ }
101
106
 
102
107
  # FIXME(uwe): The x86 emulator does not respect the heap setting and
103
108
  # restricts to a 16MB heap on Android 2.3 which will crash any
@@ -105,42 +110,48 @@ module Ruboto
105
110
  # on x86 emulator.
106
111
  # https://code.google.com/p/android/issues/detail?id=37597
107
112
  # https://code.google.com/p/android/issues/detail?id=61596
108
- if sdk_level == 10
113
+ if sdk_level.to_i == 10
109
114
  abi_opt = '--abi armeabi'
115
+ elsif has_x86 && (ON_MAC_OS_X || ON_WINDOWS)
116
+ abi_opt = '--abi x86'
110
117
  else
111
- if has_haxm
112
- abi_opt = '--abi x86'
113
- else
114
- if [17, 16, 15, 13, 11].include? sdk_level
115
- abi_opt = '--abi armeabi-v7a'
116
- elsif sdk_level == 10
117
- abi_opt = '--abi armeabi'
118
- end
119
- end
118
+ abi_opt = '--abi armeabi-v7a'
120
119
  end
121
120
  # EMXIF
122
121
 
123
- puts `echo n | android create avd -a -n #{avd_name} -t android-#{sdk_level} #{abi_opt} -c 64M -s HVGA`
122
+ skin_filename = "#{Ruboto::SdkLocations::ANDROID_HOME}/platforms/android-L/skins/HVGA/hardware.ini"
123
+ if File.exists?(skin_filename)
124
+ old_skin_config = File.read(skin_filename)
125
+ new_skin_config = old_skin_config.gsub(/vm.heapSize=([0-9]*)/) { |m| $1.to_i < heap_size ? "vm.heapSize=#{heap_size}" : m }
126
+ File.write(skin_filename, new_skin_config) if new_skin_config != old_skin_config
127
+ end
128
+
129
+ puts `echo n | android create avd -a -n #{avd_name} -t android-#{sdk_level} #{abi_opt} -c 64M -s HVGA -d "Nexus One"`
124
130
 
125
131
  if $? != 0
126
132
  puts 'Failed to create AVD.'
127
133
  exit 3
128
134
  end
129
- avd_config_file_name = "#{avd_home}/config.ini"
130
- old_avd_config = File.read(avd_config_file_name)
131
- manifest_file = 'AndroidManifest.xml'
132
- heap_size = (File.exists?(manifest_file) && File.read(manifest_file) =~ /largeHeap/) ? 256 : 48
133
- new_avd_config = old_avd_config.gsub(/vm.heapSize=([0-9]*)/) { |m| $1.to_i < heap_size ? "vm.heapSize=#{heap_size}" : m }
134
- add_property(new_avd_config, 'hw.device.manufacturer', 'Generic')
135
- add_property(new_avd_config, 'hw.device.name', '3.2" HVGA slider (ADP1)')
136
- add_property(new_avd_config, 'hw.mainKeys', 'yes')
137
- add_property(new_avd_config, 'hw.sdCard', 'yes')
138
-
139
- File.write(avd_config_file_name, new_avd_config) if new_avd_config != old_avd_config
135
+ # avd_config_file_name = "#{avd_home}/config.ini"
136
+ # old_avd_config = File.read(avd_config_file_name)
137
+ # new_avd_config = old_avd_config.gsub(/vm.heapSize=([0-9]*)/) { |m| $1.to_i < heap_size ? "vm.heapSize=#{heap_size}" : m }
138
+ # add_property(new_avd_config, 'hw.device.manufacturer', 'Generic')
139
+ # add_property(new_avd_config, 'hw.device.name', '3.2" HVGA slider (ADP1)')
140
+ # add_property(new_avd_config, 'hw.mainKeys', 'yes')
141
+ # add_property(new_avd_config, 'hw.sdCard', 'yes')
142
+ # File.write(avd_config_file_name, new_avd_config) if new_avd_config != old_avd_config
143
+
140
144
  new_snapshot = true
141
145
  end
142
146
 
143
- puts "Start emulator#{' without snapshot' if no_snapshot}"
147
+ # hw_config_file_name = "#{avd_home}/hardware-qemu.ini"
148
+ # if File.exists?(hw_config_file_name)
149
+ # old_hw_config = File.read(hw_config_file_name)
150
+ # new_hw_config = old_hw_config.gsub(/vm.heapSize=([0-9]*)/) { |m| $1.to_i < heap_size ? "vm.heapSize=#{heap_size}" : m }
151
+ # File.write(hw_config_file_name, new_hw_config) if new_hw_config != old_hw_config
152
+ # end
153
+
154
+ puts "Start emulator #{avd_name}#{' without snapshot' if no_snapshot}"
144
155
  system "emulator -avd #{avd_name} #{emulator_opts} #{'&' unless ON_WINDOWS}"
145
156
  return if ON_WINDOWS
146
157
 
@@ -179,7 +190,7 @@ module Ruboto
179
190
  `killall -0 #{emulator_cmd} 2> /dev/null`
180
191
  if $? == 0
181
192
  print 'Emulator started: '
182
- 50.times do
193
+ 60.times do
183
194
  break if device_ready?
184
195
  print '.'
185
196
  sleep 1
@@ -198,13 +209,18 @@ module Ruboto
198
209
 
199
210
  if new_snapshot
200
211
  puts 'Allow the emulator to calm down a bit.'
201
- sleep 15
212
+ 60.times do
213
+ break if `adb shell ps` =~ /android.process.acore/
214
+ print '.'
215
+ sleep 1
216
+ end
217
+ puts
202
218
  end
203
219
 
204
220
  system <<EOF
205
221
  (
206
222
  set +e
207
- for i in 1 2 3 4 5 6 7 8 9 10 ; do
223
+ for i in {1..10} ; do
208
224
  sleep 6
209
225
  adb shell input keyevent 82 >/dev/null 2>&1
210
226
  if [ "$?" = "0" ] ; then
@@ -598,7 +598,11 @@ module Ruboto
598
598
  end
599
599
  if accept_all || a == 'Y' || a.empty?
600
600
  android_cmd = windows? ? 'android.bat' : 'android'
601
- update_cmd = "#{android_cmd} update sdk --no-ui --filter #{api_level},sysimg-#{api_level.slice(/\d+$/)} --all"
601
+
602
+ # FIXME(uwe): Does this pattern work for all api levels?
603
+ update_cmd = "#{android_cmd} update sdk --no-ui --filter #{api_level},sys-img-x86-#{api_level.downcase},sys-img-armeabi-v7a-#{api_level.downcase} --all"
604
+ # EMXIF
605
+
602
606
  update_sdk(update_cmd, accept_all)
603
607
  check_for_android_platform(api_level)
604
608
  end
@@ -33,13 +33,13 @@ module Ruboto
33
33
 
34
34
  def update_project_properties_target_level(prop_file, target_level)
35
35
  if (project_property_file = File.read(prop_file)) =~ TARGET_VERSION_REGEXP
36
- min_sdk = $2.to_i
36
+ min_sdk = $2
37
37
  if target_level
38
38
  unless target_level == min_sdk
39
39
  puts "Changing project target from #{min_sdk} to #{MINIMUM_SUPPORTED_SDK_LEVEL}."
40
40
  new_target_level = target_level
41
41
  end
42
- elsif min_sdk < MINIMUM_SUPPORTED_SDK_LEVEL
42
+ elsif min_sdk.to_i < MINIMUM_SUPPORTED_SDK_LEVEL
43
43
  puts "Upgrading project target from #{min_sdk} to #{MINIMUM_SUPPORTED_SDK_LEVEL}."
44
44
  new_target_level = MINIMUM_SUPPORTED_SDK_LEVEL
45
45
  end
@@ -74,6 +74,19 @@ module Ruboto
74
74
  test_manifest.elements['application'].attributes['android:icon'] ||= '@drawable/ic_launcher'
75
75
  test_manifest.elements['instrumentation'].attributes['android:name'] = 'org.ruboto.test.InstrumentationTestRunner'
76
76
 
77
+ # FIXME(uwe): Remove when "Android L" has been released.
78
+ puts "update_test: target_level: #{target_level}"
79
+ if target_level == 'L'
80
+ if (sdk_element = test_manifest.elements['uses-sdk'])
81
+ sdk_element.attributes['android:minSdkVersion'] = target_level
82
+ sdk_element.attributes['android:targetSdkVersion'] = target_level
83
+ else
84
+ test_manifest.add_element 'uses-sdk', {'android:minSdkVersion' => target_level, 'android:targetSdkVersion' => target_level}
85
+ end
86
+ test_manifest.elements['instrumentation'].attributes['android:name'] = 'org.ruboto.test.InstrumentationTestRunner'
87
+ end
88
+ # EMXIF
89
+
77
90
  # TODO(uwe): Trying to push test scripts for faster test cycle, but failing...
78
91
  # if test_manifest.elements["uses-permission[@android:name='android.permission.WRITE_INTERNAL_STORAGE']"]
79
92
  # puts 'Found permission tag'
@@ -324,27 +337,37 @@ module Ruboto
324
337
 
325
338
  def update_manifest(min_sdk, target, force = false)
326
339
  log_action("\nAdding RubotoActivity, RubotoDialog, RubotoService, and SDK versions to the manifest") do
327
- if (sdk_element = verify_manifest.elements['uses-sdk'])
328
- min_sdk ||= sdk_element.attributes['android:minSdkVersion']
329
- target ||= sdk_element.attributes['android:targetSdkVersion']
340
+ # FIXME(uwe): Remove the special case 'L' when Android L is released.
341
+ if target == 'L'
342
+ min_sdk = 'L'
330
343
  else
331
- min_sdk ||= MINIMUM_SUPPORTED_SDK_LEVEL
332
- target ||= MINIMUM_SUPPORTED_SDK_LEVEL
333
- end
344
+ if (sdk_element = verify_manifest.elements['uses-sdk'])
345
+ min_sdk ||= sdk_element.attributes['android:minSdkVersion']
346
+ target ||= sdk_element.attributes['android:targetSdkVersion']
347
+ else
348
+ min_sdk ||= MINIMUM_SUPPORTED_SDK_LEVEL
349
+ target ||= MINIMUM_SUPPORTED_SDK_LEVEL
350
+ end
334
351
 
335
- if min_sdk.to_i < MINIMUM_SUPPORTED_SDK_LEVEL
336
- min_sdk = MINIMUM_SUPPORTED_SDK_LEVEL
337
- end
352
+ # FIXME(uwe): Remove the L special case when Android L has been released
353
+ if min_sdk == 'L'
354
+ puts "Android L detected."
355
+ elsif min_sdk.to_i < MINIMUM_SUPPORTED_SDK_LEVEL
356
+ min_sdk = MINIMUM_SUPPORTED_SDK_LEVEL
357
+ end
338
358
 
339
- if target.to_i < MINIMUM_SUPPORTED_SDK_LEVEL
340
- target = MINIMUM_SUPPORTED_SDK_LEVEL
359
+ if target.to_i < MINIMUM_SUPPORTED_SDK_LEVEL
360
+ target = MINIMUM_SUPPORTED_SDK_LEVEL
361
+ end
341
362
  end
363
+ # EMXIF
342
364
 
343
365
  app_element = verify_manifest.elements['application']
344
366
  app_element.attributes['android:icon'] ||= '@drawable/ic_launcher'
345
367
 
346
368
  # FIXME(uwe): Simplify when we stop supporting Android 2.3.x
347
- if min_sdk.to_i >= 11
369
+ # FIXME(uwe): Simplify when Android L is released
370
+ if min_sdk == 'L' || min_sdk.to_i >= 11
348
371
  app_element.attributes['android:hardwareAccelerated'] ||= 'true'
349
372
  app_element.attributes['android:largeHeap'] ||= 'true'
350
373
  end
@@ -382,7 +405,7 @@ module Ruboto
382
405
  sleep 1
383
406
  FileUtils.touch 'ruboto.yml'
384
407
  end
385
- Dir['src/*_activity.rb'].each{|f|FileUtils.touch(f)}
408
+ Dir['src/*_activity.rb'].each { |f| FileUtils.touch(f) }
386
409
  system 'rake build_xml jruby_adapter ruboto_activity'
387
410
  end
388
411
 
@@ -443,10 +466,14 @@ module Ruboto
443
466
  if gem_version >= Gem::Version.new('9000.dev')
444
467
  #noinspection RubyLiteralArrayInspection
445
468
  excluded_core_packages = [
446
- '**/*Darwin*',
447
- '**/*Solaris*',
448
- '**/*windows*',
449
- '**/*Windows*',
469
+
470
+ # FIXME(uwe): Exclude these packages?
471
+ # '**/*Darwin*',
472
+ # '**/*Solaris*',
473
+ # '**/*windows*',
474
+ # '**/*Windows*',
475
+ # EMXIF
476
+
450
477
  'META-INF',
451
478
  # 'com/headius',
452
479
  'com/headius/invokebinder',
@@ -455,6 +482,7 @@ module Ruboto
455
482
  'com/kenai/jffi',
456
483
  'com/kenai/jnr/x86asm',
457
484
  'com/martiansoftware',
485
+ 'com/oracle/nfi',
458
486
  'com/oracle/truffle',
459
487
  'jni',
460
488
  'jnr/constants/platform/darwin',
@@ -462,7 +490,7 @@ module Ruboto
462
490
  'jnr/constants/platform/freebsd',
463
491
  'jnr/constants/platform/openbsd',
464
492
  'jnr/constants/platform/sunos',
465
- 'jnr/enxio',
493
+ # 'jnr/enxio',
466
494
  'jnr/ffi/annotations',
467
495
  'jnr/ffi/byref',
468
496
  'jnr/ffi/mapper',
@@ -479,7 +507,6 @@ module Ruboto
479
507
  'org/jruby/ant',
480
508
  # 'org/jruby/compiler', # Needed for initialization, but should not be necessary
481
509
  # 'org/jruby/compiler/impl', # Needed for initialization, but should not be necessary
482
- 'org/jruby/compiler/impl/BaseBodyCompiler*',
483
510
  'org/jruby/compiler/util',
484
511
  'org/jruby/demo',
485
512
  'org/jruby/embed/bsf',
@@ -492,10 +519,29 @@ module Ruboto
492
519
  # 'org/jruby/runtime/invokedynamic', # Should be excluded
493
520
  # 'org/jruby/runtime/opto', # What is this?
494
521
  # 'org/jruby/runtime/opto/OptoFactory*', # What is this?
495
- 'org/jruby/truffle',
522
+
523
+ # FIXME(uwe): We should filter the whole truffle package...
524
+ # 'org/jruby/truffle',
525
+
526
+ 'org/jruby/truffle/*.class',
527
+ 'org/jruby/truffle/nodes',
528
+ 'org/jruby/truffle/runtime/control',
529
+ 'org/jruby/truffle/runtime/core',
530
+ 'org/jruby/truffle/runtime/lookup',
531
+ 'org/jruby/truffle/runtime/methods',
532
+ 'org/jruby/truffle/runtime/objectstorage',
533
+ 'org/jruby/truffle/runtime/signal',
534
+ 'org/jruby/truffle/runtime/subsystems',
535
+ 'org/jruby/truffle/runtime/util',
536
+ 'org/jruby/truffle/runtime/*.class',
537
+ 'org/jruby/truffle/translator',
538
+ # EMXIF
539
+
496
540
  'org/yecht',
497
541
  'yaml.rb', # This looks like 1.8 stdlib...
498
542
  ]
543
+ elsif gem_version >= Gem::Version.new('1.7.17.dev')
544
+ excluded_core_packages = %w(*.sh **/*Darwin* **/*Solaris* **/*windows* **/*Windows* META-INF com/headius/invokebinder com/headius/options/example com/kenai/constantine com/kenai/jffi com/kenai/jnr/x86asm com/martiansoftware jni jnr/constants/platform/darwin jnr/constants/platform/fake jnr/constants/platform/freebsd jnr/constants/platform/openbsd jnr/constants/platform/sunos jnr/enxio jnr/ffi/annotations jnr/ffi/byref jnr/ffi/mapper jnr/ffi/provider jnr/ffi/util jnr/ffi/Struct$* jnr/ffi/types jnr/posix/Aix* jnr/posix/FreeBSD* jnr/posix/MacOS* jnr/posix/OpenBSD* jnr/x86asm org/jruby/ant org/jruby/cext org/jruby/compiler/impl/BaseBodyCompiler* org/jruby/compiler/util org/jruby/demo org/jruby/embed/bsf org/jruby/embed/jsr223 org/jruby/embed/osgi org/jruby/ext/ffi/AbstractMemory* org/jruby/ext/ffi/Enums* org/jruby/ext/ffi/io org/jruby/ext/ffi/jffi org/jruby/javasupport/bsf org/yecht yaml.rb)
499
545
  elsif gem_version >= Gem::Version.new('1.7.12')
500
546
  excluded_core_packages = %w(**/*Darwin* **/*Solaris* **/*windows* **/*Windows* META-INF com/headius/invokebinder com/headius/options/example com/kenai/constantine com/kenai/jffi com/kenai/jnr/x86asm com/martiansoftware jni jnr/constants/platform/darwin jnr/constants/platform/fake jnr/constants/platform/freebsd jnr/constants/platform/openbsd jnr/constants/platform/sunos jnr/enxio jnr/ffi/annotations jnr/ffi/byref jnr/ffi/mapper jnr/ffi/provider jnr/ffi/util jnr/ffi/Struct$* jnr/ffi/types jnr/posix/Aix* jnr/posix/FreeBSD* jnr/posix/MacOS* jnr/posix/OpenBSD* jnr/x86asm org/jruby/ant org/jruby/cext org/jruby/compiler/impl/BaseBodyCompiler* org/jruby/compiler/util org/jruby/demo org/jruby/embed/bsf org/jruby/embed/jsr223 org/jruby/embed/osgi org/jruby/ext/ffi/AbstractMemory* org/jruby/ext/ffi/Enums* org/jruby/ext/ffi/io org/jruby/ext/ffi/jffi org/jruby/javasupport/bsf org/yecht yaml.rb)
501
547
  elsif gem_version >= Gem::Version.new('1.7.5')