Skip to content

Commit

Permalink
Update to ruboto 0.10 dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rscottm committed Dec 19, 2012
1 parent 401afa0 commit b0e057c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 26 deletions.
32 changes: 16 additions & 16 deletions AndroidManifest.xml
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<manifest xmlns:android='http://schemas.android.com/apk/res/android' package='org.ruboto.irb' android:installLocation='preferExternal' android:versionCode='12' android:versionName='@string/version_name'> <manifest package='org.ruboto.irb' android:installLocation='preferExternal' android:versionCode='12' android:versionName='@string/version_name' xmlns:android='http://schemas.android.com/apk/res/android'>
<application android:hardwareAccelerated='true' android:label='@string/app_name' android:icon='@drawable/icon' android:largeHeap='true'> <application android:hardwareAccelerated='true' android:icon='@drawable/icon' android:label='@string/app_name' android:largeHeap='true'>
<activity android:hardwareAccelerated='false' android:label='@string/app_name' android:windowSoftInputMode='adjustResize' android:alwaysRetainTaskState='true' android:configChanges='orientation|screenSize' android:name='IRB'> <activity android:alwaysRetainTaskState='true' android:configChanges='orientation|screenSize' android:hardwareAccelerated='false' android:label='@string/app_name' android:name='IRB' android:windowSoftInputMode='adjustResize'>
<intent-filter> <intent-filter>
<action android:name='android.intent.action.MAIN'/> <action android:name='android.intent.action.MAIN'/>
<category android:name='android.intent.category.LAUNCHER'/> <category android:name='android.intent.category.LAUNCHER'/>
Expand All @@ -28,24 +28,24 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:alwaysRetainTaskState='true' android:configChanges='orientation|screenSize' android:name='org.ruboto.RubotoActivity'/> <activity android:alwaysRetainTaskState='true' android:configChanges='orientation|screenSize' android:name='org.ruboto.RubotoActivity'/>
<activity android:theme='@android:style/Theme.Dialog' android:configChanges='orientation|screenSize' android:name='org.ruboto.RubotoDialog'/> <activity android:configChanges='orientation|screenSize' android:name='org.ruboto.RubotoDialog' android:theme='@android:style/Theme.Dialog'/>
<activity android:name='org.ruboto.RubotoPreferenceActivity'/> <activity android:name='org.ruboto.RubotoPreferenceActivity'/>
<activity android:configChanges='orientation|screenSize' android:name='net.android.facebook.TestConnect'/> <activity android:configChanges='orientation|screenSize' android:name='net.android.facebook.TestConnect'/>
<activity android:configChanges='orientation|screenSize' android:name='net.android.facebook.TestPost'/> <activity android:configChanges='orientation|screenSize' android:name='net.android.facebook.TestPost'/>
<service android:exported='false' android:name='org.ruboto.RubotoService'/> <service android:exported='false' android:name='org.ruboto.RubotoService'/>
</application> </application>
<uses-sdk android:targetSdkVersion='13' android:minSdkVersion='7'/> <uses-sdk android:minSdkVersion='7' android:targetSdkVersion='13'/>
<supports-screens android:xlargeScreens='true' android:largeScreens='true' android:normalScreens='true' android:anyDensity='true' android:smallScreens='true'/> <supports-screens android:anyDensity='true' android:largeScreens='true' android:normalScreens='true' android:smallScreens='true' android:xlargeScreens='true'/>
<uses-feature android:required='false' android:name='android.hardware.telephony'/> <uses-feature android:name='android.hardware.telephony' android:required='false'/>
<uses-feature android:required='false' android:name='android.hardware.touchscreen'/> <uses-feature android:name='android.hardware.touchscreen' android:required='false'/>
<uses-feature android:required='false' android:name='android.hardware.location'/> <uses-feature android:name='android.hardware.location' android:required='false'/>
<uses-feature android:required='false' android:name='android.hardware.location.gps'/> <uses-feature android:name='android.hardware.location.gps' android:required='false'/>
<uses-feature android:required='false' android:name='android.hardware.location.network'/> <uses-feature android:name='android.hardware.location.network' android:required='false'/>
<uses-feature android:required='false' android:name='android.hardware.wifi'/> <uses-feature android:name='android.hardware.wifi' android:required='false'/>
<uses-feature android:required='false' android:name='android.hardware.microphone'/> <uses-feature android:name='android.hardware.microphone' android:required='false'/>
<uses-feature android:required='false' android:name='android.hardware.camera'/> <uses-feature android:name='android.hardware.camera' android:required='false'/>
<uses-feature android:required='false' android:name='android.hardware.camera.autofocus'/> <uses-feature android:name='android.hardware.camera.autofocus' android:required='false'/>
<uses-feature android:required='false' android:name='android.hardware.bluetooth'/> <uses-feature android:name='android.hardware.bluetooth' android:required='false'/>
<uses-permission android:name='android.permission.WRITE_EXTERNAL_STORAGE'/> <uses-permission android:name='android.permission.WRITE_EXTERNAL_STORAGE'/>
<uses-permission android:name='com.android.launcher.permission.INSTALL_SHORTCUT'/> <uses-permission android:name='com.android.launcher.permission.INSTALL_SHORTCUT'/>
<uses-permission android:name='android.permission.INTERNET'/> <uses-permission android:name='android.permission.INTERNET'/>
Expand Down
18 changes: 13 additions & 5 deletions rakelib/ruboto.rake
@@ -1,4 +1,8 @@
require 'rbconfig' require 'rbconfig'
require 'rubygems'
require 'time'
require 'rake/clean'
require 'rexml/document'


ANT_CMD = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw/i) ? "ant.bat" : "ant" ANT_CMD = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw/i) ? "ant.bat" : "ant"


Expand All @@ -7,17 +11,19 @@ if `#{ANT_CMD} -version` !~ /version (\d+)\.(\d+)\.(\d+)/ || $1.to_i < 1 || ($1.
exit 1 exit 1
end end


require 'time' adb_version_str = `adb version`
(puts "Android SDK platform tools not in PATH (adb command not found).";exit 1) unless $? == 0
(puts "Unrecognized adb version: #$1";exit 1) unless adb_version_str =~ /Android Debug Bridge version (\d+\.\d+\.\d+)/
(puts "adb version 1.0.31 or later required. Version found: #$1";exit 1) unless Gem::Version.new($1) >= Gem::Version.new('1.0.31')
adb_path = `which adb`
ENV['ANDROID_HOME'] ||= File.dirname(File.dirname(adb_path)) if $? == 0


def manifest() @manifest ||= REXML::Document.new(File.read(MANIFEST_FILE)) end def manifest() @manifest ||= REXML::Document.new(File.read(MANIFEST_FILE)) end
def package() manifest.root.attribute('package') end def package() manifest.root.attribute('package') end
def build_project_name() @build_project_name ||= REXML::Document.new(File.read('build.xml')).elements['project'].attribute(:name).value end def build_project_name() @build_project_name ||= REXML::Document.new(File.read('build.xml')).elements['project'].attribute(:name).value end
def scripts_path() @sdcard_path ||= "/mnt/sdcard/Android/data/#{package}/files/scripts" end def scripts_path() @sdcard_path ||= "/mnt/sdcard/Android/data/#{package}/files/scripts" end
def app_files_path() @app_files_path ||= "/data/data/#{package}/files" end def app_files_path() @app_files_path ||= "/data/data/#{package}/files" end


require 'rake/clean'
require 'rexml/document'

PROJECT_DIR = File.expand_path('..', File.dirname(__FILE__)) PROJECT_DIR = File.expand_path('..', File.dirname(__FILE__))
UPDATE_MARKER_FILE = File.join(PROJECT_DIR, 'bin', 'LAST_UPDATE') UPDATE_MARKER_FILE = File.join(PROJECT_DIR, 'bin', 'LAST_UPDATE')
BUNDLE_JAR = File.expand_path 'libs/bundle.jar' BUNDLE_JAR = File.expand_path 'libs/bundle.jar'
Expand All @@ -38,7 +44,7 @@ APK_DEPENDENCIES = [MANIFEST_FILE, RUBOTO_CONFIG_FILE, BUNDLE_JAR] + JRUBY_JAR
KEYSTORE_FILE = (key_store = File.readlines('ant.properties').grep(/^key.store=/).first) ? File.expand_path(key_store.chomp.sub(/^key.store=/, '').sub('${user.home}', '~')) : "#{build_project_name}.keystore" KEYSTORE_FILE = (key_store = File.readlines('ant.properties').grep(/^key.store=/).first) ? File.expand_path(key_store.chomp.sub(/^key.store=/, '').sub('${user.home}', '~')) : "#{build_project_name}.keystore"
KEYSTORE_ALIAS = (key_alias = File.readlines('ant.properties').grep(/^key.alias=/).first) ? key_alias.chomp.sub(/^key.alias=/, '') : build_project_name KEYSTORE_ALIAS = (key_alias = File.readlines('ant.properties').grep(/^key.alias=/).first) ? key_alias.chomp.sub(/^key.alias=/, '') : build_project_name


CLEAN.include('bin') CLEAN.include('bin', 'gen')


task :default => :debug task :default => :debug


Expand Down Expand Up @@ -98,6 +104,8 @@ file RELEASE_APK_FILE => [KEYSTORE_FILE] + APK_DEPENDENCIES do |t|
end end


desc 'Create a keystore for signing the release APK' desc 'Create a keystore for signing the release APK'
task :keystore => KEYSTORE_FILE

file KEYSTORE_FILE do file KEYSTORE_FILE do
unless File.read('ant.properties') =~ /^key.store=/ unless File.read('ant.properties') =~ /^key.store=/
File.open('ant.properties', 'a'){|f| f << "\nkey.store=#{KEYSTORE_FILE}\n"} File.open('ant.properties', 'a'){|f| f << "\nkey.store=#{KEYSTORE_FILE}\n"}
Expand Down
14 changes: 10 additions & 4 deletions src/org/ruboto/JRubyAdapter.java
Expand Up @@ -262,6 +262,11 @@ public static synchronized boolean setUpJRuby(Context appContext, PrintStream ou
System.setProperty("jruby.ji.proxyClassFactory", "org.ruboto.DalvikProxyClassFactory"); System.setProperty("jruby.ji.proxyClassFactory", "org.ruboto.DalvikProxyClassFactory");
System.setProperty("jruby.class.cache.path", appContext.getDir("dex", 0).getAbsolutePath()); System.setProperty("jruby.class.cache.path", appContext.getDir("dex", 0).getAbsolutePath());


// Workaround for bug in Android 2.2
// http://code.google.com/p/android/issues/detail?id=9431
// System.setProperty("java.net.preferIPv4Stack", "true");
// System.setProperty("java.net.preferIPv6Addresses", "false");

ClassLoader classLoader; ClassLoader classLoader;
Class<?> scriptingContainerClass; Class<?> scriptingContainerClass;
String apkName = null; String apkName = null;
Expand Down Expand Up @@ -439,14 +444,15 @@ private static void handleInitException(Exception e) {


static void printStackTrace(Throwable t) { static void printStackTrace(Throwable t) {
// TODO(uwe): Simplify this when Issue #144 is resolved // TODO(uwe): Simplify this when Issue #144 is resolved
try { // TODO(scott): printStackTrace is causing too many problems
t.printStackTrace(output); //try {
} catch (NullPointerException npe) { // t.printStackTrace(output);
//} catch (NullPointerException npe) {
// TODO(uwe): printStackTrace should not fail // TODO(uwe): printStackTrace should not fail
for (java.lang.StackTraceElement ste : t.getStackTrace()) { for (java.lang.StackTraceElement ste : t.getStackTrace()) {
output.append(ste.toString() + "\n"); output.append(ste.toString() + "\n");
} }
} //}
} }


private static String scriptsDirName(Context context) { private static String scriptsDirName(Context context) {
Expand Down
2 changes: 1 addition & 1 deletion test/AndroidManifest.xml
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us --> <!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android='http://schemas.android.com/apk/res/android' package='org.ruboto.irb.tests' android:versionCode='1' android:versionName='1.0'> <manifest package='org.ruboto.irb.tests' android:versionCode='1' android:versionName='1.0' xmlns:android='http://schemas.android.com/apk/res/android'>
<!-- We add an application tag here just so that we can indicate that <!-- We add an application tag here just so that we can indicate that
this package needs to link against the android.test library, this package needs to link against the android.test library,
which is needed when building test cases. --> which is needed when building test cases. -->
Expand Down

0 comments on commit b0e057c

Please sign in to comment.