rhodes 3.3.3.beta.3 → 3.3.3.beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. data/Manifest.txt +16 -1
  2. data/Rakefile +77 -28
  3. data/doc/build.txt +5 -3
  4. data/doc/configuration.txt +13 -0
  5. data/doc/device-caps.txt +46 -27
  6. data/doc/rhom.txt +2 -2
  7. data/doc/test-log-debug.txt +6 -0
  8. data/doc/ui.txt +13 -0
  9. data/lib/build/jake.rb +11 -11
  10. data/lib/extensions/crypt/crypt/cbc.rb +5 -2
  11. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +14 -4
  12. data/lib/framework/rho/render.rb +17 -4
  13. data/lib/framework/rho/rho.rb +1 -1
  14. data/lib/framework/rho/rhocontroller.rb +11 -1
  15. data/lib/framework/rhomotoapi.rb +110 -0
  16. data/platform/android/Rhodes/jni/Android.mk +2 -5
  17. data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +1 -0
  18. data/platform/android/Rhodes/jni/include/rhodes/fileapi.h +38 -0
  19. data/platform/android/Rhodes/jni/src/callbacks.cpp +7 -26
  20. data/platform/android/Rhodes/jni/src/extmanager.cpp +4 -1
  21. data/platform/android/Rhodes/jni/src/fileapi.cpp +38 -14
  22. data/platform/android/Rhodes/jni/src/mapview.cpp +1 -2
  23. data/platform/android/Rhodes/jni/src/rhodesapp.cpp +10 -0
  24. data/platform/android/Rhodes/jni/src/rhodessystem.cpp +1 -1
  25. data/platform/android/Rhodes/jni/src/signature.cpp +1 -4
  26. data/platform/android/Rhodes/rhobundle.xml +1 -1
  27. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +11 -1
  28. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityListener.java +4 -3
  29. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +26 -6
  30. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +3 -1
  31. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +70 -0
  32. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtData.java +3 -1
  33. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +21 -7
  34. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +19 -10
  35. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtDataImpl.java +8 -5
  36. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManager.java +18 -0
  37. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +168 -31
  38. data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +46 -9
  39. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +3 -2
  40. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +27 -53
  41. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +27 -3
  42. data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/Utils.java +13 -14
  43. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +12 -5
  44. data/platform/android/build/RhodesSRC_build.files +2 -1
  45. data/platform/android/build/android.rake +48 -17
  46. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +1 -1
  47. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +24 -3
  48. data/platform/iphone/Classes/AppManager/AppManager.m +1 -1
  49. data/platform/iphone/Classes/Camera/PickImageDelegate.m +27 -2
  50. data/platform/iphone/Classes/DateTimePickerDelegate.h +2 -0
  51. data/platform/iphone/Classes/DateTimePickerDelegate.m +85 -9
  52. data/platform/iphone/Classes/DateTimePickerViewController.h +21 -0
  53. data/platform/iphone/Classes/DateTimePickerViewController.m +75 -0
  54. data/platform/iphone/Classes/GeoLocation/LocationController.h +6 -2
  55. data/platform/iphone/Classes/GeoLocation/LocationController.m +54 -14
  56. data/platform/iphone/Classes/RhoMainView.h +2 -0
  57. data/platform/iphone/Classes/Rhodes.m +11 -5
  58. data/platform/iphone/Classes/Signature/SignatureDelegate.m +13 -12
  59. data/platform/iphone/Classes/Signature/SignatureViewController.m +2 -1
  60. data/platform/iphone/Classes/SimpleMainView.m +3 -0
  61. data/platform/iphone/Classes/SplitView/SplittedMainView.m +3 -0
  62. data/platform/iphone/Classes/TabbedMainView.m +30 -11
  63. data/platform/iphone/rbuild/iphone.rake +7 -1
  64. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +6 -0
  65. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1 -1
  66. data/platform/shared/common/BundleManager.cpp +42 -2
  67. data/platform/shared/common/ExtManager.h +7 -0
  68. data/platform/shared/common/RhoFile.cpp +170 -2
  69. data/platform/shared/common/RhoFile.h +4 -0
  70. data/platform/shared/common/RhodesApp.cpp +30 -0
  71. data/platform/shared/common/RhodesApp.h +1 -0
  72. data/platform/shared/common/map/OSMMapEngine.cpp +11 -3
  73. data/platform/shared/common/map/OSMMapEngine.h +3 -0
  74. data/platform/shared/logging/RhoLogConf.cpp +8 -9
  75. data/platform/shared/logging/RhoLogConf.h +5 -7
  76. data/platform/shared/logging/RhoLogSink.cpp +3 -3
  77. data/platform/shared/logging/RhoLogSink.h +1 -1
  78. data/platform/shared/net/HttpServer.cpp +17 -9
  79. data/platform/shared/qt/rhodes/main.cpp +1 -1
  80. data/platform/shared/ruby/ext/rho/rhoruby.c +4 -0
  81. data/platform/shared/ruby/ext/webview/webview.i +9 -4
  82. data/platform/shared/ruby/ext/webview/webview_wrap.c +2 -2
  83. data/platform/shared/test/Tests.cpp +2 -2
  84. data/platform/wm/build/build_inf.js +75 -47
  85. data/platform/wm/build/wm.rake +50 -53
  86. data/platform/wm/rhodes/Rhodes.cpp +40 -97
  87. data/platform/wm/rhodes/rho/common/ExtManager.cpp +23 -1
  88. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +9 -0
  89. data/platform/wm/tools/detool/detool.cpp +103 -52
  90. data/platform/wp7/RhoRubyExtGen/RhoDateTimePicker.cs +60 -0
  91. data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +1 -0
  92. data/platform/wp7/RhoRubyExtGen/RhoWebView.cs +4 -4
  93. data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +15 -1
  94. data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +12 -2
  95. data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +2 -0
  96. data/platform/wp7/RhoRubyLib/common/RhoFile.cs +3 -3
  97. data/platform/wp7/RhoRubyLib/common/RhoFilePath.cs +2 -2
  98. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +39 -24
  99. data/platform/wp7/RhoRubyLib/json/RJSONTokener.cs +8 -1
  100. data/platform/wp7/RhoRubyLib/logging/RhoLogServerSink.cs +3 -3
  101. data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +1 -1
  102. data/platform/wp7/RhoRubyLib/net/HttpServer.cs +22 -15
  103. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +1 -1
  104. data/platform/wp7/RhoRubyLib/rubyext/RhoDateTimePicker.cs +237 -0
  105. data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +5 -5
  106. data/platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml +37 -0
  107. data/platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml.cs +59 -0
  108. data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +34 -41
  109. data/platform/wp7/rhodes/App.xaml.cs +1 -0
  110. data/platform/wp7/rhodes/Properties/WMAppManifest.xml +18 -18
  111. data/platform/wp7/rhodes/Rhodes.csproj +5 -1
  112. data/platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Cancel.png +0 -0
  113. data/platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Check.png +0 -0
  114. data/rakefile.rb +77 -28
  115. data/res/build-tools/Microsoft.Phone.Controls.Toolkit.dll +0 -0
  116. data/res/build-tools/YUICompressorLicense.txt +54 -0
  117. data/res/build-tools/detool.exe +0 -0
  118. data/res/build-tools/yuicompressor-2.4.7.jar +0 -0
  119. data/res/generators/templates/application/app/layout.erb +1 -0
  120. data/res/generators/templates/application/public/js/jquery-wp7-patch.js +8 -2
  121. data/res/generators/templates/application/public/js/syncengine.js +147 -0
  122. data/spec/phone_spec/app/Data/septest.json +1 -1
  123. data/spec/phone_spec/app/spec/asynchttp_spec.rb +11 -10
  124. data/spec/phone_spec/app/spec/blobsync_spec.rb +9 -34
  125. data/spec/phone_spec/app/spec/date_spec.rb +6 -6
  126. data/spec/phone_spec/app/spec/rho_spec.rb +1 -6
  127. data/spec/phone_spec/app/spec/rhofile_spec.rb +13 -7
  128. data/spec/phone_spec/app/spec/rhom_object_spec.rb +4 -3
  129. data/spec/phone_spec/app/spec/syncengine_spec.rb +12 -14
  130. data/spec/phone_spec/app/spec_runner.rb +9 -10
  131. data/version +1 -1
  132. metadata +20 -5
  133. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerSingleton.java +0 -15
@@ -165,9 +165,9 @@ void CLogOutputSink::writeLogMessage( String& strMsg )
165
165
 
166
166
  CLogSocketSink::CLogSocketSink(const LogSettings& oSettings)
167
167
  {
168
- m_addrHost = "http://"+oSettings.getLogHost() + ":" + oSettings.getLogPort();
168
+ m_URL = oSettings.getLogURL();
169
169
 
170
- CThreadQueue::setLogCategory(LogCategory("NO_LOGGING"));
170
+ CThreadQueue::setLogCategory(LogCategory("NO_LOGGING"));
171
171
  setPollInterval(QUEUE_POLL_INTERVAL_INFINITE);
172
172
  start(epLow);
173
173
  }
@@ -180,7 +180,7 @@ CLogSocketSink::~CLogSocketSink()
180
180
 
181
181
  void CLogSocketSink::writeLogMessage( String& strMsg )
182
182
  {
183
- addQueueCommand(new LogCommand(m_addrHost.c_str(), strMsg.c_str()));
183
+ addQueueCommand(new LogCommand(m_URL.c_str(), strMsg.c_str()));
184
184
  }
185
185
 
186
186
  void CLogSocketSink::processCommand(IQueueCommand* pCmd)
@@ -70,7 +70,7 @@ public:
70
70
  };
71
71
 
72
72
  class CLogSocketSink : public ILogSink, common::CThreadQueue{
73
- String m_addrHost;
73
+ String m_URL;
74
74
 
75
75
  public:
76
76
  CLogSocketSink(const LogSettings& oSettings);
@@ -280,7 +280,7 @@ CHttpServer::CHttpServer(int port, String const &root, String const &user_root,
280
280
  {
281
281
  m_root = CFilePath::normalizePath(root);
282
282
  m_strRhoRoot = m_root.substr(0, m_root.length()-5);
283
- m_strRuntimeRoot = runtime_root.substr(0, runtime_root.length()-5);
283
+ m_strRuntimeRoot = runtime_root.substr(0, runtime_root.length()-5) + "/rho/apps";
284
284
  m_userroot = CFilePath::normalizePath(user_root);
285
285
  m_strRhoUserRoot = m_userroot;
286
286
  }
@@ -289,7 +289,7 @@ CHttpServer::CHttpServer(int port, String const &root)
289
289
  :m_active(false), m_port(port), verbose(true)
290
290
  {
291
291
  m_root = CFilePath::normalizePath(root);
292
- m_strRuntimeRoot = m_strRhoRoot = m_root.substr(0, m_root.length()-5);
292
+ m_strRuntimeRoot = (m_strRhoRoot = m_root.substr(0, m_root.length()-5)) + "/rho/apps";
293
293
  m_userroot = CFilePath::normalizePath(root);
294
294
  m_strRhoUserRoot = m_root.substr(0, m_root.length()-5);
295
295
  }
@@ -975,8 +975,6 @@ bool CHttpServer::send_file(String const &path, HeaderList const &hdrs)
975
975
  else if (fullPath.find(m_root) != 0 && fullPath.find(m_strRhoRoot) != 0 && fullPath.find(m_strRuntimeRoot) != 0 && fullPath.find(m_userroot) != 0 && fullPath.find(m_strRhoUserRoot) != 0)
976
976
  fullPath = CFilePath::join( m_root, path );
977
977
 
978
- if (verbose) RAWTRACE1("Sending file %s...", fullPath.c_str());
979
-
980
978
  struct stat st;
981
979
  bool bCheckExist = true;
982
980
  #ifdef RHODES_EMULATOR
@@ -999,11 +997,21 @@ bool CHttpServer::send_file(String const &path, HeaderList const &hdrs)
999
997
 
1000
998
  #endif
1001
999
 
1002
- if ( bCheckExist && (stat(fullPath.c_str(), &st) != 0 || !S_ISREG(st.st_mode))) {
1003
- RAWLOG_ERROR1("The file %s was not found", path.c_str());
1004
- String error = "<html><font size=\"+4\"><h2>404 Not Found.</h2> The file " + path + " was not found.</font></html>";
1005
- send_response(create_response("404 Not Found",error));
1006
- return false;
1000
+ bool doesNotExists = bCheckExist && (stat(fullPath.c_str(), &st) != 0 || !S_ISREG(st.st_mode));
1001
+ if ( doesNotExists ) {
1002
+ // looking for files at 'rho/apps' at runtime folder
1003
+ fullPath = CFilePath::join( m_strRuntimeRoot, path );
1004
+ }
1005
+
1006
+ if (verbose) RAWTRACE1("Sending file %s...", fullPath.c_str());
1007
+
1008
+ if ( doesNotExists ) {
1009
+ if ( stat(fullPath.c_str(), &st) != 0 || !S_ISREG(st.st_mode) ) {
1010
+ RAWLOG_ERROR1("The file %s was not found", path.c_str());
1011
+ String error = "<html><font size=\"+4\"><h2>404 Not Found.</h2> The file " + path + " was not found.</font></html>";
1012
+ send_response(create_response("404 Not Found",error));
1013
+ return false;
1014
+ }
1007
1015
  }
1008
1016
 
1009
1017
  FILE *fp = fopen(fullPath.c_str(), "rb");
@@ -142,7 +142,7 @@ int main(int argc, char *argv[])
142
142
  #endif
143
143
 
144
144
  // PreMessageLoop:
145
- rho_logconf_Init(m_strRootPath.c_str(), m_logPort.c_str());
145
+ rho_logconf_Init(m_strRootPath.c_str(), m_strRootPath.c_str(), m_logPort.c_str());
146
146
  #ifdef RHODES_EMULATOR
147
147
  RHOSIMCONF().setAppConfFilePath(CFilePath::join(m_strRootPath, RHO_EMULATOR_DIR"/rhosimconfig.txt").c_str());
148
148
  RHOSIMCONF().loadFromFile();
@@ -255,6 +255,10 @@ void RhoRubyStart()
255
255
  Init_Extensions();
256
256
  #endif //RHO_SYMBIAN
257
257
 
258
+ #if defined(APP_BUILD_CAPABILITY_MOTOROLA)
259
+ rb_require("rhomotoapi");
260
+ #endif //APP_BUILD_CAPABILITY_MOTOROLA
261
+
258
262
  #ifdef ENABLE_RUBY_VM_STAT
259
263
  struct timeval start;
260
264
  struct timeval end;
@@ -3,11 +3,11 @@
3
3
  %{
4
4
  extern void rho_webview_refresh(int index);
5
5
  #define refresh rho_webview_refresh
6
- extern void rho_webview_navigate(const char* url, int index);
6
+ extern void rho_webview_navigate(const char* url, int tab_index);
7
7
  #define navigate rho_webview_navigate
8
8
  extern char* rho_webview_current_location(int index);
9
9
  #define current_location rho_webview_current_location
10
- extern char* rho_webview_execute_js(const char* js, int index);
10
+ extern char* rho_webview_execute_js(const char* js, int tab_index);
11
11
  #define execute_js rho_webview_execute_js
12
12
  extern void rho_webview_set_menu_items(VALUE argv);
13
13
  #define set_menu_items rho_webview_set_menu_items
@@ -29,10 +29,15 @@ extern void rho_webview_navigate_back();
29
29
  $1 = -1;
30
30
  }
31
31
 
32
+ %typemap(default) int tab_index {
33
+ $1 = -1;
34
+ }
35
+
36
+
32
37
  extern void refresh(int index);
33
- extern void navigate(const char* url, int index);
38
+ extern void navigate(const char* url, int tab_index);
34
39
  extern const char* current_location(int index);
35
- extern const char* execute_js(const char* js, int index);
40
+ extern const char* execute_js(const char* js, int tab_index);
36
41
  extern void set_menu_items(VALUE argv);
37
42
  extern int active_tab();
38
43
  extern void full_screen_mode(int enable);
@@ -1827,11 +1827,11 @@ static VALUE mWebView;
1827
1827
 
1828
1828
  extern void rho_webview_refresh(int index);
1829
1829
  #define refresh rho_webview_refresh
1830
- extern void rho_webview_navigate(const char* url, int index);
1830
+ extern void rho_webview_navigate(const char* url, int tab_index);
1831
1831
  #define navigate rho_webview_navigate
1832
1832
  extern char* rho_webview_current_location(int index);
1833
1833
  #define current_location rho_webview_current_location
1834
- extern char* rho_webview_execute_js(const char* js, int index);
1834
+ extern char* rho_webview_execute_js(const char* js, int tab_index);
1835
1835
  #define execute_js rho_webview_execute_js
1836
1836
  extern void rho_webview_set_menu_items(VALUE argv);
1837
1837
  #define set_menu_items rho_webview_set_menu_items
@@ -36,7 +36,7 @@
36
36
 
37
37
  void runAllLogTests();
38
38
  extern "C" void runAllProfilingTests();
39
- extern "C" void rho_logconf_Init(const char* path, const char* logPort);
39
+ extern "C" void rho_logconf_Init(const char* logPath, const char* path, const char* logPort);
40
40
  extern "C" const char* RhoGetRootPath();
41
41
 
42
42
  #ifdef OS_MACOSX
@@ -56,7 +56,7 @@ int _tmain(int argc, _TCHAR* argv[])
56
56
 
57
57
  #endif
58
58
 
59
- rho_logconf_Init(RhoGetRootPath(), "");
59
+ rho_logconf_Init(RhoGetRootPath(), RhoGetRootPath(), "");
60
60
 
61
61
  //runAllLogTests();
62
62
  //runAllProfilingTests();
@@ -204,8 +204,7 @@ function fill_extensions_files(exts) {
204
204
  }
205
205
  }
206
206
 
207
- function pinf(platform,es,exts,name,vendor,show_shortcut,webkit,rhogempath) {
208
-
207
+ function pinf(platform,es,exts,name,vendor,srcdir,show_shortcut,is_icon,webkit,rhogempath,usereruntime) {
209
208
  p("[Version]");
210
209
  p("Signature=\"$Windows NT$\"");
211
210
  p("Provider=\""+vendor+"\"");
@@ -224,43 +223,52 @@ function pinf(platform,es,exts,name,vendor,show_shortcut,webkit,rhogempath) {
224
223
  p("BuildMax=0xE0000000");
225
224
  p("");
226
225
  p("[DefaultInstall]");
227
- if (show_shortcut){
226
+ if (show_shortcut && (!usereruntime)){
228
227
  p("CEShortcuts=Shortcuts");
229
228
  }
230
229
  p("AddReg=RegKeys");
231
- p("CopyFiles=CopyToInstallDir"+(webkit ? ",CopyWebKitBin,CopyNPAPI,CopyConfig" : "")+get_copyfiles_sections(es));
230
+ p("CopyFiles=CopyToInstallDir"+((!usereruntime) && webkit ? ",CopyWebKitBin,CopyNPAPI,CopyConfig" : "")+(show_shortcut && usereruntime ? ",Shortcuts" : "")+get_copyfiles_sections(es));
232
231
  p("");
233
232
  p("[SourceDisksNames]");
234
- p("1=,\"\",,\"..\\bin\\"+settings[platform][0]+"\\rhodes\\Release\\\"");
235
- if (webkit) {
236
- p("2=,\"\",," + rhogempath + "\"\\\"");
237
- p("3=,\"\",," + rhogempath + "\"\\NPAPI\\\"");
238
- p("4=,\"\",," + rhogempath + "\"\\Config\\\"");
233
+ if (usereruntime) {
234
+ p("1=,\"\",,\"" + srcdir + "\\..\\\"");
235
+ } else {
236
+ p("1=,\"\",,\"..\\bin\\"+settings[platform][0]+"\\rhodes\\Release\\\"");
237
+ if (webkit) {
238
+ p("2=,\"\",," + rhogempath + "\"\\\"");
239
+ p("3=,\"\",," + rhogempath + "\"\\NPAPI\\\"");
240
+ p("4=,\"\",," + rhogempath + "\"\\Config\\\"");
241
+ }
239
242
  }
240
243
  get_source_disks_names(es);
241
244
  p("");
242
245
  p("[SourceDisksFiles]");
243
- p("\"" + name + ".exe\"=1");
244
- if (webkit) {
245
- p("\"eklibrary.dll\"=2");
246
- p("\"webkit.dll\"=2");
247
- p("\"license_rc.dll\"=2");
248
- p("\"openssl.dll\"=2");
249
- p("\"PBEngine_WK.dll\"=2");
250
- p("\"npwtg_jsobjects.dll\"=3");
251
- p("\"Config.xml\"=4");
252
- p("\"Plugin.xml\"=4");
253
- p("\"RegEx.xml\"=4");
246
+ if (usereruntime) {
247
+ p("\"" + name + ".lnk\"=1");
248
+ } else {
249
+ p("\"" + name + ".exe\"=1");
250
+ if (webkit) {
251
+ p("\"eklibrary.dll\"=2");
252
+ p("\"webkit.dll\"=2");
253
+ p("\"license_rc.dll\"=2");
254
+ p("\"openssl.dll\"=2");
255
+ p("\"PBEngine_WK.dll\"=2");
256
+ p("\"npwtg_jsobjects.dll\"=3");
257
+ p("\"npwtg_legacy.dll\"=3");
258
+ p("\"Config.xml\"=4");
259
+ p("\"Plugin.xml\"=4");
260
+ p("\"RegEx.xml\"=4");
261
+ }
254
262
  }
255
263
  fill_extensions_source_disk_files(exts);
256
264
  var f = get_source_disks_files(es);
257
265
  p("");
258
266
  p("[DestinationDirs]");
259
267
  if (show_shortcut){
260
- p("Shortcuts=0,%CE2%\Start Menu");
268
+ p("Shortcuts=0,\"%CE11%\"");
261
269
  }
262
270
  p("CopyToInstallDir=0,\"%InstallDir%\"");
263
- if (webkit) {
271
+ if ((!usereruntime) && webkit) {
264
272
  p("CopyWebKitBin=0,\"%InstallDir%\"");
265
273
  p("CopyNPAPI=0,\"%InstallDir%\\NPAPI\"");
266
274
  p("CopyConfig=0,\"%InstallDir%\\Config\"");
@@ -268,23 +276,28 @@ function pinf(platform,es,exts,name,vendor,show_shortcut,webkit,rhogempath) {
268
276
  get_destination_dirs(es);
269
277
  p("");
270
278
  p("[CopyToInstallDir]");
271
- p("\"" + name + ".exe\",\"" + name + ".exe\",,0");
272
- if (webkit) {
273
- p("");
274
- p("[CopyWebKitBin]");
275
- p("\"eklibrary.dll\",\"eklibrary.dll\",,0");
276
- p("\"webkit.dll\",\"webkit.dll\",,0");
277
- p("\"license_rc.dll\",\"license_rc.dll\",,0");
278
- p("\"openssl.dll\",\"openssl.dll\",,0");
279
- p("\"PBEngine_WK.dll\",\"PBEngine_WK.dll\",,0");
280
- p("");
281
- p("[CopyNPAPI]");
282
- p("\"npwtg_jsobjects.dll\",\"npwtg_jsobjects.dll\",,0");
283
- p("");
284
- p("[CopyConfig]");
285
- p("\"Config.xml\",\"Config.xml\",,0");
286
- p("\"Plugin.xml\",\"Plugin.xml\",,0");
287
- p("\"RegEx.xml\",\"RegEx.xml\",,0");
279
+ if (usereruntime) {
280
+ p("\"" + name + ".lnk\",\"" + name + ".lnk\",,0");
281
+ } else {
282
+ p("\"" + name + ".exe\",\"" + name + ".exe\",,0");
283
+ if (webkit) {
284
+ p("");
285
+ p("[CopyWebKitBin]");
286
+ p("\"eklibrary.dll\",\"eklibrary.dll\",,0");
287
+ p("\"webkit.dll\",\"webkit.dll\",,0");
288
+ p("\"license_rc.dll\",\"license_rc.dll\",,0");
289
+ p("\"openssl.dll\",\"openssl.dll\",,0");
290
+ p("\"PBEngine_WK.dll\",\"PBEngine_WK.dll\",,0");
291
+ p("");
292
+ p("[CopyNPAPI]");
293
+ p("\"npwtg_jsobjects.dll\",\"npwtg_jsobjects.dll\",,0");
294
+ p("\"npwtg_legacy.dll\",\"npwtg_legacy.dll\",,0");
295
+ p("");
296
+ p("[CopyConfig]");
297
+ p("\"Config.xml\",\"Config.xml\",,0");
298
+ p("\"Plugin.xml\",\"Plugin.xml\",,0");
299
+ p("\"RegEx.xml\",\"RegEx.xml\",,0");
300
+ }
288
301
  }
289
302
  fill_extensions_files(exts);
290
303
  p("");
@@ -292,7 +305,10 @@ function pinf(platform,es,exts,name,vendor,show_shortcut,webkit,rhogempath) {
292
305
  if (show_shortcut){
293
306
  p("");
294
307
  p("[Shortcuts]");
295
- p("\""+name+"\",0,\"" + name + ".exe\",%CE11%");
308
+ if (usereruntime)
309
+ p("\"" + name + ".lnk\",\"" + name + ".lnk\",,0");
310
+ else
311
+ p("\""+name+"\",0,\"" + name + ".exe\",%CE11%");
296
312
  }
297
313
  p("");
298
314
  p("[RegKeys]");
@@ -306,23 +322,32 @@ function main() {
306
322
  // args(3) = vendor
307
323
  // args(4) = srcdir
308
324
  // args(5) = hidden_app
309
- // args(6) = include motorola webkit binaries and configs
325
+ // args(6) = include motorola webkit binaries and configs?
310
326
  // args(7) = rhoelements gem folder path
311
- // args(8) = additional files
327
+ // args(8) = use RhoElements runtime?
328
+ // args(9)... = additional files
312
329
 
313
330
  var args = WScript.Arguments;
314
331
  fso = new ActiveXObject("Scripting.FileSystemObject");
315
332
  output_file = fso.CreateTextFile(args(0));
333
+ srcdir = args(4)
334
+ is_icon = fso.FileExists(srcdir+"/icon/icon.ico");
335
+ show_shortcut = (args(5) == "0");
336
+ include_webkit = (args(6) == "1");
337
+ usereruntime = (args(8) == "1");
316
338
 
317
339
  var sources = new Object();
318
340
  sources['db'] = ["db","..\\..\\..\\platform\\shared\\db\\res\\db"];
319
341
  //sources['sqlite3']= ["sqlite3","..\\..\\shared\\sqlite3"];
320
- sources['lib']= ["lib",args(4)+"/lib"];
321
- sources['apps']= ["apps",args(4)+"/apps"];
342
+ if (!usereruntime)
343
+ sources['lib']= ["lib",srcdir+"/lib"];
344
+ else if (is_icon)
345
+ sources['icon']= ["icon",srcdir+"/icon"];
346
+ sources['apps']= ["apps",srcdir+"/apps"];
322
347
 
323
348
  var es = expand_sources(sources);
324
349
 
325
- for (var idx = 8; idx < args.length; idx++)
350
+ for (var idx = 9; idx < args.length; idx++)
326
351
  {
327
352
  if (args(idx) == null)
328
353
  break;
@@ -332,8 +357,11 @@ function main() {
332
357
  es = expand_sources1(es, sources_add);
333
358
  }
334
359
 
335
- var exts = expand_extensions(args(1));
336
- pinf(args(1),es,exts,args(2),args(3), (args(5) == "0"), (args(6) == "1"), args(7));
360
+ var exts;
361
+ if (!usereruntime) {
362
+ exts = expand_extensions(args(1));
363
+ }
364
+ pinf(args(1),es,exts,args(2),args(3),srcdir,show_shortcut,is_icon,include_webkit,args(7),usereruntime);
337
365
 
338
366
  output_file.Close();
339
367
  }
@@ -66,12 +66,6 @@ namespace "config" do
66
66
  $sdk = "Win32"
67
67
  end
68
68
 
69
- task :set_motce_platform do
70
- $current_platform = "wm" unless $current_platform
71
- $build_solution = 'rhoelements.sln' unless $build_solution
72
- $sdk = "MC3000c50b (ARMV4I)"
73
- end
74
-
75
69
  task :wm => [:set_wm_platform, "config:common"] do
76
70
  puts " $current_platform : #{$current_platform}"
77
71
 
@@ -138,12 +132,17 @@ namespace "config" do
138
132
 
139
133
  $wm_emulator = $app_config["wm"]["emulator"] if $app_config["wm"] and $app_config["wm"]["emulator"]
140
134
  $wm_emulator = "Windows Mobile 6 Professional Emulator" unless $wm_emulator
135
+
136
+ $use_re_runtime = (($app_config["wm"].nil? || $app_config["wm"]["use_re_runtime"].nil?) ? nil : 1 )
137
+ #puts $app_config["wm"]["use_re_runtime"].inspect
138
+ #puts $use_re_runtime.inspect
141
139
  end
142
140
  end
143
141
 
144
142
  namespace "build" do
145
143
  namespace "wm" do
146
144
  task :extensions => "config:wm" do
145
+ if not $use_re_runtime.nil? then next end
147
146
 
148
147
  if $additional_dlls_path.nil?
149
148
  puts 'new $additional_dlls_paths'
@@ -202,6 +201,8 @@ namespace "build" do
202
201
  end
203
202
 
204
203
  task :rhodes => ["config:wm", "build:wm:rhobundle"] do
204
+ if not $use_re_runtime.nil? then next end
205
+
205
206
  chdir $config["build"]["wmpath"]
206
207
 
207
208
  cp $app_path + "/icon/icon.ico", "rhodes/resources" if File.exists? $app_path + "/icon/icon.ico"
@@ -353,18 +354,22 @@ end
353
354
 
354
355
  namespace "device" do
355
356
 
356
- namespace "motce" do
357
- desc "Build production for Motorola device"
358
- task :production => ["config:set_motce_platform", "device:wm:production"] do
359
- end
360
- end
361
-
362
357
  namespace "wm" do
363
358
  desc "Build production for device or emulator"
364
359
  task :production => ["config:wm","build:wm:rhobundle","build:wm:rhodes"] do
365
360
 
366
- out_dir = $startdir + "/" + $vcbindir + "/#{$sdk}" + "/rhodes/Release/"
367
- cp out_dir + "rhodes.exe", out_dir + $appname + ".exe"
361
+ wm_icon = $app_path + '/icon/icon.ico'
362
+ if $use_re_runtime.nil? then
363
+ out_dir = $startdir + "/" + $vcbindir + "/#{$sdk}" + "/rhodes/Release/"
364
+ cp out_dir + "rhodes.exe", out_dir + $appname + ".exe"
365
+ else
366
+ shortcut_content = '"\\Program Files\\RhoElements2\\RhoElements2.exe" -approot="\\Program Files\\' + $appname + '"'
367
+ if File.exists? wm_icon then
368
+ shortcut_content = shortcut_content + '?"\\Program Files\\' + $appname + '\\rho\\icon\\icon.ico"'
369
+ end
370
+ shortcut_content = shortcut_content.length().to_s + '#' + shortcut_content
371
+ File.open($srcdir + '/../' + $appname + ".lnk", "w") { |f| f.write(shortcut_content) }
372
+ end
368
373
 
369
374
  chdir $builddir
370
375
 
@@ -372,26 +377,22 @@ namespace "device" do
372
377
  build_platform = 'wm653' if $sdk == "Windows Mobile 6.5.3 Professional DTK (ARMV4I)"
373
378
  build_platform = 'ce5' if $sdk == "MC3000c50b (ARMV4I)"
374
379
 
375
- if $webkit_capability and $wk_data_dir != nil
376
- wk_config_dir = $wk_data_dir + "/Config"
377
- config_files = ['Config','Plugin','RegEx']
378
- config_files.each do |filename|
379
- filepath = File.join(wk_config_dir,filename + ".xml.template")
380
- if not File.exists?(filepath)
381
- puts "Cannot find required config template: #{filepath}"
382
- exit 1
383
- end
384
- template = File.read(filepath)
385
- config = template.to_s.gsub('(%APPNAME%)',$app_config["name"]);
386
- filepath = File.join(wk_config_dir,filename + ".xml")
387
- File.open(filepath, "w") { |f| f.write(config) }
380
+ icon_dest = $srcdir + '/icon'
381
+ rm_rf icon_dest
382
+ if not $use_re_runtime.nil? then
383
+ rm_rf $srcdir + '/lib'
384
+ if File.exists? wm_icon then
385
+ mkdir_p icon_dest if not File.exists? icon_dest
386
+ cp wm_icon, icon_dest
388
387
  end
389
388
  end
390
389
 
391
- args = ['build_inf.js', $appname + ".inf", build_platform, '"' + $app_config["name"] +'"', $app_config["vendor"], '"' + $srcdir + '"', $hidden_app, ($webkit_capability ? "1" : "0"), $wk_data_dir]
390
+ args = ['build_inf.js', $appname + ".inf", build_platform, '"' + $app_config["name"] +'"', $app_config["vendor"], '"' + $srcdir + '"', $hidden_app, ($webkit_capability ? "1" : "0"), $wk_data_dir, (($use_re_runtime.nil?) ? "0" : "1")]
392
391
 
393
- $additional_dlls_paths.each do |path|
394
- args << path
392
+ if $use_re_runtime.nil? then
393
+ $additional_dlls_paths.each do |path|
394
+ args << path
395
+ end
395
396
  end
396
397
 
397
398
  puts Jake.run('cscript',args)
@@ -435,10 +436,6 @@ end
435
436
 
436
437
  namespace "clean" do
437
438
 
438
- desc "Clean Motorola device build"
439
- task :motce => ["config:set_motce_platform", "clean:wm:all"] do
440
- end
441
-
442
439
  desc "Clean wm"
443
440
  task :wm => "clean:wm:all" do
444
441
  end
@@ -489,19 +486,19 @@ namespace "run" do
489
486
  sleep(1)
490
487
  end
491
488
 
492
- if $webkit_capability
489
+ if $webkit_capability and ($use_re_runtime.nil?)
493
490
  wk_args = [ 'wk-emu', "\"#{$wm_emulator}\"", '"'+ $wk_data_dir.gsub(/"/,'\\"') + '"', '"'+ $appname + '"']
494
491
  Jake.run2( detool, wk_args, {:nowait => false})
495
492
  end
496
493
 
497
- #if $additional_dlls_paths
498
- # $additional_dlls_paths.each do |path|
499
- # add_files_args = [ 'wk-emu', "\"#{$wm_emulator}\"", '"'+ path.gsub(/"/,'\\"') + '"', '"'+ $appname + '"']
500
- # Jake.run2( detool, add_files_args, {:nowait => false})
501
- # end
502
- #end
494
+ if $additional_dlls_paths
495
+ $additional_dlls_paths.each do |path|
496
+ add_files_args = [ 'wk-emu', "\"#{$wm_emulator}\"", '"'+ path.gsub(/"/,'\\"') + '"', '"'+ $appname + '"']
497
+ Jake.run2( detool, add_files_args, {:nowait => false})
498
+ end
499
+ end
503
500
 
504
- args = [ 'emu', "\"#{$wm_emulator}\"", '"'+$appname.gsub(/"/,'\\"')+'"', '"'+$srcdir.gsub(/"/,'\\"')+'"', '"'+($startdir + "/" + $vcbindir + "/#{$sdk}" + "/rhodes/Release/" + $appname + ".exe").gsub(/"/,'\\"')+'"' , $port]
501
+ args = [ 'emu', "\"#{$wm_emulator}\"", '"'+$appname.gsub(/"/,'\\"')+'"', '"'+$srcdir.gsub(/"/,'\\"')+'"', '"'+((not $use_re_runtime.nil?) ? $srcdir + '/../' + $appname + '.lnk' : $startdir + "/" + $vcbindir + "/#{$sdk}" + "/rhodes/Release/" + $appname + ".exe").gsub(/"/,'\\"')+'"' , $port]
505
502
  Jake.run2( detool, args, {:nowait => false})
506
503
  end
507
504
 
@@ -543,19 +540,19 @@ namespace "run" do
543
540
  sleep(1)
544
541
  end
545
542
 
546
- if $webkit_capability
543
+ if $webkit_capability and ($use_re_runtime.nil?)
547
544
  wk_args = [ 'wk-dev', '"'+ $wk_data_dir.gsub(/"/,'\\"') + '"', '"'+ $appname + '"']
548
545
  Jake.run2( detool, wk_args, {:nowait => false})
549
546
  end
550
547
 
551
- #if $additional_dlls_paths
552
- # $additional_dlls_paths.each do |path|
553
- # add_files_args = [ 'wk-dev', '"'+ path.gsub(/"/,'\\"') + '"', '"'+ $appname + '"']
554
- # Jake.run2( detool, add_files_args, {:nowait => false})
555
- # end
556
- #end
548
+ if $additional_dlls_paths
549
+ $additional_dlls_paths.each do |path|
550
+ add_files_args = [ 'wk-dev', '"'+ path.gsub(/"/,'\\"') + '"', '"'+ $appname + '"']
551
+ Jake.run2( detool, add_files_args, {:nowait => false})
552
+ end
553
+ end
557
554
 
558
- args = [ 'dev', '"'+$appname.gsub(/"/,'\\"')+'"', '"'+$srcdir.gsub(/"/,'\\"')+'"', '"'+($startdir + "/" + $vcbindir + "/#{$sdk}" + "/rhodes/Release/" + $appname + ".exe").gsub(/"/,'\\"')+'"', $port ]
555
+ args = [ 'dev', '"'+$appname.gsub(/"/,'\\"')+'"', '"'+$srcdir.gsub(/"/,'\\"')+'"', '"'+((not $use_re_runtime.nil?) ? $srcdir + '/../' + $appname + '.lnk' : $startdir + "/" + $vcbindir + "/#{$sdk}" + "/rhodes/Release/" + $appname + ".exe").gsub(/"/,'\\"')+'"', $port ]
559
556
  Jake.run2( detool, args, {:nowait => false})
560
557
  end
561
558
 
@@ -648,14 +645,14 @@ namespace "run" do
648
645
  end
649
646
 
650
647
  namespace "device" do
651
- desc "Build, install .cab and run on the Windows Phone"
648
+ desc "Build, install .cab and run on the Windows Mobile device"
652
649
  task :cab => ["device:wm:production"] do
653
650
  # kill all running detool
654
651
  kill_detool
655
652
 
656
653
  cd $startdir + "/res/build-tools"
657
654
  detool = "detool.exe"
658
- args = ['devcab', $targetdir + '/' + $appname + ".cab", $appname, $port]
655
+ args = ['devcab', $targetdir + '/' + $appname + ".cab", $appname, (($use_re_runtime.nil?) ? "0" : "1")]
659
656
  puts "\nStarting application on the device"
660
657
  puts "Please, connect you device via ActiveSync.\n\n"
661
658
  log_file = gelLogPath
@@ -673,7 +670,7 @@ namespace "run" do
673
670
 
674
671
  cd $startdir + "/res/build-tools"
675
672
  detool = "detool.exe"
676
- args = ['emucab', "\"#{$wm_emulator}\"", $targetdir + '/' + $appname + ".cab", $appname, $port]
673
+ args = ['emucab', "\"#{$wm_emulator}\"", $targetdir + '/' + $appname + ".cab", $appname, (($use_re_runtime.nil?) ? "0" : "1")]
677
674
  log_file = gelLogPath
678
675
 
679
676
  Jake.run2( detool, ['log', log_file, $port], {:nowait => true})