<td>0.1.0</td>
<td>2015-05-15</td>
<td>Initial Draft</td>
-<td>Wojciech Kosowicz<br><a href="mailto:w.kosowicz@samsung.com">w.kosowicz@samsung.com</a></td>
+<td>Wojciech Kosowicz<br><a href="mailto:w.kosowicz@samsung.com">w.kosowicz@samsung.com</a></td>
</tr>
<tr>
<td>0.2.0</td>
<td>2015-05-22</td>
<td>Extended version</td>
-<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
+<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
</tr>
<tr>
<td>0.2.1</td>
<td>2015-06-01</td>
<td>Proofreading</td>
-<td>Rafal Galka<br><a href="mailto:r.galka@samsung.com">r.galka@samsung.com</a></td>
+<td>Rafal Galka<br><a href="mailto:r.galka@samsung.com">r.galka@samsung.com</a></td>
</tr>
<tr>
<td>0.3.0</td>
<td>2015-06-08</td>
<td>Supplemented C++ implementation guide</td>
-<td>Rafal Galka<br><a href="mailto:r.galka@samsung.com">r.galka@samsung.com</a></td>
+<td>Rafal Galka<br><a href="mailto:r.galka@samsung.com">r.galka@samsung.com</a></td>
</tr>
<tr>
<td>0.4.0</td>
<td>2015-06-16</td>
<td>Guideline</td>
-<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
+<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
</tr>
<tr>
<td>0.5.0</td>
<td>2015-06-18</td>
<td>Devel package</td>
-<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
+<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
</tr>
<tr>
<td>0.5.1</td>
<td>2015-06-24</td>
<td>Add info about WAPIOven.py</td>
-<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
+<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">p.kaczmarek3@samsung.com</a></td>
+</tr>
+<tr>
+<td>0.6.0</td>
+<td>2016-10-28</td>
+<td>update devel package for tizen 3.0</td>
+<td>Annie Park<br><a href="mailto:hj.na.park@samsung.com">hj.na.park@samsung.com</a></td>
</tr>
</tbody>
</table>
<code>tools/skeleton_generator/</code> directory and run the python command:</p>
<pre><code class="lang-sh">$ python WAPIOven.py -d <stub code destination directory name> <widl directory/pluginname>.widl
</code></pre>
-<p>If tizen.widl is needed, add tizen.widl you can use stub generator located in
-<code>tools/skeleton_generator/</code> directory and run the python command:</p>
-<pre><code class="lang-sh">$ python WAPIOven.py -d <stub code destination directory name> <widl directory/pluginname>.widl <widl directory/>tizen.widl
-</code></pre>
-<p>Path to WAPIOven.py:</p>
+<p>If tizen.widl is needed, add tizen.widl</p>
+<pre class="prettyprint linenums"><code>$ python WAPIOven.py -d <stub code destination directory name> <widl directory/pluginname>.widl <widl directory/>tizen.widl
+</code></pre><p>Path to WAPIOven.py:</p>
<pre><code class="lang-sh">$ tools/skeleton_generator/WAPIOven.py
</code></pre>
<p>You need to install jinja2 for WAPIOven.py:</p>
Libs: -L${libdir} -ltizen_common
Cflags: -I${includedir}
</code></pre><h3 id="devel-package/creating-custom-web-device-plugins-module">Creating custom web device plugins module</h3>
-<p>To create custom web device plugins module <code>webapi-plugins.spec</code>, <code>tizen-wrt.gyp</code> and <code>src</code> files are needed.
+<p>To create custom web device plugins module <code>webapi-plugins.spec</code>, <code>tizen-wrt.gyp</code>, <code>webapi-plugins.manifest</code> and <code>src</code> files are needed.
Skeleton below shows the required structure of test module.</p>
<pre><code class="lang-sh">├── packaging
│ └── webapi-plugins.spec
└── src
│ ├── test
-│ ├── test_api.js
-│ ├── test_extension.cc
-│ ├── test_extension.h
-│ ├── test.gyp
-│ ├── test_instance.cc
-│ └── test_instance.h
-└── tizen-wrt.gyp
+│ | ├── test_api.js
+│ | ├── test_extension.cc
+│ | ├── test_extension.h
+│ | ├── test.gyp
+│ | ├── test_instance.cc
+│ | └── test_instance.h
+│ ├── tool
+│ | ├── desc_gentool.cc
+│ | └── tool.gyp
+| └── tizen-wrt.gyp
+└── webapi-plugins.manifest
</code></pre>
<p>webapi-plugins.spec source:</p>
-<pre class="prettyprint linenums"><code>%define _manifestdir %{TZ_SYS_RW_PACKAGES}
+<pre class="prettyprint linenums"><code>%bcond_with wayland
+
+%define _manifestdir %{TZ_SYS_RW_PACKAGES}
%define _desktop_icondir %{TZ_SYS_SHARE}/icons/default/small
%define crosswalk_extensions tizen-extensions-crosswalk
+%define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions}
+
Name: webapi-plugins-test
Version: 0.1
Release: 0
License: Apache-2.0 and BSD-2.0 and MIT
Group: Development/Libraries
-Summary: Tizen Web APIs implemented
+Summary: Tizen Test Web APIs
Source0: %{name}-%{version}.tar.gz
+%ifarch %{arm} aarch64
+# ARM
+%define tizen_is_emulator 0
+%else
+# I586
+%define tizen_is_emulator 1
+%endif
+
BuildRequires: ninja
BuildRequires: pkgconfig(webapi-plugins)
%description
-Tizen Test Web APIs.
+Tizen Test Web APIs
%prep
%setup -q
%build
export GYP_GENERATORS='ninja'
-GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=%{tizen_profile_name} -Dprivilege_engine=%{tizen_privilege_engine}"
-GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=x11"
+GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=%{profile} -Dprivilege_engine=%{tizen_privilege_engine}"
+GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
+GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
+
+# feature flags
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}"
/usr/include/webapi-plugins/tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
ninja -C out/Default %{?_smp_mflags}
%install
-mkdir -p %{buildroot}%{_libdir}/%{crosswalk_extensions}
-install -p -m 644 out/Default/libtizen*.so %{buildroot}%{_libdir}/%{crosswalk_extensions}
+
+# Extensions.
+mkdir -p %{buildroot}%{crosswalk_extensions_path}
+install -p -m 644 out/Default/libwebapis*.so %{buildroot}%{crosswalk_extensions_path}
+
+# execute desc_gentool
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path} out/Default/desc_gentool \
+ %{crosswalk_extensions_path} \
+ %{buildroot}%{crosswalk_extensions_path} > webapis-plugins.json
+
+# temporary plugins description for lazy loading
+install -p -m 644 webapis-plugins.json %{buildroot}%{crosswalk_extensions_path}/webapis-plugins.json
+
%files
-%{_libdir}/%{crosswalk_extensions}/libtizen*.so
+%{crosswalk_extensions_path}/libwebapis*.so
+%{crosswalk_extensions_path}/webapis-plugins.json
+%manifest webapi-plugins.manifest
</code></pre><p>tizen-wrt.gyp source:</p>
<pre class="prettyprint linenums"><code>{
'includes':[
'target_name': 'extensions',
'type': 'none',
'dependencies': [
+ 'tool/tool.gyp:*',
'test/test.gyp:*',
],
'conditions': [],
],
'targets': [
{
- 'target_name': 'tizen_test',
+ 'target_name': 'webapis_test',
'type': 'loadable_module',
'sources': [
'test_api.js',
Custom web device plugins module test is placed in <code>src/</code> directory and contains all required files.
Please see <a href="#plugin-structure">Plugin structure</a> chapter for more details.</p>
<p>To install custom web device plugins module <code>webapi-plugins-xxx.rpm</code> and <code>webapi-plugins-devel-xxx.rpm</code> must be installed first.
-After build and installation webapi-plugins-devel-test <code>tizen.test</code> namespace should be available.</p>
-<pre class="prettyprint linenums"><code class="lang-javascript">var test = tizen.test.ping();
+After build and installation webapi-plugins-test <code>webapis.test</code> namespace should be available.</p>
+<pre class="prettyprint linenums"><code class="lang-javascript">var test = webapis.test.ping();
console.log(test); // Hello!
</code></pre>
--- /dev/null
+MIT License
+Copyright (c) 2015 Samsung Electronics Co, Ltd. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+%bcond_with wayland
+
%define _manifestdir %{TZ_SYS_RW_PACKAGES}
%define _desktop_icondir %{TZ_SYS_SHARE}/icons/default/small
%define crosswalk_extensions tizen-extensions-crosswalk
+%define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions}
+
Name: webapi-plugins-test
Version: 0.1
Release: 0
License: Apache-2.0 and BSD-2.0 and MIT
Group: Development/Libraries
-Summary: Tizen Web APIs implemented
+Summary: Tizen Test Web APIs
Source0: %{name}-%{version}.tar.gz
+%ifarch %{arm} aarch64
+# ARM
+%define tizen_is_emulator 0
+%else
+# I586
+%define tizen_is_emulator 1
+%endif
+
BuildRequires: ninja
BuildRequires: pkgconfig(webapi-plugins)
%description
-Tizen Test Web APIs.
+Tizen Test Web APIs
%prep
%setup -q
%build
export GYP_GENERATORS='ninja'
-GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=%{tizen_profile_name} -Dprivilege_engine=%{tizen_privilege_engine}"
-GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=x11"
+GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=%{profile} -Dprivilege_engine=%{tizen_privilege_engine}"
+GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
+GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
+
+# feature flags
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}"
/usr/include/webapi-plugins/tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
ninja -C out/Default %{?_smp_mflags}
%install
-mkdir -p %{buildroot}%{_libdir}/%{crosswalk_extensions}
-install -p -m 644 out/Default/libtizen*.so %{buildroot}%{_libdir}/%{crosswalk_extensions}
+
+# Extensions.
+mkdir -p %{buildroot}%{crosswalk_extensions_path}
+install -p -m 644 out/Default/libwebapis*.so %{buildroot}%{crosswalk_extensions_path}
+
+# execute desc_gentool
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path} out/Default/desc_gentool \
+ %{crosswalk_extensions_path} \
+ %{buildroot}%{crosswalk_extensions_path} > webapis-plugins.json
+
+# temporary plugins description for lazy loading
+install -p -m 644 webapis-plugins.json %{buildroot}%{crosswalk_extensions_path}/webapis-plugins.json
+
%files
-%{_libdir}/%{crosswalk_extensions}/libtizen*.so
+%{crosswalk_extensions_path}/libwebapis*.so
+%{crosswalk_extensions_path}/webapis-plugins.json
+%manifest webapi-plugins.manifest
],
'targets': [
{
- 'target_name': 'tizen_test',
+ 'target_name': 'webapis_test',
'type': 'loadable_module',
'sources': [
'test_api.js',
}
TestExtension::TestExtension() {
- SetExtensionName("tizen.test");
+ SetExtensionName("webapis.test");
SetJavaScriptAPI(kSource_test_api);
}
'target_name': 'extensions',
'type': 'none',
'dependencies': [
+ 'tool/tool.gyp:*',
'test/test.gyp:*',
],
'conditions': [],
--- /dev/null
+#include <iostream>
+#include <string>
+#include <vector>
+#include <map>
+#include <functional>
+
+#include <dlfcn.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+
+#include <common/extension.h>
+
+static std::string prefix_ = "libwebapis";
+static std::string postfix_ = ".so";
+static std::vector<std::string> apinamespaces = {"tizen", "xwalk", "webapis"};
+
+typedef common::Extension *(*CreateExtensionFunc)(void);
+
+struct module_description {
+ std::string name;
+ std::string lib;
+ std::vector<std::string> entries;
+};
+
+
+static XW_Extension ext = 0;
+static std::map<XW_Extension, module_description> descriptions;
+
+#ifndef JSON_MINIFY
+ #define PRINT_TAB() std::cout << "\t"
+#else
+ #define PRINT_TAB()
+#endif
+
+void print_json() {
+ std::cout << "[" << std::endl;
+ for (const auto& kv : descriptions) {
+ const module_description &desc = kv.second;
+
+ std::string::size_type n = desc.name.find('.');
+ std::string ns =
+ n == std::string::npos ? desc.name : desc.name.substr(0, n);
+
+ if (std::find(apinamespaces.begin(), apinamespaces.end(), ns) ==
+ apinamespaces.end()) {
+ continue;
+ }
+
+ PRINT_TAB();
+ std::cout << "{" << std::endl;
+ PRINT_TAB();
+ PRINT_TAB();
+ std::cout << "\"name\":\"" << desc.name << "\"," << std::endl;
+ PRINT_TAB();
+ PRINT_TAB();
+ std::cout << "\"lib\":\"" << desc.lib << "\"," << std::endl;
+ PRINT_TAB();
+ PRINT_TAB();
+ std::cout << "\"entry_points\": [";
+ for (std::vector<std::string>::size_type i=0; i<desc.entries.size(); i++) {
+ if (i != 0) {
+ std::cout << ",";
+ }
+ std::cout << "\"" << desc.entries[i] << "\"";
+ }
+ std::cout << "]" << std::endl;
+ PRINT_TAB();
+ std::cout << "}";
+ if (kv.first != ext) {
+ std::cout << ",";
+ }
+ std::cout << std::endl;
+ }
+ std::cout << "]" << std::endl;
+}
+
+const void* get_interface(const char* name) {
+ if (!strcmp(name, XW_CORE_INTERFACE_1)) {
+ static const XW_CoreInterface coreInterface1 = {
+ [](XW_Extension extension, const char* name) {
+ module_description *desc = &descriptions[extension];
+ desc->name = name;
+ },
+ [](XW_Extension extension, const char* api) {},
+ [](XW_Extension extension, XW_CreatedInstanceCallback created,
+ XW_DestroyedInstanceCallback destroyed) {},
+ [](XW_Extension extension, XW_ShutdownCallback shutdown_callback) {},
+ [](XW_Instance instance, void* data) {},
+ [](XW_Instance instance) -> void* { return nullptr; }
+ };
+ return &coreInterface1;
+ }
+
+ if (!strcmp(name, XW_INTERNAL_ENTRY_POINTS_INTERFACE_1)) {
+ static const XW_Internal_EntryPointsInterface entryPointsInterface1 = {
+ [](XW_Extension extension, const char** entries) {
+ module_description *desc = &descriptions[extension];
+ for (int i=0; entries[i]; i++) {
+ desc->entries.push_back(std::string(entries[i]));
+ }
+ }
+ };
+ return &entryPointsInterface1;
+ }
+
+ if (!strcmp(name, XW_MESSAGING_INTERFACE_1)) {
+ static const XW_MessagingInterface_1 messagingInterface1 = {
+ [](XW_Extension extension, XW_HandleMessageCallback handle_message) {
+ },
+ [](XW_Instance instance, const char* message) {
+ }
+ };
+ return &messagingInterface1;
+ }
+
+ if (!strcmp(name, XW_INTERNAL_SYNC_MESSAGING_INTERFACE_1)) {
+ static const XW_Internal_SyncMessagingInterface syncMessagingInterface1 = {
+ [](XW_Extension extension, XW_HandleSyncMessageCallback handle_sync_msg) {
+ },
+ [](XW_Instance instance, const char* reply){
+ }
+ };
+ return &syncMessagingInterface1;
+ }
+
+ if (!strcmp(name, XW_INTERNAL_RUNTIME_INTERFACE_1)) {
+ static const XW_Internal_RuntimeInterface_1 runtimeInterface1 = {
+ [](XW_Extension extension, const char* key, char* value, size_t vlen) {
+ }
+ };
+ return &runtimeInterface1;
+ }
+
+ if (!strcmp(name, XW_INTERNAL_PERMISSIONS_INTERFACE_1)) {
+ static const XW_Internal_PermissionsInterface_1 permissionsInterface1 = {
+ [](XW_Extension extension, const char* api_name) -> int {
+ return XW_ERROR;
+ },
+ [](XW_Extension extension, const char* perm_table) -> int {
+ return XW_ERROR;
+ }
+ };
+ return &permissionsInterface1;
+ }
+
+ return NULL;
+}
+
+int main(int argc, char* argv[]) {
+ if (argc < 3) {
+ std::cerr << "Need tizen crosswalk path" << std::endl;
+ return -1;
+ }
+ std::string lib_path = argv[1];
+ if (lib_path.empty()) {
+ std::cerr << "Invalid libpath for tec." << std::endl;
+ return -1;
+ }
+
+ std::string tec_path = argv[2];
+ if (tec_path.empty()) {
+ std::cerr << "Invalid tizen crosswalk path" << std::endl;
+ return -1;
+ }
+
+ struct dirent** namelist;
+ int num_entries = scandir(tec_path.c_str(), &namelist, NULL, alphasort);
+ if( num_entries >= 0 ) {
+ for( int i = 0; i < num_entries; ++i ) {
+ std::string fname = namelist[i]->d_name;
+
+ if (fname.size() >= prefix_.size() + postfix_.size() &&
+ !fname.compare(0, prefix_.size(), prefix_) &&
+ !fname.compare(fname.size() - postfix_.size(), postfix_.size(),
+ postfix_)) {
+ std::string so_path = tec_path + "/" + fname;
+ void *handle = dlopen(so_path.c_str(), RTLD_LAZY);
+ if (handle == NULL) {
+ std::cerr << "cannot open " << so_path << std::endl;
+ char* error = dlerror();
+ std::cerr << "Error >>" << ((error == NULL) ? "NULL" : error) << std::endl;
+ return -1;
+ }
+
+ XW_Initialize_Func initialize = reinterpret_cast<XW_Initialize_Func>(
+ dlsym(handle, "XW_Initialize"));
+
+ if (!initialize) {
+ std::cerr << "Can not loading extension " << fname << std::endl;
+ } else {
+ ext++;
+ descriptions[ext] = module_description();
+ descriptions[ext].lib = lib_path + "/" + fname;
+ int ret = initialize(ext, get_interface);
+ if (ret != XW_OK) {
+ std::cerr << "Error loading extension " << fname << std::endl;
+ }
+ }
+
+ // some Shared libraries have static finalizer.
+ // __attribute__((destructor)) this gcc extension makes finalizer.
+ // if close it, it can makes segfault.
+ // True, It's shared object's problem. but we can't fix it.
+ // so don't close it in only this tool. just finish process.
+ //
+ // dlclose(handle);
+ }
+ free(namelist[i]);
+ }
+ free(namelist);
+ print_json();
+ } else {
+ perror("scandir");
+ if( errno == ENOENT )
+ std::cerr << "path not exist : " << tec_path << std::endl;
+ return -1;
+ }
+
+ // it would be need for ignore loaded libraries destructor
+ _exit(0);
+}
--- /dev/null
+{
+ 'target_defaults': {
+ 'variables': {'packages': ['dlog']},
+ 'includes': [
+ '/usr/include/webapi-plugins/src/common/pkg-config.gypi'
+ ]
+ },
+ 'targets' : [
+ {
+ 'target_name': 'desc_gentool',
+ 'cflags': [
+ '-std=c++0x',
+ '-Wall'
+ ],
+ 'link_settings': {'libraries': [ '-ldl'], },
+ 'include_dirs': [
+ '/usr/include/webapi-plugins/src/'
+ ],
+ 'type': 'executable',
+ 'sources': [
+ 'desc_gentool.cc'
+ ]
+ }
+ ]
+}
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
### Creating custom web device plugins module
-To create custom web device plugins module ```webapi-plugins.spec```, ```tizen-wrt.gyp``` and ```src``` files are needed.
+To create custom web device plugins module ```webapi-plugins.spec```, ```tizen-wrt.gyp```, ```webapi-plugins.manifest``` and ```src``` files are needed.
Skeleton below shows the required structure of test module.
```sh
│ └── webapi-plugins.spec
└── src
│ ├── test
-│ ├── test_api.js
-│ ├── test_extension.cc
-│ ├── test_extension.h
-│ ├── test.gyp
-│ ├── test_instance.cc
-│ └── test_instance.h
-└── tizen-wrt.gyp
+│ | ├── test_api.js
+│ | ├── test_extension.cc
+│ | ├── test_extension.h
+│ | ├── test.gyp
+│ | ├── test_instance.cc
+│ | └── test_instance.h
+│ ├── tool
+│ | ├── desc_gentool.cc
+│ | └── tool.gyp
+| └── tizen-wrt.gyp
+└── webapi-plugins.manifest
```
webapi-plugins.spec source:
```
+%bcond_with wayland
+
%define _manifestdir %{TZ_SYS_RW_PACKAGES}
%define _desktop_icondir %{TZ_SYS_SHARE}/icons/default/small
%define crosswalk_extensions tizen-extensions-crosswalk
+%define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions}
+
Name: webapi-plugins-test
Version: 0.1
Release: 0
License: Apache-2.0 and BSD-2.0 and MIT
Group: Development/Libraries
-Summary: Tizen Web APIs implemented
+Summary: Tizen Test Web APIs
Source0: %{name}-%{version}.tar.gz
+%ifarch %{arm} aarch64
+# ARM
+%define tizen_is_emulator 0
+%else
+# I586
+%define tizen_is_emulator 1
+%endif
+
BuildRequires: ninja
BuildRequires: pkgconfig(webapi-plugins)
%description
-Tizen Test Web APIs.
+Tizen Test Web APIs
%prep
%setup -q
%build
export GYP_GENERATORS='ninja'
-GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=%{tizen_profile_name} -Dprivilege_engine=%{tizen_privilege_engine}"
-GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=x11"
+GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=%{profile} -Dprivilege_engine=%{tizen_privilege_engine}"
+GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
+GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
+
+# feature flags
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}"
/usr/include/webapi-plugins/tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
ninja -C out/Default %{?_smp_mflags}
%install
-mkdir -p %{buildroot}%{_libdir}/%{crosswalk_extensions}
-install -p -m 644 out/Default/libtizen*.so %{buildroot}%{_libdir}/%{crosswalk_extensions}
+
+# Extensions.
+mkdir -p %{buildroot}%{crosswalk_extensions_path}
+install -p -m 644 out/Default/libwebapis*.so %{buildroot}%{crosswalk_extensions_path}
+
+# execute desc_gentool
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path} out/Default/desc_gentool \
+ %{crosswalk_extensions_path} \
+ %{buildroot}%{crosswalk_extensions_path} > webapis-plugins.json
+
+# temporary plugins description for lazy loading
+install -p -m 644 webapis-plugins.json %{buildroot}%{crosswalk_extensions_path}/webapis-plugins.json
+
%files
-%{_libdir}/%{crosswalk_extensions}/libtizen*.so
+%{crosswalk_extensions_path}/libwebapis*.so
+%{crosswalk_extensions_path}/webapis-plugins.json
+%manifest webapi-plugins.manifest
```
tizen-wrt.gyp source:
'target_name': 'extensions',
'type': 'none',
'dependencies': [
+ 'tool/tool.gyp:*',
'test/test.gyp:*',
],
'conditions': [],
],
'targets': [
{
- 'target_name': 'tizen_test',
+ 'target_name': 'webapis_test',
'type': 'loadable_module',
'sources': [
'test_api.js',
Please see [Plugin structure](#plugin-structure) chapter for more details.
To install custom web device plugins module ```webapi-plugins-xxx.rpm``` and ```webapi-plugins-devel-xxx.rpm``` must be installed first.
-After build and installation webapi-plugins-devel-test ```tizen.test``` namespace should be available.
+After build and installation webapi-plugins-test ```webapis.test``` namespace should be available.
```javascript
-var test = tizen.test.ping();
+var test = webapis.test.ping();
console.log(test); // Hello!
```
| 0.4.0 | 2015-06-16 | Guideline | Pawel Kaczmarek<br><p.kaczmarek3@samsung.com> |
| 0.5.0 | 2015-06-18 | Devel package | Pawel Kaczmarek<br><p.kaczmarek3@samsung.com> |
| 0.5.1 | 2015-06-24 | Add info about WAPIOven.py | Pawel Kaczmarek<br><p.kaczmarek3@samsung.com> |
+| 0.6.0 | 2016-10-28 | update devel package for tizen 3.0 | Annie Park<br><hj.na.park@samsung.com> |
## Overview
This document should be used as a guideline for developers who are creating web