rhodes 5.5.0.7 → 5.5.0.22
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.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +1 -1
- data/CREDITS +3 -3
- data/Rakefile +24 -0
- data/extensions/instrumentation/ext/platform/android/src/com/rho/instrumentation/Instrumentation.java +5 -0
- data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/Rakefile +1 -1
- data/lib/build/jake.rb +5 -0
- data/lib/commonAPI/clipboard/ext.yml +17 -0
- data/lib/commonAPI/clipboard/ext/Clipboard.xml +49 -0
- data/lib/commonAPI/clipboard/ext/build +19 -0
- data/lib/commonAPI/clipboard/ext/build.bat +29 -0
- data/lib/commonAPI/clipboard/ext/platform/android/Rakefile +141 -0
- data/lib/commonAPI/clipboard/ext/platform/android/ext_java.files +9 -0
- data/lib/commonAPI/clipboard/ext/platform/android/ext_native.files +7 -0
- data/lib/commonAPI/clipboard/ext/platform/android/jni/Clipboard_impl.cpp +61 -0
- data/lib/commonAPI/clipboard/ext/platform/android/src/com/rho/clipboard/Clipboard.java +15 -0
- data/lib/commonAPI/clipboard/ext/platform/android/src/com/rho/clipboard/ClipboardFactory.java +18 -0
- data/lib/commonAPI/clipboard/ext/platform/android/src/com/rho/clipboard/ClipboardSingleton.java +146 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/Clipboard.xcodeproj/project.pbxproj +368 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/Clipboard_Prefix.pch +7 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/Rakefile +73 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/Clipboard.h +11 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/Clipboard.m +12 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/ClipboardFactorySingleton.m +16 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/ClipboardSetup.m +9 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/ClipboardSingleton.h +18 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/ClipboardSingleton.m +43 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/readme.txt +7 -0
- data/lib/commonAPI/coreapi/ext/NativeTabbar.xml +3 -3
- data/lib/commonAPI/coreapi/ext/shared/TimerImpl.cpp +36 -27
- data/lib/commonAPI/coreapi/public/api/rhoapi-force.ajax.js +3 -1
- data/lib/commonAPI/coreapi/public/api/rhoapi.js +2 -1
- data/lib/commonAPI/devicesecurity/ext.yml +11 -0
- data/lib/commonAPI/devicesecurity/ext/DeviceSecurity.xml +91 -0
- data/lib/commonAPI/devicesecurity/ext/build +19 -0
- data/lib/commonAPI/devicesecurity/ext/build.bat +29 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/InbuiltValues.erb +16 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/Rakefile +166 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/ext_java.files +10 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/ext_native.files +7 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/jni/DeviceSecurity_impl.cpp +61 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/src/com/rho/devicesecurity/DeviceSecurity.java +14 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/src/com/rho/devicesecurity/DeviceSecurityFactory.java +18 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/src/com/rho/devicesecurity/DeviceSecuritySingleton.java +412 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/DeviceSecurity.xcodeproj/project.pbxproj +368 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/DeviceSecurity_Prefix.pch +7 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/Rakefile +73 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecurity.h +11 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecurity.m +12 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecurityFactorySingleton.m +16 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecuritySetup.m +9 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecuritySingleton.h +19 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecuritySingleton.m +106 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/readme.txt +7 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +5 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/Utils.java +9 -0
- data/platform/android/build/android.rake +42 -1
- data/platform/android/build/androidcommon.rb +4 -2
- data/platform/iphone/Classes/RhoWKWebView.m +4 -0
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.h +2 -0
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +195 -30
- data/platform/iphone/Classes/rho/net/IPhoneNetRequest.mm +91 -4
- data/platform/iphone/rbuild/iphone.rake +297 -231
- data/platform/iphone/rbuild/putsOverride.rake +8 -0
- data/platform/shared/common/RhoTime.cpp +81 -40
- data/platform/shared/common/RhodesApp.cpp +16 -18
- data/platform/shared/db/DBAdapter.cpp +33 -0
- data/platform/shared/db/DBAdapter.h +5 -0
- data/platform/shared/net/HttpServer.cpp +27 -1
- data/platform/shared/net/INetRequest.cpp +33 -6
- data/platform/shared/qt/rhodes/qkineticscroller.cpp +2 -2
- data/platform/shared/qt/rhodes/qkineticscroller_p.h +1 -1
- data/platform/shared/qt/rhodes/qtscrollerfilter.cpp +3 -3
- data/platform/shared/qt/rhodes/qtscrollevent.cpp +2 -2
- data/platform/shared/qt/rhodes/qwebviewkineticscroller.cpp +1 -1
- data/platform/shared/qt/rhodes/qwebviewkineticscroller.h +1 -1
- data/platform/wm/build/wm.rake +7 -3
- data/platform/wm/rhodes/browser/BrowserFactory.cpp +4 -6
- data/platform/wm/rhodes/browser/stubs.cpp +5 -0
- data/platform/wm/rhodes/rhodes.vcproj +31 -2
- data/rakefile.rb +24 -0
- data/res/generators/templates/application/app/Settings/home.erb +1 -1
- data/res/generators/templates/application/build.yml +61 -4
- data/res/generators/templates/application/icon/icon.png +0 -0
- data/res/generators/templates/application/icon/icon114.png +0 -0
- data/res/generators/templates/application/icon/icon120.png +0 -0
- data/res/generators/templates/application/icon/icon144.png +0 -0
- data/res/generators/templates/application/icon/icon152.png +0 -0
- data/res/generators/templates/application/icon/icon180.png +0 -0
- data/res/generators/templates/application/icon/icon57.png +0 -0
- data/res/generators/templates/application/icon/icon60.png +0 -0
- data/res/generators/templates/application/icon/icon72.png +0 -0
- data/res/generators/templates/application/icon/icon76.png +0 -0
- data/res/generators/templates/application/production/iTunesArtwork.png +0 -0
- data/res/generators/templates/application/production/iTunesArtwork@2x.png +0 -0
- data/res/generators/templates/iphone_project/Bremen7.xcodeproj/project.pbxproj +1 -0
- data/res/generators/templates/iphone_project/buildRhoBundle +23 -7
- data/res/generators/templates/iphone_project/root/Info.plist +0 -2
- data/res/generators/templates/iphone_project/root/iTunesArtwork +0 -0
- data/res/generators/templates/iphone_project/root/iTunesArtwork@2x +0 -0
- data/res/generators/templates/iphone_project/root/icon114.png +0 -0
- data/res/generators/templates/iphone_project/root/icon120.png +0 -0
- data/res/generators/templates/iphone_project/root/icon144.png +0 -0
- data/res/generators/templates/iphone_project/root/icon152.png +0 -0
- data/res/generators/templates/iphone_project/root/icon180.png +0 -0
- data/res/generators/templates/iphone_project/root/icon57.png +0 -0
- data/res/generators/templates/iphone_project/root/icon60.png +0 -0
- data/res/generators/templates/iphone_project/root/icon72.png +0 -0
- data/res/generators/templates/iphone_project/root/icon76.png +0 -0
- data/res/generators/templates/iphone_project/root/rhorunner_development.entitlements +6 -0
- data/rhodes.gemspec +19 -17
- data/version +1 -1
- metadata +118 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b59d660eec4516c51b9d05121cf3ec2a002447c8
|
4
|
+
data.tar.gz: 3dff6eb9aaf1b99bdbc1e73a7391b7505952e4e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e9dfe2d490773cb366588e3b30c65d4a3781918b50b70fc34b36e9e8d60a1adedb4d38f5303ef68430ae0f21b86641f793787ede5df479441622b3afc436e6b
|
7
|
+
data.tar.gz: 3b2b2095210b17c711bb34a6d0de3136b42669fea381dc11d24cf8e34d33441ae098d51bca8c829dee53ee9b87352c92dbe7dc52bb768819747c54c687e84b3e
|
data/CONTRIBUTING.md
CHANGED
@@ -4,7 +4,7 @@ Found an issue with Rhodes, give feedback or provide a patch? Here's how!
|
|
4
4
|
|
5
5
|
## Reporting issues
|
6
6
|
|
7
|
-
We only accept issues that are bug reports or feature requests. Bugs must be isolated and reproducible problems that we can fix within Rhodes. For application-specific or API-related questions, please visit our [
|
7
|
+
We only accept issues that are bug reports or feature requests. Bugs must be isolated and reproducible problems that we can fix within Rhodes. For application-specific or API-related questions, please visit our [Forums](http://forums.tau-technologies.com). Please read the following guidelines before opening any issue.
|
8
8
|
|
9
9
|
1. **Search for existing issues.** We sometimes get duplicate issues, and you'd help us out a lot by first checking if someone else has reported the same issue. Moreover, the issue may have already been resolved with a fix available.
|
10
10
|
2. **Create an isolated and reproducible test case.** Be sure the problem exists in Rhodes' code.
|
data/CREDITS
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
This media, software or hardware ("Product") obtained from Tau, Inc. ("Tau") may include Tau?
|
1
|
+
This media, software or hardware ("Product") obtained from Tau Technologies, Inc. ("Tau") may include Tau?
|
2
2
|
Software, Third Party Software (defined below), and/or Open Source Software
|
3
3
|
(defined below).
|
4
4
|
|
@@ -9,9 +9,9 @@ more agreements in force between the purchaser of the Tau
|
|
9
9
|
Product or licensee of the Tau Software and Tau. SOFTWARE IS PROTECTED BY U.S. COPYRIGHT LAWS AND INTERNATIONAL
|
10
10
|
LAWS AND TREATIES. UNAUTHORIZED COPYING, DISTRIBUTION OR OTHER USE OF
|
11
11
|
THIS PRODUCT IS STRICTLY PROHIBITED. ANY DISTRIBUTION OR USE NOT
|
12
|
-
SPECIFICALLY APPROVED BY
|
12
|
+
SPECIFICALLY APPROVED BY TAU IS STRICTLY PROHIBITED.
|
13
13
|
|
14
|
-
Tau
|
14
|
+
Tau Software is subject to the commercial terms and
|
15
15
|
conditions entered into with Tau, any other use is strictly
|
16
16
|
prohibited. Commercial Software licensed for redistribution by Tau ("Third Party Software") is subject to the terms and conditions
|
17
17
|
in force between Tau and the licensor of the Third party
|
data/Rakefile
CHANGED
@@ -74,6 +74,7 @@ end
|
|
74
74
|
#------------------------------------------------------------------------
|
75
75
|
|
76
76
|
$app_basedir = pwd
|
77
|
+
$is_webkit_engine = false
|
77
78
|
$startdir = File.dirname(__FILE__)
|
78
79
|
$startdir.gsub!('\\', '/')
|
79
80
|
|
@@ -2125,6 +2126,8 @@ namespace "config" do
|
|
2125
2126
|
# $app_config["extensions"].delete("audiocapture")
|
2126
2127
|
#end
|
2127
2128
|
|
2129
|
+
$app_config['extensions'].delete('barcode') if ( $app_config['extensions'].index('enterprise-barcode') || $app_config['extensions'].index('allbarcode') )
|
2130
|
+
|
2128
2131
|
$hidden_app = $app_config["hidden_app"].nil?() ? "0" : $app_config["hidden_app"]
|
2129
2132
|
|
2130
2133
|
#application build configs
|
@@ -2484,6 +2487,10 @@ def init_extensions(dest, mode = "")
|
|
2484
2487
|
|
2485
2488
|
$app_config["extensions"].each do |extname|
|
2486
2489
|
puts 'ext - ' + extname
|
2490
|
+
|
2491
|
+
if extname == "webkit"
|
2492
|
+
$is_webkit_engine = true
|
2493
|
+
end
|
2487
2494
|
|
2488
2495
|
extpath = nil
|
2489
2496
|
extpaths.each do |p|
|
@@ -2668,6 +2675,23 @@ def init_extensions(dest, mode = "")
|
|
2668
2675
|
|
2669
2676
|
end
|
2670
2677
|
|
2678
|
+
stubs = File.join($startdir, "platform", "wm", "rhodes", "browser", "stubs.cpp")
|
2679
|
+
if $is_webkit_engine == false
|
2680
|
+
File.open(stubs, "w+") do |f|
|
2681
|
+
f.puts "// WARNING! THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT IT MANUALLY!"
|
2682
|
+
f.puts "#include \"StdAfx.h\""
|
2683
|
+
f.puts "#include \"common/RhoStd.h\""
|
2684
|
+
f.puts "#include \"IBrowserEngine.h\""
|
2685
|
+
f.puts "rho::IBrowserEngine* rho_wmimpl_get_webkitBrowserEngine(HWND hwndParent, HINSTANCE rhoAppInstance) {return 0;}"
|
2686
|
+
Jake.modify_file_if_content_changed( stubs, f )
|
2687
|
+
end
|
2688
|
+
else
|
2689
|
+
File.open(stubs, "w+") do |f|
|
2690
|
+
f.puts "// WARNING! THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT IT MANUALLY!"
|
2691
|
+
f.puts "#include \"StdAfx.h\""
|
2692
|
+
Jake.modify_file_if_content_changed( stubs, f )
|
2693
|
+
end
|
2694
|
+
end
|
2671
2695
|
|
2672
2696
|
if ($ruby_only_extensions_list)
|
2673
2697
|
BuildOutput.warning([
|
@@ -402,4 +402,9 @@ public class Instrumentation extends InstrumentationBase implements IInstrumenta
|
|
402
402
|
// TODO Auto-generated method stub
|
403
403
|
return false;
|
404
404
|
}
|
405
|
+
|
406
|
+
@Override
|
407
|
+
public boolean onLoadResource(IRhoExtManager extManager, String url, IRhoWebView ext, boolean res) {
|
408
|
+
return false;
|
409
|
+
}
|
405
410
|
}
|
@@ -21,7 +21,7 @@ ARGS = [
|
|
21
21
|
"-I\"#{$rootdir}/platform/android/Rhodes/jni/include\"",
|
22
22
|
"-I\"#{$rootdir}/platform/android/Rhodes/jni/include/rhodes/details\"",
|
23
23
|
"-I\"#{$rootdir}/platform/shared/ruby/include\"",
|
24
|
-
"-I\"#{$rootdir}/lib/
|
24
|
+
"-I\"#{$rootdir}/lib/commonAPI/coreapi/ext/shared\"",
|
25
25
|
"-I\"#{$rootdir}/platform/shared\"",
|
26
26
|
"-I\"#{$rootdir}/platform/shared/common\"",
|
27
27
|
"-I\"#{$rootdir}/platform/shared/api_generator\"",
|
data/lib/build/jake.rb
CHANGED
@@ -876,6 +876,11 @@ class Jake
|
|
876
876
|
app_version += "\r\napp_name='#{$app_config["name"]}'"
|
877
877
|
app_version += "\r\ntitle_text='#{$app_config["name"]}'" if $current_platform == "win32"
|
878
878
|
app_version += "\r\norg_name='#{$app_config["vendor"]}'" if $current_platform == "win32"
|
879
|
+
app_version += "\r\nrho_app_id='#{$app_config["rho_app_id"]}'" if $app_config['rho_app_id']
|
880
|
+
|
881
|
+
if $is_webkit_engine == true
|
882
|
+
File.open(File.join($srcdir,'apps/rhoconfig.txt'), "a"){ |f| f.write("\r\nwebengine=webkit") }
|
883
|
+
end
|
879
884
|
|
880
885
|
File.open(File.join($srcdir,'apps/rhoconfig.txt'), "a"){ |f| f.write(app_version) }
|
881
886
|
File.open(File.join($srcdir,'apps/rhoconfig.txt.timestamp'), "w"){ |f| f.write(Time.now.to_f().to_s()) }
|
@@ -0,0 +1,17 @@
|
|
1
|
+
entry: Init_Clipboard_extension
|
2
|
+
javaentry: com.clipboard.Clipboard
|
3
|
+
libraries: ["Clipboard"]
|
4
|
+
android:
|
5
|
+
source_list: ext/platform/android/ext_java.files
|
6
|
+
exttype: rakefile
|
7
|
+
wp8:
|
8
|
+
csharp_impl: yes
|
9
|
+
root_namespace: rho
|
10
|
+
|
11
|
+
project_paths:
|
12
|
+
wp8: ext/platform/wp8/ClipboardLib.vcxproj
|
13
|
+
wm: ext/platform/wm/Clipboard.vcproj
|
14
|
+
|
15
|
+
xml_api_paths: ext/Clipboard.xml
|
16
|
+
|
17
|
+
platforms: ["iphone", "android"]
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<?xml version = "1.0"?>
|
2
|
+
<?xml-stylesheet type="text/xsl" href="pb_help.xsl"?>
|
3
|
+
<API>
|
4
|
+
<MODULE name="Clipboard" parent="Rho">
|
5
|
+
<HELP_OVERVIEW>Clipboard API</HELP_OVERVIEW>
|
6
|
+
<MORE_HELP>API for working with device's Clipboard</MORE_HELP>
|
7
|
+
|
8
|
+
|
9
|
+
<PROPERTIES>
|
10
|
+
</PROPERTIES>
|
11
|
+
|
12
|
+
<METHODS>
|
13
|
+
|
14
|
+
<METHOD name="getText" access="STATIC">
|
15
|
+
<DESC>return text contain in Clipboard</DESC>
|
16
|
+
<PLATFORM>iOS,Android</PLATFORM>
|
17
|
+
<RETURN type="STRING">
|
18
|
+
</RETURN>
|
19
|
+
</METHOD>
|
20
|
+
|
21
|
+
<METHOD name="hasText" access="STATIC">
|
22
|
+
<DESC>return true if Clipboard contain some text</DESC>
|
23
|
+
<PLATFORM>iOS,Android</PLATFORM>
|
24
|
+
<RETURN type="BOOLEAN"/>
|
25
|
+
</METHOD>
|
26
|
+
|
27
|
+
<METHOD name="setText" access="STATIC">
|
28
|
+
<DESC>put text to Clipboard</DESC>
|
29
|
+
<PLATFORM>iOS,Android</PLATFORM>
|
30
|
+
<PARAMS>
|
31
|
+
<PARAM name="text" type="STRING">
|
32
|
+
</PARAM>
|
33
|
+
</PARAMS>
|
34
|
+
</METHOD>
|
35
|
+
|
36
|
+
<METHOD name="clear" access="STATIC">
|
37
|
+
<PLATFORM>iOS,Android</PLATFORM>
|
38
|
+
<DESC>clear Clipboard</DESC>
|
39
|
+
</METHOD>
|
40
|
+
|
41
|
+
</METHODS>
|
42
|
+
|
43
|
+
<USER_OVERVIEW>
|
44
|
+
</USER_OVERVIEW>
|
45
|
+
|
46
|
+
<VER_INTRODUCED>1.0.0</VER_INTRODUCED>
|
47
|
+
<PLATFORM>iOS,Android</PLATFORM>
|
48
|
+
</MODULE>
|
49
|
+
</API>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
|
4
|
+
if [ "$RHO_PLATFORM" = "android" ]; then
|
5
|
+
|
6
|
+
cd platform/android
|
7
|
+
rake --trace
|
8
|
+
|
9
|
+
elif [ "$RHO_PLATFORM" = "iphone" ]; then
|
10
|
+
|
11
|
+
cd platform/iphone
|
12
|
+
rake --trace
|
13
|
+
|
14
|
+
elif [ "$RHO_PLATFORM" = "osx" ]; then
|
15
|
+
|
16
|
+
cd platform/qt
|
17
|
+
rake --trace
|
18
|
+
|
19
|
+
fi
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
if "%RHO_PLATFORM%" == "android" (
|
3
|
+
|
4
|
+
cd platform\android
|
5
|
+
rake --trace
|
6
|
+
|
7
|
+
)
|
8
|
+
|
9
|
+
if "%RHO_PLATFORM%" == "iphone" (
|
10
|
+
|
11
|
+
cd platform\phone
|
12
|
+
rake --trace
|
13
|
+
|
14
|
+
)
|
15
|
+
|
16
|
+
if "%RHO_PLATFORM%" == "win32" (
|
17
|
+
|
18
|
+
call "%RHO_VSCMNTOOLS%..\..\VC\vcvarsall.bat" x86
|
19
|
+
cd platform\qt
|
20
|
+
rake --trace
|
21
|
+
|
22
|
+
)
|
23
|
+
|
24
|
+
if "%RHO_PLATFORM%" == "bb" (
|
25
|
+
|
26
|
+
cd platform\bb
|
27
|
+
rake --trace
|
28
|
+
|
29
|
+
)
|
@@ -0,0 +1,141 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
SOURCEPATH = ENV['SOURCEPATH']
|
4
|
+
raise 'SOURCEPATH is not set' if SOURCEPATH.nil?
|
5
|
+
|
6
|
+
SOURCELIST = ENV['SOURCELIST']
|
7
|
+
raise 'SOURCELIS is not setT' if SOURCELIST.nil?
|
8
|
+
|
9
|
+
BUILDARGS = ENV['BUILDARGS'].split if ENV['BUILDARGS']
|
10
|
+
|
11
|
+
TARGETDIR = ENV['TARGETPATH']
|
12
|
+
raise "TARGETPATH is not set" if TARGETDIR.nil?
|
13
|
+
|
14
|
+
TARGETLIB = ENV['TARGETLIB']
|
15
|
+
raise "TARGETLIB is not set" if TARGETLIB.nil?
|
16
|
+
|
17
|
+
OBJDIR = ENV['TEMP_FILES_DIR']
|
18
|
+
raise "TEMP_FILES_DIR is not set" if OBJDIR.nil?
|
19
|
+
|
20
|
+
$rootdir = ENV['RHO_ROOT']
|
21
|
+
raise "RHO_ROOT is not set" if $rootdir.nil?
|
22
|
+
|
23
|
+
$appincdir = ENV["RHO_INC"]
|
24
|
+
raise "RHO_INC is not set" if $appincdir.nil?
|
25
|
+
|
26
|
+
ANDROID_NDK = ENV['ANDROID_NDK']
|
27
|
+
raise 'ANDROID_NDK is not set' if ANDROID_NDK.nil?
|
28
|
+
|
29
|
+
ANDROID_API_LEVEL = ENV['ANDROID_API_LEVEL']
|
30
|
+
raise 'ANDROID_API_LEVEL is not set' if ANDROID_API_LEVEL.nil?
|
31
|
+
|
32
|
+
$debug = ENV['RHO_DEBUG'] == 'true'
|
33
|
+
|
34
|
+
cd SOURCEPATH
|
35
|
+
|
36
|
+
require File.join($rootdir, 'platform/android/build/androidcommon.rb')
|
37
|
+
|
38
|
+
ARGS = ['-Iext/platform/android/generated/jni',
|
39
|
+
'-Iext/platform/android/jni',
|
40
|
+
'-Iext/shared',
|
41
|
+
"-I\"#{$rootdir}/platform/android/Rhodes/jni/include\"",
|
42
|
+
"-I\"#{$rootdir}/platform/android/Rhodes/jni/include/rhodes/details\"",
|
43
|
+
"-I\"#{$rootdir}/platform/shared/ruby/include\"",
|
44
|
+
"-I\"#{$rootdir}/platform/shared\"",
|
45
|
+
"-I\"#{$rootdir}/platform/shared/common\"",
|
46
|
+
"-I\"#{$rootdir}/platform/shared/api_generator\"",
|
47
|
+
"-I\"#{$appincdir}\"",
|
48
|
+
"-I\"#{$rootdir}/platform/shared/ruby\"",
|
49
|
+
"-I\"#{$rootdir}/platform/shared/ruby/android\"",
|
50
|
+
"-I\"#{$rootdir}/platform/shared/ruby/generated\""]
|
51
|
+
|
52
|
+
OBJDIR_ARM = File.join(OBJDIR,'arm')
|
53
|
+
OBJDIR_x86 = File.join(OBJDIR,'x86')
|
54
|
+
OBJDIR_MIPS = File.join(OBJDIR,'mips')
|
55
|
+
|
56
|
+
|
57
|
+
SRC = get_sources File.join(SOURCELIST)
|
58
|
+
|
59
|
+
OBJ_ARM = FileList.new(get_objects(SRC, OBJDIR_ARM))
|
60
|
+
OBJ_x86 = FileList.new(get_objects(SRC, OBJDIR_x86))
|
61
|
+
OBJ_MIPS = FileList.new(get_objects(SRC, OBJDIR_MIPS))
|
62
|
+
|
63
|
+
TARGETDIR_ARM = File.join(TARGETDIR,'armeabi')
|
64
|
+
TARGETDIR_x86 = File.join(TARGETDIR,'x86')
|
65
|
+
TARGETDIR_MIPS = File.join(TARGETDIR,'mips')
|
66
|
+
|
67
|
+
TARGETLIB_ARM = File.join(TARGETDIR_ARM,TARGETLIB)
|
68
|
+
TARGETLIB_x86 = File.join(TARGETDIR_x86,TARGETLIB)
|
69
|
+
TARGETLIB_MIPS = File.join(TARGETDIR_MIPS,TARGETLIB)
|
70
|
+
|
71
|
+
cd '../../..'
|
72
|
+
|
73
|
+
namespace 'config' do
|
74
|
+
task :arm do
|
75
|
+
setup_ndk(ANDROID_NDK, ANDROID_API_LEVEL,'arm')
|
76
|
+
end
|
77
|
+
|
78
|
+
task :x86 do
|
79
|
+
setup_ndk(ANDROID_NDK, ANDROID_API_LEVEL,'x86')
|
80
|
+
end
|
81
|
+
|
82
|
+
task :mips do
|
83
|
+
setup_ndk(ANDROID_NDK, ANDROID_API_LEVEL,'mips')
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
directory TARGETDIR_ARM
|
88
|
+
directory TARGETDIR_x86
|
89
|
+
directory TARGETDIR_MIPS
|
90
|
+
directory OBJDIR_ARM
|
91
|
+
directory OBJDIR_x86
|
92
|
+
directory OBJDIR_MIPS
|
93
|
+
|
94
|
+
rule '.o' => lambda {|obj| find_source(obj) } do |t|
|
95
|
+
abi = File.basename(File.dirname(t.name))
|
96
|
+
Rake::Task["config:#{abi}"].invoke
|
97
|
+
cc_compile(find_source(t.name), File.dirname(t.name), BUILDARGS.nil? ? ARGS : BUILDARGS) or raise "\e[31mCompilation failed: #{find_source(t.name)}\e[0m"
|
98
|
+
end
|
99
|
+
|
100
|
+
task OBJ_ARM => OBJDIR_ARM
|
101
|
+
task OBJ_x86 => OBJDIR_x86
|
102
|
+
task OBJ_MIPS => OBJDIR_MIPS
|
103
|
+
|
104
|
+
def find_source(objfile)
|
105
|
+
base = File.basename(objfile, '.o')
|
106
|
+
src = SRC.find { |s| File.basename(s) == base }
|
107
|
+
src
|
108
|
+
end
|
109
|
+
|
110
|
+
file TARGETLIB_ARM => TARGETDIR_ARM do |t|
|
111
|
+
Rake::Task["config:arm"].invoke
|
112
|
+
cc_ar t.name, OBJ_ARM or raise "\e[31mCreating library failed: #{t.name}\e[0m"
|
113
|
+
end
|
114
|
+
multitask TARGETLIB_ARM => OBJ_ARM
|
115
|
+
|
116
|
+
file TARGETLIB_x86 => TARGETDIR_x86 do |t|
|
117
|
+
Rake::Task["config:x86"].invoke
|
118
|
+
cc_ar t.name, OBJ_x86 or raise "\e[31mCreating library failed: #{t.name}\e[0m"
|
119
|
+
end
|
120
|
+
multitask TARGETLIB_x86 => OBJ_x86
|
121
|
+
|
122
|
+
file TARGETLIB_MIPS => TARGETDIR_MIPS do |t|
|
123
|
+
Rake::Task["config:mips"].invoke
|
124
|
+
cc_ar t.name, OBJ_MIPS or raise "\e[31mCreating library failed: #{t.name}\e[0m"
|
125
|
+
end
|
126
|
+
multitask TARGETLIB_MIPS => OBJ_MIPS
|
127
|
+
|
128
|
+
|
129
|
+
namespace 'build' do
|
130
|
+
task :arm => OBJ_ARM
|
131
|
+
task :x86 => OBJ_x86
|
132
|
+
task :mips => OBJ_MIPS
|
133
|
+
end
|
134
|
+
|
135
|
+
namespace 'arch' do
|
136
|
+
task :arm => TARGETLIB_ARM
|
137
|
+
task :x86 => TARGETLIB_x86
|
138
|
+
task :mips => TARGETLIB_MIPS
|
139
|
+
end
|
140
|
+
|
141
|
+
task :default => ["arch:arm"]
|
@@ -0,0 +1,9 @@
|
|
1
|
+
ext/platform/android/generated/src/com/rho/clipboard/ClipboardBase.java
|
2
|
+
ext/platform/android/generated/src/com/rho/clipboard/ClipboardFactorySingleton.java
|
3
|
+
ext/platform/android/generated/src/com/rho/clipboard/ClipboardSingletonBase.java
|
4
|
+
ext/platform/android/generated/src/com/rho/clipboard/IClipboard.java
|
5
|
+
ext/platform/android/generated/src/com/rho/clipboard/IClipboardFactory.java
|
6
|
+
ext/platform/android/generated/src/com/rho/clipboard/IClipboardSingleton.java
|
7
|
+
ext/platform/android/src/com/rho/clipboard/Clipboard.java
|
8
|
+
ext/platform/android/src/com/rho/clipboard/ClipboardFactory.java
|
9
|
+
ext/platform/android/src/com/rho/clipboard/ClipboardSingleton.java
|
@@ -0,0 +1,7 @@
|
|
1
|
+
ext/platform/android/generated/jni/Clipboard.cpp
|
2
|
+
ext/platform/android/generated/jni/clipboard_ruby_wrap.cpp
|
3
|
+
ext/platform/android/generated/jni/clipboard_js_wrap.cpp
|
4
|
+
ext/platform/android/jni/Clipboard_impl.cpp
|
5
|
+
ext/shared/generated/clipboard_api_init.cpp
|
6
|
+
ext/shared/generated/clipboard_js_api.cpp
|
7
|
+
ext/shared/generated/clipboard_ruby_api.c
|
@@ -0,0 +1,61 @@
|
|
1
|
+
#include "rhodes.h"
|
2
|
+
#include "Clipboard.h"
|
3
|
+
|
4
|
+
#include "logging/RhoLog.h"
|
5
|
+
#undef DEFAULT_LOGCATEGORY
|
6
|
+
#define DEFAULT_LOGCATEGORY "Clipboard_impl"
|
7
|
+
|
8
|
+
#define CLIPBOARD_FACTORY_CLASS "com.rho.clipboard.ClipboardFactory"
|
9
|
+
|
10
|
+
extern "C" void Init_Clipboard_API(void);
|
11
|
+
|
12
|
+
extern "C" void Init_Clipboard(void)
|
13
|
+
{
|
14
|
+
RAWTRACE(__FUNCTION__);
|
15
|
+
|
16
|
+
JNIEnv *env = jnienv();
|
17
|
+
if(env)
|
18
|
+
{
|
19
|
+
jclass cls = rho_find_class(env, CLIPBOARD_FACTORY_CLASS);
|
20
|
+
if(!cls)
|
21
|
+
{
|
22
|
+
RAWLOG_ERROR1("Failed to find java class: %s", CLIPBOARD_FACTORY_CLASS);
|
23
|
+
return;
|
24
|
+
}
|
25
|
+
jmethodID midFactory = env->GetMethodID(cls, "<init>", "()V");
|
26
|
+
if(!midFactory)
|
27
|
+
{
|
28
|
+
RAWLOG_ERROR1("Failed to get constructor for java class %s", CLIPBOARD_FACTORY_CLASS);
|
29
|
+
return;
|
30
|
+
}
|
31
|
+
jobject jFactory = env->NewObject(cls, midFactory);
|
32
|
+
if(env->IsSameObject(jFactory, NULL))
|
33
|
+
{
|
34
|
+
RAWLOG_ERROR1("Failed to create %s instance", CLIPBOARD_FACTORY_CLASS);
|
35
|
+
return;
|
36
|
+
}
|
37
|
+
|
38
|
+
RAWTRACE("Initializing Java factory");
|
39
|
+
|
40
|
+
rho::CClipboardBase::setJavaFactory(env, jFactory);
|
41
|
+
|
42
|
+
RAWTRACE("Deleting JNI reference");
|
43
|
+
|
44
|
+
env->DeleteLocalRef(jFactory);
|
45
|
+
|
46
|
+
RAWTRACE("Initializing API");
|
47
|
+
|
48
|
+
Init_Clipboard_API();
|
49
|
+
|
50
|
+
RAWTRACE("Init_Clipboard succeeded");
|
51
|
+
}
|
52
|
+
else
|
53
|
+
{
|
54
|
+
RAWLOG_ERROR("Failed to initialize Clipboard API: jnienv() is failed");
|
55
|
+
}
|
56
|
+
|
57
|
+
}
|
58
|
+
|
59
|
+
extern "C" void Init_Clipboard_extension() {
|
60
|
+
Init_Clipboard();
|
61
|
+
}
|