ruboto 1.0.3 → 1.1.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.
data/test/test_helper.rb CHANGED
@@ -92,7 +92,7 @@ module RubotoTest
92
92
  puts "RUBOTO_PLATFORM: #{RUBOTO_PLATFORM}"
93
93
 
94
94
  if RUBOTO_PLATFORM == 'CURRENT'
95
- JRUBY_JARS_VERSION = Gem::Version.new('1.7.4')
95
+ JRUBY_JARS_VERSION = Gem::Version.new('1.7.12')
96
96
  elsif ENV['JRUBY_JARS_VERSION']
97
97
  JRUBY_JARS_VERSION = Gem::Version.new(ENV['JRUBY_JARS_VERSION'])
98
98
  else
@@ -159,9 +159,11 @@ class Test::Unit::TestCase
159
159
  package = options.delete(:package) || PACKAGE
160
160
  standalone = options.delete(:standalone) || !!included_stdlibs || !!excluded_stdlibs || ENV['RUBOTO_PLATFORM'] == 'STANDALONE'
161
161
  update = options.delete(:update) || false
162
- ruby_version = options.delete(:ruby_version) || (JRUBY_JARS_VERSION.to_s[0..0] == "9" ? 2.1 : 1.9)
163
- raise "Unknown options: #{options.inspect}" unless options.empty?
162
+ ruby_version = options.delete(:ruby_version) || (JRUBY_JARS_VERSION.to_s[0..0] == '9' ? 2.1 : 1.9)
163
+ multi_dex = options.has_key?(:multi_dex) ? options.delete(:multi_dex) :
164
+ (standalone && !example && ANDROID_TARGET >= 16)
164
165
 
166
+ raise "Unknown options: #{options.inspect}" unless options.empty?
165
167
  raise 'Inclusion/exclusion of libs requires standalone mode.' if (included_stdlibs || excluded_stdlibs) && !standalone
166
168
 
167
169
  Dir.mkdir TMP_DIR unless File.exists? TMP_DIR
@@ -170,11 +172,12 @@ class Test::Unit::TestCase
170
172
  template_dir = "#{APP_DIR}_template_#{$$}"
171
173
  template_dir << "_package_#{package}" if package != PACKAGE
172
174
  template_dir << "_heap_alloc_#{heap_alloc}" if heap_alloc
173
- # template_dir << "_ruby_version_#{ruby_version.to_s.gsub('.', '_')}" if ruby_version
175
+ # template_dir << "_ruby_version_#{ruby_version.to_s.gsub('.', '_')}" if ruby_version
174
176
  template_dir << "_example_#{example}" if example
175
177
  template_dir << "_bundle_#{[*bundle].join('_')}" if bundle
176
178
  template_dir << '_updated' if update
177
179
  template_dir << '_standalone' if standalone
180
+ template_dir << '_multi-dex' if multi_dex
178
181
  template_dir << "_without_#{excluded_stdlibs.map { |ed| ed.gsub(/[.\/]/, '_') }.join('_')}" if excluded_stdlibs
179
182
  template_dir << "_with_#{included_stdlibs.map { |ed| ed.gsub(/[.\/]/, '_') }.join('_')}" if included_stdlibs
180
183
  if File.exists?(template_dir)
@@ -189,7 +192,9 @@ class Test::Unit::TestCase
189
192
  File.open('local.properties', 'w') { |f| f.puts "sdk.dir=#{ANDROID_HOME}" }
190
193
  File.open('test/local.properties', 'w') { |f| f.puts "sdk.dir=#{ANDROID_HOME}" }
191
194
  if standalone
192
- write_ruboto_yml(included_stdlibs, excluded_stdlibs, heap_alloc, ruby_version) if included_stdlibs || excluded_stdlibs || heap_alloc || ruby_version
195
+ if included_stdlibs || excluded_stdlibs || heap_alloc || ruby_version || multi_dex
196
+ write_ruboto_yml(included_stdlibs, excluded_stdlibs, heap_alloc, ruby_version, multi_dex)
197
+ end
193
198
  FileUtils.touch 'libs/jruby-core-x.x.x.jar'
194
199
  FileUtils.touch 'libs/jruby-stdlib-x.x.x.jar'
195
200
  install_jruby_jars_gem
@@ -211,7 +216,11 @@ class Test::Unit::TestCase
211
216
  end
212
217
  Dir.chdir APP_DIR do
213
218
  write_gemfile(bundle) if bundle
214
- write_ruboto_yml(included_stdlibs, excluded_stdlibs, heap_alloc, ruby_version) if included_stdlibs || excluded_stdlibs || heap_alloc || ruby_version
219
+ if included_stdlibs || excluded_stdlibs || heap_alloc || ruby_version || multi_dex
220
+ sleep 1
221
+ write_ruboto_yml(included_stdlibs, excluded_stdlibs, heap_alloc, ruby_version, multi_dex)
222
+ system 'rake build_xml jruby_adapter'
223
+ end
215
224
  if standalone
216
225
  system "#{RUBOTO_CMD} gen jruby"
217
226
  raise "update jruby failed with return code #$?" if $? != 0
@@ -219,17 +228,10 @@ class Test::Unit::TestCase
219
228
  end
220
229
  end
221
230
 
222
- # FIXME(uwe): Installation with dx.jar fails on Android < 4.0.3 due to complex interface structure
223
- # Fixme(uwe): Remove when solved
224
- #if standalone && ANDROID_OS < 15
225
- # Dir.chdir APP_DIR do
226
- # puts "Removing dx.jar for android-#{ANDROID_OS}"
227
- # FileUtils.rm(Dir['libs/dx.jar'])
228
- # end
229
- #end
230
- # EMXIF
231
-
232
231
  Dir.chdir APP_DIR do
232
+ File.write('AndroidManifest.xml',
233
+ File.read('AndroidManifest.xml').sub(%r{</manifest>},
234
+ " <uses-permission android:name='android.permission.INTERNET'/>\n</manifest>"))
233
235
  if update
234
236
  update_app
235
237
  end
@@ -289,11 +291,13 @@ class Test::Unit::TestCase
289
291
  end
290
292
  end
291
293
 
292
- def write_ruboto_yml(included_stdlibs, excluded_stdlibs, heap_alloc, ruby_version)
294
+ def write_ruboto_yml(included_stdlibs, excluded_stdlibs, heap_alloc, ruby_version, multi_dex)
293
295
  yml = YAML.dump({'included_stdlibs' => included_stdlibs,
294
- 'excluded_stdlibs' => excluded_stdlibs,
295
- # 'ruby_version' => ruby_version,
296
- 'heap_alloc' => heap_alloc})
296
+ 'excluded_stdlibs' => excluded_stdlibs,
297
+ # 'ruby_version' => ruby_version,
298
+ 'heap_alloc' => heap_alloc,
299
+ 'multi_dex' => multi_dex,
300
+ })
297
301
  puts "Adding ruboto.yml:\n#{yml}"
298
302
  File.open('ruboto.yml', 'w') { |f| f << yml }
299
303
  end
@@ -303,7 +307,7 @@ class Test::Unit::TestCase
303
307
  puts "Adding Gemfile.apk: #{gems.join(' ')}"
304
308
  File.open('Gemfile.apk', 'w') do |f|
305
309
  f << "source 'http://rubygems.org/'\n\n"
306
- gems.each { |g| f << "gem #{[*g].map{|gp|"'#{gp}'"}.join(', ')}\n" }
310
+ gems.each { |g| f << "gem #{[*g].map { |gp| "'#{gp}'" }.join(', ')}\n" }
307
311
  end
308
312
  end
309
313
 
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.0.3
4
+ version: 1.1.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: 2014-04-17 00:00:00.000000000 Z
14
+ date: 2014-05-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: main
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: 5.2.0
22
+ version: '5.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 5.2.0
29
+ version: '5.2'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rake
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -78,9 +78,9 @@ files:
78
78
  - assets/Rakefile
79
79
  - assets/libs/dx.jar
80
80
  - assets/rakelib/ruboto.rake
81
- - assets/rakelib/stdlib.rake
82
- - assets/rakelib/stdlib.yml
83
- - assets/rakelib/stdlib_dependencies.rb
81
+ - assets/rakelib/ruboto.stdlib.rake
82
+ - assets/rakelib/ruboto.stdlib.rb
83
+ - assets/rakelib/ruboto.stdlib.yml
84
84
  - assets/res/.DS_Store
85
85
  - assets/res/drawable-hdpi/.DS_Store
86
86
  - assets/res/drawable-hdpi/ic_launcher.png
@@ -105,7 +105,9 @@ files:
105
105
  - assets/src/RubotoActivity.java
106
106
  - assets/src/RubotoBroadcastReceiver.java
107
107
  - assets/src/RubotoService.java
108
+ - assets/src/org/ruboto/DexDex.java
108
109
  - assets/src/org/ruboto/EntryPointActivity.java
110
+ - assets/src/org/ruboto/FrameworkHack.java
109
111
  - assets/src/org/ruboto/JRubyAdapter.java
110
112
  - assets/src/org/ruboto/Log.java
111
113
  - assets/src/org/ruboto/RubotoComponent.java
@@ -203,6 +205,7 @@ files:
203
205
  - test/rake_test.rb
204
206
  - test/ruboto_activity_test.rb
205
207
  - test/ruboto_gen_test.rb
208
+ - test/ruboto_setup_test.rb
206
209
  - test/ruboto_update_test.rb
207
210
  - test/sample_broadcast_receiver_test.rb
208
211
  - test/service_test.rb