rhoconnect-client 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +9 -0
- data/CREDITS +0 -0
- data/LICENSE +9 -0
- data/README.md +47 -0
- data/ext/rhoconnect-client/RhoConnectClient.rb +190 -0
- data/ext/rhoconnect-client/ext/RhoConnectClient.xml +726 -0
- data/ext/rhoconnect-client/ext/build +26 -0
- data/ext/rhoconnect-client/ext/build.bat +30 -0
- data/ext/rhoconnect-client/ext/platform/android/ext_java.files +1 -0
- data/ext/rhoconnect-client/ext/platform/android/ext_native.files +14 -0
- data/ext/rhoconnect-client/ext/platform/android/src/com/rhoconnectclient/RhoconnectClient.java +1 -0
- data/ext/rhoconnect-client/ext/platform/iphone/.gitignore +1 -0
- data/ext/rhoconnect-client/ext/platform/iphone/Rakefile +74 -0
- data/ext/rhoconnect-client/ext/platform/iphone/RhoconnectClient.xcodeproj/project.pbxproj +390 -0
- data/ext/rhoconnect-client/ext/platform/iphone/RhoconnectClient_Prefix.pch +7 -0
- data/ext/rhoconnect-client/ext/platform/iphone/impl/readme.txt +7 -0
- data/ext/rhoconnect-client/ext/platform/qt/Rakefile +35 -0
- data/ext/rhoconnect-client/ext/platform/qt/rhoconnect-client.pro +88 -0
- data/ext/rhoconnect-client/ext/platform/wm/Rhoconnect-client.sln +36 -0
- data/ext/rhoconnect-client/ext/platform/wm/Rhoconnect-client.vcproj +774 -0
- data/ext/rhoconnect-client/ext/platform/wm/Rhoconnect-client.vsprops +15 -0
- data/ext/rhoconnect-client/ext/platform/wm/src/rhoconnectclient_wm.cpp +40 -0
- data/ext/rhoconnect-client/ext/platform/wm/src/rhoconnectclient_wm.h +2 -0
- data/ext/rhoconnect-client/ext/platform/wp8/Rhoconnect-client.props +22 -0
- data/ext/rhoconnect-client/ext/platform/wp8/Rhoconnect-client.sln +32 -0
- data/ext/rhoconnect-client/ext/platform/wp8/Rhoconnect-client.vcxproj +220 -0
- data/ext/rhoconnect-client/ext/platform/wp8/Rhoconnect-client.vcxproj.filters +103 -0
- data/ext/rhoconnect-client/ext/shared/RhoConnectClientImpl.cpp +273 -0
- data/ext/rhoconnect-client/ext/shared/RhoConnectClientImpl.h +60 -0
- data/ext/rhoconnect-client/ext/shared/RhoConnectClientSingletonImpl.h +53 -0
- data/ext/rhoconnect-client/ext/shared/initRhoconnectClient.cpp +207 -0
- data/ext/rhoconnect-client/ext/shared/rhoconnectclient.c +18 -0
- data/ext/rhoconnect-client/ext/shared/sync/ClientRegister.cpp +398 -0
- data/ext/rhoconnect-client/ext/shared/sync/ClientRegister.h +147 -0
- data/ext/rhoconnect-client/ext/shared/sync/ISyncProtocol.h +91 -0
- data/ext/rhoconnect-client/ext/shared/sync/SyncEngine.cpp +1245 -0
- data/ext/rhoconnect-client/ext/shared/sync/SyncEngine.h +213 -0
- data/ext/rhoconnect-client/ext/shared/sync/SyncNotify.cpp +737 -0
- data/ext/rhoconnect-client/ext/shared/sync/SyncNotify.h +209 -0
- data/ext/rhoconnect-client/ext/shared/sync/SyncProtocol_3.h +220 -0
- data/ext/rhoconnect-client/ext/shared/sync/SyncProtocol_4.h +259 -0
- data/ext/rhoconnect-client/ext/shared/sync/SyncSource.cpp +1694 -0
- data/ext/rhoconnect-client/ext/shared/sync/SyncSource.h +212 -0
- data/ext/rhoconnect-client/ext/shared/sync/SyncThread.cpp +583 -0
- data/ext/rhoconnect-client/ext/shared/sync/SyncThread.h +250 -0
- data/ext/rhoconnect-client/ext.yml +12 -0
- data/lib/build/run_rhoconnect_spec.rb +135 -0
- data/lib/rhoconnect-client.rb +3 -0
- data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1673 -0
- data/platform/shared/RhoConnectClient/RhoConnectClient.h +181 -0
- data/platform/shared/RhoConnectClient/RhoError.h +77 -0
- data/rhoconnect-client/C++/Tests/RhoConnectClientTest.cpp +830 -0
- data/rhoconnect-client/C++/Tests/win32/.gitignore +3 -0
- data/rhoconnect-client/C++/Tests/win32/RhoConnectClient.sln +65 -0
- data/rhoconnect-client/C++/Tests/win32/RhoConnectClient.vcproj +634 -0
- data/rhoconnect-client/C++/Tests/win32/RhoConnectClientTest/RhoConnectClientTest.vcproj +222 -0
- data/rhoconnect-client/C++/Tests/win32/RhoConnectClientTest/stdafx.h +65 -0
- data/rhoconnect-client/C++/Tests/win32/stdafx.h +65 -0
- data/rhoconnect-client/CHANGELOG +18 -0
- data/rhoconnect-client/Java/Android/build/android.rake +387 -0
- data/rhoconnect-client/Java/Android/build/android_sdk.rb +582 -0
- data/rhoconnect-client/Java/Android/build/libcurl_build.files +73 -0
- data/rhoconnect-client/Java/Android/build/libjson_build.files +9 -0
- data/rhoconnect-client/Java/Android/build/librhocommon_build.files +14 -0
- data/rhoconnect-client/Java/Android/build/librhodb_build.files +5 -0
- data/rhoconnect-client/Java/Android/build/librhoimpl_build.files +13 -0
- data/rhoconnect-client/Java/Android/build/librholog_build.files +4 -0
- data/rhoconnect-client/Java/Android/build/libsqlite_build.files +1 -0
- data/rhoconnect-client/Java/Android/build/libsync_build.files +7 -0
- data/rhoconnect-client/Java/Android/build/libunzip_build.files +1 -0
- data/rhoconnect-client/Java/Android/build/rhoconnectclient_build.files +3 -0
- data/rhoconnect-client/Java/Android/build/rhoimpljava_build.files +21 -0
- data/rhoconnect-client/Java/Android/src/com/rhomobile/rhodes/Capabilities.java +63 -0
- data/rhoconnect-client/Java/Android/src/com/rhomobile/rhodes/MemoryInfoCollector.java +79 -0
- data/rhoconnect-client/Java/Android/src/com/rhomobile/rhodes/util/ContextFactory.java +63 -0
- data/rhoconnect-client/Java/Android/test/.classpath +9 -0
- data/rhoconnect-client/Java/Android/test/.project +33 -0
- data/rhoconnect-client/Java/Android/test/AndroidManifest.xml +14 -0
- data/rhoconnect-client/Java/Android/test/assets/apps/androidtest.png +0 -0
- data/rhoconnect-client/Java/Android/test/assets/apps/rhoconfig.txt +19 -0
- data/rhoconnect-client/Java/Android/test/assets/apps/rhoconfig.txt.timestamp +1 -0
- data/rhoconnect-client/Java/Android/test/assets/db/syncdb.schema +44 -0
- data/rhoconnect-client/Java/Android/test/assets/db/syncdb.triggers +10 -0
- data/rhoconnect-client/Java/Android/test/assets/db/syncdb_java.triggers +21 -0
- data/rhoconnect-client/Java/Android/test/assets/rho.dat +9 -0
- data/rhoconnect-client/Java/Android/test/proguard.cfg +36 -0
- data/rhoconnect-client/Java/Android/test/project.properties +11 -0
- data/rhoconnect-client/Java/Android/test/res/drawable-hdpi/icon.png +0 -0
- data/rhoconnect-client/Java/Android/test/res/drawable-ldpi/icon.png +0 -0
- data/rhoconnect-client/Java/Android/test/res/drawable-mdpi/icon.png +0 -0
- data/rhoconnect-client/Java/Android/test/res/layout/main.xml +12 -0
- data/rhoconnect-client/Java/Android/test/res/values/strings.xml +5 -0
- data/rhoconnect-client/Java/Android/test/rhoimpl.jar +0 -0
- data/rhoconnect-client/Java/Android/test/src/com/rhomobile/rhoconnect_client_test/TestRhoConnectClient.java +343 -0
- data/rhoconnect-client/Java/Android/test/src/com/rhomobile/rhoconnect_client_test/TestRhoConnectClientBlobs.java +219 -0
- data/rhoconnect-client/Java/RhoConnect/.classpath +6 -0
- data/rhoconnect-client/Java/RhoConnect/.project +93 -0
- data/rhoconnect-client/Java/RhoConnect/assets/apps/rhoconfig.txt +19 -0
- data/rhoconnect-client/Java/RhoConnect/assets/apps/rhoconfig.txt.timestamp +1 -0
- data/rhoconnect-client/Java/RhoConnect/assets/db/syncdb.schema +44 -0
- data/rhoconnect-client/Java/RhoConnect/assets/db/syncdb.triggers +10 -0
- data/rhoconnect-client/Java/RhoConnect/assets/db/syncdb_java.triggers +21 -0
- data/rhoconnect-client/Java/RhoConnect/assets/rho.dat +8 -0
- data/rhoconnect-client/Java/RhoConnect/jni/include/RhoConnectJniNotify.h +61 -0
- data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectClient.h +181 -0
- data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectNotify.h +13 -0
- data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectNotify_IDelegate.h +13 -0
- data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectObjectNotify.h +13 -0
- data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhoConnectObjectNotify_IDelegate.h +13 -0
- data/rhoconnect-client/Java/RhoConnect/jni/include/com_rhomobile_rhoconnect_RhomModel.h +103 -0
- data/rhoconnect-client/Java/RhoConnect/jni/include/rhojava.inc +76 -0
- data/rhoconnect-client/Java/RhoConnect/jni/src/RhoConnectJniClient.cpp +401 -0
- data/rhoconnect-client/Java/RhoConnect/jni/src/RhoConnectJniModel.cpp +332 -0
- data/rhoconnect-client/Java/RhoConnect/jni/src/RhoConnectJniNotify.cpp +223 -0
- data/rhoconnect-client/Java/RhoConnect/jni/src/RhoConnectUtil.cpp +82 -0
- data/rhoconnect-client/Java/RhoConnect/jni/src/RhodesApp.cpp +114 -0
- data/rhoconnect-client/Java/RhoConnect/src/com/rhomobile/rhoconnect/RhoConnectClient.java +108 -0
- data/rhoconnect-client/Java/RhoConnect/src/com/rhomobile/rhoconnect/RhoConnectNotify.java +78 -0
- data/rhoconnect-client/Java/RhoConnect/src/com/rhomobile/rhoconnect/RhoConnectObjectNotify.java +71 -0
- data/rhoconnect-client/Java/RhoConnect/src/com/rhomobile/rhoconnect/RhomModel.java +195 -0
- data/rhoconnect-client/JavaScript/.classpath +10 -0
- data/rhoconnect-client/JavaScript/.gitignore +4 -0
- data/rhoconnect-client/JavaScript/.project +17 -0
- data/rhoconnect-client/JavaScript/README.textile +1 -0
- data/rhoconnect-client/JavaScript/build.xml +185 -0
- data/rhoconnect-client/JavaScript/doc/fsm-sample.js +44 -0
- data/rhoconnect-client/JavaScript/doc/fsm-sample.png +0 -0
- data/rhoconnect-client/JavaScript/src/RhoSyncJS.gwt.xml +21 -0
- data/rhoconnect-client/JavaScript/stubs/RhoSyncStubsJS.gwt.xml +21 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/Capabilities.java +7 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/IRhoRubyHelper.java +7 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/Mutex.java +5 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/RhoAppAdapter.java +39 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/RhoClassFactory.java +29 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/RhoConf.java +100 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/RhoEmptyLogger.java +7 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/RhoEmptyProfiler.java +5 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/RhoLogger.java +32 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/RhoProfiler.java +27 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/RhodesApp.java +25 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/TimeInterval.java +22 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/Tokenizer.java +23 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/db/DBAdapter.java +174 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/db/DBAttrManager.java +15 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/db/DBException.java +5 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/db/IDBResult.java +27 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/file/IFileAccess.java +7 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/file/SimpleFile.java +15 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/net/IHttpConnection.java +22 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/net/NetRequest.java +324 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/net/NetResponse.java +51 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/net/URI.java +64 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/sync/ClientRegister.java +15 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/sync/JSONArrayIterator.java +37 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/sync/JSONEntry.java +48 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/sync/JSONStructIterator.java +41 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/sync/SyncNotify.java +98 -0
- data/rhoconnect-client/JavaScript/stubs/com/rho/sync/SyncThread.java +92 -0
- data/rhoconnect-client/JavaScript/war/WEB-INF/lib/gwt-servlet-deps.jar +0 -0
- data/rhoconnect-client/JavaScript/war/WEB-INF/lib/gwt-servlet.jar +0 -0
- data/rhoconnect-client/JavaScript/war/js/fsm-sample.js +54 -0
- data/rhoconnect-client/JavaScript/war/js/rhosync-api.js +237 -0
- data/rhoconnect-client/JavaScript/war/js/rhosync-fsm.js +307 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/4C71D69C9BBC9E6F05C6BA49B01BCBC1.cache.html +3122 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/5146F4FFF34511C8BB2661E920B49E3A.cache.html +3254 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/5248C67481D9D27AD0703D15CDBD2A1C.cache.html +3147 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/EE1DC2692C9C32367B53A39E2358AF23.cache.html +3195 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/clear.cache.gif +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/corner.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/corner_ie6.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/hborder.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/hborder_ie6.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/corner_dialog_topleft.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/corner_dialog_topright.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/hborder_blue_shadow.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/hborder_gray_shadow.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/vborder_blue_shadow.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/ie6/vborder_gray_shadow.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/splitPanelThumb.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/vborder.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/images/vborder_ie6.png +0 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/standard.css +1144 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/gwt/standard/standard_rtl.css +1145 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/hosted.html +350 -0
- data/rhoconnect-client/JavaScript/war/rhosyncjs/rhosyncjs.nocache.js +314 -0
- data/rhoconnect-client/JavaScript/war/test/SpecRunner.html +35 -0
- data/rhoconnect-client/JavaScript/war/test/dbtest.html +38 -0
- data/rhoconnect-client/JavaScript/war/test/lib/jasmine-1.0.1/MIT.LICENSE +20 -0
- data/rhoconnect-client/JavaScript/war/test/lib/jasmine-1.0.1/jasmine-html.js +188 -0
- data/rhoconnect-client/JavaScript/war/test/lib/jasmine-1.0.1/jasmine.css +166 -0
- data/rhoconnect-client/JavaScript/war/test/lib/jasmine-1.0.1/jasmine.js +2421 -0
- data/rhoconnect-client/JavaScript/war/test/spec/SpecHelper.js +7 -0
- data/rhoconnect-client/JavaScript/war/test/spec/SyncApiSpec.js +573 -0
- data/rhoconnect-client/JavaScript/war/test/spec/samples/PlayerSpec.js +58 -0
- data/rhoconnect-client/JavaScript/war/test/worker-test.js +17 -0
- data/rhoconnect-client/LICENSE +41 -0
- data/rhoconnect-client/ObjectiveC/RhoConnectClient.h +118 -0
- data/rhoconnect-client/ObjectiveC/RhoConnectClient.m +641 -0
- data/rhoconnect-client/ObjectiveC/RhoConnectClient.xcodeproj/project.pbxproj +1434 -0
- data/rhoconnect-client/ObjectiveC/RhoConnectNotify.h +83 -0
- data/rhoconnect-client/ObjectiveC/RhoConnectNotify.m +181 -0
- data/rhoconnect-client/ObjectiveC/RhoConnectObjectNotify.h +65 -0
- data/rhoconnect-client/ObjectiveC/RhoConnectObjectNotify.m +73 -0
- data/rhoconnect-client/ObjectiveC/RhomModel.h +101 -0
- data/rhoconnect-client/ObjectiveC/RhomModel.m +320 -0
- data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/MainWindow.xib +198 -0
- data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTest-Info.plist +30 -0
- data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTest.xcodeproj/project.pbxproj +373 -0
- data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTestAppDelegate.h +58 -0
- data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTestAppDelegate.m +84 -0
- data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/RhoConnectClientTest_Prefix.pch +8 -0
- data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/invalid_import_db.zip +0 -0
- data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/main.m +1096 -0
- data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/test.png +0 -0
- data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/test2.png +0 -0
- data/rhoconnect-client/ObjectiveC/Tests/RhoConnectClientTest/valid_import_db.zip +0 -0
- data/rhoconnect-client/ObjectiveC/Tests/ptests/Classes/ptestsAppDelegate.h +62 -0
- data/rhoconnect-client/ObjectiveC/Tests/ptests/Classes/ptestsAppDelegate.m +35 -0
- data/rhoconnect-client/ObjectiveC/Tests/ptests/Classes/ptestsViewController.h +78 -0
- data/rhoconnect-client/ObjectiveC/Tests/ptests/Classes/ptestsViewController.m +549 -0
- data/rhoconnect-client/ObjectiveC/Tests/ptests/MainWindow.xib +227 -0
- data/rhoconnect-client/ObjectiveC/Tests/ptests/main.m +17 -0
- data/rhoconnect-client/ObjectiveC/Tests/ptests/ptests-Info.plist +30 -0
- data/rhoconnect-client/ObjectiveC/Tests/ptests/ptests.xcodeproj/project.pbxproj +363 -0
- data/rhoconnect-client/ObjectiveC/Tests/ptests/ptestsViewController.xib +641 -0
- data/rhoconnect-client/ObjectiveC/Tests/ptests/ptests_Prefix.pch +8 -0
- data/rhoconnect-client/README.textile +23 -0
- data/rhoconnect-client/Rakefile +20 -0
- data/rhoconnect-client/Samples/Java/android_store/.classpath +8 -0
- data/rhoconnect-client/Samples/Java/android_store/.project +33 -0
- data/rhoconnect-client/Samples/Java/android_store/AndroidManifest.xml +24 -0
- data/rhoconnect-client/Samples/Java/android_store/assets/apps/rhoconfig.txt +19 -0
- data/rhoconnect-client/Samples/Java/android_store/assets/apps/rhoconfig.txt.timestamp +1 -0
- data/rhoconnect-client/Samples/Java/android_store/assets/db/syncdb.schema +44 -0
- data/rhoconnect-client/Samples/Java/android_store/assets/db/syncdb.triggers +10 -0
- data/rhoconnect-client/Samples/Java/android_store/assets/db/syncdb_java.triggers +21 -0
- data/rhoconnect-client/Samples/Java/android_store/assets/rho.dat +8 -0
- data/rhoconnect-client/Samples/Java/android_store/default.properties +11 -0
- data/rhoconnect-client/Samples/Java/android_store/project.properties +14 -0
- data/rhoconnect-client/Samples/Java/android_store/res/drawable-hdpi/icon.png +0 -0
- data/rhoconnect-client/Samples/Java/android_store/res/drawable-ldpi/icon.png +0 -0
- data/rhoconnect-client/Samples/Java/android_store/res/drawable-mdpi/icon.png +0 -0
- data/rhoconnect-client/Samples/Java/android_store/res/layout/main.xml +12 -0
- data/rhoconnect-client/Samples/Java/android_store/res/values/strings.xml +5 -0
- data/rhoconnect-client/Samples/Java/android_store/rhoimpl.jar +0 -0
- data/rhoconnect-client/Samples/Java/android_store/src/com/rhomobile/android_store/StoreActivity.java +68 -0
- data/rhoconnect-client/Samples/Java/android_store/src/com/rhomobile/android_store/StoreApplication.java +15 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/Classes/LoginViewController.h +70 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/Classes/LoginViewController.m +94 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/Classes/RhoConnectEngine.h +82 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/Classes/RhoConnectEngine.m +119 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/Classes/RootViewController.h +63 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/Classes/RootViewController.m +314 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/Classes/WaitLoginController.h +65 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/Classes/WaitLoginController.m +110 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/Classes/storeAppDelegate.h +61 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/Classes/storeAppDelegate.m +171 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/LoginViewController.xib +779 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/MainWindow.xib +580 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/RootViewController.xib +384 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/WaitLoginController.xib +557 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/icon.png +0 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/main.m +22 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/store-Info.plist +30 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/store.xcodeproj/project.pbxproj +367 -0
- data/rhoconnect-client/Samples/ObjectiveC/store/store_Prefix.pch +14 -0
- data/rhoconnect-client/build.yml +3 -0
- data/rhoconnect-client/version +1 -0
- metadata +314 -0
@@ -0,0 +1,582 @@
|
|
1
|
+
#------------------------------------------------------------------------
|
2
|
+
# (The MIT License)
|
3
|
+
#
|
4
|
+
# Copyright (c) 2008-2011 Rhomobile, Inc.
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
# THE SOFTWARE.
|
23
|
+
#
|
24
|
+
# http://rhomobile.com
|
25
|
+
|
26
|
+
# Copyright (c) 2011-2016 Symbol Technologies, Inc.
|
27
|
+
#
|
28
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
29
|
+
# of this software and associated documentation files (the "Software"), to deal
|
30
|
+
# in the Software without restriction, including without limitation the rights
|
31
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
32
|
+
# copies of the Software, and to permit persons to whom the Software is
|
33
|
+
# furnished to do so, subject to the following conditions:
|
34
|
+
#
|
35
|
+
# The above copyright notice and this permission notice shall be included in
|
36
|
+
# all copies or substantial portions of the Software.
|
37
|
+
#
|
38
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
39
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
40
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
41
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
42
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
43
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
44
|
+
# THE SOFTWARE.
|
45
|
+
#
|
46
|
+
# http://symbol.com
|
47
|
+
#------------------------------------------------------------------------
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
#common functions for compiling android
|
52
|
+
#
|
53
|
+
# uses following globals
|
54
|
+
# $objdir[] list of paths to compiled library object files
|
55
|
+
# $libname[] list of paths to compiled library
|
56
|
+
# $build_release set to true to disable debug binaries
|
57
|
+
|
58
|
+
USE_TRACES = Rake.application.options.trace
|
59
|
+
|
60
|
+
if RUBY_PLATFORM =~ /(win|w)32$/
|
61
|
+
$bat_ext = ".bat"
|
62
|
+
$exe_ext = ".exe"
|
63
|
+
$ndkhost = "windows"
|
64
|
+
else
|
65
|
+
$bat_ext = ""
|
66
|
+
$exe_ext = ""
|
67
|
+
$ndkhost = `uname -s`.downcase!.chomp! + "-x86"
|
68
|
+
end
|
69
|
+
|
70
|
+
def num_cpus
|
71
|
+
num = nil
|
72
|
+
if RUBY_PLATFORM =~ /linux/
|
73
|
+
num = `cat /proc/cpuinfo | grep processor | wc -l`.gsub("\n", '')
|
74
|
+
elsif RUBY_PLATFORM =~ /darwin/
|
75
|
+
num = `sysctl -n hw.ncpu`.gsub("\n", '')
|
76
|
+
elsif RUBY_PLATFORM =~ /w(in)?32/
|
77
|
+
num = ENV['NUMBER_OF_PROCESSORS']
|
78
|
+
else
|
79
|
+
num = 1
|
80
|
+
end
|
81
|
+
num = num.to_i
|
82
|
+
num = 1 if num == 0
|
83
|
+
num
|
84
|
+
end
|
85
|
+
|
86
|
+
def setup_sdk(sdkpath, api_level)
|
87
|
+
unless File.exists? sdkpath
|
88
|
+
puts "Missing or invalid 'android' section in rhobuild.yml: '#{sdkpath}'"
|
89
|
+
exit 1
|
90
|
+
end
|
91
|
+
|
92
|
+
# $rhobindir = File.join($basepath, "bin")
|
93
|
+
# $shareddir = File.join($androidpath, "..", "shared")
|
94
|
+
# $srcdir = File.join($bindir, "RhoBundle")
|
95
|
+
# $targetdir = File.join($bindir, "target")
|
96
|
+
# $excludelib = ['**/builtinME.rb','**/ServeME.rb','**/dateME.rb','**/rationalME.rb']
|
97
|
+
# $tmpdir = File.join($bindir, "tmp")
|
98
|
+
# $resourcedir = File.join($tmpdir, "resource")
|
99
|
+
# $libs = File.join($androidpath, "Rhodes", "libs")
|
100
|
+
|
101
|
+
puts "+++ Looking for platform..." if USE_TRACES
|
102
|
+
top_level = api_level
|
103
|
+
|
104
|
+
api_levels = Array.new
|
105
|
+
platforms = File.join sdkpath, "platforms"
|
106
|
+
|
107
|
+
Dir.glob(File.join(platforms, "*")).each do |platform|
|
108
|
+
|
109
|
+
props = File.join(platform, "source.properties")
|
110
|
+
unless File.file? props
|
111
|
+
puts "+++ WARNING! No source.properties found in #{platform}"
|
112
|
+
next
|
113
|
+
end
|
114
|
+
|
115
|
+
level = -1
|
116
|
+
marketversion = nil
|
117
|
+
File.open(props, "r") do |f|
|
118
|
+
while line = f.gets
|
119
|
+
level = $1.to_i if line =~ /^\s*AndroidVersion\.ApiLevel\s*=\s*([0-9]+)\s*$/
|
120
|
+
marketversion = $1 if line =~ /^\s*Platform\.Version\s*=\s*([^\s]*)\s*$/
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
puts "+++ API LEVEL of #{platform}: #{level}" if USE_TRACES
|
125
|
+
api_levels.push level
|
126
|
+
|
127
|
+
if level >= top_level
|
128
|
+
top_level = level
|
129
|
+
$androidplatform = File.basename(platform)
|
130
|
+
#$found_api_level = level
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
api_levels.sort!
|
135
|
+
|
136
|
+
if USE_TRACES
|
137
|
+
puts "Found API levels:"
|
138
|
+
api_levels.each do |level|
|
139
|
+
puts level
|
140
|
+
end
|
141
|
+
#puts "Corresponding API level #{requested_api_level}"
|
142
|
+
end
|
143
|
+
|
144
|
+
# if !is_api_level_installed
|
145
|
+
# puts "ERROR!!! API version is not found in installed Android SDK: #{$emuversion}"
|
146
|
+
# exit 1
|
147
|
+
# end
|
148
|
+
|
149
|
+
# if $androidplatform.nil?
|
150
|
+
# ajar = File.join($androidsdkpath, 'platforms', 'android-' + $min_sdk_level.to_s, 'android.jar')
|
151
|
+
# if USE_TRACES
|
152
|
+
# puts "Using target path: "+ ajar
|
153
|
+
# end
|
154
|
+
# $androidplatform = 'android-' + $min_sdk_level.to_s if File.file?(ajar)
|
155
|
+
# end
|
156
|
+
|
157
|
+
if $androidplatform.nil?
|
158
|
+
puts "+++ No required platform (API level >= #{api_level}) found, can't proceed"
|
159
|
+
puts "+++ Looks like you have no installed required Android platform package."
|
160
|
+
puts "+++ To solve that, please strictly follow instructions from http://wiki.rhomobile.com/index.php/BuildingRhodes#Prerequisites_5"
|
161
|
+
exit 1
|
162
|
+
else
|
163
|
+
puts "SDK platform path: #{File.join platforms, $androidplatform}"
|
164
|
+
end
|
165
|
+
$stdout.flush
|
166
|
+
|
167
|
+
top_level
|
168
|
+
|
169
|
+
end
|
170
|
+
|
171
|
+
def setup_ndk(ndkpath, apilevel)
|
172
|
+
puts "setup_ndk(#{ndkpath}, #{apilevel})" if USE_TRACES
|
173
|
+
|
174
|
+
unless File.exists? ndkpath
|
175
|
+
puts "Invalid 'android-ndk' section in rhobuild.yml: '#{ndkpath}'"
|
176
|
+
exit 1
|
177
|
+
end
|
178
|
+
|
179
|
+
if ndkpath =~ /\s/
|
180
|
+
errfmt = "WARNING!!! Path to Android %s contain spaces! It will not work because of the Google toolchain restrictions. Move it to another location and reconfigure rhodes."
|
181
|
+
puts(errfmt % "NDK")
|
182
|
+
exit 1
|
183
|
+
end
|
184
|
+
|
185
|
+
$ndktools = nil
|
186
|
+
$ndkabi = "unknown"
|
187
|
+
$ndkgccver = "unknown"
|
188
|
+
["arm-linux-androideabi-4.4.3", "arm-eabi-4.4.0", "arm-eabi-4.2.1"].each do |abi|
|
189
|
+
variants = []
|
190
|
+
variants << File.join(ndkpath, "toolchains", abi, "prebuilt", $ndkhost)
|
191
|
+
variants << File.join(ndkpath, "build/prebuilt", $ndkhost, abi)
|
192
|
+
variants.each do |variant|
|
193
|
+
next unless File.directory? variant
|
194
|
+
$ndktools = variant
|
195
|
+
$ndkabi = abi.gsub(/^(.*)-([^-]*)$/, '\1')
|
196
|
+
$ndkgccver = abi.gsub(/^(.*)-([^-]*)$/, '\2')
|
197
|
+
break
|
198
|
+
end
|
199
|
+
break unless $ndktools.nil?
|
200
|
+
end
|
201
|
+
if $ndktools.nil?
|
202
|
+
raise "Can't detect NDK toolchain path (corrupted NDK installation?)"
|
203
|
+
end
|
204
|
+
|
205
|
+
variants = []
|
206
|
+
variants << "platforms"
|
207
|
+
variants << File.join("build", "platforms")
|
208
|
+
|
209
|
+
api_levels = Array.new
|
210
|
+
|
211
|
+
variants.each do |variant|
|
212
|
+
puts "Check NDK folder: #{variant}" if USE_TRACES
|
213
|
+
Dir.glob(File.join(ndkpath, variant, "*")).each do |platform|
|
214
|
+
sys_root = File.join platform, "arch-arm"
|
215
|
+
puts "Checking #{sys_root} for NDK nsysroot" if USE_TRACES
|
216
|
+
next unless File.directory? sys_root
|
217
|
+
next unless platform =~ /android-([0-9]+)$/
|
218
|
+
api_level = $1.to_i
|
219
|
+
api_levels.push api_level
|
220
|
+
puts "NDK API level: #{api_level}" if USE_TRACES
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
api_levels.sort!
|
225
|
+
|
226
|
+
last_api_level = 0
|
227
|
+
api_levels.each do |cur_api_level|
|
228
|
+
puts "Checking is API level enough: #{cur_api_level}" if USE_TRACES
|
229
|
+
break if cur_api_level > apilevel.to_i
|
230
|
+
last_api_level = cur_api_level
|
231
|
+
end
|
232
|
+
|
233
|
+
variants.each do |variant|
|
234
|
+
sysroot = File.join(ndkpath, variant, "android-#{last_api_level}/arch-arm")
|
235
|
+
next unless File.directory? sysroot
|
236
|
+
$ndksysroot = sysroot
|
237
|
+
break
|
238
|
+
end
|
239
|
+
if $ndksysroot.nil?
|
240
|
+
raise "Can't detect NDK sysroot (corrupted NDK installation?)"
|
241
|
+
end
|
242
|
+
puts "NDK platform sysroot: #{$ndksysroot}"
|
243
|
+
|
244
|
+
['gcc', 'g++', 'ar', 'strip', 'objdump'].each do |tool|
|
245
|
+
name = tool.gsub('+', 'p')
|
246
|
+
eval "$#{name}bin = $ndktools + '/bin/#{$ndkabi}-#{tool}' + $exe_ext"
|
247
|
+
end
|
248
|
+
|
249
|
+
# Detect rlim_t
|
250
|
+
if $have_rlim_t.nil?
|
251
|
+
$have_rlim_t = false
|
252
|
+
resource_h = File.join(ndkpath, 'build', 'platforms', "android-#{apilevel}", "arch-arm", "usr", "include", "sys", "resource.h")
|
253
|
+
if File.exists? resource_h
|
254
|
+
File.open(resource_h, 'r') do |f|
|
255
|
+
while line = f.gets
|
256
|
+
if line =~ /^\s*typedef\b.*\brlim_t\s*;\s*$/
|
257
|
+
$have_rlim_t = true;
|
258
|
+
break;
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
def cc_def_args
|
267
|
+
if $cc_def_args_val.nil?
|
268
|
+
args = []
|
269
|
+
args << "--sysroot"
|
270
|
+
args << $ndksysroot
|
271
|
+
#args << "-fvisibility=hidden"
|
272
|
+
args << "-fPIC"
|
273
|
+
args << "-Wno-psabi" if $ndkgccver != "4.2.1"
|
274
|
+
args << "-mandroid"
|
275
|
+
args << "-DANDROID"
|
276
|
+
args << "-DOS_ANDROID"
|
277
|
+
args << "-DRHO_DEBUG"
|
278
|
+
args << "-DHAVE_RLIM_T" if $have_rlim_t
|
279
|
+
args << "-g"
|
280
|
+
if $build_release
|
281
|
+
args << "-O2"
|
282
|
+
args << "-DNDEBUG"
|
283
|
+
else
|
284
|
+
args << "-O0"
|
285
|
+
args << "-D_DEBUG"
|
286
|
+
end
|
287
|
+
$cc_def_args_val = args
|
288
|
+
end
|
289
|
+
$cc_def_args_val.dup
|
290
|
+
end
|
291
|
+
|
292
|
+
def cpp_def_args
|
293
|
+
if $cpp_def_args_val.nil?
|
294
|
+
args = []
|
295
|
+
args << "-fvisibility-inlines-hidden"
|
296
|
+
args << "-fno-exceptions"
|
297
|
+
args << "-fno-rtti"
|
298
|
+
$cpp_def_args_val = args
|
299
|
+
end
|
300
|
+
$cpp_def_args_val.dup
|
301
|
+
end
|
302
|
+
|
303
|
+
def get_def_args(filename)
|
304
|
+
if filename =~ /\.[cC]$/
|
305
|
+
cc_def_args
|
306
|
+
elsif filename =~ /\.[cC]([cC]|[xXpP][xXpP])$/
|
307
|
+
cpp_def_args + cc_def_args
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
311
|
+
def cc_get_ccbin(filename)
|
312
|
+
if filename =~ /\.[cC]$/
|
313
|
+
$gccbin
|
314
|
+
elsif filename =~ /\.[cC]([cC]|[xXpP][xXpP])$/
|
315
|
+
$gppbin
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
def cc_deps(filename, objdir, additional)
|
320
|
+
#puts "Check #{filename}..."
|
321
|
+
depfile = File.join objdir, File.basename(filename).gsub(/\.[cC]([cC]|[xXpP][xXpP])?$/, ".d")
|
322
|
+
if File.exists? depfile
|
323
|
+
if FileUtils.uptodate? depfile, File.read(depfile).gsub(/(^\s+|\s+$)/, '').split(/\s+/)
|
324
|
+
return []
|
325
|
+
end
|
326
|
+
end
|
327
|
+
ccbin = cc_get_ccbin(filename)
|
328
|
+
args = get_def_args(filename)
|
329
|
+
args += additional unless additional.nil?
|
330
|
+
out = `#{ccbin} #{args.join(' ')} -MM -MG #{filename}`
|
331
|
+
out.gsub!(/^[^:]*:\s*/, '') unless out.nil?
|
332
|
+
out.gsub!(/\\\n/, ' ') unless out.nil?
|
333
|
+
out = "" if out.nil?
|
334
|
+
#out = File.expand_path(__FILE__) + ' ' + out
|
335
|
+
|
336
|
+
mkdir_p objdir unless File.directory? objdir
|
337
|
+
File.open(depfile, "w") { |f| f.write(out) }
|
338
|
+
|
339
|
+
out.split(/\s+/)
|
340
|
+
end
|
341
|
+
|
342
|
+
def cc_run(command, args, chdir = nil)
|
343
|
+
save_cwd = FileUtils.pwd
|
344
|
+
FileUtils.cd chdir unless chdir.nil?
|
345
|
+
argv = [command]
|
346
|
+
argv += args
|
347
|
+
cmdstr = argv.map! { |x| x.to_s }.map! { |x| x =~ / / ? '"' + x + '"' : x }.join(' ')
|
348
|
+
puts cmdstr
|
349
|
+
$stdout.flush
|
350
|
+
argv = cmdstr if RUBY_VERSION =~ /^1\.[89]/
|
351
|
+
IO.popen(argv) do |f|
|
352
|
+
while data = f.gets
|
353
|
+
puts data
|
354
|
+
$stdout.flush
|
355
|
+
end
|
356
|
+
end
|
357
|
+
ret = $?
|
358
|
+
FileUtils.cd save_cwd
|
359
|
+
ret.success?
|
360
|
+
end
|
361
|
+
|
362
|
+
def get_object(source, dir)
|
363
|
+
return File.join dir, File.basename(source) + ".o"
|
364
|
+
end
|
365
|
+
|
366
|
+
def cc_compile(filename, objdir, additional = nil)
|
367
|
+
#filename.chomp!
|
368
|
+
objname = get_object filename, objdir
|
369
|
+
|
370
|
+
return true if FileUtils.uptodate? objname, [filename] + cc_deps(filename, objdir, additional)
|
371
|
+
|
372
|
+
mkdir_p objdir unless File.directory? objdir
|
373
|
+
|
374
|
+
ccbin = cc_get_ccbin(filename)
|
375
|
+
|
376
|
+
args = get_def_args(filename)
|
377
|
+
args << "-Wall"
|
378
|
+
args << "-Wextra"
|
379
|
+
args << "-Wno-unused"
|
380
|
+
args += additional if additional.is_a? Array and not additional.empty?
|
381
|
+
args << "-c"
|
382
|
+
args << filename
|
383
|
+
args << "-o"
|
384
|
+
args << objname
|
385
|
+
cmdline = ccbin + ' ' + args.join(' ')
|
386
|
+
cc_run(ccbin, args)
|
387
|
+
end
|
388
|
+
|
389
|
+
def get_sources(name)
|
390
|
+
File.read(File.join($basepath, name + '_build.files')).split("\n")
|
391
|
+
end
|
392
|
+
|
393
|
+
def get_objects(sources, objdir)
|
394
|
+
objects = []
|
395
|
+
sources.each do |filename|
|
396
|
+
objects << get_object(filename, objdir)
|
397
|
+
end
|
398
|
+
|
399
|
+
if USE_TRACES
|
400
|
+
puts "sources:"
|
401
|
+
sources.each do |src|
|
402
|
+
puts src
|
403
|
+
end
|
404
|
+
puts "objects:"
|
405
|
+
objects.each do |obj|
|
406
|
+
puts obj
|
407
|
+
end
|
408
|
+
puts ""
|
409
|
+
end
|
410
|
+
|
411
|
+
objects
|
412
|
+
end
|
413
|
+
|
414
|
+
def cc_build(sources, buildpath, additional = nil)
|
415
|
+
|
416
|
+
# Ruby 1.8 has problems with Thread.join on Windows
|
417
|
+
if RUBY_PLATFORM =~ /w(in)?32/ and RUBY_VERSION =~ /^1\.8\./
|
418
|
+
sources.each do |src|
|
419
|
+
f = File.join $rhodespath, src
|
420
|
+
return false unless cc_compile f, buildpath, additional
|
421
|
+
end
|
422
|
+
true
|
423
|
+
else
|
424
|
+
jobs = num_cpus
|
425
|
+
jobs += 1 if jobs > 1
|
426
|
+
|
427
|
+
srcs = []
|
428
|
+
for i in (0..jobs-1)
|
429
|
+
srcs[i] = []
|
430
|
+
end
|
431
|
+
|
432
|
+
sources.each do |src|
|
433
|
+
f = File.join $rhodespath, src
|
434
|
+
puts "job for: #{f}" if USE_TRACES
|
435
|
+
|
436
|
+
idx = sources.index(src)%jobs
|
437
|
+
srcs[idx] << f
|
438
|
+
end
|
439
|
+
|
440
|
+
ths = []
|
441
|
+
srcs.each do |src|
|
442
|
+
ths << Thread.new do
|
443
|
+
success = true
|
444
|
+
src.each do |f|
|
445
|
+
success = cc_compile f, buildpath, additional
|
446
|
+
break unless success
|
447
|
+
end
|
448
|
+
success
|
449
|
+
end
|
450
|
+
end
|
451
|
+
|
452
|
+
ret = true
|
453
|
+
ths.each do |th|
|
454
|
+
success = th.value
|
455
|
+
ret = success unless success
|
456
|
+
end
|
457
|
+
ret
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
461
|
+
def cc_ar(libname, objects)
|
462
|
+
return true if FileUtils.uptodate? libname, objects
|
463
|
+
cc_run($arbin, ["crs", libname] + objects)
|
464
|
+
end
|
465
|
+
|
466
|
+
def cc_link(outname, objects, additional = nil, deps = nil)
|
467
|
+
puts "linking #{outname}"
|
468
|
+
dependencies = objects
|
469
|
+
unless deps.nil?
|
470
|
+
if USE_TRACES
|
471
|
+
deps.each do |dep|
|
472
|
+
puts "link dep: #{dep}"
|
473
|
+
end
|
474
|
+
end
|
475
|
+
dependencies += deps
|
476
|
+
end
|
477
|
+
#return true if FileUtils.uptodate? outname, dependencies
|
478
|
+
args = ["-g", "--sysroot", $ndksysroot]
|
479
|
+
if $ndkabi == "arm-eabi"
|
480
|
+
args << "-nostdlib"
|
481
|
+
args << "-Wl,-shared,-Bsymbolic"
|
482
|
+
else
|
483
|
+
args << "-shared"
|
484
|
+
end
|
485
|
+
#args << "-Wl,--no-whole-archive"
|
486
|
+
args << "-Wl,--no-undefined"
|
487
|
+
args << "-Wl,-z,defs"
|
488
|
+
args << "-fPIC"
|
489
|
+
args << "-Wl,-soname,#{File.basename(outname)}"
|
490
|
+
args << "-o"
|
491
|
+
args << outname
|
492
|
+
args += objects
|
493
|
+
args += additional if additional.is_a? Array and not additional.empty?
|
494
|
+
unless USE_OWN_STLPORT
|
495
|
+
args << "-L#{File.join($androidndkpath, "sources","cxx-stl","stlport","libs","armeabi")}"
|
496
|
+
args << "-L#{File.join($androidndkpath, "tmp","ndk-digit","build","install","sources","cxx-stl","stlport","libs","armeabi")}"
|
497
|
+
args << "-lstlport_static"
|
498
|
+
end
|
499
|
+
args << "-L#{$ndksysroot}/usr/lib"
|
500
|
+
args << "-Wl,-rpath-link=#{$ndksysroot}/usr/lib"
|
501
|
+
if $cxxlibs.nil?
|
502
|
+
$cxxlibs = []
|
503
|
+
$cxxlibs << File.join($ndksysroot, "usr/lib/libstdc++.so")
|
504
|
+
end
|
505
|
+
args += $cxxlibs
|
506
|
+
$libgcc = `#{$gccbin} -mthumb-interwork -print-file-name=libgcc.a`.gsub("\n", "") if $libgcc.nil?
|
507
|
+
args << $libgcc if $ndkgccver != "4.2.1"
|
508
|
+
args << "#{$ndksysroot}/usr/lib/libc.so"
|
509
|
+
args << "#{$ndksysroot}/usr/lib/libm.so"
|
510
|
+
args << $libgcc if $ndkgccver == "4.2.1"
|
511
|
+
cc_run($gccbin, args)
|
512
|
+
end
|
513
|
+
|
514
|
+
def cc_clean(name)
|
515
|
+
[$objdir[name], $libname[name]].each do |x|
|
516
|
+
rm_rf x if File.exists? x
|
517
|
+
end
|
518
|
+
end
|
519
|
+
|
520
|
+
def jar_build(name, classpath, jarname, buildpath)
|
521
|
+
javac = File.join($rhoconfig["env"]["paths"]["java"], "javac" + $exe_ext)
|
522
|
+
jarbin = File.join($rhoconfig["env"]["paths"]["java"], "jar" + $exe_ext)
|
523
|
+
|
524
|
+
args = [
|
525
|
+
"-d", buildpath,
|
526
|
+
"-source", "1.6",
|
527
|
+
"-target", "1.6",
|
528
|
+
"-nowarn",
|
529
|
+
"-encoding", "latin1",
|
530
|
+
"-classpath", classpath,
|
531
|
+
"@#{File.join($basepath, name + '_build.files')}"
|
532
|
+
]
|
533
|
+
cc_run(javac, args)
|
534
|
+
unless $?.success?
|
535
|
+
puts "Error compiling java code"
|
536
|
+
exit 1
|
537
|
+
end
|
538
|
+
|
539
|
+
files = []
|
540
|
+
Dir.glob(File.join(buildpath, "*")).each do |f|
|
541
|
+
relpath = Pathname.new(f).relative_path_from(Pathname.new(buildpath)).to_s
|
542
|
+
files << relpath
|
543
|
+
end
|
544
|
+
unless files.empty?
|
545
|
+
reljarpath = Pathname.new(jarname).relative_path_from(Pathname.new(buildpath)).to_s
|
546
|
+
args = ["cf", reljarpath]
|
547
|
+
args += files
|
548
|
+
cc_run(jarbin, args, buildpath)
|
549
|
+
unless $?.success?
|
550
|
+
puts "Error running jar"
|
551
|
+
exit 1
|
552
|
+
end
|
553
|
+
end
|
554
|
+
|
555
|
+
end
|
556
|
+
|
557
|
+
def apk_build(sdk, apk_name, res_name, dex_name, debug)
|
558
|
+
puts "Building APK file..."
|
559
|
+
prev_dir = Dir.pwd
|
560
|
+
Dir.chdir File.join(sdk, "tools")
|
561
|
+
#"-classpath", File.join("lib", "sdklib.jar"), "com.android.sdklib.build.ApkBuilderMain",
|
562
|
+
if debug
|
563
|
+
params = [apk_name, "-z", res_name, "-f", dex_name]
|
564
|
+
else
|
565
|
+
params = [apk_name, "-u", "-z", res_name, "-f", dex_name]
|
566
|
+
end
|
567
|
+
|
568
|
+
if RUBY_PLATFORM =~ /(win|w)32$/
|
569
|
+
apkbuilder = "apkbuilder" + $bat_ext
|
570
|
+
else
|
571
|
+
apkbuilder = File.join(".", "apkbuilder" + $bat_ext)
|
572
|
+
end
|
573
|
+
|
574
|
+
Jake.run apkbuilder, params
|
575
|
+
|
576
|
+
unless $?.success?
|
577
|
+
Dir.chdir prev_dir
|
578
|
+
puts "Error building APK file"
|
579
|
+
exit 1
|
580
|
+
end
|
581
|
+
Dir.chdir prev_dir
|
582
|
+
end
|