--Gyeongseok Seo <gyeongseok.seo@samsung.com>\r
--BonYong Lee <bonyong.lee@samsung.com>\r
--Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
--Kangho Kim <kh5325.kim@samsung.com>\r
--HyunGoo Kang <hyungoo1.kang@samsung.com>\r
++Gyeongseok Seo <gyeongseok.seo@samsung.com>
++BonYong Lee <bonyong.lee@samsung.com>
++Hyeongseok Heo <hyeongseok.heo@samsung.com>
++Kangho Kim <kh5325.kim@samsung.com>
++HyunGoo Kang <hyungoo1.kang@samsung.com>
--Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
--\r
-- Apache License\r
-- Version 2.0, January 2004\r
-- http://www.apache.org/licenses/\r
--\r
-- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
--\r
-- 1. Definitions.\r
--\r
-- "License" shall mean the terms and conditions for use, reproduction,\r
-- and distribution as defined by Sections 1 through 9 of this document.\r
--\r
-- "Licensor" shall mean the copyright owner or entity authorized by\r
-- the copyright owner that is granting the License.\r
--\r
-- "Legal Entity" shall mean the union of the acting entity and all\r
-- other entities that control, are controlled by, or are under common\r
-- control with that entity. For the purposes of this definition,\r
-- "control" means (i) the power, direct or indirect, to cause the\r
-- direction or management of such entity, whether by contract or\r
-- otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
-- outstanding shares, or (iii) beneficial ownership of such entity.\r
--\r
-- "You" (or "Your") shall mean an individual or Legal Entity\r
-- exercising permissions granted by this License.\r
--\r
-- "Source" form shall mean the preferred form for making modifications,\r
-- including but not limited to software source code, documentation\r
-- source, and configuration files.\r
--\r
-- "Object" form shall mean any form resulting from mechanical\r
-- transformation or translation of a Source form, including but\r
-- not limited to compiled object code, generated documentation,\r
-- and conversions to other media types.\r
--\r
-- "Work" shall mean the work of authorship, whether in Source or\r
-- Object form, made available under the License, as indicated by a\r
-- copyright notice that is included in or attached to the work\r
-- (an example is provided in the Appendix below).\r
--\r
-- "Derivative Works" shall mean any work, whether in Source or Object\r
-- form, that is based on (or derived from) the Work and for which the\r
-- editorial revisions, annotations, elaborations, or other modifications\r
-- represent, as a whole, an original work of authorship. For the purposes\r
-- of this License, Derivative Works shall not include works that remain\r
-- separable from, or merely link (or bind by name) to the interfaces of,\r
-- the Work and Derivative Works thereof.\r
--\r
-- "Contribution" shall mean any work of authorship, including\r
-- the original version of the Work and any modifications or additions\r
-- to that Work or Derivative Works thereof, that is intentionally\r
-- submitted to Licensor for inclusion in the Work by the copyright owner\r
-- or by an individual or Legal Entity authorized to submit on behalf of\r
-- the copyright owner. For the purposes of this definition, "submitted"\r
-- means any form of electronic, verbal, or written communication sent\r
-- to the Licensor or its representatives, including but not limited to\r
-- communication on electronic mailing lists, source code control systems,\r
-- and issue tracking systems that are managed by, or on behalf of, the\r
-- Licensor for the purpose of discussing and improving the Work, but\r
-- excluding communication that is conspicuously marked or otherwise\r
-- designated in writing by the copyright owner as "Not a Contribution."\r
--\r
-- "Contributor" shall mean Licensor and any individual or Legal Entity\r
-- on behalf of whom a Contribution has been received by Licensor and\r
-- subsequently incorporated within the Work.\r
--\r
-- 2. Grant of Copyright License. Subject to the terms and conditions of\r
-- this License, each Contributor hereby grants to You a perpetual,\r
-- worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
-- copyright license to reproduce, prepare Derivative Works of,\r
-- publicly display, publicly perform, sublicense, and distribute the\r
-- Work and such Derivative Works in Source or Object form.\r
--\r
-- 3. Grant of Patent License. Subject to the terms and conditions of\r
-- this License, each Contributor hereby grants to You a perpetual,\r
-- worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
-- (except as stated in this section) patent license to make, have made,\r
-- use, offer to sell, sell, import, and otherwise transfer the Work,\r
-- where such license applies only to those patent claims licensable\r
-- by such Contributor that are necessarily infringed by their\r
-- Contribution(s) alone or by combination of their Contribution(s)\r
-- with the Work to which such Contribution(s) was submitted. If You\r
-- institute patent litigation against any entity (including a\r
-- cross-claim or counterclaim in a lawsuit) alleging that the Work\r
-- or a Contribution incorporated within the Work constitutes direct\r
-- or contributory patent infringement, then any patent licenses\r
-- granted to You under this License for that Work shall terminate\r
-- as of the date such litigation is filed.\r
--\r
-- 4. Redistribution. You may reproduce and distribute copies of the\r
-- Work or Derivative Works thereof in any medium, with or without\r
-- modifications, and in Source or Object form, provided that You\r
-- meet the following conditions:\r
--\r
-- (a) You must give any other recipients of the Work or\r
-- Derivative Works a copy of this License; and\r
--\r
-- (b) You must cause any modified files to carry prominent notices\r
-- stating that You changed the files; and\r
--\r
-- (c) You must retain, in the Source form of any Derivative Works\r
-- that You distribute, all copyright, patent, trademark, and\r
-- attribution notices from the Source form of the Work,\r
-- excluding those notices that do not pertain to any part of\r
-- the Derivative Works; and\r
--\r
-- (d) If the Work includes a "NOTICE" text file as part of its\r
-- distribution, then any Derivative Works that You distribute must\r
-- include a readable copy of the attribution notices contained\r
-- within such NOTICE file, excluding those notices that do not\r
-- pertain to any part of the Derivative Works, in at least one\r
-- of the following places: within a NOTICE text file distributed\r
-- as part of the Derivative Works; within the Source form or\r
-- documentation, if provided along with the Derivative Works; or,\r
-- within a display generated by the Derivative Works, if and\r
-- wherever such third-party notices normally appear. The contents\r
-- of the NOTICE file are for informational purposes only and\r
-- do not modify the License. You may add Your own attribution\r
-- notices within Derivative Works that You distribute, alongside\r
-- or as an addendum to the NOTICE text from the Work, provided\r
-- that such additional attribution notices cannot be construed\r
-- as modifying the License.\r
--\r
-- You may add Your own copyright statement to Your modifications and\r
-- may provide additional or different license terms and conditions\r
-- for use, reproduction, or distribution of Your modifications, or\r
-- for any such Derivative Works as a whole, provided Your use,\r
-- reproduction, and distribution of the Work otherwise complies with\r
-- the conditions stated in this License.\r
--\r
-- 5. Submission of Contributions. Unless You explicitly state otherwise,\r
-- any Contribution intentionally submitted for inclusion in the Work\r
-- by You to the Licensor shall be under the terms and conditions of\r
-- this License, without any additional terms or conditions.\r
-- Notwithstanding the above, nothing herein shall supersede or modify\r
-- the terms of any separate license agreement you may have executed\r
-- with Licensor regarding such Contributions.\r
--\r
-- 6. Trademarks. This License does not grant permission to use the trade\r
-- names, trademarks, service marks, or product names of the Licensor,\r
-- except as required for reasonable and customary use in describing the\r
-- origin of the Work and reproducing the content of the NOTICE file.\r
--\r
-- 7. Disclaimer of Warranty. Unless required by applicable law or\r
-- agreed to in writing, Licensor provides the Work (and each\r
-- Contributor provides its Contributions) on an "AS IS" BASIS,\r
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
-- implied, including, without limitation, any warranties or conditions\r
-- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
-- PARTICULAR PURPOSE. You are solely responsible for determining the\r
-- appropriateness of using or redistributing the Work and assume any\r
-- risks associated with Your exercise of permissions under this License.\r
--\r
-- 8. Limitation of Liability. In no event and under no legal theory,\r
-- whether in tort (including negligence), contract, or otherwise,\r
-- unless required by applicable law (such as deliberate and grossly\r
-- negligent acts) or agreed to in writing, shall any Contributor be\r
-- liable to You for damages, including any direct, indirect, special,\r
-- incidental, or consequential damages of any character arising as a\r
-- result of this License or out of the use or inability to use the\r
-- Work (including but not limited to damages for loss of goodwill,\r
-- work stoppage, computer failure or malfunction, or any and all\r
-- other commercial damages or losses), even if such Contributor\r
-- has been advised of the possibility of such damages.\r
--\r
-- 9. Accepting Warranty or Additional Liability. While redistributing\r
-- the Work or Derivative Works thereof, You may choose to offer,\r
-- and charge a fee for, acceptance of support, warranty, indemnity,\r
-- or other liability obligations and/or rights consistent with this\r
-- License. However, in accepting such obligations, You may act only\r
-- on Your own behalf and on Your sole responsibility, not on behalf\r
-- of any other Contributor, and only if You agree to indemnify,\r
-- defend, and hold each Contributor harmless for any liability\r
-- incurred by, or claims asserted against, such Contributor by reason\r
-- of your accepting any such warranty or additional liability.\r
--\r
-- END OF TERMS AND CONDITIONS\r
--\r
-- APPENDIX: How to apply the Apache License to your work.\r
--\r
-- To apply the Apache License to your work, attach the following\r
-- boilerplate notice, with the fields enclosed by brackets "[]"\r
-- replaced with your own identifying information. (Don't include\r
-- the brackets!) The text should be enclosed in the appropriate\r
-- comment syntax for the file format. We also recommend that a\r
-- file or class name and description of purpose be included on the\r
-- same "printed page" as the copyright notice for easier\r
-- identification within third-party archives.\r
--\r
-- Copyright [yyyy] [name of copyright owner]\r
--\r
-- Licensed under the Apache License, Version 2.0 (the "License");\r
-- you may not use this file except in compliance with the License.\r
-- You may obtain a copy of the License at\r
--\r
-- http://www.apache.org/licenses/LICENSE-2.0\r
--\r
-- Unless required by applicable law or agreed to in writing, software\r
-- distributed under the License is distributed on an "AS IS" BASIS,\r
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- See the License for the specific language governing permissions and\r
-- limitations under the License.\r
--\r
--\r
--\r
++Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
++
++ Apache License
++ Version 2.0, January 2004
++ http://www.apache.org/licenses/
++
++ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
++
++ 1. Definitions.
++
++ "License" shall mean the terms and conditions for use, reproduction,
++ and distribution as defined by Sections 1 through 9 of this document.
++
++ "Licensor" shall mean the copyright owner or entity authorized by
++ the copyright owner that is granting the License.
++
++ "Legal Entity" shall mean the union of the acting entity and all
++ other entities that control, are controlled by, or are under common
++ control with that entity. For the purposes of this definition,
++ "control" means (i) the power, direct or indirect, to cause the
++ direction or management of such entity, whether by contract or
++ otherwise, or (ii) ownership of fifty percent (50%) or more of the
++ outstanding shares, or (iii) beneficial ownership of such entity.
++
++ "You" (or "Your") shall mean an individual or Legal Entity
++ exercising permissions granted by this License.
++
++ "Source" form shall mean the preferred form for making modifications,
++ including but not limited to software source code, documentation
++ source, and configuration files.
++
++ "Object" form shall mean any form resulting from mechanical
++ transformation or translation of a Source form, including but
++ not limited to compiled object code, generated documentation,
++ and conversions to other media types.
++
++ "Work" shall mean the work of authorship, whether in Source or
++ Object form, made available under the License, as indicated by a
++ copyright notice that is included in or attached to the work
++ (an example is provided in the Appendix below).
++
++ "Derivative Works" shall mean any work, whether in Source or Object
++ form, that is based on (or derived from) the Work and for which the
++ editorial revisions, annotations, elaborations, or other modifications
++ represent, as a whole, an original work of authorship. For the purposes
++ of this License, Derivative Works shall not include works that remain
++ separable from, or merely link (or bind by name) to the interfaces of,
++ the Work and Derivative Works thereof.
++
++ "Contribution" shall mean any work of authorship, including
++ the original version of the Work and any modifications or additions
++ to that Work or Derivative Works thereof, that is intentionally
++ submitted to Licensor for inclusion in the Work by the copyright owner
++ or by an individual or Legal Entity authorized to submit on behalf of
++ the copyright owner. For the purposes of this definition, "submitted"
++ means any form of electronic, verbal, or written communication sent
++ to the Licensor or its representatives, including but not limited to
++ communication on electronic mailing lists, source code control systems,
++ and issue tracking systems that are managed by, or on behalf of, the
++ Licensor for the purpose of discussing and improving the Work, but
++ excluding communication that is conspicuously marked or otherwise
++ designated in writing by the copyright owner as "Not a Contribution."
++
++ "Contributor" shall mean Licensor and any individual or Legal Entity
++ on behalf of whom a Contribution has been received by Licensor and
++ subsequently incorporated within the Work.
++
++ 2. Grant of Copyright License. Subject to the terms and conditions of
++ this License, each Contributor hereby grants to You a perpetual,
++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
++ copyright license to reproduce, prepare Derivative Works of,
++ publicly display, publicly perform, sublicense, and distribute the
++ Work and such Derivative Works in Source or Object form.
++
++ 3. Grant of Patent License. Subject to the terms and conditions of
++ this License, each Contributor hereby grants to You a perpetual,
++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
++ (except as stated in this section) patent license to make, have made,
++ use, offer to sell, sell, import, and otherwise transfer the Work,
++ where such license applies only to those patent claims licensable
++ by such Contributor that are necessarily infringed by their
++ Contribution(s) alone or by combination of their Contribution(s)
++ with the Work to which such Contribution(s) was submitted. If You
++ institute patent litigation against any entity (including a
++ cross-claim or counterclaim in a lawsuit) alleging that the Work
++ or a Contribution incorporated within the Work constitutes direct
++ or contributory patent infringement, then any patent licenses
++ granted to You under this License for that Work shall terminate
++ as of the date such litigation is filed.
++
++ 4. Redistribution. You may reproduce and distribute copies of the
++ Work or Derivative Works thereof in any medium, with or without
++ modifications, and in Source or Object form, provided that You
++ meet the following conditions:
++
++ (a) You must give any other recipients of the Work or
++ Derivative Works a copy of this License; and
++
++ (b) You must cause any modified files to carry prominent notices
++ stating that You changed the files; and
++
++ (c) You must retain, in the Source form of any Derivative Works
++ that You distribute, all copyright, patent, trademark, and
++ attribution notices from the Source form of the Work,
++ excluding those notices that do not pertain to any part of
++ the Derivative Works; and
++
++ (d) If the Work includes a "NOTICE" text file as part of its
++ distribution, then any Derivative Works that You distribute must
++ include a readable copy of the attribution notices contained
++ within such NOTICE file, excluding those notices that do not
++ pertain to any part of the Derivative Works, in at least one
++ of the following places: within a NOTICE text file distributed
++ as part of the Derivative Works; within the Source form or
++ documentation, if provided along with the Derivative Works; or,
++ within a display generated by the Derivative Works, if and
++ wherever such third-party notices normally appear. The contents
++ of the NOTICE file are for informational purposes only and
++ do not modify the License. You may add Your own attribution
++ notices within Derivative Works that You distribute, alongside
++ or as an addendum to the NOTICE text from the Work, provided
++ that such additional attribution notices cannot be construed
++ as modifying the License.
++
++ You may add Your own copyright statement to Your modifications and
++ may provide additional or different license terms and conditions
++ for use, reproduction, or distribution of Your modifications, or
++ for any such Derivative Works as a whole, provided Your use,
++ reproduction, and distribution of the Work otherwise complies with
++ the conditions stated in this License.
++
++ 5. Submission of Contributions. Unless You explicitly state otherwise,
++ any Contribution intentionally submitted for inclusion in the Work
++ by You to the Licensor shall be under the terms and conditions of
++ this License, without any additional terms or conditions.
++ Notwithstanding the above, nothing herein shall supersede or modify
++ the terms of any separate license agreement you may have executed
++ with Licensor regarding such Contributions.
++
++ 6. Trademarks. This License does not grant permission to use the trade
++ names, trademarks, service marks, or product names of the Licensor,
++ except as required for reasonable and customary use in describing the
++ origin of the Work and reproducing the content of the NOTICE file.
++
++ 7. Disclaimer of Warranty. Unless required by applicable law or
++ agreed to in writing, Licensor provides the Work (and each
++ Contributor provides its Contributions) on an "AS IS" BASIS,
++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
++ implied, including, without limitation, any warranties or conditions
++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
++ PARTICULAR PURPOSE. You are solely responsible for determining the
++ appropriateness of using or redistributing the Work and assume any
++ risks associated with Your exercise of permissions under this License.
++
++ 8. Limitation of Liability. In no event and under no legal theory,
++ whether in tort (including negligence), contract, or otherwise,
++ unless required by applicable law (such as deliberate and grossly
++ negligent acts) or agreed to in writing, shall any Contributor be
++ liable to You for damages, including any direct, indirect, special,
++ incidental, or consequential damages of any character arising as a
++ result of this License or out of the use or inability to use the
++ Work (including but not limited to damages for loss of goodwill,
++ work stoppage, computer failure or malfunction, or any and all
++ other commercial damages or losses), even if such Contributor
++ has been advised of the possibility of such damages.
++
++ 9. Accepting Warranty or Additional Liability. While redistributing
++ the Work or Derivative Works thereof, You may choose to offer,
++ and charge a fee for, acceptance of support, warranty, indemnity,
++ or other liability obligations and/or rights consistent with this
++ License. However, in accepting such obligations, You may act only
++ on Your own behalf and on Your sole responsibility, not on behalf
++ of any other Contributor, and only if You agree to indemnify,
++ defend, and hold each Contributor harmless for any liability
++ incurred by, or claims asserted against, such Contributor by reason
++ of your accepting any such warranty or additional liability.
++
++ END OF TERMS AND CONDITIONS
++
++ APPENDIX: How to apply the Apache License to your work.
++
++ To apply the Apache License to your work, attach the following
++ boilerplate notice, with the fields enclosed by brackets "[]"
++ replaced with your own identifying information. (Don't include
++ the brackets!) The text should be enclosed in the appropriate
++ comment syntax for the file format. We also recommend that a
++ file or class name and description of purpose be included on the
++ same "printed page" as the copyright notice for easier
++ identification within third-party archives.
++
++ Copyright [yyyy] [name of copyright owner]
++
++ Licensed under the Apache License, Version 2.0 (the "License");
++ you may not use this file except in compliance with the License.
++ You may obtain a copy of the License at
++
++ http://www.apache.org/licenses/LICENSE-2.0
++
++ Unless required by applicable law or agreed to in writing, software
++ distributed under the License is distributed on an "AS IS" BASIS,
++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ See the License for the specific language governing permissions and
++ limitations under the License.
++
++
++
--eclipse.preferences.version=1\r
--encoding/<project>=utf8\r
++eclipse.preferences.version=1
++encoding/<project>=utf8
--<?xml version="1.0" encoding="UTF-8" ?>\r
--<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"\r
-- xmlns:xsd="http://www.w3.org/2001/XMLSchema"\r
-- xmlns:target="http://www.samsung.com/schema/profiles"\r
-- targetNamespace="http://www.samsung.com/schema/profiles"\r
-- elementFormDefault="qualified"\r
-- attributeFormDefault="unqualified">\r
--\r
-- <xsd:complexType name="profileitemType">\r
-- <xsd:attribute name="author" type="xsd:string"></xsd:attribute>\r
-- <xsd:attribute name="identifier" type="xsd:string"></xsd:attribute>\r
-- <xsd:attribute name="key" type="xsd:string"></xsd:attribute>\r
-- </xsd:complexType>\r
--\r
-- <xsd:complexType name="profileType">\r
-- <xsd:sequence>\r
-- <xsd:element name="profileitem" type="target:profileitemType" minOccurs="0" maxOccurs="unbounded">\r
-- </xsd:element>\r
-- </xsd:sequence>\r
-- <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>\r
-- </xsd:complexType>\r
--\r
-- <xsd:element name="profiles">\r
-- <xsd:complexType>\r
-- <xsd:sequence>\r
-- <xsd:element name="profile" type="target:profileType" minOccurs="0" maxOccurs="unbounded">\r
-- </xsd:element>\r
-- </xsd:sequence>\r
-- </xsd:complexType>\r
-- </xsd:element>\r
--\r
--\r
--</xsd:schema>\r
++<?xml version="1.0" encoding="UTF-8" ?>
++<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
++ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
++ xmlns:target="http://www.samsung.com/schema/profiles"
++ targetNamespace="http://www.samsung.com/schema/profiles"
++ elementFormDefault="qualified"
++ attributeFormDefault="unqualified">
++
++ <xsd:complexType name="profileitemType">
++ <xsd:attribute name="author" type="xsd:string"></xsd:attribute>
++ <xsd:attribute name="identifier" type="xsd:string"></xsd:attribute>
++ <xsd:attribute name="key" type="xsd:string"></xsd:attribute>
++ </xsd:complexType>
++
++ <xsd:complexType name="profileType">
++ <xsd:sequence>
++ <xsd:element name="profileitem" type="target:profileitemType" minOccurs="0" maxOccurs="unbounded">
++ </xsd:element>
++ </xsd:sequence>
++ <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
++ </xsd:complexType>
++
++ <xsd:element name="profiles">
++ <xsd:complexType>
++ <xsd:sequence>
++ <xsd:element name="profile" type="target:profileType" minOccurs="0" maxOccurs="unbounded">
++ </xsd:element>
++ </xsd:sequence>
++ </xsd:complexType>
++ </xsd:element>
++
++
++</xsd:schema>
--README\r
--\r
--INTRODUCTION\r
--This CLI name is 'web-hybridapp' for generating hybrid app structure.\r
--(Linux version is supported currently, and Windows version will be supported.)\r
--\r
--REQUIRED ARGUMENTS\r
--Both a built native service app project path and a web project path are required.\r
--\r
--USAGE\r
--$ web-hybridapp [Native service app project path] [Web project path]\r
--\r
--EXAMPLES\r
--$ web-hybridapp ~/workspace/hybridserviceapp ~/workspace/hybridwebapp\r
--or\r
--$ web-hybridapp hybridserviceapp hybridwebapp\r
--\r
--RESULT\r
--The '.pack' folder will be created under current folder, and the web project name folder will be created under this folder.\r
--For example, if current folder name is '~/workspace' and web project path is '~/workspace/hybridwebapp', the result folder is '~/workspace/.pack/hybridwebapp'.\r
--\r
--USEFUL INFORMATION\r
--If Native service app project has a CommandLineBuild binary (a project is generated by CLI), copy this.\r
--If Native service app project has both a Release binary and a Debug binary (a project is generated by IDE), copy a Release binary first. (In this case, a Debug binary is not copied.)\r
--After this CLI process was completed, the next step is to sign the result folder using 'web-signing' CLI and then pack the result folder using 'web-packaging' CLI. Please refer to each detail in Web CLI help documents.\r
++README
++
++INTRODUCTION
++This CLI name is 'web-hybridapp' for generating hybrid app structure.
++(Linux version is supported currently, and Windows version will be supported.)
++
++REQUIRED ARGUMENTS
++Both a built native service app project path and a web project path are required.
++
++USAGE
++$ web-hybridapp [Native service app project path] [Web project path]
++
++EXAMPLES
++$ web-hybridapp ~/workspace/hybridserviceapp ~/workspace/hybridwebapp
++or
++$ web-hybridapp hybridserviceapp hybridwebapp
++
++RESULT
++The '.pack' folder will be created under current folder, and the web project name folder will be created under this folder.
++For example, if current folder name is '~/workspace' and web project path is '~/workspace/hybridwebapp', the result folder is '~/workspace/.pack/hybridwebapp'.
++
++USEFUL INFORMATION
++If Native service app project has a CommandLineBuild binary (a project is generated by CLI), copy this.
++If Native service app project has both a Release binary and a Debug binary (a project is generated by IDE), copy a Release binary first. (In this case, a Debug binary is not copied.)
++After this CLI process was completed, the next step is to sign the result folder using 'web-signing' CLI and then pack the result folder using 'web-packaging' CLI. Please refer to each detail in Web CLI help documents.
--@echo off\r
--\r
--set TOOLS_HOME=%~dp0\..\..\r
--\r
--set SDB=%TOOLS_HOME%\sdb.exe\r
--set LAUNCH_APP=launch_app\r
--set BINARY=\r
--set PACKAGE=\r
--set IS_EMULATOR=\r
--\r
--IF !%1==! (\r
-- GOTO help\r
-- exit /b 1\r
--)\r
--:getoptStart\r
-- IF %1==-h (\r
-- GOTO help\r
-- )\r
-- IF %1==--help (\r
-- GOTO help\r
-- )\r
-- IF %1==-s (\r
-- GOTO serial\r
-- )\r
-- IF %1==--serial (\r
-- GOTO serial\r
-- )\r
-- IF %1==-p (\r
-- GOTO package\r
-- )\r
-- IF %1==--package (\r
-- GOTO package\r
-- )\r
-- IF %1==-b (\r
-- GOTO binary\r
-- )\r
-- IF %1==--binary (\r
-- GOTO binary\r
-- )\r
--\r
-- :help\r
-- call :usage\r
-- exit /b\r
-- :serial\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set SERIAL=%2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- :package\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set PACKAGE=%2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- :binary\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set BINARY=%2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- \r
--\r
--:getoptEnd\r
-- IF NOT !%1==! (\r
-- GOTO getoptStart\r
-- )\r
--\r
--set SDB_COMMAND=%SDB%\r
--IF NOT !%SERIAL%==! (\r
-- set SDB_COMMAND=%SDB_COMMAND% -s %SERIAL%\r
--)\r
--\r
--SET DEVICES=0\r
--FOR /f "usebackq delims=" %%a IN (`%SDB% devices`) DO (\r
-- SET /a DEVICES+=1\r
-- SET TESTDE=1\r
--)\r
--IF %DEVICES% lss 2 (\r
-- echo error: device not found\r
-- exit /b 2\r
--)\r
--IF %DEVICES% GTR 2 (\r
-- IF !%SERIAL%==! (\r
-- echo error: more than one device and emulator\r
-- exit /b 2\r
-- )\r
--)\r
--\r
--IF !%PACKAGE%==! (\r
-- call :usage\r
-- exit /b 1\r
--)\r
--\r
--SET COUNT=0\r
--SET FIND_PKGID_COMMAND=pkgcmd -l ^| grep %PACKAGE%\r
--FOR /f "usebackq delims=" %%a IN (`%SDB_COMMAND% shell "%FIND_PKGID_COMMAND% | wc -l"`) DO (\r
-- set COUNT=%%a\r
--)\r
--IF NOT %COUNT%==1 (\r
-- echo error: %PACKAGE%: no such package\r
-- exit /b 2\r
--)\r
--\r
--SET COUNT=0\r
--IF !%BINARY%==! (\r
-- FOR /f "usebackq delims=" %%a IN (`%SDB_COMMAND% shell "%FIND_PKGID_COMMAND% | awk '{gsub(/[\[\]]/, \"\", $6); print $6}'"`) DO (\r
-- set BINARY=%%a\r
-- )\r
--)\r
--\r
--call :check_target_type\r
--call :ondemand_install\r
--call :launch_gdbserver\r
--call :launch_gdb\r
--\r
--exit /b %ERRORLEVEL%\r
--\r
--:usage\r
-- echo Usage: native-debug -p ^<tpk file path^> [options]\r
-- echo -s,--serial ^<serial number^> direct command to the USB device or emulator with\r
-- echo the given serial number\r
-- echo -p,--package ^<pkg_name^> debug the application given ^<pkg_name^> on the target\r
-- echo -b,--binary ^<executable^> debug the application given ^<pkg_name^>.^<executable^>\r
--exit /b\r
--\r
--:ondemand_install\r
-- IF %TARGET_TYPE%==arm (\r
-- set GDBSERVER_TAR=gdbserver_7.5.0_armel.tar\r
-- ) ELSE (\r
-- set GDBSERVER_TAR=gdbserver_7.5.0_i386.tar\r
-- )\r
--\r
-- call %SDB_COMMAND% push %TOOLS_HOME%/../platforms/tizen2.2/on-demand/%GDBSERVER_TAR% /home/developer/sdk_tools/%GDBSERVER_TAR%\r
-- call %SDB_COMMAND% shell "cd /home/developer/sdk_tools/ && tar -xf %GDBSERVER_TAR%"\r
--exit /b\r
--\r
--:check_target_type\r
-- FOR /f "usebackq delims=" %%a IN (`%SDB_COMMAND% shell "uname -m 2> /dev/null | grep 86 | wc -l"`) DO (\r
-- set IS_EMULATOR=%%a\r
-- )\r
--\r
-- IF %IS_EMULATOR%==0 (\r
-- set TARGET_TYPE=arm\r
-- ) ELSE (\r
-- set TARGET_TYPE=x86\r
-- )\r
--exit /b\r
--\r
--:launch_gdbserver\r
-- set TARGET_INSTALL_PATH=/opt/apps/%PACKAGE%/bin/%BINARY%\r
-- set GDBSERVER_COMMAND=/home/developer/sdk_tools/gdbserver/gdbserver :26102 %TARGET_INSTALL_PATH%\r
-- set SDB_GDBSERVER_COMMAND=%SDB_COMMAND% shell %GDBSERVER_COMMAND% 2> NUL\r
--\r
-- call cmd /c start %SDB_GDBSERVER_COMMAND%\r
-- timeout /t 1 > NUL\r
--exit /b\r
--\r
--:launch_gdb\r
-- call %SDB_COMMAND% forward tcp:7123 tcp:26102\r
--\r
-- IF %TARGET_TYPE%==arm (\r
-- call %TOOLS_HOME%\arm-linux-gnueabi-gdb-7.5\bin\arm-linux-gnueabi-gdb --eval-command="target remote:7123" --exec=%BINARY%\r
-- ) ELSE (\r
-- call %TOOLS_HOME%\i386-linux-gnueabi-gdb-7.5\bin\i386-linux-gnueabi-gdb --eval-command="target remote:7123" --exec=%BINARY%\r
-- )\r
--exit /b\r
++@echo off
++
++set TOOLS_HOME=%~dp0\..\..
++
++set SDB=%TOOLS_HOME%\sdb.exe
++set LAUNCH_APP=launch_app
++set BINARY=
++set PACKAGE=
++set IS_EMULATOR=
++
++IF !%1==! (
++ GOTO help
++ exit /b 1
++)
++:getoptStart
++ IF %1==-h (
++ GOTO help
++ )
++ IF %1==--help (
++ GOTO help
++ )
++ IF %1==-s (
++ GOTO serial
++ )
++ IF %1==--serial (
++ GOTO serial
++ )
++ IF %1==-p (
++ GOTO package
++ )
++ IF %1==--package (
++ GOTO package
++ )
++ IF %1==-b (
++ GOTO binary
++ )
++ IF %1==--binary (
++ GOTO binary
++ )
++
++ :help
++ call :usage
++ exit /b
++ :serial
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set SERIAL=%2
++ shift
++ shift
++ GOTO getoptEnd
++ :package
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set PACKAGE=%2
++ shift
++ shift
++ GOTO getoptEnd
++ :binary
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set BINARY=%2
++ shift
++ shift
++ GOTO getoptEnd
++
++
++:getoptEnd
++ IF NOT !%1==! (
++ GOTO getoptStart
++ )
++
++set SDB_COMMAND=%SDB%
++IF NOT !%SERIAL%==! (
++ set SDB_COMMAND=%SDB_COMMAND% -s %SERIAL%
++)
++
++SET DEVICES=0
++FOR /f "usebackq delims=" %%a IN (`%SDB% devices`) DO (
++ SET /a DEVICES+=1
++ SET TESTDE=1
++)
++IF %DEVICES% lss 2 (
++ echo error: device not found
++ exit /b 2
++)
++IF %DEVICES% GTR 2 (
++ IF !%SERIAL%==! (
++ echo error: more than one device and emulator
++ exit /b 2
++ )
++)
++
++IF !%PACKAGE%==! (
++ call :usage
++ exit /b 1
++)
++
++SET COUNT=0
++SET FIND_PKGID_COMMAND=pkgcmd -l ^| grep %PACKAGE%
++FOR /f "usebackq delims=" %%a IN (`%SDB_COMMAND% shell "%FIND_PKGID_COMMAND% | wc -l"`) DO (
++ set COUNT=%%a
++)
++IF NOT %COUNT%==1 (
++ echo error: %PACKAGE%: no such package
++ exit /b 2
++)
++
++SET COUNT=0
++IF !%BINARY%==! (
++ FOR /f "usebackq delims=" %%a IN (`%SDB_COMMAND% shell "%FIND_PKGID_COMMAND% | awk '{gsub(/[\[\]]/, \"\", $6); print $6}'"`) DO (
++ set BINARY=%%a
++ )
++)
++
++call :check_target_type
++call :ondemand_install
++call :launch_gdbserver
++call :launch_gdb
++
++exit /b %ERRORLEVEL%
++
++:usage
++ echo Usage: native-debug -p ^<tpk file path^> [options]
++ echo -s,--serial ^<serial number^> direct command to the USB device or emulator with
++ echo the given serial number
++ echo -p,--package ^<pkg_name^> debug the application given ^<pkg_name^> on the target
++ echo -b,--binary ^<executable^> debug the application given ^<pkg_name^>.^<executable^>
++exit /b
++
++:ondemand_install
++ IF %TARGET_TYPE%==arm (
++ set GDBSERVER_TAR=gdbserver_7.5.0_armel.tar
++ ) ELSE (
++ set GDBSERVER_TAR=gdbserver_7.5.0_i386.tar
++ )
++
++ call %SDB_COMMAND% push %TOOLS_HOME%/../platforms/tizen2.2/on-demand/%GDBSERVER_TAR% /home/developer/sdk_tools/%GDBSERVER_TAR%
++ call %SDB_COMMAND% shell "cd /home/developer/sdk_tools/ && tar -xf %GDBSERVER_TAR%"
++exit /b
++
++:check_target_type
++ FOR /f "usebackq delims=" %%a IN (`%SDB_COMMAND% shell "uname -m 2> /dev/null | grep 86 | wc -l"`) DO (
++ set IS_EMULATOR=%%a
++ )
++
++ IF %IS_EMULATOR%==0 (
++ set TARGET_TYPE=arm
++ ) ELSE (
++ set TARGET_TYPE=x86
++ )
++exit /b
++
++:launch_gdbserver
++ set TARGET_INSTALL_PATH=/opt/apps/%PACKAGE%/bin/%BINARY%
++ set GDBSERVER_COMMAND=/home/developer/sdk_tools/gdbserver/gdbserver :26102 %TARGET_INSTALL_PATH%
++ set SDB_GDBSERVER_COMMAND=%SDB_COMMAND% shell %GDBSERVER_COMMAND% 2> NUL
++
++ call cmd /c start %SDB_GDBSERVER_COMMAND%
++ timeout /t 1 > NUL
++exit /b
++
++:launch_gdb
++ call %SDB_COMMAND% forward tcp:7123 tcp:26102
++
++ IF %TARGET_TYPE%==arm (
++ call %TOOLS_HOME%\arm-linux-gnueabi-gdb-7.5\bin\arm-linux-gnueabi-gdb --eval-command="target remote:7123" --exec=%BINARY%
++ ) ELSE (
++ call %TOOLS_HOME%\i386-linux-gnueabi-gdb-7.5\bin\i386-linux-gnueabi-gdb --eval-command="target remote:7123" --exec=%BINARY%
++ )
++exit /b
--@echo off\r
--\r
--set TOOLS_HOME=%~dp0\..\..\r
--\r
--\r
--set SDB=%TOOLS_HOME%\sdb.exe\r
--\r
--IF !%1==! (\r
-- GOTO help\r
-- exit /b 1\r
--)\r
--:getoptStart\r
-- IF %1==-h (\r
-- GOTO help\r
-- )\r
-- IF %1==--help (\r
-- GOTO help\r
-- )\r
-- IF %1==-s (\r
-- GOTO serial\r
-- )\r
-- IF %1==--serial (\r
-- GOTO serial\r
-- )\r
-- IF %1==-p (\r
-- GOTO package\r
-- )\r
-- IF %1==--package (\r
-- GOTO package\r
-- )\r
--\r
-- :help\r
-- call :usage\r
-- exit /b\r
-- :serial\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set SERIAL=%2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- :package\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set PACKAGE=%2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
--\r
--:getoptEnd\r
-- IF NOT !%1==! (\r
-- GOTO getoptStart\r
-- )\r
--\r
--IF !%PACKAGE%==! (\r
-- call :usage\r
-- exit /b 1\r
--)\r
--\r
--SET DEVICES=0\r
--FOR /f "usebackq delims=" %%a IN (`%SDB% devices`) DO (\r
-- SET /A DEVICES+=1\r
--)\r
--IF %DEVICES% lss 2 (\r
-- echo error: device not found\r
-- exit /b 2\r
--) \r
--IF %DEVICES% GTR 2 (\r
-- IF !%SERIAL%==! (\r
-- echo error: more than one device and emulator\r
-- exit /b 2\r
-- )\r
--)\r
--\r
--set COMMAND=%SDB%\r
--IF NOT !%SERIAL%==! (\r
-- set COMMAND=%COMMAND% -s %SERIAL%\r
--)\r
--set COMMAND=%COMMAND% install %PACKAGE%\r
--\r
--CALL %COMMAND%\r
--\r
--IF %ERRORLEVEL%==0 (\r
-- echo.\r
-- echo To launch the application, run native-run with -p ^<pkg_name^>.\r
-- echo And to debug the application, run native-debug with -p ^<pkg_name^>.\r
--)\r
--\r
--exit /b %ERRORLEVEL%\r
--\r
--:usage\r
-- echo Usage: native-install -p ^<tpk file path^> [options]\r
-- echo -s,--serial ^<serial number^> direct command to the USB device or emulator with\r
-- echo the given serial number\r
-- echo -p,--package ^<tpk file path^> push given tpk file and install it.\r
--exit /b\r
++@echo off
++
++set TOOLS_HOME=%~dp0\..\..
++
++
++set SDB=%TOOLS_HOME%\sdb.exe
++
++IF !%1==! (
++ GOTO help
++ exit /b 1
++)
++:getoptStart
++ IF %1==-h (
++ GOTO help
++ )
++ IF %1==--help (
++ GOTO help
++ )
++ IF %1==-s (
++ GOTO serial
++ )
++ IF %1==--serial (
++ GOTO serial
++ )
++ IF %1==-p (
++ GOTO package
++ )
++ IF %1==--package (
++ GOTO package
++ )
++
++ :help
++ call :usage
++ exit /b
++ :serial
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set SERIAL=%2
++ shift
++ shift
++ GOTO getoptEnd
++ :package
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set PACKAGE=%2
++ shift
++ shift
++ GOTO getoptEnd
++
++:getoptEnd
++ IF NOT !%1==! (
++ GOTO getoptStart
++ )
++
++IF !%PACKAGE%==! (
++ call :usage
++ exit /b 1
++)
++
++SET DEVICES=0
++FOR /f "usebackq delims=" %%a IN (`%SDB% devices`) DO (
++ SET /A DEVICES+=1
++)
++IF %DEVICES% lss 2 (
++ echo error: device not found
++ exit /b 2
++)
++IF %DEVICES% GTR 2 (
++ IF !%SERIAL%==! (
++ echo error: more than one device and emulator
++ exit /b 2
++ )
++)
++
++set COMMAND=%SDB%
++IF NOT !%SERIAL%==! (
++ set COMMAND=%COMMAND% -s %SERIAL%
++)
++set COMMAND=%COMMAND% install %PACKAGE%
++
++CALL %COMMAND%
++
++IF %ERRORLEVEL%==0 (
++ echo.
++ echo To launch the application, run native-run with -p ^<pkg_name^>.
++ echo And to debug the application, run native-debug with -p ^<pkg_name^>.
++)
++
++exit /b %ERRORLEVEL%
++
++:usage
++ echo Usage: native-install -p ^<tpk file path^> [options]
++ echo -s,--serial ^<serial number^> direct command to the USB device or emulator with
++ echo the given serial number
++ echo -p,--package ^<tpk file path^> push given tpk file and install it.
++exit /b
--@echo off\r
--\r
--set TOOLS_HOME=%~dp0\..\..\r
--\r
--\r
--set command=%TOOLS_HOME%\smart-build-interface\bin\sbi-make.bat\r
--REM init environment variable\r
--set IS_CLEAN=0\r
--\r
--IF !%1==! (\r
-- GOTO getoptEnd\r
--)\r
--:getoptStart\r
-- IF %1==-h (\r
-- GOTO help\r
-- )\r
-- IF %1==--help (\r
-- GOTO help\r
-- )\r
-- IF %1==-n (\r
-- GOTO name\r
-- )\r
-- IF %1==--name (\r
-- GOTO name\r
-- )\r
-- IF %1==-v (\r
-- GOTO version \r
-- )\r
-- IF %1==--version (\r
-- GOTO version\r
-- )\r
-- IF %1==-a (\r
-- GOTO arch\r
-- )\r
-- IF %1==--arch (\r
-- GOTO arch\r
-- )\r
-- IF %1==-t (\r
-- GOTO toolchain\r
-- )\r
-- IF %1==--toolchain (\r
-- GOTO toolchain\r
-- )\r
-- IF %1==-rp (\r
-- GOTO referencing\r
-- )\r
-- IF %1==--ref-project (\r
-- GOTO referencing\r
-- )\r
-- IF %1==-u (\r
-- GOTO unittest\r
-- )\r
-- IF %1==--unittest-target (\r
-- GOTO unittest\r
-- )\r
-- IF %1==clean (\r
-- GOTO clean\r
-- )\r
--\r
-- :help\r
-- call :usage\r
-- exit /b\r
-- :name\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set command=%command% -n %2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- :version\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set command=%command% -v %2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- :arch\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set command=%command% -a %2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- :toolchain\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set command=%command% -t %2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- :referencing\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set command=%command% -r %2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- :unittest\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set command=%command% -u %2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- :clean\r
-- shift\r
-- set command=%command% clean\r
-- set IS_CLEAN=1\r
-- shift\r
-- GOTO getoptEnd\r
--\r
--:getoptEnd\r
--IF NOT !%1==! (\r
-- GOTO getoptStart\r
--)\r
--\r
--CALL %command%\r
--\r
--IF %IS_CLEAN%==1 (\r
-- exit /b %ERRORLEVEL%\r
--) ELSE (\r
-- IF %ERRORLEVEL%==0 (\r
-- echo.\r
-- echo To package the project, run native-packaging in %CD%\r
-- )\r
--)\r
--\r
--exit /b %ERRORLEVEL%\r
--\r
--:usage\r
-- echo Usage: native-make [options]\r
-- echo -n,--name ^<arg^> Specify a platform name ("Tizen Device 2.2" ^|\r
-- echo "Tizen Emulator 2.2")\r
-- echo If this options is not defined, the default\r
-- echo value of platform name is set by using\r
-- echo platform version and architecture\r
-- echo -v,--version ^<arg^> Specify a platform version ("Tizen 2.2")\r
-- echo If this options is not defined, it uses a value\r
-- echo of PLATFORM_VER in build_data file by default\r
-- echo -a,--arch ^<arg^> Specify an architecture ("armel" ^| "i386")\r
-- echo If this options is not defined, it uses a value\r
-- echo of ARCHITECTURE in build_data file by default\r
-- echo -t,--toolchain ^<arg^> Specify a toolchain ("GCC-4.5" ^| "LLVM-3.1")\r
-- echo If this options is not defined, it uses a value\r
-- echo of TOOLCHAIN in build_data file by default\r
-- echo -rp,--ref-project ^<arg^> Specify a path of referencing project\r
-- echo -u,--unittest-target ^<arg^> Specify a path of tested project\r
-- echo clean\r
--exit /b\r
++@echo off
++
++set TOOLS_HOME=%~dp0\..\..
++
++
++set command=%TOOLS_HOME%\smart-build-interface\bin\sbi-make.bat
++REM init environment variable
++set IS_CLEAN=0
++
++IF !%1==! (
++ GOTO getoptEnd
++)
++:getoptStart
++ IF %1==-h (
++ GOTO help
++ )
++ IF %1==--help (
++ GOTO help
++ )
++ IF %1==-n (
++ GOTO name
++ )
++ IF %1==--name (
++ GOTO name
++ )
++ IF %1==-v (
++ GOTO version
++ )
++ IF %1==--version (
++ GOTO version
++ )
++ IF %1==-a (
++ GOTO arch
++ )
++ IF %1==--arch (
++ GOTO arch
++ )
++ IF %1==-t (
++ GOTO toolchain
++ )
++ IF %1==--toolchain (
++ GOTO toolchain
++ )
++ IF %1==-rp (
++ GOTO referencing
++ )
++ IF %1==--ref-project (
++ GOTO referencing
++ )
++ IF %1==-u (
++ GOTO unittest
++ )
++ IF %1==--unittest-target (
++ GOTO unittest
++ )
++ IF %1==clean (
++ GOTO clean
++ )
++
++ :help
++ call :usage
++ exit /b
++ :name
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set command=%command% -n %2
++ shift
++ shift
++ GOTO getoptEnd
++ :version
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set command=%command% -v %2
++ shift
++ shift
++ GOTO getoptEnd
++ :arch
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set command=%command% -a %2
++ shift
++ shift
++ GOTO getoptEnd
++ :toolchain
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set command=%command% -t %2
++ shift
++ shift
++ GOTO getoptEnd
++ :referencing
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set command=%command% -r %2
++ shift
++ shift
++ GOTO getoptEnd
++ :unittest
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set command=%command% -u %2
++ shift
++ shift
++ GOTO getoptEnd
++ :clean
++ shift
++ set command=%command% clean
++ set IS_CLEAN=1
++ shift
++ GOTO getoptEnd
++
++:getoptEnd
++IF NOT !%1==! (
++ GOTO getoptStart
++)
++
++CALL %command%
++
++IF %IS_CLEAN%==1 (
++ exit /b %ERRORLEVEL%
++) ELSE (
++ IF %ERRORLEVEL%==0 (
++ echo.
++ echo To package the project, run native-packaging in %CD%
++ )
++)
++
++exit /b %ERRORLEVEL%
++
++:usage
++ echo Usage: native-make [options]
++ echo -n,--name ^<arg^> Specify a platform name ("Tizen Device 2.2" ^|
++ echo "Tizen Emulator 2.2")
++ echo If this options is not defined, the default
++ echo value of platform name is set by using
++ echo platform version and architecture
++ echo -v,--version ^<arg^> Specify a platform version ("Tizen 2.2")
++ echo If this options is not defined, it uses a value
++ echo of PLATFORM_VER in build_data file by default
++ echo -a,--arch ^<arg^> Specify an architecture ("armel" ^| "i386")
++ echo If this options is not defined, it uses a value
++ echo of ARCHITECTURE in build_data file by default
++ echo -t,--toolchain ^<arg^> Specify a toolchain ("GCC-4.5" ^| "LLVM-3.1")
++ echo If this options is not defined, it uses a value
++ echo of TOOLCHAIN in build_data file by default
++ echo -rp,--ref-project ^<arg^> Specify a path of referencing project
++ echo -u,--unittest-target ^<arg^> Specify a path of tested project
++ echo clean
++exit /b
--@echo off\r
--\r
--set TOOLS_HOME=%~dp0\..\..\r
--\r
--set SDB=%TOOLS_HOME%\sdb.exe\r
--set LAUNCH_APP=launch_app\r
--set BINARY=\r
--set PACKAGE=\r
--set COUNT=0\r
--\r
--IF !%1==! (\r
-- GOTO help\r
-- exit /b 1\r
--)\r
--:getoptStart\r
-- IF %1==-h (\r
-- GOTO help\r
-- )\r
-- IF %1==--help (\r
-- GOTO help\r
-- )\r
-- IF %1==-s (\r
-- GOTO serial\r
-- )\r
-- IF %1==--serial (\r
-- GOTO serial\r
-- )\r
-- IF %1==-p (\r
-- GOTO package\r
-- )\r
-- IF %1==--package (\r
-- GOTO package\r
-- )\r
-- IF %1==-b (\r
-- GOTO binary\r
-- )\r
-- IF %1==--binary (\r
-- GOTO binary\r
-- )\r
--\r
-- :help\r
-- call :usage\r
-- exit /b\r
-- :serial\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set SERIAL=%2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- :package\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set PACKAGE=%2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- :binary\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set BINARY=%2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- \r
--\r
--:getoptEnd\r
-- IF NOT !%1==! (\r
-- GOTO getoptStart\r
-- )\r
--\r
--set SDB_COMMAND=%SDB%\r
--IF NOT !%SERIAL%==! (\r
-- set SDB_COMMAND=%SDB_COMMAND% -s %SERIAL%\r
--)\r
--\r
--SET DEVICES=0\r
--\r
--FOR /f "usebackq delims=" %%a IN (`%SDB% devices`) DO (\r
-- SET /a DEVICES+=1\r
--)\r
--\r
--IF %DEVICES% lss 2 (\r
-- echo error: device not found\r
-- exit /b 2\r
--)\r
--IF %DEVICES% GTR 2 (\r
-- IF !%SERIAL%==! (\r
-- echo error: more than one device and emulator\r
-- exit /b 2\r
-- )\r
--)\r
--\r
--IF !%PACKAGE%==! (\r
-- call :usage\r
-- exit /b 1\r
--)\r
--\r
--SET COUNT=0\r
--SET FIND_PKGID_COMMAND=pkgcmd -l ^| grep %PACKAGE%\r
--FOR /f "usebackq delims=" %%a IN (`%SDB_COMMAND% shell "%FIND_PKGID_COMMAND% | wc -l"`) DO (\r
-- set COUNT=%%a\r
--)\r
--IF NOT %COUNT%==1 (\r
-- echo error: %PACKAGE%: no such package\r
-- exit /b 2\r
--)\r
--SET COUNT=0\r
--\r
--IF !%BINARY%==! (\r
-- FOR /f "usebackq delims=" %%a IN (`%SDB_COMMAND% shell "%FIND_PKGID_COMMAND% | awk '{gsub(/[\[\]]/, "", $6); print $6}'"`) DO (\r
-- set BINARY=%%a\r
-- )\r
--)\r
--\r
--set COMMAND=%SDB_COMMAND% shell %LAUNCH_APP% %PACKAGE%.%BINARY%\r
--\r
--CALL %COMMAND%\r
--\r
--\r
--exit /b %ERRORLEVEL%\r
--\r
--:usage\r
-- echo Usage: native-run -p ^<tpk file path^> [options]\r
-- echo -s,--serial ^<serial number^> direct command to the USB device or emulator with\r
-- echo the given serial number\r
-- echo -p,--package ^<pkg_name^> launch the application given ^<pkg_name^> on the target\r
-- echo -b,--binary ^<executable^> launch the application given ^<pkg_name^>.^<executable^>\r
--exit /b\r
++@echo off
++
++set TOOLS_HOME=%~dp0\..\..
++
++set SDB=%TOOLS_HOME%\sdb.exe
++set LAUNCH_APP=launch_app
++set BINARY=
++set PACKAGE=
++set COUNT=0
++
++IF !%1==! (
++ GOTO help
++ exit /b 1
++)
++:getoptStart
++ IF %1==-h (
++ GOTO help
++ )
++ IF %1==--help (
++ GOTO help
++ )
++ IF %1==-s (
++ GOTO serial
++ )
++ IF %1==--serial (
++ GOTO serial
++ )
++ IF %1==-p (
++ GOTO package
++ )
++ IF %1==--package (
++ GOTO package
++ )
++ IF %1==-b (
++ GOTO binary
++ )
++ IF %1==--binary (
++ GOTO binary
++ )
++
++ :help
++ call :usage
++ exit /b
++ :serial
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set SERIAL=%2
++ shift
++ shift
++ GOTO getoptEnd
++ :package
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set PACKAGE=%2
++ shift
++ shift
++ GOTO getoptEnd
++ :binary
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set BINARY=%2
++ shift
++ shift
++ GOTO getoptEnd
++
++
++:getoptEnd
++ IF NOT !%1==! (
++ GOTO getoptStart
++ )
++
++set SDB_COMMAND=%SDB%
++IF NOT !%SERIAL%==! (
++ set SDB_COMMAND=%SDB_COMMAND% -s %SERIAL%
++)
++
++SET DEVICES=0
++
++FOR /f "usebackq delims=" %%a IN (`%SDB% devices`) DO (
++ SET /a DEVICES+=1
++)
++
++IF %DEVICES% lss 2 (
++ echo error: device not found
++ exit /b 2
++)
++IF %DEVICES% GTR 2 (
++ IF !%SERIAL%==! (
++ echo error: more than one device and emulator
++ exit /b 2
++ )
++)
++
++IF !%PACKAGE%==! (
++ call :usage
++ exit /b 1
++)
++
++SET COUNT=0
++SET FIND_PKGID_COMMAND=pkgcmd -l ^| grep %PACKAGE%
++FOR /f "usebackq delims=" %%a IN (`%SDB_COMMAND% shell "%FIND_PKGID_COMMAND% | wc -l"`) DO (
++ set COUNT=%%a
++)
++IF NOT %COUNT%==1 (
++ echo error: %PACKAGE%: no such package
++ exit /b 2
++)
++SET COUNT=0
++
++IF !%BINARY%==! (
++ FOR /f "usebackq delims=" %%a IN (`%SDB_COMMAND% shell "%FIND_PKGID_COMMAND% | awk '{gsub(/[\[\]]/, "", $6); print $6}'"`) DO (
++ set BINARY=%%a
++ )
++)
++
++set COMMAND=%SDB_COMMAND% shell %LAUNCH_APP% %PACKAGE%.%BINARY%
++
++CALL %COMMAND%
++
++
++exit /b %ERRORLEVEL%
++
++:usage
++ echo Usage: native-run -p ^<tpk file path^> [options]
++ echo -s,--serial ^<serial number^> direct command to the USB device or emulator with
++ echo the given serial number
++ echo -p,--package ^<pkg_name^> launch the application given ^<pkg_name^> on the target
++ echo -b,--binary ^<executable^> launch the application given ^<pkg_name^>.^<executable^>
++exit /b
--@echo off\r
--\r
--set TOOLS_HOME=%~dp0\..\..\r
--\r
--REM init environment variable\r
--set SERIAL=\r
--set PACKAGE=\r
--set DEVICES=\r
--set COMMAND=\r
--\r
--IF !%1==! (\r
-- GOTO help\r
-- exit /b 1\r
--)\r
--:getoptStart\r
-- IF %1==-h (\r
-- GOTO help\r
-- )\r
-- IF %1==--help (\r
-- GOTO help\r
-- )\r
-- IF %1==-s (\r
-- GOTO serial\r
-- )\r
-- IF %1==--serial (\r
-- GOTO serial\r
-- )\r
-- IF %1==-p (\r
-- GOTO package\r
-- )\r
-- IF %1==--package (\r
-- GOTO package\r
-- )\r
--\r
-- :help\r
-- call :usage\r
-- exit /b\r
-- :serial\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set SERIAL=%2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
-- :package\r
-- IF !%2==! (\r
-- CALL :usage\r
-- exit /b 1\r
-- )\r
-- set PACKAGE=%2\r
-- shift\r
-- shift\r
-- GOTO getoptEnd\r
--\r
--:getoptEnd\r
-- IF NOT !%1==! (\r
-- GOTO getoptStart\r
-- )\r
--\r
--IF !%PACKAGE%==! (\r
-- call :usage\r
-- exit /b 1\r
--)\r
--\r
--SET DEVICES=0\r
--FOR /f "usebackq delims=" %%a IN (`%SDB% devices`) DO (\r
-- SET /A DEVICES+=1\r
--)\r
--IF %DEVICES% lss 2 (\r
-- echo error: device not found\r
-- exit /b 2\r
--) \r
--IF %DEVICES% GTR 2 (\r
-- IF !%SERIAL%==! (\r
-- echo error: more than one device and emulator\r
-- exit /b 2\r
-- )\r
--)\r
--\r
--set COMMAND=%SDB%\r
--IF NOT !%SERIAL%==! (\r
-- set COMMAND=%COMMAND% -s %SERIAL%\r
--)\r
--set COMMAND=%COMMAND% uninstall %PACKAGE%\r
--\r
--CALL %COMMAND%\r
--\r
--exit /b %ERRORLEVEL%\r
--\r
--:usage\r
-- echo Usage: native-uninstall -p ^<pkg_name^> [options]\r
-- echo -s,--serial ^<serial number^> directs command to the USB device or emulator with\r
-- echo the given serial number.\r
-- echo -p,package ^<pkg_name^> uninstall this package from the device.\r
--exit /b\r
++@echo off
++
++set TOOLS_HOME=%~dp0\..\..
++
++REM init environment variable
++set SERIAL=
++set PACKAGE=
++set DEVICES=
++set COMMAND=
++
++IF !%1==! (
++ GOTO help
++ exit /b 1
++)
++:getoptStart
++ IF %1==-h (
++ GOTO help
++ )
++ IF %1==--help (
++ GOTO help
++ )
++ IF %1==-s (
++ GOTO serial
++ )
++ IF %1==--serial (
++ GOTO serial
++ )
++ IF %1==-p (
++ GOTO package
++ )
++ IF %1==--package (
++ GOTO package
++ )
++
++ :help
++ call :usage
++ exit /b
++ :serial
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set SERIAL=%2
++ shift
++ shift
++ GOTO getoptEnd
++ :package
++ IF !%2==! (
++ CALL :usage
++ exit /b 1
++ )
++ set PACKAGE=%2
++ shift
++ shift
++ GOTO getoptEnd
++
++:getoptEnd
++ IF NOT !%1==! (
++ GOTO getoptStart
++ )
++
++IF !%PACKAGE%==! (
++ call :usage
++ exit /b 1
++)
++
++SET DEVICES=0
++FOR /f "usebackq delims=" %%a IN (`%SDB% devices`) DO (
++ SET /A DEVICES+=1
++)
++IF %DEVICES% lss 2 (
++ echo error: device not found
++ exit /b 2
++)
++IF %DEVICES% GTR 2 (
++ IF !%SERIAL%==! (
++ echo error: more than one device and emulator
++ exit /b 2
++ )
++)
++
++set COMMAND=%SDB%
++IF NOT !%SERIAL%==! (
++ set COMMAND=%COMMAND% -s %SERIAL%
++)
++set COMMAND=%COMMAND% uninstall %PACKAGE%
++
++CALL %COMMAND%
++
++exit /b %ERRORLEVEL%
++
++:usage
++ echo Usage: native-uninstall -p ^<pkg_name^> [options]
++ echo -s,--serial ^<serial number^> directs command to the USB device or emulator with
++ echo the given serial number.
++ echo -p,package ^<pkg_name^> uninstall this package from the device.
++exit /b
--{\r
-- "id": "tizen-standard-realm",\r
-- "loader": "file:///$${CLI_HOME}/realm/realm.jar",\r
-- "template-query-url": "file:///$${CLI_HOME}/realm/template/$${id}.jar",\r
-- "search-query-type": "directory",\r
-- "search-query-url": "file:///$${CLI_HOME}/realm/template"\r
--}\r
++{
++ "id": "tizen-standard-realm",
++ "loader": "file:///$${CLI_HOME}/realm/realm.jar",
++ "template-query-url": "file:///$${CLI_HOME}/realm/template/$${id}.jar",
++ "search-query-type": "directory",
++ "search-query-url": "file:///$${CLI_HOME}/realm/template"
++}
--/*\r
-- * Command line interface\r
-- *\r
-- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact: \r
-- * BonYong Lee <bonyong.lee@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- *\r
-- */\r
--package org.tizen.cli.command;\r
--\r
--import org.slf4j.Logger;\r
--import org.slf4j.LoggerFactory;\r
--\r
--abstract public class\r
--AbstractCommand\r
--implements CommandWithParameter\r
--{\r
-- \r
-- protected Logger logger = LoggerFactory.getLogger( getClass() );\r
--\r
--}\r
++/*
++ * Command line interface
++ *
++ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * BonYong Lee <bonyong.lee@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ *
++ */
++package org.tizen.cli.command;
++
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++
++abstract public class
++AbstractCommand
++implements CommandWithParameter
++{
++
++ protected Logger logger = LoggerFactory.getLogger( getClass() );
++
++}
--/*\r
-- * Command line interface\r
-- *\r
-- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact: \r
-- * BonYong Lee <bonyong.lee@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- *\r
-- */\r
--package org.tizen.cli.command;\r
--\r
--import org.tizen.common.core.command.ExecutionContext;\r
--\r
--public interface\r
--CommandWithParameter\r
--{\r
-- void process( ExecutionContext context, String[] args ) throws Exception;\r
--\r
--}\r
++/*
++ * Command line interface
++ *
++ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * BonYong Lee <bonyong.lee@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ *
++ */
++package org.tizen.cli.command;
++
++import org.tizen.common.core.command.ExecutionContext;
++
++public interface
++CommandWithParameter
++{
++ void process( ExecutionContext context, String[] args ) throws Exception;
++
++}
--/*\r
-- * Command line interface\r
-- *\r
-- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact: \r
-- * BonYong Lee <bonyong.lee@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- *\r
-- */\r
--package org.tizen.cli.command;\r
--\r
--public class PluginConstants\r
--{\r
--\r
-- public static final String OBSERVER = "pic.file.observer";\r
-- public static final String PLUGINS = "pic.server.plugin";\r
-- \r
-- public static final String REALM = "pic.template.realm";\r
-- \r
-- \r
-- public static final String PROP_DOCBASE = "document.base";\r
-- \r
-- public static final String PROP_CWD = "user.dir";\r
-- \r
--\r
--}\r
++/*
++ * Command line interface
++ *
++ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * BonYong Lee <bonyong.lee@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ *
++ */
++package org.tizen.cli.command;
++
++public class PluginConstants
++{
++
++ public static final String OBSERVER = "pic.file.observer";
++ public static final String PLUGINS = "pic.server.plugin";
++
++ public static final String REALM = "pic.template.realm";
++
++
++ public static final String PROP_DOCBASE = "document.base";
++
++ public static final String PROP_CWD = "user.dir";
++
++
++}
--Specify profile( profile name and profiles file path )\r
--\r
--* profile name\r
-- Profiles file can contain multiple profiles. You must specify profile to use in signing.\r
--\r
--* profiles file path\r
-- Path of profiles file containing profiles. Default value is "$CLI_HOME/conf/profiles.xml". You can change it using java virtual machine properties( -D ).\r
--\r
-- Ex.)\r
-- web-signing -p develop:/home/tizen/profiles.xml\r
-- web-signing -p develop\r
--\r
--* profiles file format\r
-- It is xml-formatted file. Its schema( xml schema ) exists in $CLI_HOME/doc/schema/profiles.xsd\r
++Specify profile( profile name and profiles file path )
++
++* profile name
++ Profiles file can contain multiple profiles. You must specify profile to use in signing.
++
++* profiles file path
++ Path of profiles file containing profiles. Default value is "$CLI_HOME/conf/profiles.xml". You can change it using java virtual machine properties( -D ).
++
++ Ex.)
++ web-signing -p develop:/home/tizen/profiles.xml
++ web-signing -p develop
++
++* profiles file format
++ It is xml-formatted file. Its schema( xml schema ) exists in $CLI_HOME/doc/schema/profiles.xsd
You don't have to specify schema in profiles file
--/*\r
-- * Command line interface\r
-- *\r
-- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact: \r
-- * BonYong Lee <bonyong.lee@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- *\r
-- */\r
--package org.tizen.cli.util;\r
--\r
--import static org.tizen.common.util.ObjectUtil.nvl;\r
--import static org.tizen.common.util.StringUtil.nvl;\r
--\r
--import java.util.Collection;\r
--\r
--import org.tizen.common.config.Preference;\r
--import org.tizen.common.core.command.ExecutionContext;\r
--import org.tizen.common.core.command.Prompter;\r
--import org.tizen.common.core.command.prompter.GenericOption;\r
--import org.tizen.common.verrari.IModelProvider;\r
--import org.tizen.common.verrari.template.CommonTemplate;\r
--import org.tizen.common.verrari.template.StandardTemplate;\r
--\r
--public class\r
--TemplateModelProvider\r
--implements IModelProvider\r
--{\r
-- protected static final Object NULL = new Object();\r
-- \r
-- protected final ExecutionContext context;\r
-- \r
-- \r
-- public\r
-- TemplateModelProvider(\r
-- final ExecutionContext context\r
-- )\r
-- {\r
-- this.context = context;\r
-- }\r
--\r
-- @Override\r
-- public boolean isEmpty()\r
-- {\r
-- return false;\r
-- }\r
--\r
-- @Override\r
-- public Collection<String> keys()\r
-- {\r
-- throw new UnsupportedOperationException();\r
-- }\r
--\r
-- @Override\r
-- public\r
-- Object\r
-- getModel(\r
-- final String key\r
-- )\r
-- {\r
-- Object obj = context.getValue( key );\r
-- if ( NULL.equals( obj ) )\r
-- {\r
-- return null;\r
-- } else if ( null != obj )\r
-- {\r
-- return obj;\r
-- }\r
-- \r
-- obj = Preference.getValue( key, null );\r
-- if ( null != obj )\r
-- {\r
-- return obj;\r
-- }\r
-- \r
-- obj = inputFromUser( key );\r
-- \r
-- this.context.setValue( key, nvl( obj, NULL ) );\r
-- \r
-- return obj;\r
-- }\r
--\r
-- protected Object inputFromUser( final String key )\r
-- {\r
-- final Prompter prompter = this.context.getPrompter();\r
-- final GenericOption opt = new GenericOption();\r
--\r
-- CommonTemplate current = CommonTemplate.getCurrentTemplate();\r
-- String message = "Input " + key + " ?";\r
-- if ( null != current )\r
-- {\r
-- message = nvl( current.getMessage( key ), message );\r
-- }\r
-- prompter.interact( message, opt );\r
-- \r
-- return opt.getAnswer();\r
-- }\r
--\r
--}\r
++/*
++ * Command line interface
++ *
++ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * BonYong Lee <bonyong.lee@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ *
++ */
++package org.tizen.cli.util;
++
++import static org.tizen.common.util.ObjectUtil.nvl;
++import static org.tizen.common.util.StringUtil.nvl;
++
++import java.util.Collection;
++
++import org.tizen.common.config.Preference;
++import org.tizen.common.core.command.ExecutionContext;
++import org.tizen.common.core.command.Prompter;
++import org.tizen.common.core.command.prompter.GenericOption;
++import org.tizen.common.verrari.IModelProvider;
++import org.tizen.common.verrari.template.CommonTemplate;
++import org.tizen.common.verrari.template.StandardTemplate;
++
++public class
++TemplateModelProvider
++implements IModelProvider
++{
++ protected static final Object NULL = new Object();
++
++ protected final ExecutionContext context;
++
++
++ public
++ TemplateModelProvider(
++ final ExecutionContext context
++ )
++ {
++ this.context = context;
++ }
++
++ @Override
++ public boolean isEmpty()
++ {
++ return false;
++ }
++
++ @Override
++ public Collection<String> keys()
++ {
++ throw new UnsupportedOperationException();
++ }
++
++ @Override
++ public
++ Object
++ getModel(
++ final String key
++ )
++ {
++ Object obj = context.getValue( key );
++ if ( NULL.equals( obj ) )
++ {
++ return null;
++ } else if ( null != obj )
++ {
++ return obj;
++ }
++
++ obj = Preference.getValue( key, null );
++ if ( null != obj )
++ {
++ return obj;
++ }
++
++ obj = inputFromUser( key );
++
++ this.context.setValue( key, nvl( obj, NULL ) );
++
++ return obj;
++ }
++
++ protected Object inputFromUser( final String key )
++ {
++ final Prompter prompter = this.context.getPrompter();
++ final GenericOption opt = new GenericOption();
++
++ CommonTemplate current = CommonTemplate.getCurrentTemplate();
++ String message = "Input " + key + " ?";
++ if ( null != current )
++ {
++ message = nvl( current.getMessage( key ), message );
++ }
++ prompter.interact( message, opt );
++
++ return opt.getAnswer();
++ }
++
++}
--/*\r
--* Command Line Interface\r
--*\r
--* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
--*\r
--* Contact: \r
--* BonYong Lee <bonyong.lee@samsung.com>\r
--* \r
--* Licensed under the Apache License, Version 2.0 (the "License");\r
--* you may not use this file except in compliance with the License.\r
--* You may obtain a copy of the License at\r
--*\r
--* http://www.apache.org/licenses/LICENSE-2.0\r
--*\r
--* Unless required by applicable law or agreed to in writing, software\r
--* distributed under the License is distributed on an "AS IS" BASIS,\r
--* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
--* See the License for the specific language governing permissions and\r
--* limitations under the License.\r
--*\r
--* Contributors:\r
--* - S-Core Co., Ltd\r
--*\r
--*/\r
--package org.tizen.cli.exec;\r
--\r
--import static org.junit.Assert.assertEquals;\r
--import static org.mockito.Mockito.mock;\r
--\r
--import java.io.PrintStream;\r
--import java.io.Reader;\r
--import java.io.StringReader;\r
--import java.util.Arrays;\r
--\r
--import org.junit.Test;\r
--import org.tizen.common.core.command.UserField;\r
--\r
--/**\r
-- * ConsolePrompterTest\r
-- *\r
-- * Test case for {@link ConsolePrompter}\r
-- * \r
-- * @author BonYong Lee{@literal <bonyong.lee@samsung.com>} (S-Core)\r
-- * \r
-- * @see ConsolePrompter\r
-- */\r
--public class\r
--ConsolePrompterTest\r
--{\r
--\r
-- /**\r
-- * Test {@link ConsolePrompter#batch(java.util.Collection)}\r
-- * \r
-- * @throws Exception in case of failure in test\r
-- * \r
-- * @see ConsolePrompter#batch(java.util.Collection)\r
-- */\r
-- @Test\r
-- public void test_batch()\r
-- {\r
-- final PrintStream outMock = mock( PrintStream.class );\r
-- final Reader readerMock = new StringReader( "bylee\ny\nn\n" );\r
-- final ConsolePrompter prompter = new ConsolePrompter( outMock, readerMock );\r
-- \r
-- final UserField name = new UserField( "name", "Input your name?", String.class );\r
-- final UserField sex = new UserField( "sex", "Are you man?", boolean.class );\r
-- final UserField tall = new UserField( "tallerThan180", "Are you taller than 180cm?", Boolean.class );\r
-- \r
-- prompter.batch( Arrays.asList( name, sex, tall ), null );\r
-- \r
-- assertEquals( "bylee", name.getValue() );\r
-- assertEquals( true, sex.getValue() );\r
-- assertEquals( false, tall.getValue() );\r
-- }\r
--\r
--}\r
++/*
++* Command Line Interface
++*
++* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
++*
++* Contact:
++* BonYong Lee <bonyong.lee@samsung.com>
++*
++* Licensed under the Apache License, Version 2.0 (the "License");
++* you may not use this file except in compliance with the License.
++* You may obtain a copy of the License at
++*
++* http://www.apache.org/licenses/LICENSE-2.0
++*
++* Unless required by applicable law or agreed to in writing, software
++* distributed under the License is distributed on an "AS IS" BASIS,
++* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++* See the License for the specific language governing permissions and
++* limitations under the License.
++*
++* Contributors:
++* - S-Core Co., Ltd
++*
++*/
++package org.tizen.cli.exec;
++
++import static org.junit.Assert.assertEquals;
++import static org.mockito.Mockito.mock;
++
++import java.io.PrintStream;
++import java.io.Reader;
++import java.io.StringReader;
++import java.util.Arrays;
++
++import org.junit.Test;
++import org.tizen.common.core.command.UserField;
++
++/**
++ * ConsolePrompterTest
++ *
++ * Test case for {@link ConsolePrompter}
++ *
++ * @author BonYong Lee{@literal <bonyong.lee@samsung.com>} (S-Core)
++ *
++ * @see ConsolePrompter
++ */
++public class
++ConsolePrompterTest
++{
++
++ /**
++ * Test {@link ConsolePrompter#batch(java.util.Collection)}
++ *
++ * @throws Exception in case of failure in test
++ *
++ * @see ConsolePrompter#batch(java.util.Collection)
++ */
++ @Test
++ public void test_batch()
++ {
++ final PrintStream outMock = mock( PrintStream.class );
++ final Reader readerMock = new StringReader( "bylee\ny\nn\n" );
++ final ConsolePrompter prompter = new ConsolePrompter( outMock, readerMock );
++
++ final UserField name = new UserField( "name", "Input your name?", String.class );
++ final UserField sex = new UserField( "sex", "Are you man?", boolean.class );
++ final UserField tall = new UserField( "tallerThan180", "Are you taller than 180cm?", Boolean.class );
++
++ prompter.batch( Arrays.asList( name, sex, tall ), null );
++
++ assertEquals( "bylee", name.getValue() );
++ assertEquals( true, sex.getValue() );
++ assertEquals( false, tall.getValue() );
++ }
++
++}
--/*\r
--* Web IDE - Command Line Interface\r
--*\r
--* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
--*\r
--* Contact: \r
--* BonYong Lee <bonyong.lee@samsung.com>\r
--* \r
--* Licensed under the Apache License, Version 2.0 (the "License");\r
--* you may not use this file except in compliance with the License.\r
--* You may obtain a copy of the License at\r
--*\r
--* http://www.apache.org/licenses/LICENSE-2.0\r
--*\r
--* Unless required by applicable law or agreed to in writing, software\r
--* distributed under the License is distributed on an "AS IS" BASIS,\r
--* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
--* See the License for the specific language governing permissions and\r
--* limitations under the License.\r
--*\r
--* Contributors:\r
--* - S-Core Co., Ltd\r
--*\r
--*/\r
--package org.tizen.cli.exec.template;\r
--\r
--import static org.junit.Assert.assertNotNull;\r
--import static org.mockito.Mockito.mock;\r
--\r
--import org.apache.commons.cli.CommandLine;\r
--import org.apache.commons.cli.Options;\r
--import org.apache.commons.cli.PosixParser;\r
--import org.junit.Test;\r
--import org.tizen.cli.exec.CommandLineExecutor;\r
--import org.tizen.common.core.command.Executor;\r
--import org.tizen.common.core.command.Prompter;\r
--\r
--/**\r
-- * ClientMainTest\r
-- *\r
-- * Test case for {@link ClientMain}\r
-- * \r
-- * @author BonYong Lee{@literal <bonyong.lee@samsung.com>} (S-Core)\r
-- * \r
-- * @see ClientMain\r
-- */\r
--public class\r
--ClientMainTest\r
--{\r
--\r
-- /**\r
-- * Test {@link ClientMain#getOptions()}\r
-- * \r
-- * @throws Exception in case of failure in test\r
-- * \r
-- * @see ClientMain#getOptions()}\r
-- */\r
-- @Test\r
-- public\r
-- void\r
-- test_getOptions()\r
-- {\r
-- final ClientMain target = new ClientMain();\r
-- final Options opts = target.getOptions();\r
-- assertNotNull( opts );\r
-- }\r
-- \r
-- /**\r
-- * Test {@link ClientMain#run(String...)}\r
-- * \r
-- * @throws Exception in case of failure in test\r
-- * \r
-- * @see ClientMain#run(String...)}\r
-- */\r
-- @Test\r
-- public\r
-- void\r
-- test_run()\r
-- throws Exception\r
-- {\r
-- final Prompter prompterMock = mock( Prompter.class );\r
-- final Executor executor2 = new CommandLineExecutor( prompterMock );\r
-- final ClientMain target = new ClientMain() {\r
-- @Override\r
-- protected Executor getExecutor()\r
-- {\r
-- return executor2;\r
-- }\r
-- \r
-- };\r
-- final PosixParser parser = new PosixParser();\r
-- final CommandLine cmd = parser.parse( target.getOptions(), new String[] {} );\r
-- target.execute( cmd );\r
-- }\r
--\r
--}\r
++/*
++* Web IDE - Command Line Interface
++*
++* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
++*
++* Contact:
++* BonYong Lee <bonyong.lee@samsung.com>
++*
++* Licensed under the Apache License, Version 2.0 (the "License");
++* you may not use this file except in compliance with the License.
++* You may obtain a copy of the License at
++*
++* http://www.apache.org/licenses/LICENSE-2.0
++*
++* Unless required by applicable law or agreed to in writing, software
++* distributed under the License is distributed on an "AS IS" BASIS,
++* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++* See the License for the specific language governing permissions and
++* limitations under the License.
++*
++* Contributors:
++* - S-Core Co., Ltd
++*
++*/
++package org.tizen.cli.exec.template;
++
++import static org.junit.Assert.assertNotNull;
++import static org.mockito.Mockito.mock;
++
++import org.apache.commons.cli.CommandLine;
++import org.apache.commons.cli.Options;
++import org.apache.commons.cli.PosixParser;
++import org.junit.Test;
++import org.tizen.cli.exec.CommandLineExecutor;
++import org.tizen.common.core.command.Executor;
++import org.tizen.common.core.command.Prompter;
++
++/**
++ * ClientMainTest
++ *
++ * Test case for {@link ClientMain}
++ *
++ * @author BonYong Lee{@literal <bonyong.lee@samsung.com>} (S-Core)
++ *
++ * @see ClientMain
++ */
++public class
++ClientMainTest
++{
++
++ /**
++ * Test {@link ClientMain#getOptions()}
++ *
++ * @throws Exception in case of failure in test
++ *
++ * @see ClientMain#getOptions()}
++ */
++ @Test
++ public
++ void
++ test_getOptions()
++ {
++ final ClientMain target = new ClientMain();
++ final Options opts = target.getOptions();
++ assertNotNull( opts );
++ }
++
++ /**
++ * Test {@link ClientMain#run(String...)}
++ *
++ * @throws Exception in case of failure in test
++ *
++ * @see ClientMain#run(String...)}
++ */
++ @Test
++ public
++ void
++ test_run()
++ throws Exception
++ {
++ final Prompter prompterMock = mock( Prompter.class );
++ final Executor executor2 = new CommandLineExecutor( prompterMock );
++ final ClientMain target = new ClientMain() {
++ @Override
++ protected Executor getExecutor()
++ {
++ return executor2;
++ }
++
++ };
++ final PosixParser parser = new PosixParser();
++ final CommandLine cmd = parser.parse( target.getOptions(), new String[] {} );
++ target.execute( cmd );
++ }
++
++}
--<?xml version="1.0" encoding="UTF-8"?>\r
--<projectDescription>\r
-- <name>org.tizen.ncli.ide</name>\r
-- <comment></comment>\r
-- <projects>\r
-- </projects>\r
-- <buildSpec>\r
-- <buildCommand>\r
-- <name>org.eclipse.jdt.core.javabuilder</name>\r
-- <arguments>\r
-- </arguments>\r
-- </buildCommand>\r
-- <buildCommand>\r
-- <name>org.eclipse.pde.ManifestBuilder</name>\r
-- <arguments>\r
-- </arguments>\r
-- </buildCommand>\r
-- <buildCommand>\r
-- <name>org.eclipse.pde.SchemaBuilder</name>\r
-- <arguments>\r
-- </arguments>\r
-- </buildCommand>\r
-- </buildSpec>\r
-- <natures>\r
-- <nature>org.eclipse.pde.PluginNature</nature>\r
-- <nature>org.eclipse.jdt.core.javanature</nature>\r
-- </natures>\r
--</projectDescription>\r
++<?xml version="1.0" encoding="UTF-8"?>
++<projectDescription>
++ <name>org.tizen.ncli.ide</name>
++ <comment></comment>
++ <projects>
++ </projects>
++ <buildSpec>
++ <buildCommand>
++ <name>org.eclipse.jdt.core.javabuilder</name>
++ <arguments>
++ </arguments>
++ </buildCommand>
++ <buildCommand>
++ <name>org.eclipse.pde.ManifestBuilder</name>
++ <arguments>
++ </arguments>
++ </buildCommand>
++ <buildCommand>
++ <name>org.eclipse.pde.SchemaBuilder</name>
++ <arguments>
++ </arguments>
++ </buildCommand>
++ </buildSpec>
++ <natures>
++ <nature>org.eclipse.pde.PluginNature</nature>
++ <nature>org.eclipse.jdt.core.javanature</nature>
++ </natures>
++</projectDescription>
--eclipse.preferences.version=1\r
--org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
--org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r
--org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve\r
--org.eclipse.jdt.core.compiler.compliance=1.6\r
--org.eclipse.jdt.core.compiler.debug.lineNumber=generate\r
--org.eclipse.jdt.core.compiler.debug.localVariable=generate\r
--org.eclipse.jdt.core.compiler.debug.sourceFile=generate\r
--org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
--org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
--org.eclipse.jdt.core.compiler.source=1.6\r
++eclipse.preferences.version=1
++org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
++org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
++org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
++org.eclipse.jdt.core.compiler.compliance=1.6
++org.eclipse.jdt.core.compiler.debug.lineNumber=generate
++org.eclipse.jdt.core.compiler.debug.localVariable=generate
++org.eclipse.jdt.core.compiler.debug.sourceFile=generate
++org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
++org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
++org.eclipse.jdt.core.compiler.source=1.6
--eclipse.preferences.version=1\r
--pluginProject.extensions=false\r
--resolve.requirebundle=false\r
++eclipse.preferences.version=1
++pluginProject.extensions=false
++resolve.requirebundle=false
--<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
--<!-- WARNING: Eclipse auto-generated file.\r
-- Any modifications will be overwritten.\r
-- To include a user specific buildfile here, simply create one in the same\r
-- directory with the processing instruction <?eclipse.ant.import?>\r
-- as the first entry and export the buildfile again. -->\r
--<project basedir="." default="build" name="org.tizen.ncli.ide">\r
-- <property environment="env"/>\r
-- <property name="ECLIPSE_HOME" value="C:/tizen-sdk/ide"/>\r
-- <property name="junit.output.dir" value="junit"/>\r
-- <property name="debuglevel" value="source,lines,vars"/>\r
-- <property name="target" value="1.6"/>\r
-- <property name="source" value="1.6"/>\r
-- <path id="Plug-in Dependencies.libraryclasspath">\r
-- <pathelement location="../../../org.tizen.common"/>\r
-- <pathelement location="../../../org.tizen.common.builder"/>\r
-- <pathelement location="${ECLIPSE_HOME}/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/junit.jar"/>\r
-- </path>\r
-- <path id="JUnit 4.libraryclasspath">\r
-- <pathelement location="../../../devtools/eclipse-jee-kepler-SR1/plugins/org.junit_4.11.0.v201303080030/junit.jar"/>\r
-- <pathelement location="../../../devtools/eclipse-jee-kepler-SR1/plugins/org.hamcrest.core_1.3.0.v201303031735.jar"/>\r
-- </path>\r
-- <path id="org.tizen.ncli.ide.classpath">\r
-- <pathelement location="lib/args4j-2.0.24-SNAPSHOT.jar"/>\r
-- <path refid="Plug-in Dependencies.libraryclasspath"/>\r
-- <pathelement location="bin"/>\r
-- <path refid="JUnit 4.libraryclasspath"/>\r
-- </path>\r
-- <target name="init">\r
-- <mkdir dir="bin"/>\r
-- <copy includeemptydirs="false" todir="bin">\r
-- <fileset dir="src">\r
-- <exclude name="**/*.launch"/>\r
-- <exclude name="**/*.java"/>\r
-- </fileset>\r
-- </copy>\r
-- <copy includeemptydirs="false" todir="bin">\r
-- <fileset dir="test/src">\r
-- <exclude name="**/*.launch"/>\r
-- <exclude name="**/*.java"/>\r
-- </fileset>\r
-- </copy>\r
-- <copy includeemptydirs="false" todir="bin">\r
-- <fileset dir="test/resources">\r
-- <exclude name="**/*.launch"/>\r
-- <exclude name="**/*.java"/>\r
-- </fileset>\r
-- </copy>\r
-- </target>\r
-- <target name="clean">\r
-- <delete dir="bin"/>\r
-- </target>\r
-- <target depends="clean" name="cleanall"/>\r
-- <target depends="build-subprojects,build-project" name="build"/>\r
-- <target name="build-subprojects"/>\r
-- <target depends="init" name="build-project">\r
-- <echo message="${ant.project.name}: ${ant.file}"/>\r
-- <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">\r
-- <src path="src"/>\r
-- <src path="test/src"/>\r
-- <src path="test/resources"/>\r
-- <classpath refid="org.tizen.ncli.ide.classpath"/>\r
-- </javac>\r
-- </target>\r
-- <!-- ================================= \r
-- target: jar \r
-- ================================= -->\r
-- <target name="jar" depends="build-project" description="make jar package">\r
-- <jar destfile="org.tizen.ncli.ide.jar" basedir="bin" >\r
-- \r
-- </jar>\r
-- </target>\r
--\r
-- <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>\r
-- <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">\r
-- <copy todir="${ant.library.dir}">\r
-- <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>\r
-- </copy>\r
-- <unzip dest="${ant.library.dir}">\r
-- <patternset includes="jdtCompilerAdapter.jar"/>\r
-- <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>\r
-- </unzip>\r
-- </target>\r
-- <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">\r
-- <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>\r
-- <antcall target="build"/>\r
-- </target>\r
-- <target name="BuildWeb-main">\r
-- <java classname="org.tizen.ncli.ide.shell.Main" failonerror="true" fork="yes">\r
-- <arg line="build-web -- . -opt"/>\r
-- <classpath refid="org.tizen.ncli.ide.classpath"/>\r
-- </java>\r
-- </target>\r
-- <target name="BuildWebCLICommandTest">\r
-- <mkdir dir="${junit.output.dir}"/>\r
-- <junit fork="yes" printsummary="withOutAndErr">\r
-- <formatter type="xml"/>\r
-- <test name="org.tizen.ncli.ide.subcommands.BuildWebCLICommandTest" todir="${junit.output.dir}"/>\r
-- <classpath refid="org.tizen.ncli.ide.classpath"/>\r
-- </junit>\r
-- </target>\r
-- <target name="ConfigCLITest">\r
-- <mkdir dir="${junit.output.dir}"/>\r
-- <junit fork="yes" printsummary="withOutAndErr">\r
-- <formatter type="xml"/>\r
-- <test name="org.tizen.ncli.ide.shell.ConfigCLITest" todir="${junit.output.dir}"/>\r
-- <classpath refid="org.tizen.ncli.ide.classpath"/>\r
-- </junit>\r
-- </target>\r
-- <target name="ConfigCommandTest">\r
-- <mkdir dir="${junit.output.dir}"/>\r
-- <junit fork="yes" printsummary="withOutAndErr">\r
-- <formatter type="xml"/>\r
-- <test name="org.tizen.ncli.ide.subcommands.ConfigCommandTest" todir="${junit.output.dir}"/>\r
-- <classpath refid="org.tizen.ncli.ide.classpath"/>\r
-- </junit>\r
-- </target>\r
-- <target name="NCLITestResourceUtilTest">\r
-- <mkdir dir="${junit.output.dir}"/>\r
-- <junit fork="yes" printsummary="withOutAndErr">\r
-- <formatter type="xml"/>\r
-- <test name="org.tizen.ncli.ide.subcommands.NCLITestResourceUtilTest" todir="${junit.output.dir}"/>\r
-- <classpath refid="org.tizen.ncli.ide.classpath"/>\r
-- </junit>\r
-- </target>\r
-- <target name="junitreport">\r
-- <junitreport todir="${junit.output.dir}">\r
-- <fileset dir="${junit.output.dir}">\r
-- <include name="TEST-*.xml"/>\r
-- </fileset>\r
-- <report format="frames" todir="${junit.output.dir}"/>\r
-- </junitreport>\r
-- </target>\r
--</project>\r
++<?xml version="1.0" encoding="UTF-8" standalone="no"?>
++<!-- WARNING: Eclipse auto-generated file.
++ Any modifications will be overwritten.
++ To include a user specific buildfile here, simply create one in the same
++ directory with the processing instruction <?eclipse.ant.import?>
++ as the first entry and export the buildfile again. -->
++<project basedir="." default="build" name="org.tizen.ncli.ide">
++ <property environment="env"/>
++ <property name="ECLIPSE_HOME" value="C:/tizen-sdk/ide"/>
++ <property name="junit.output.dir" value="junit"/>
++ <property name="debuglevel" value="source,lines,vars"/>
++ <property name="target" value="1.6"/>
++ <property name="source" value="1.6"/>
++ <path id="Plug-in Dependencies.libraryclasspath">
++ <pathelement location="../../../org.tizen.common"/>
++ <pathelement location="../../../org.tizen.common.builder"/>
++ <pathelement location="${ECLIPSE_HOME}/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/junit.jar"/>
++ </path>
++ <path id="JUnit 4.libraryclasspath">
++ <pathelement location="../../../devtools/eclipse-jee-kepler-SR1/plugins/org.junit_4.11.0.v201303080030/junit.jar"/>
++ <pathelement location="../../../devtools/eclipse-jee-kepler-SR1/plugins/org.hamcrest.core_1.3.0.v201303031735.jar"/>
++ </path>
++ <path id="org.tizen.ncli.ide.classpath">
++ <pathelement location="lib/args4j-2.0.24-SNAPSHOT.jar"/>
++ <path refid="Plug-in Dependencies.libraryclasspath"/>
++ <pathelement location="bin"/>
++ <path refid="JUnit 4.libraryclasspath"/>
++ </path>
++ <target name="init">
++ <mkdir dir="bin"/>
++ <copy includeemptydirs="false" todir="bin">
++ <fileset dir="src">
++ <exclude name="**/*.launch"/>
++ <exclude name="**/*.java"/>
++ </fileset>
++ </copy>
++ <copy includeemptydirs="false" todir="bin">
++ <fileset dir="test/src">
++ <exclude name="**/*.launch"/>
++ <exclude name="**/*.java"/>
++ </fileset>
++ </copy>
++ <copy includeemptydirs="false" todir="bin">
++ <fileset dir="test/resources">
++ <exclude name="**/*.launch"/>
++ <exclude name="**/*.java"/>
++ </fileset>
++ </copy>
++ </target>
++ <target name="clean">
++ <delete dir="bin"/>
++ </target>
++ <target depends="clean" name="cleanall"/>
++ <target depends="build-subprojects,build-project" name="build"/>
++ <target name="build-subprojects"/>
++ <target depends="init" name="build-project">
++ <echo message="${ant.project.name}: ${ant.file}"/>
++ <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
++ <src path="src"/>
++ <src path="test/src"/>
++ <src path="test/resources"/>
++ <classpath refid="org.tizen.ncli.ide.classpath"/>
++ </javac>
++ </target>
++ <!-- =================================
++ target: jar
++ ================================= -->
++ <target name="jar" depends="build-project" description="make jar package">
++ <jar destfile="org.tizen.ncli.ide.jar" basedir="bin" >
++
++ </jar>
++ </target>
++
++ <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
++ <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
++ <copy todir="${ant.library.dir}">
++ <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
++ </copy>
++ <unzip dest="${ant.library.dir}">
++ <patternset includes="jdtCompilerAdapter.jar"/>
++ <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
++ </unzip>
++ </target>
++ <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
++ <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
++ <antcall target="build"/>
++ </target>
++ <target name="BuildWeb-main">
++ <java classname="org.tizen.ncli.ide.shell.Main" failonerror="true" fork="yes">
++ <arg line="build-web -- . -opt"/>
++ <classpath refid="org.tizen.ncli.ide.classpath"/>
++ </java>
++ </target>
++ <target name="BuildWebCLICommandTest">
++ <mkdir dir="${junit.output.dir}"/>
++ <junit fork="yes" printsummary="withOutAndErr">
++ <formatter type="xml"/>
++ <test name="org.tizen.ncli.ide.subcommands.BuildWebCLICommandTest" todir="${junit.output.dir}"/>
++ <classpath refid="org.tizen.ncli.ide.classpath"/>
++ </junit>
++ </target>
++ <target name="ConfigCLITest">
++ <mkdir dir="${junit.output.dir}"/>
++ <junit fork="yes" printsummary="withOutAndErr">
++ <formatter type="xml"/>
++ <test name="org.tizen.ncli.ide.shell.ConfigCLITest" todir="${junit.output.dir}"/>
++ <classpath refid="org.tizen.ncli.ide.classpath"/>
++ </junit>
++ </target>
++ <target name="ConfigCommandTest">
++ <mkdir dir="${junit.output.dir}"/>
++ <junit fork="yes" printsummary="withOutAndErr">
++ <formatter type="xml"/>
++ <test name="org.tizen.ncli.ide.subcommands.ConfigCommandTest" todir="${junit.output.dir}"/>
++ <classpath refid="org.tizen.ncli.ide.classpath"/>
++ </junit>
++ </target>
++ <target name="NCLITestResourceUtilTest">
++ <mkdir dir="${junit.output.dir}"/>
++ <junit fork="yes" printsummary="withOutAndErr">
++ <formatter type="xml"/>
++ <test name="org.tizen.ncli.ide.subcommands.NCLITestResourceUtilTest" todir="${junit.output.dir}"/>
++ <classpath refid="org.tizen.ncli.ide.classpath"/>
++ </junit>
++ </target>
++ <target name="junitreport">
++ <junitreport todir="${junit.output.dir}">
++ <fileset dir="${junit.output.dir}">
++ <include name="TEST-*.xml"/>
++ </fileset>
++ <report format="frames" todir="${junit.output.dir}"/>
++ </junitreport>
++ </target>
++</project>
--source.. = src/\r
--output.. = bin/\r
--bin.includes = META-INF/,\\r
-- .\r
++source.. = src/
++output.. = bin/
++bin.includes = META-INF/,\
++ .
--<?xml version="1.0" encoding="UTF-8"?>\r
--<!-- ====================================================================== \r
-- 2013. 10. 10. 오후 9:03:37 \r
--\r
-- org.tizen.ncli.ide \r
-- Ant build file for Tizen New CLI for IDE \r
-- \r
-- Harry Hyeongseok Heo <hyeongseok.heo@samsung.com \r
-- ====================================================================== -->\r
--<project name="org.tizen.ncli.ide" default="default">\r
-- <description>\r
-- \r
-- </description>\r
--\r
-- <!-- ================================= \r
-- target: default \r
-- ================================= -->\r
-- <target name="default" depends="depends" description="description">\r
-- \r
-- </target>\r
--\r
-- <!-- - - - - - - - - - - - - - - - - - \r
-- target: depends \r
-- - - - - - - - - - - - - - - - - - -->\r
-- <target name="depends">\r
-- </target>\r
--\r
--</project>\r
++<?xml version="1.0" encoding="UTF-8"?>
++<!-- ======================================================================
++ 2013. 10. 10. 오후 9:03:37
++
++ org.tizen.ncli.ide
++ Ant build file for Tizen New CLI for IDE
++
++ Harry Hyeongseok Heo <hyeongseok.heo@samsung.com
++ ====================================================================== -->
++<project name="org.tizen.ncli.ide" default="default">
++ <description>
++
++ </description>
++
++ <!-- =================================
++ target: default
++ ================================= -->
++ <target name="default" depends="depends" description="description">
++
++ </target>
++
++ <!-- - - - - - - - - - - - - - - - - -
++ target: depends
++ - - - - - - - - - - - - - - - - - -->
++ <target name="depends">
++ </target>
++
++</project>
--@echo off\r
--set CLI_HOME=%1\r
--set CLI_NAME=%2\r
--set MAIN=%3\r
--set ARGS=%4\r
--\r
--set OPT_LOGGING=-Dlog4j.configuration=log4j.xml\r
--set OPT_PRG_NAME=-Dcli.name=%CLI_NAME%\r
--set LIB_PATH=%CLI_HOME%\lib\r
--\r
--set classpath=\r
--FOR /f "tokens=*" %%i IN ('dir %LIB_PATH% /B') DO ( call:CONCAT %LIB_PATH%\%%i )\r
--\r
--set READ_ARG="n"\r
--\r
--FOR %%W IN ( %* ) DO ( call:parseArg %%W )\r
--\r
--set OPT=%OPT_TRACE% %OPT_LOGGING% %OPT_PRG_NAME%\r
--set EXEC=java -cp %CLI_HOME%\conf;%classpath% %OPT% %MAIN% %ARGS%\r
--\r
--IF NOT "" == "%OPT_TRACE%" ( echo Command :%EXEC% )\r
--\r
--%EXEC%\r
--goto:eof\r
--\r
--:parseArg\r
-- IF "y" == %READ_ARG% goto SET_LOGGING\r
--\r
--:SECOND_STEP\r
-- IF "%~1" == "--log" goto SET_READY\r
-- IF "%~1" == "-l" goto SET_READY\r
--:END_STEP\r
--goto:eof\r
--\r
--:SET_LOGGING\r
-- set OPT_LOGGING=-Dlog4j.configuration=log4j-%~1.xml\r
-- IF "%~1" == "trace" set OPT_TRACE=-Dlog4j.debug=true\r
-- set READ_ARG="n"\r
--\r
-- goto SECOND_STEP\r
--\r
--:SET_READY\r
-- set READ_ARG="y"\r
-- goto END_STEP\r
--\r
--:CONCAT\r
-- set classpath=%classpath%%1;\r
++@echo off
++set CLI_HOME=%1
++set CLI_NAME=%2
++set MAIN=%3
++set ARGS=%4
++
++set OPT_LOGGING=-Dlog4j.configuration=log4j.xml
++set OPT_PRG_NAME=-Dcli.name=%CLI_NAME%
++set LIB_PATH=%CLI_HOME%\lib
++
++set classpath=
++FOR /f "tokens=*" %%i IN ('dir %LIB_PATH% /B') DO ( call:CONCAT %LIB_PATH%\%%i )
++
++set READ_ARG="n"
++
++FOR %%W IN ( %* ) DO ( call:parseArg %%W )
++
++set OPT=%OPT_TRACE% %OPT_LOGGING% %OPT_PRG_NAME%
++set EXEC=java -cp %CLI_HOME%\conf;%classpath% %OPT% %MAIN% %ARGS%
++
++IF NOT "" == "%OPT_TRACE%" ( echo Command :%EXEC% )
++
++%EXEC%
++goto:eof
++
++:parseArg
++ IF "y" == %READ_ARG% goto SET_LOGGING
++
++:SECOND_STEP
++ IF "%~1" == "--log" goto SET_READY
++ IF "%~1" == "-l" goto SET_READY
++:END_STEP
++goto:eof
++
++:SET_LOGGING
++ set OPT_LOGGING=-Dlog4j.configuration=log4j-%~1.xml
++ IF "%~1" == "trace" set OPT_TRACE=-Dlog4j.debug=true
++ set READ_ARG="n"
++
++ goto SECOND_STEP
++
++:SET_READY
++ set READ_ARG="y"
++ goto END_STEP
++
++:CONCAT
++ set classpath=%classpath%%1;
--/**\r
-- * \r
-- */\r
--package org.tizen.ncli.core.collection;\r
--\r
--import java.util.Iterator;\r
--\r
--/**\r
-- * Tree structure collection.<br>\r
-- * <p>\r
-- * Initially this is copied from https://code.google.com/p/yet-another-tree-structure/\r
-- * \r
-- * This is not for general data container like huge size of data.(e.g. file directory structure)\r
-- * @author Grzegorz Dev {@literal <gt4dev@gmail.com>}\r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- * @param <T>\r
-- * @date 2013. 11. 20.\r
-- */\r
--public class TreeNodeIter<T> implements Iterator<TreeNode<T>> {\r
--\r
-- enum ProcessStages {\r
-- ProcessParent, ProcessChildCurNode, ProcessChildSubNode\r
-- }\r
--\r
-- private TreeNode<T> treeNode;\r
--\r
-- public TreeNodeIter(TreeNode<T> treeNode) {\r
-- this.treeNode = treeNode;\r
-- this.doNext = ProcessStages.ProcessParent;\r
-- this.childrenCurNodeIter = treeNode.children.iterator();\r
-- }\r
--\r
-- private ProcessStages doNext;\r
-- private TreeNode<T> next;\r
-- private Iterator<TreeNode<T>> childrenCurNodeIter;\r
-- private Iterator<TreeNode<T>> childrenSubNodeIter;\r
--\r
-- @Override\r
-- public boolean hasNext() {\r
--\r
-- if (this.doNext == ProcessStages.ProcessParent) {\r
-- this.next = this.treeNode;\r
-- this.doNext = ProcessStages.ProcessChildCurNode;\r
-- return true;\r
-- }\r
--\r
-- if (this.doNext == ProcessStages.ProcessChildCurNode) {\r
-- if (childrenCurNodeIter.hasNext()) {\r
-- TreeNode<T> childDirect = childrenCurNodeIter.next();\r
-- childrenSubNodeIter = childDirect.iterator();\r
-- this.doNext = ProcessStages.ProcessChildSubNode;\r
-- return hasNext();\r
-- }\r
--\r
-- else {\r
-- this.doNext = null;\r
-- return false;\r
-- }\r
-- }\r
--\r
-- if (this.doNext == ProcessStages.ProcessChildSubNode) {\r
-- if (childrenSubNodeIter.hasNext()) {\r
-- this.next = childrenSubNodeIter.next();\r
-- return true;\r
-- } else {\r
-- this.next = null;\r
-- this.doNext = ProcessStages.ProcessChildCurNode;\r
-- return hasNext();\r
-- }\r
-- }\r
--\r
-- return false;\r
-- }\r
--\r
-- @Override\r
-- public TreeNode<T> next() {\r
-- return this.next;\r
-- }\r
--\r
-- @Override\r
-- public void remove() {\r
-- throw new UnsupportedOperationException();\r
-- }\r
--\r
--}\r
++/**
++ *
++ */
++package org.tizen.ncli.core.collection;
++
++import java.util.Iterator;
++
++/**
++ * Tree structure collection.<br>
++ * <p>
++ * Initially this is copied from https://code.google.com/p/yet-another-tree-structure/
++ *
++ * This is not for general data container like huge size of data.(e.g. file directory structure)
++ * @author Grzegorz Dev {@literal <gt4dev@gmail.com>}
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ * @param <T>
++ * @date 2013. 11. 20.
++ */
++public class TreeNodeIter<T> implements Iterator<TreeNode<T>> {
++
++ enum ProcessStages {
++ ProcessParent, ProcessChildCurNode, ProcessChildSubNode
++ }
++
++ private TreeNode<T> treeNode;
++
++ public TreeNodeIter(TreeNode<T> treeNode) {
++ this.treeNode = treeNode;
++ this.doNext = ProcessStages.ProcessParent;
++ this.childrenCurNodeIter = treeNode.children.iterator();
++ }
++
++ private ProcessStages doNext;
++ private TreeNode<T> next;
++ private Iterator<TreeNode<T>> childrenCurNodeIter;
++ private Iterator<TreeNode<T>> childrenSubNodeIter;
++
++ @Override
++ public boolean hasNext() {
++
++ if (this.doNext == ProcessStages.ProcessParent) {
++ this.next = this.treeNode;
++ this.doNext = ProcessStages.ProcessChildCurNode;
++ return true;
++ }
++
++ if (this.doNext == ProcessStages.ProcessChildCurNode) {
++ if (childrenCurNodeIter.hasNext()) {
++ TreeNode<T> childDirect = childrenCurNodeIter.next();
++ childrenSubNodeIter = childDirect.iterator();
++ this.doNext = ProcessStages.ProcessChildSubNode;
++ return hasNext();
++ }
++
++ else {
++ this.doNext = null;
++ return false;
++ }
++ }
++
++ if (this.doNext == ProcessStages.ProcessChildSubNode) {
++ if (childrenSubNodeIter.hasNext()) {
++ this.next = childrenSubNodeIter.next();
++ return true;
++ } else {
++ this.next = null;
++ this.doNext = ProcessStages.ProcessChildCurNode;
++ return hasNext();
++ }
++ }
++
++ return false;
++ }
++
++ @Override
++ public TreeNode<T> next() {
++ return this.next;
++ }
++
++ @Override
++ public void remove() {
++ throw new UnsupportedOperationException();
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide;\r
--\r
--import org.tizen.common.TizenPlatformConstants;\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)\r
-- *\r
-- */\r
--public class CLIConstant {\r
-- \r
-- public static final String TIZEN_CLI_GLOBAL_KEY = "TIZEN.CLI.GLOBAL";//Preference key\r
-- public static final String TIZEN_CLI_LOCAL_KEY = "TIZEN.CLI.LOCAL";//Preference key\r
-- \r
-- public static final String CLI_HOME = System.getenv("CLI_HOME");\r
-- public static final String DEFAULT_BUILD_OUTPUT = ".buildResult";\r
-- \r
-- public static String NATIVE_PKG_EXT = TizenPlatformConstants.PKGTYPE_TPK.toLowerCase();\r
-- public static String WEB_PKG_EXT = TizenPlatformConstants.PKGTYPE_WGT.toLowerCase();\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide;
++
++import org.tizen.common.TizenPlatformConstants;
++
++/**
++ * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)
++ *
++ */
++public class CLIConstant {
++
++ public static final String TIZEN_CLI_GLOBAL_KEY = "TIZEN.CLI.GLOBAL";//Preference key
++ public static final String TIZEN_CLI_LOCAL_KEY = "TIZEN.CLI.LOCAL";//Preference key
++
++ public static final String CLI_HOME = System.getenv("CLI_HOME");
++ public static final String DEFAULT_BUILD_OUTPUT = ".buildResult";
++
++ public static String NATIVE_PKG_EXT = TizenPlatformConstants.PKGTYPE_TPK.toLowerCase();
++ public static String WEB_PKG_EXT = TizenPlatformConstants.PKGTYPE_WGT.toLowerCase();
++
++}
--/**\r
-- * \r
-- */\r
--package org.tizen.ncli.ide;\r
--\r
--import org.tizen.ncli.ide.core.command.CreateCommand;\r
--import org.tizen.ncli.ide.core.command.SetConfigCommand;\r
--import org.tizen.ncli.ide.subcommands.ConfigCLICommand;\r
--\r
--\r
--/**\r
-- * This class offers Tizen CLI command with API level\r
-- * @author Hyeongseok Heo\r
-- *\r
-- */\r
--public class Tizen {\r
-- \r
-- public Tizen() {\r
-- \r
-- }\r
-- \r
--\r
-- @SuppressWarnings("rawtypes")\r
-- public CreateCommand<?> create(){\r
-- return new CreateCommand();\r
-- }\r
--\r
-- /**\r
-- * @return config command instance\r
-- */\r
-- public ConfigCLICommand config() {\r
-- return new ConfigCLICommand();\r
-- }\r
--\r
--}\r
++/**
++ *
++ */
++package org.tizen.ncli.ide;
++
++import org.tizen.ncli.ide.core.command.CreateCommand;
++import org.tizen.ncli.ide.core.command.SetConfigCommand;
++import org.tizen.ncli.ide.subcommands.ConfigCLICommand;
++
++
++/**
++ * This class offers Tizen CLI command with API level
++ * @author Hyeongseok Heo
++ *
++ */
++public class Tizen {
++
++ public Tizen() {
++
++ }
++
++
++ @SuppressWarnings("rawtypes")
++ public CreateCommand<?> create(){
++ return new CreateCommand();
++ }
++
++ /**
++ * @return config command instance
++ */
++ public ConfigCLICommand config() {
++ return new ConfigCLICommand();
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide;\r
--\r
--import java.io.File;\r
--\r
--import org.tizen.common.config.Preference;\r
--import org.tizen.common.config.PreferenceProvider;\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--public class TizenCLIConfig {\r
-- \r
-- public TizenCLIConfig(File configfile) {\r
-- }\r
--\r
-- /**\r
-- * \r
-- */\r
-- public TizenCLIConfig() {\r
-- // TODO Auto-generated constructor stub\r
-- }\r
-- \r
-- \r
-- \r
-- \r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide;
++
++import java.io.File;
++
++import org.tizen.common.config.Preference;
++import org.tizen.common.config.PreferenceProvider;
++
++/**
++ * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)
++ */
++public class TizenCLIConfig {
++
++ public TizenCLIConfig(File configfile) {
++ }
++
++ /**
++ *
++ */
++ public TizenCLIConfig() {
++ // TODO Auto-generated constructor stub
++ }
++
++
++
++
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- *\r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.config;\r
--\r
--import java.io.File;\r
--\r
--/**\r
-- * This class provids CLI config key name constant.\r
-- * \r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- * \r
-- */\r
--public class ConfigConstant {\r
-- public static final String KEY = "";\r
--\r
-- public static final String REALM = "pic.template.realm";\r
-- public static final String CLI_HOME = System.getenv("CLI_HOME");\r
-- public static final String REALM_HOME = CLI_HOME + File.separator + "realm";\r
-- public static final String WEB_REALM_URL = "file:///" + REALM_HOME + File.separator + "ncli-web-config.json";\r
--\r
-- public static final String DEFAULT_BUILD_ARCHITECTURE = "default.build.architecture";\r
-- public static final String DEFAULT_BUILD_COMPILER = "default.build.compiler";\r
-- public static final String DEFAULT_BUILD_CONFIGURATION = "default.build.configuration";\r
-- public static final String DEFAULT_SDB_TIMEOUT = "default.sdb.timeout";\r
-- public static final String DEFAULT_PROFILES_PATH = "default.profiles.path";\r
--\r
-- public static final String DEFAULT_BUILD_ARCHITECTURE_VALUE = "x86";\r
-- public static final String DEFAULT_BUILD_COMPILER_VALUE = "llvm";\r
-- public static final String DEFAULT_BUILD_CONFIGURATION_VALUE = "Debug";\r
-- public static final String DEFAULT_SDB_TIMEOUT_VALUE = "60000";\r
--\r
-- public static String getDefaultValues() {\r
-- String valueFormat = "%s=%s\n";\r
-- String defaultValues = String.format(valueFormat, DEFAULT_BUILD_ARCHITECTURE, DEFAULT_BUILD_ARCHITECTURE_VALUE)\r
-- + String.format(valueFormat, DEFAULT_BUILD_COMPILER, DEFAULT_BUILD_COMPILER_VALUE)\r
-- + String.format(valueFormat, DEFAULT_BUILD_CONFIGURATION, DEFAULT_BUILD_CONFIGURATION_VALUE)\r
-- + String.format(valueFormat, DEFAULT_SDB_TIMEOUT, DEFAULT_SDB_TIMEOUT_VALUE);\r
-- return defaultValues;\r
-- }\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.config;
++
++import java.io.File;
++
++/**
++ * This class provids CLI config key name constant.
++ *
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ *
++ */
++public class ConfigConstant {
++ public static final String KEY = "";
++
++ public static final String REALM = "pic.template.realm";
++ public static final String CLI_HOME = System.getenv("CLI_HOME");
++ public static final String REALM_HOME = CLI_HOME + File.separator + "realm";
++ public static final String WEB_REALM_URL = "file:///" + REALM_HOME + File.separator + "ncli-web-config.json";
++
++ public static final String DEFAULT_BUILD_ARCHITECTURE = "default.build.architecture";
++ public static final String DEFAULT_BUILD_COMPILER = "default.build.compiler";
++ public static final String DEFAULT_BUILD_CONFIGURATION = "default.build.configuration";
++ public static final String DEFAULT_SDB_TIMEOUT = "default.sdb.timeout";
++ public static final String DEFAULT_PROFILES_PATH = "default.profiles.path";
++
++ public static final String DEFAULT_BUILD_ARCHITECTURE_VALUE = "x86";
++ public static final String DEFAULT_BUILD_COMPILER_VALUE = "llvm";
++ public static final String DEFAULT_BUILD_CONFIGURATION_VALUE = "Debug";
++ public static final String DEFAULT_SDB_TIMEOUT_VALUE = "60000";
++
++ public static String getDefaultValues() {
++ String valueFormat = "%s=%s\n";
++ String defaultValues = String.format(valueFormat, DEFAULT_BUILD_ARCHITECTURE, DEFAULT_BUILD_ARCHITECTURE_VALUE)
++ + String.format(valueFormat, DEFAULT_BUILD_COMPILER, DEFAULT_BUILD_COMPILER_VALUE)
++ + String.format(valueFormat, DEFAULT_BUILD_CONFIGURATION, DEFAULT_BUILD_CONFIGURATION_VALUE)
++ + String.format(valueFormat, DEFAULT_SDB_TIMEOUT, DEFAULT_SDB_TIMEOUT_VALUE);
++ return defaultValues;
++ }
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.config;\r
--\r
--import java.util.ArrayList;\r
--import java.util.Collection;\r
--import java.util.Collections;\r
--import java.util.HashSet;\r
--import java.util.SortedSet;\r
--import java.util.TreeSet;\r
--\r
--import org.tizen.common.config.Preference;\r
--import org.tizen.common.util.CollectionUtil;\r
--import org.tizen.ncli.ide.CLIConstant;\r
--\r
--/**\r
-- * This class represents Tizen CLI config information.\r
-- * \r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--public class Configuration {\r
-- \r
-- private Collection<String> globalKeys;\r
-- private Collection<String> localKeys;\r
--\r
--\r
-- public Configuration() {\r
-- setConfigValues();\r
-- }\r
-- \r
-- /**\r
-- * \r
-- */\r
-- private void setConfigValues() {\r
-- globalKeys = Preference.sortedList(CLIConstant.TIZEN_CLI_GLOBAL_KEY);\r
-- localKeys = Preference.sortedList(CLIConstant.TIZEN_CLI_LOCAL_KEY);\r
-- }\r
--\r
-- \r
-- public Collection<String> getGlobalKeys(){\r
-- return globalKeys;\r
-- }\r
-- \r
-- public Collection<String> getLocalKeys(){\r
-- return localKeys;\r
-- }\r
-- \r
-- /**\r
-- * Get all keys by natural order. \r
-- * @return allKeys\r
-- */\r
-- public Collection<String> getAllKeys(){\r
-- TreeSet<String> allKeys = new TreeSet<String>();\r
-- allKeys.addAll(globalKeys);\r
-- allKeys.addAll(localKeys);\r
-- return allKeys;\r
-- }\r
-- \r
-- public String getValue(String key) {\r
-- if( null != localKeys && localKeys.contains(key)) {\r
-- return Preference.get(CLIConstant.TIZEN_CLI_LOCAL_KEY, key);\r
-- }else if ( null != globalKeys && globalKeys.contains(key)) {\r
-- return Preference.get(CLIConstant.TIZEN_CLI_GLOBAL_KEY, key);\r
-- }\r
-- return null;\r
-- }\r
--\r
-- public String getLocalValue(String localKey) {\r
-- return Preference.get(CLIConstant.TIZEN_CLI_LOCAL_KEY, localKey);\r
-- }\r
-- \r
-- public String getGlobalValue(String globalKey) {\r
-- return Preference.get(CLIConstant.TIZEN_CLI_GLOBAL_KEY, globalKey);\r
-- }\r
-- \r
-- \r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.config;
++
++import java.util.ArrayList;
++import java.util.Collection;
++import java.util.Collections;
++import java.util.HashSet;
++import java.util.SortedSet;
++import java.util.TreeSet;
++
++import org.tizen.common.config.Preference;
++import org.tizen.common.util.CollectionUtil;
++import org.tizen.ncli.ide.CLIConstant;
++
++/**
++ * This class represents Tizen CLI config information.
++ *
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++public class Configuration {
++
++ private Collection<String> globalKeys;
++ private Collection<String> localKeys;
++
++
++ public Configuration() {
++ setConfigValues();
++ }
++
++ /**
++ *
++ */
++ private void setConfigValues() {
++ globalKeys = Preference.sortedList(CLIConstant.TIZEN_CLI_GLOBAL_KEY);
++ localKeys = Preference.sortedList(CLIConstant.TIZEN_CLI_LOCAL_KEY);
++ }
++
++
++ public Collection<String> getGlobalKeys(){
++ return globalKeys;
++ }
++
++ public Collection<String> getLocalKeys(){
++ return localKeys;
++ }
++
++ /**
++ * Get all keys by natural order.
++ * @return allKeys
++ */
++ public Collection<String> getAllKeys(){
++ TreeSet<String> allKeys = new TreeSet<String>();
++ allKeys.addAll(globalKeys);
++ allKeys.addAll(localKeys);
++ return allKeys;
++ }
++
++ public String getValue(String key) {
++ if( null != localKeys && localKeys.contains(key)) {
++ return Preference.get(CLIConstant.TIZEN_CLI_LOCAL_KEY, key);
++ }else if ( null != globalKeys && globalKeys.contains(key)) {
++ return Preference.get(CLIConstant.TIZEN_CLI_GLOBAL_KEY, key);
++ }
++ return null;
++ }
++
++ public String getLocalValue(String localKey) {
++ return Preference.get(CLIConstant.TIZEN_CLI_LOCAL_KEY, localKey);
++ }
++
++ public String getGlobalValue(String globalKey) {
++ return Preference.get(CLIConstant.TIZEN_CLI_GLOBAL_KEY, globalKey);
++ }
++
++
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.core.command;\r
--\r
--import org.tizen.common.core.command.ExecutionContext;\r
--import org.tizen.common.core.command.Executor;\r
--import org.tizen.ncli.ide.shell.CreateCLI;\r
--\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)\r
-- * @param <T>\r
-- */\r
--public class CreateCommand<T> extends TizenCommand<T> {\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.common.core.command.Command#run(org.tizen.common.core.command.Executor, org.tizen.common.core.command.ExecutionContext)\r
-- */\r
-- @Override\r
-- public void run(Executor executor, ExecutionContext context) throws Exception {\r
-- // TODO Auto-generated method stub\r
-- \r
-- }\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.common.core.command.Command#undo(org.tizen.common.core.command.Executor, org.tizen.common.core.command.ExecutionContext)\r
-- */\r
-- @Override\r
-- public void undo(Executor executor, ExecutionContext context) throws Exception {\r
-- // TODO Auto-generated method stub\r
-- \r
-- }\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.common.core.command.Command#getResult()\r
-- */\r
-- @Override\r
-- public T getResult() {\r
-- // TODO Auto-generated method stub\r
-- return null;\r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.core.command;
++
++import org.tizen.common.core.command.ExecutionContext;
++import org.tizen.common.core.command.Executor;
++import org.tizen.ncli.ide.shell.CreateCLI;
++
++
++/**
++ * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)
++ * @param <T>
++ */
++public class CreateCommand<T> extends TizenCommand<T> {
++
++ /* (non-Javadoc)
++ * @see org.tizen.common.core.command.Command#run(org.tizen.common.core.command.Executor, org.tizen.common.core.command.ExecutionContext)
++ */
++ @Override
++ public void run(Executor executor, ExecutionContext context) throws Exception {
++ // TODO Auto-generated method stub
++
++ }
++
++ /* (non-Javadoc)
++ * @see org.tizen.common.core.command.Command#undo(org.tizen.common.core.command.Executor, org.tizen.common.core.command.ExecutionContext)
++ */
++ @Override
++ public void undo(Executor executor, ExecutionContext context) throws Exception {
++ // TODO Auto-generated method stub
++
++ }
++
++ /* (non-Javadoc)
++ * @see org.tizen.common.core.command.Command#getResult()
++ */
++ @Override
++ public T getResult() {
++ // TODO Auto-generated method stub
++ return null;
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.core.command;\r
--\r
--import org.tizen.common.core.command.AbstractCommand;\r
--import org.tizen.common.core.command.ExecutionContext;\r
--import org.tizen.common.core.command.Executor;\r
--import org.tizen.common.core.command.file.WriteFileCommand;\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--public class SaveConfigFileCommand extends AbstractCommand<Object>{\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.common.core.command.AbstractCommand#run(org.tizen.common.core.command.Executor, org.tizen.common.core.command.ExecutionContext)\r
-- */\r
-- @Override\r
-- public void run(Executor executor, ExecutionContext context) throws Exception {\r
-- \r
-- \r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.core.command;
++
++import org.tizen.common.core.command.AbstractCommand;
++import org.tizen.common.core.command.ExecutionContext;
++import org.tizen.common.core.command.Executor;
++import org.tizen.common.core.command.file.WriteFileCommand;
++
++/**
++ * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)
++ */
++public class SaveConfigFileCommand extends AbstractCommand<Object>{
++
++ /* (non-Javadoc)
++ * @see org.tizen.common.core.command.AbstractCommand#run(org.tizen.common.core.command.Executor, org.tizen.common.core.command.ExecutionContext)
++ */
++ @Override
++ public void run(Executor executor, ExecutionContext context) throws Exception {
++
++
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.core.command;\r
--\r
--import java.util.Map;\r
--\r
--import org.tizen.common.config.PreferenceProvider;\r
--import org.tizen.common.core.command.AbstractCommand;\r
--import org.tizen.common.core.command.CompositeCommand;\r
--import org.tizen.common.core.command.ExecutionContext;\r
--import org.tizen.common.core.command.Executor;\r
--import org.tizen.common.file.FileHandler;\r
--import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;\r
--\r
--/**\r
-- * This class handles setting and saving cli config to specific file.\r
-- * \r
-- * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)\r
-- *\r
-- */\r
--public class SetConfigCommand extends AbstractCommand<Object>{\r
-- private static final String CONFIG_FILE_NAME = ".tizen-cli-config";\r
-- \r
-- \r
-- /**\r
-- * @param key\r
-- * @param value\r
-- */\r
-- public void setConfig(String key, String value) {\r
-- }\r
-- \r
-- public void setConfig(Map keyValueMap) {\r
-- \r
-- }\r
--\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.common.core.command.Command#run(org.tizen.common.core.command.Executor, org.tizen.common.core.command.ExecutionContext)\r
-- */\r
-- @Override\r
-- public void run(Executor executor, ExecutionContext context) throws Exception {\r
-- FileHandler fileHandler = context.getFileHandler();\r
--// WriteFileCommand writeFileCmd = new WriteFileCommand(path, contents);\r
-- \r
-- }\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.common.core.command.Command#undo(org.tizen.common.core.command.Executor, org.tizen.common.core.command.ExecutionContext)\r
-- */\r
-- @Override\r
-- public void undo(Executor executor, ExecutionContext context) throws Exception {\r
-- // TODO Auto-generated method stub\r
-- \r
-- }\r
--\r
-- \r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.core.command;
++
++import java.util.Map;
++
++import org.tizen.common.config.PreferenceProvider;
++import org.tizen.common.core.command.AbstractCommand;
++import org.tizen.common.core.command.CompositeCommand;
++import org.tizen.common.core.command.ExecutionContext;
++import org.tizen.common.core.command.Executor;
++import org.tizen.common.file.FileHandler;
++import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;
++
++/**
++ * This class handles setting and saving cli config to specific file.
++ *
++ * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)
++ *
++ */
++public class SetConfigCommand extends AbstractCommand<Object>{
++ private static final String CONFIG_FILE_NAME = ".tizen-cli-config";
++
++
++ /**
++ * @param key
++ * @param value
++ */
++ public void setConfig(String key, String value) {
++ }
++
++ public void setConfig(Map keyValueMap) {
++
++ }
++
++
++ /* (non-Javadoc)
++ * @see org.tizen.common.core.command.Command#run(org.tizen.common.core.command.Executor, org.tizen.common.core.command.ExecutionContext)
++ */
++ @Override
++ public void run(Executor executor, ExecutionContext context) throws Exception {
++ FileHandler fileHandler = context.getFileHandler();
++// WriteFileCommand writeFileCmd = new WriteFileCommand(path, contents);
++
++ }
++
++ /* (non-Javadoc)
++ * @see org.tizen.common.core.command.Command#undo(org.tizen.common.core.command.Executor, org.tizen.common.core.command.ExecutionContext)
++ */
++ @Override
++ public void undo(Executor executor, ExecutionContext context) throws Exception {
++ // TODO Auto-generated method stub
++
++ }
++
++
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.core.command;\r
--\r
--import org.tizen.common.core.command.Command;\r
--\r
--/**\r
-- * Abstract class for CLI command classes.\r
-- * \r
-- * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)\r
-- * @param <T>\r
-- *\r
-- */\r
--public abstract class TizenCommand<T> implements Command<T>{\r
-- \r
-- protected T result;\r
-- \r
-- \r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.core.command;
++
++import org.tizen.common.core.command.Command;
++
++/**
++ * Abstract class for CLI command classes.
++ *
++ * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)
++ * @param <T>
++ *
++ */
++public abstract class TizenCommand<T> implements Command<T>{
++
++ protected T result;
++
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.core.config;\r
--\r
--import java.io.File;\r
--import java.io.FileInputStream;\r
--import java.io.FileNotFoundException;\r
--import java.io.IOException;\r
--import java.io.InputStream;\r
--import java.util.Properties;\r
--\r
--import org.slf4j.Logger;\r
--import org.slf4j.LoggerFactory;\r
--import org.tizen.common.config.Loader;\r
--import org.tizen.common.config.Preference;\r
--import org.tizen.common.core.application.InstallPathConfig;\r
--import org.tizen.common.util.Assert;\r
--import org.tizen.common.util.FileUtil;\r
--import org.tizen.common.util.HostUtil;\r
--import org.tizen.common.util.IOUtil;\r
--import org.tizen.ncli.ide.CLIConstant;\r
--import org.tizen.ncli.ide.config.ConfigConstant;\r
--\r
--/**\r
-- * This class loads Tizen configuration from the specified file named <tt>.tizen-cli-config</tt> .\r
-- * \r
-- * <p>\r
-- * Tizen configuration file could be located at two location. <br>\r
-- * First, global configuration file is located under the <tt>user home</tt> location.In Windows it would be C:\Users\accountName.\r
-- * <br>\r
-- * Second, local configuration file is located under the <tt>Tizen SDK tools path</tt>.<br>\r
-- * <br>\r
-- * And in case of there is not exist Tizen configuration file at loading , the file will be created automatically.<br>\r
-- * The last thing , make sure that local config will have high priority to global config if there is same key.\r
-- * \r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--public class NCLIConfigLoader implements Loader {\r
-- private static final String configFileName = ".tizen-cli-config";\r
-- private static Logger log = LoggerFactory.getLogger(NCLIConfigLoader.class);\r
--\r
-- /*\r
-- * (non-Javadoc)\r
-- * \r
-- * @see org.tizen.common.config.Loader#load(java.lang.String)\r
-- */\r
-- @Override\r
-- public void load(String ns) throws IOException {\r
-- Assert.notNull(ns, "Namespace could not be null");\r
-- if (CLIConstant.TIZEN_CLI_GLOBAL_KEY.equals(ns)) {\r
-- Preference.register(ns, new TizenCLIConfigProvider(loadGlobalConf()));\r
-- } else if (CLIConstant.TIZEN_CLI_LOCAL_KEY.equals(ns)) {\r
-- Preference.register(ns, new TizenCLIConfigProvider(loadLocalConf()));\r
-- }\r
-- }\r
--\r
-- /**\r
-- * Load local configuration from <tt>Tizen SDK Tools</tt>\r
-- * \r
-- * @return localProperties.\r
-- */\r
-- public static Properties loadLocalConf() {\r
-- return loadConf(getLocalConfigFile(), true);\r
-- }\r
--\r
-- /**\r
-- * Load global configuration from <tt>USER HOME</tt>\r
-- * \r
-- * @return globalProperties.\r
-- */\r
-- public static Properties loadGlobalConf() {\r
-- return loadConf(getGlobalConfigFile(), false);\r
-- }\r
--\r
-- public static Properties loadConf(File file, boolean needDefaultValue) {\r
-- InputStream inStream = null;\r
-- Properties prop = new Properties();\r
-- try {\r
-- boolean isConfExist = file.exists();\r
-- log.trace("isConfExist:{}", isConfExist);\r
-- if (isConfExist) {\r
-- inStream = new FileInputStream(file);\r
-- prop.load(inStream);\r
-- } else {\r
-- log.info("{} file does not exist.", file.getAbsolutePath());\r
-- file.createNewFile();\r
-- if (needDefaultValue) {\r
-- setDefault(file);\r
-- }\r
-- inStream = new FileInputStream(file);\r
-- prop.load(inStream);\r
-- }\r
-- } catch (FileNotFoundException e) {\r
-- log.error("FileNotFoundException occurred: {}", file.getAbsolutePath());\r
-- } catch (IOException io) {\r
-- log.error("IOException occurred: {}", file.getAbsolutePath());\r
-- } finally {\r
-- IOUtil.tryClose(inStream);\r
-- }\r
-- return prop;\r
-- }\r
--\r
-- public static File getLocalConfigFile() {\r
-- return getConfigFile(InstallPathConfig.getToolsPath());\r
-- }\r
--\r
-- public static File getGlobalConfigFile() {\r
-- return getConfigFile(System.getProperty("user.home"));\r
-- }\r
--\r
-- public static File getConfigFile(String pathName) {\r
-- return new File(pathName + HostUtil.FILE_SEPARATOR + configFileName);\r
-- }\r
--\r
-- private static void setDefault(File file) {\r
-- String defaultValues = ConfigConstant.getDefaultValues();\r
-- try {\r
-- FileUtil.writeTextFile(file, defaultValues, null);\r
-- } catch (IOException e) {\r
-- log.error("IOException occurred: {}", file.getAbsolutePath());\r
-- }\r
-- }\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.core.config;
++
++import java.io.File;
++import java.io.FileInputStream;
++import java.io.FileNotFoundException;
++import java.io.IOException;
++import java.io.InputStream;
++import java.util.Properties;
++
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++import org.tizen.common.config.Loader;
++import org.tizen.common.config.Preference;
++import org.tizen.common.core.application.InstallPathConfig;
++import org.tizen.common.util.Assert;
++import org.tizen.common.util.FileUtil;
++import org.tizen.common.util.HostUtil;
++import org.tizen.common.util.IOUtil;
++import org.tizen.ncli.ide.CLIConstant;
++import org.tizen.ncli.ide.config.ConfigConstant;
++
++/**
++ * This class loads Tizen configuration from the specified file named <tt>.tizen-cli-config</tt> .
++ *
++ * <p>
++ * Tizen configuration file could be located at two location. <br>
++ * First, global configuration file is located under the <tt>user home</tt> location.In Windows it would be C:\Users\accountName.
++ * <br>
++ * Second, local configuration file is located under the <tt>Tizen SDK tools path</tt>.<br>
++ * <br>
++ * And in case of there is not exist Tizen configuration file at loading , the file will be created automatically.<br>
++ * The last thing , make sure that local config will have high priority to global config if there is same key.
++ *
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++public class NCLIConfigLoader implements Loader {
++ private static final String configFileName = ".tizen-cli-config";
++ private static Logger log = LoggerFactory.getLogger(NCLIConfigLoader.class);
++
++ /*
++ * (non-Javadoc)
++ *
++ * @see org.tizen.common.config.Loader#load(java.lang.String)
++ */
++ @Override
++ public void load(String ns) throws IOException {
++ Assert.notNull(ns, "Namespace could not be null");
++ if (CLIConstant.TIZEN_CLI_GLOBAL_KEY.equals(ns)) {
++ Preference.register(ns, new TizenCLIConfigProvider(loadGlobalConf()));
++ } else if (CLIConstant.TIZEN_CLI_LOCAL_KEY.equals(ns)) {
++ Preference.register(ns, new TizenCLIConfigProvider(loadLocalConf()));
++ }
++ }
++
++ /**
++ * Load local configuration from <tt>Tizen SDK Tools</tt>
++ *
++ * @return localProperties.
++ */
++ public static Properties loadLocalConf() {
++ return loadConf(getLocalConfigFile(), true);
++ }
++
++ /**
++ * Load global configuration from <tt>USER HOME</tt>
++ *
++ * @return globalProperties.
++ */
++ public static Properties loadGlobalConf() {
++ return loadConf(getGlobalConfigFile(), false);
++ }
++
++ public static Properties loadConf(File file, boolean needDefaultValue) {
++ InputStream inStream = null;
++ Properties prop = new Properties();
++ try {
++ boolean isConfExist = file.exists();
++ log.trace("isConfExist:{}", isConfExist);
++ if (isConfExist) {
++ inStream = new FileInputStream(file);
++ prop.load(inStream);
++ } else {
++ log.info("{} file does not exist.", file.getAbsolutePath());
++ file.createNewFile();
++ if (needDefaultValue) {
++ setDefault(file);
++ }
++ inStream = new FileInputStream(file);
++ prop.load(inStream);
++ }
++ } catch (FileNotFoundException e) {
++ log.error("FileNotFoundException occurred: {}", file.getAbsolutePath());
++ } catch (IOException io) {
++ log.error("IOException occurred: {}", file.getAbsolutePath());
++ } finally {
++ IOUtil.tryClose(inStream);
++ }
++ return prop;
++ }
++
++ public static File getLocalConfigFile() {
++ return getConfigFile(InstallPathConfig.getToolsPath());
++ }
++
++ public static File getGlobalConfigFile() {
++ return getConfigFile(System.getProperty("user.home"));
++ }
++
++ public static File getConfigFile(String pathName) {
++ return new File(pathName + HostUtil.FILE_SEPARATOR + configFileName);
++ }
++
++ private static void setDefault(File file) {
++ String defaultValues = ConfigConstant.getDefaultValues();
++ try {
++ FileUtil.writeTextFile(file, defaultValues, null);
++ } catch (IOException e) {
++ log.error("IOException occurred: {}", file.getAbsolutePath());
++ }
++ }
}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.core.config;\r
--\r
--import java.util.Collection;\r
--import java.util.Properties;\r
--\r
--import org.slf4j.Logger;\r
--import org.slf4j.LoggerFactory;\r
--import org.tizen.common.config.PreferenceProvider;\r
--import org.tizen.common.config.provider.PropertiesProvider;\r
--\r
--/**\r
-- * This class provides Tizen CLI config information based on {@link PropertiesProvider} \r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--public class TizenCLIConfigProvider implements PreferenceProvider{\r
-- private PropertiesProvider propProvider = null;\r
-- \r
-- public TizenCLIConfigProvider(Properties props) {\r
-- this.propProvider = new PropertiesProvider(props);\r
-- }\r
-- \r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.common.config.PreferenceProvider#keys()\r
-- */\r
-- @Override\r
-- public Collection<String> keys() {\r
-- return this.propProvider.keys();\r
-- }\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.common.config.PreferenceProvider#get(java.lang.String)\r
-- */\r
-- @Override\r
-- public String get(String key) {\r
-- return this.propProvider.get(key);\r
-- }\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.common.config.PreferenceProvider#set(java.lang.String, java.lang.String)\r
-- */\r
-- @Override\r
-- public void set(String key, String value) {\r
-- this.propProvider.set(key, value);\r
-- }\r
-- \r
-- \r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.core.config;
++
++import java.util.Collection;
++import java.util.Properties;
++
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++import org.tizen.common.config.PreferenceProvider;
++import org.tizen.common.config.provider.PropertiesProvider;
++
++/**
++ * This class provides Tizen CLI config information based on {@link PropertiesProvider}
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++public class TizenCLIConfigProvider implements PreferenceProvider{
++ private PropertiesProvider propProvider = null;
++
++ public TizenCLIConfigProvider(Properties props) {
++ this.propProvider = new PropertiesProvider(props);
++ }
++
++
++ /* (non-Javadoc)
++ * @see org.tizen.common.config.PreferenceProvider#keys()
++ */
++ @Override
++ public Collection<String> keys() {
++ return this.propProvider.keys();
++ }
++
++ /* (non-Javadoc)
++ * @see org.tizen.common.config.PreferenceProvider#get(java.lang.String)
++ */
++ @Override
++ public String get(String key) {
++ return this.propProvider.get(key);
++ }
++
++ /* (non-Javadoc)
++ * @see org.tizen.common.config.PreferenceProvider#set(java.lang.String, java.lang.String)
++ */
++ @Override
++ public void set(String key, String value) {
++ this.propProvider.set(key, value);
++ }
++
++
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.exec;\r
--\r
--import org.tizen.common.core.command.Executor;\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--public class NewCommandLineExecutor extends Executor {\r
-- \r
-- /**\r
-- * \r
-- */\r
-- public NewCommandLineExecutor() {\r
-- \r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.exec;
++
++import org.tizen.common.core.command.Executor;
++
++/**
++ * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)
++ */
++public class NewCommandLineExecutor extends Executor {
++
++ /**
++ *
++ */
++ public NewCommandLineExecutor() {
++
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyunsik Noh <hyunsik.noh@samsung.com>\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.shell;\r
--\r
--import org.kohsuke.args4j.Option;\r
--import org.slf4j.Logger;\r
--import org.slf4j.LoggerFactory;\r
--import org.tizen.ncli.core.TizenSubCommand;\r
--import org.tizen.ncli.ide.subcommands.buildnative.BuildNativeCLICommand;\r
--\r
--/**\r
-- * @author Hyunsik Noh{@literal <hyunsik.noh@samsung.com>} (S-core)\r
-- */\r
--@TizenSubCommand(name="build-native" , usage="Build for the tizen native project")\r
--public class BuildNativeCLI extends AbstractCLI {\r
-- private Logger log = LoggerFactory.getLogger(getClass());\r
--\r
-- @Option(name = "--arch", metaVar = "x86 | arm", usage = "Architecture for build result")\r
-- private String architecture;\r
--\r
-- @Option(name = "--compiler", metaVar = "gcc | llvm", usage = "Compiler for build result")\r
-- private String compiler;\r
--\r
-- @Option(name = "--configuration", metaVar = "Debug | Release | DA", usage = "Configuration for build result")\r
-- private String configuration;\r
--\r
-- @Option(name = "--predefine-option", usage = "")\r
-- private String predefineOption;\r
-- \r
-- private static final String DA = "DA";\r
-- private static final String DA_ORIGIN = "Dynamic Analyzer";\r
--\r
-- /*\r
-- * (non-Javadoc)\r
-- * \r
-- * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()\r
-- */\r
-- @Override\r
-- public void execute() {\r
-- log.trace("Execute BuildNativeCLI...");\r
--\r
-- BuildNativeCLICommand command = new BuildNativeCLICommand();\r
--\r
-- command.setWorkingDir(getRealWorkingPath());\r
-- configuration = DA.equals(configuration) ? DA_ORIGIN : configuration;\r
-- command.setRequiredOptions(new String[]{architecture, compiler, configuration});\r
-- command.setPredefineOption(predefineOption);\r
--\r
-- command.runCommand();\r
-- }\r
--\r
-- public boolean needPrintTime() {\r
-- return true;\r
-- }\r
--\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyunsik Noh <hyunsik.noh@samsung.com>
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.shell;
++
++import org.kohsuke.args4j.Option;
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++import org.tizen.ncli.core.TizenSubCommand;
++import org.tizen.ncli.ide.subcommands.buildnative.BuildNativeCLICommand;
++
++/**
++ * @author Hyunsik Noh{@literal <hyunsik.noh@samsung.com>} (S-core)
++ */
++@TizenSubCommand(name="build-native" , usage="Build for the tizen native project")
++public class BuildNativeCLI extends AbstractCLI {
++ private Logger log = LoggerFactory.getLogger(getClass());
++
++ @Option(name = "--arch", metaVar = "x86 | arm", usage = "Architecture for build result")
++ private String architecture;
++
++ @Option(name = "--compiler", metaVar = "gcc | llvm", usage = "Compiler for build result")
++ private String compiler;
++
++ @Option(name = "--configuration", metaVar = "Debug | Release | DA", usage = "Configuration for build result")
++ private String configuration;
++
++ @Option(name = "--predefine-option", usage = "")
++ private String predefineOption;
++
++ private static final String DA = "DA";
++ private static final String DA_ORIGIN = "Dynamic Analyzer";
++
++ /*
++ * (non-Javadoc)
++ *
++ * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()
++ */
++ @Override
++ public void execute() {
++ log.trace("Execute BuildNativeCLI...");
++
++ BuildNativeCLICommand command = new BuildNativeCLICommand();
++
++ command.setWorkingDir(getRealWorkingPath());
++ configuration = DA.equals(configuration) ? DA_ORIGIN : configuration;
++ command.setRequiredOptions(new String[]{architecture, compiler, configuration});
++ command.setPredefineOption(predefineOption);
++
++ command.runCommand();
++ }
++
++ public boolean needPrintTime() {
++ return true;
++ }
++
}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.shell;\r
--\r
--import java.io.File;\r
--import java.io.PrintWriter;\r
--import java.util.ArrayList;\r
--import java.util.Arrays;\r
--import java.util.Collections;\r
--import java.util.List;\r
--\r
--import org.apache.commons.lang3.time.StopWatch;\r
--import org.kohsuke.args4j.Option;\r
--import org.kohsuke.args4j.spi.StringArrayOptionHandler;\r
--import org.kohsuke.args4j.spi.StringOptionHandler;\r
--import org.slf4j.Logger;\r
--import org.slf4j.LoggerFactory;\r
--import org.tizen.core.ide.BuildWebParameter;\r
--import org.tizen.core.ide.TextProgressMonitor;\r
--import org.tizen.ncli.core.TizenSubCommand;\r
--import org.tizen.ncli.ide.subcommands.BuildWebCLICommand;\r
--\r
--/**\r
-- * Entry point of <code>build-web</code> command.<br>\r
-- * \r
-- * @author Harry Hyeongseok Heo {@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--@TizenSubCommand(name="build-web" , usage="Make a build output directory for web application")\r
--public class BuildWebCLI extends AbstractCLI {\r
-- private Logger log = LoggerFactory.getLogger(getClass());\r
--\r
-- @Option(name = "-opt", aliases = { "--optimize" }, usage = "Optimize option")\r
-- public boolean optimize;\r
--\r
-- @Option(name = "-out", aliases = {"--output"} , metaVar="name",handler=StringOptionHandler.class, usage = "Specify output directory name")\r
-- public String outputName;\r
--\r
-- @Option(name = "-euf", aliases = { "--exclude-uifw" }, usage = "Specify whether exclude tizen web ui f/w or not")\r
-- public boolean excludeUIFW;\r
--\r
-- @Option(name = "-e", aliases = { "--exclude" }, metaVar="<file>", handler=StringArrayOptionHandler.class ,usage = "Specify exclude file list")\r
-- public String[] excludeArray;\r
--\r
-- private List<String> excludeList;\r
--\r
-- public void execute() {\r
-- log.trace("Execute BuildWebCLI...");\r
-- \r
-- BuildWebCLICommand command = new BuildWebCLICommand();\r
-- log.trace("getRealWorkingPath:{}",getRealWorkingPath());\r
-- \r
-- if(null != outputName) {\r
-- command.setOutputName(outputName);\r
-- }\r
-- if( null != excludeArray) {\r
-- excludeList = new ArrayList<String>(Arrays.asList(excludeArray));\r
-- command.setExcludeList(excludeList);\r
-- }\r
-- command.setOptimize(optimize);\r
-- command.setExcludeUIFW(excludeUIFW);\r
-- command.setWorkingDir(getRealWorkingPath());\r
-- command.setProgressMonitor(new TextProgressMonitor(new PrintWriter(System.out)));\r
-- \r
-- BuildWebParameter commandData = command.runCommand();\r
-- \r
-- progressLog.info("Output path:{}",commandData.getOutputName());\r
-- if( null != commandData.getExcludeList()) {\r
-- progressLog.info("Excluded: {}",commandData.getExcludeList());\r
-- }\r
-- }\r
--\r
-- @Override\r
-- public boolean needPrintTime() {\r
-- return true;\r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.shell;
++
++import java.io.File;
++import java.io.PrintWriter;
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.Collections;
++import java.util.List;
++
++import org.apache.commons.lang3.time.StopWatch;
++import org.kohsuke.args4j.Option;
++import org.kohsuke.args4j.spi.StringArrayOptionHandler;
++import org.kohsuke.args4j.spi.StringOptionHandler;
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++import org.tizen.core.ide.BuildWebParameter;
++import org.tizen.core.ide.TextProgressMonitor;
++import org.tizen.ncli.core.TizenSubCommand;
++import org.tizen.ncli.ide.subcommands.BuildWebCLICommand;
++
++/**
++ * Entry point of <code>build-web</code> command.<br>
++ *
++ * @author Harry Hyeongseok Heo {@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++@TizenSubCommand(name="build-web" , usage="Make a build output directory for web application")
++public class BuildWebCLI extends AbstractCLI {
++ private Logger log = LoggerFactory.getLogger(getClass());
++
++ @Option(name = "-opt", aliases = { "--optimize" }, usage = "Optimize option")
++ public boolean optimize;
++
++ @Option(name = "-out", aliases = {"--output"} , metaVar="name",handler=StringOptionHandler.class, usage = "Specify output directory name")
++ public String outputName;
++
++ @Option(name = "-euf", aliases = { "--exclude-uifw" }, usage = "Specify whether exclude tizen web ui f/w or not")
++ public boolean excludeUIFW;
++
++ @Option(name = "-e", aliases = { "--exclude" }, metaVar="<file>", handler=StringArrayOptionHandler.class ,usage = "Specify exclude file list")
++ public String[] excludeArray;
++
++ private List<String> excludeList;
++
++ public void execute() {
++ log.trace("Execute BuildWebCLI...");
++
++ BuildWebCLICommand command = new BuildWebCLICommand();
++ log.trace("getRealWorkingPath:{}",getRealWorkingPath());
++
++ if(null != outputName) {
++ command.setOutputName(outputName);
++ }
++ if( null != excludeArray) {
++ excludeList = new ArrayList<String>(Arrays.asList(excludeArray));
++ command.setExcludeList(excludeList);
++ }
++ command.setOptimize(optimize);
++ command.setExcludeUIFW(excludeUIFW);
++ command.setWorkingDir(getRealWorkingPath());
++ command.setProgressMonitor(new TextProgressMonitor(new PrintWriter(System.out)));
++
++ BuildWebParameter commandData = command.runCommand();
++
++ progressLog.info("Output path:{}",commandData.getOutputName());
++ if( null != commandData.getExcludeList()) {
++ progressLog.info("Excluded: {}",commandData.getExcludeList());
++ }
++ }
++
++ @Override
++ public boolean needPrintTime() {
++ return true;
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.shell;\r
--\r
--import java.util.Collection;\r
--import java.util.HashMap;\r
--import java.util.Map;\r
--\r
--import org.kohsuke.args4j.Argument;\r
--import org.kohsuke.args4j.CmdLineException;\r
--import org.kohsuke.args4j.Option;\r
--import org.tizen.ncli.core.CommandInfo;\r
--import org.tizen.ncli.core.SubCommandData;\r
--import org.tizen.ncli.core.TizenSubCommand;\r
--import org.tizen.ncli.ide.Tizen;\r
--import org.tizen.ncli.ide.config.Configuration;\r
--import org.tizen.ncli.ide.subcommands.ConfigCLICommand;\r
--\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--@TizenSubCommand(name="cli-config" , usage="Set up configurations for the tizen CLI")\r
--public class ConfigCLI extends AbstractCLI{\r
-- private Map<String, String> properties = new HashMap<String, String>();\r
-- \r
-- @Argument(metaVar="<key>=<value>",usage="Setting Tizen CLI config with given key=value pair\n" +\r
-- " In Windows ,the setting values should be enclosed with doublequotes like as \"<key>=<value>\"")\r
-- private void setConfigProperty(final String property) throws CmdLineException {\r
-- log.trace("setConfigProperty {}",property);\r
-- if( null == property || property.startsWith("-")) return;\r
-- String[] arr = property.split("=");\r
-- if(arr.length != 2) {\r
-- throw new CmdLineException("configuration must be specified in the form:"+\r
-- "<key>=<value>");\r
-- }\r
-- properties.put(arr[0], arr[1]);\r
-- }\r
-- \r
-- @Option (name="-l", aliases="--list", usage="Show config list")\r
-- public boolean list;\r
-- \r
-- @Option (name="-g" , aliases="--global", usage="Setting global Tizen CLI config" , depends= {})\r
-- public boolean global;\r
-- \r
-- public ConfigCLI() {\r
-- this.isLoggingStartFinish = false;\r
-- }\r
-- \r
-- public void execute() {\r
-- log.trace("Execute configCLI...");\r
-- ConfigCLICommand configCommand = new Tizen().config();\r
-- \r
-- //Setting options\r
-- configCommand.setList(list);\r
-- configCommand.setGlobal(global);\r
-- configCommand.setKeyValue(properties);\r
-- \r
-- //Printout result of command\r
-- if( !list && properties.isEmpty()) {\r
-- printUsage();\r
-- return;\r
-- }\r
--\r
-- Configuration tizenCLIConfig = configCommand.runCommand();\r
--\r
-- if(list) {\r
-- Collection<String> allKeys = tizenCLIConfig.getAllKeys();\r
-- for (String key : allKeys) {\r
-- output.format("%1$s=%2$s\n", key,tizenCLIConfig.getValue(key));\r
-- }\r
--\r
-- }else if(global){\r
-- progressLog.info("Setting global configuration is succeeded....\n");\r
-- }else {\r
-- progressLog.info("Setting configuration is succeeded....\n");\r
-- }\r
-- output.flush();\r
-- }\r
--\r
--\r
--\r
--\r
-- /**\r
-- * Print usage of this command.\r
-- * This is specific case of printUsage in the CLI due to just showing information without throwing CmdLineException , \r
-- */\r
-- private void printUsage() {\r
-- CommandInfo currentCmdInfo = SubCommandData.get("CURRENT_CMD");\r
-- if( null != currentCmdInfo) {\r
-- //FIXME ResourceBundle needed.\r
-- currentCmdInfo.getCmdLineParser().printUsage(output,null);\r
-- }\r
-- }\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.shell;
++
++import java.util.Collection;
++import java.util.HashMap;
++import java.util.Map;
++
++import org.kohsuke.args4j.Argument;
++import org.kohsuke.args4j.CmdLineException;
++import org.kohsuke.args4j.Option;
++import org.tizen.ncli.core.CommandInfo;
++import org.tizen.ncli.core.SubCommandData;
++import org.tizen.ncli.core.TizenSubCommand;
++import org.tizen.ncli.ide.Tizen;
++import org.tizen.ncli.ide.config.Configuration;
++import org.tizen.ncli.ide.subcommands.ConfigCLICommand;
++
++
++/**
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++@TizenSubCommand(name="cli-config" , usage="Set up configurations for the tizen CLI")
++public class ConfigCLI extends AbstractCLI{
++ private Map<String, String> properties = new HashMap<String, String>();
++
++ @Argument(metaVar="<key>=<value>",usage="Setting Tizen CLI config with given key=value pair\n" +
++ " In Windows ,the setting values should be enclosed with doublequotes like as \"<key>=<value>\"")
++ private void setConfigProperty(final String property) throws CmdLineException {
++ log.trace("setConfigProperty {}",property);
++ if( null == property || property.startsWith("-")) return;
++ String[] arr = property.split("=");
++ if(arr.length != 2) {
++ throw new CmdLineException("configuration must be specified in the form:"+
++ "<key>=<value>");
++ }
++ properties.put(arr[0], arr[1]);
++ }
++
++ @Option (name="-l", aliases="--list", usage="Show config list")
++ public boolean list;
++
++ @Option (name="-g" , aliases="--global", usage="Setting global Tizen CLI config" , depends= {})
++ public boolean global;
++
++ public ConfigCLI() {
++ this.isLoggingStartFinish = false;
++ }
++
++ public void execute() {
++ log.trace("Execute configCLI...");
++ ConfigCLICommand configCommand = new Tizen().config();
++
++ //Setting options
++ configCommand.setList(list);
++ configCommand.setGlobal(global);
++ configCommand.setKeyValue(properties);
++
++ //Printout result of command
++ if( !list && properties.isEmpty()) {
++ printUsage();
++ return;
++ }
++
++ Configuration tizenCLIConfig = configCommand.runCommand();
++
++ if(list) {
++ Collection<String> allKeys = tizenCLIConfig.getAllKeys();
++ for (String key : allKeys) {
++ output.format("%1$s=%2$s\n", key,tizenCLIConfig.getValue(key));
++ }
++
++ }else if(global){
++ progressLog.info("Setting global configuration is succeeded....\n");
++ }else {
++ progressLog.info("Setting configuration is succeeded....\n");
++ }
++ output.flush();
++ }
++
++
++
++
++ /**
++ * Print usage of this command.
++ * This is specific case of printUsage in the CLI due to just showing information without throwing CmdLineException ,
++ */
++ private void printUsage() {
++ CommandInfo currentCmdInfo = SubCommandData.get("CURRENT_CMD");
++ if( null != currentCmdInfo) {
++ //FIXME ResourceBundle needed.
++ currentCmdInfo.getCmdLineParser().printUsage(output,null);
++ }
++ }
++}
--package org.tizen.ncli.ide.shell;\r
--\r
--import org.kohsuke.args4j.Argument;\r
--import org.kohsuke.args4j.spi.SubCommand;\r
--import org.kohsuke.args4j.spi.SubCommandHandler;\r
--import org.kohsuke.args4j.spi.SubCommands;\r
--import org.slf4j.Logger;\r
--import org.slf4j.LoggerFactory;\r
--import org.tizen.ncli.core.TizenSubCommand;\r
--import org.tizen.ncli.core.TizenSubCommandHandler;\r
--\r
--@TizenSubCommand(name="create" , usage="Create tizen resource")\r
--public class CreateCLI extends AbstractCLI {\r
-- private Logger log = LoggerFactory.getLogger(CreateCLI.class);\r
-- \r
-- @Argument(index = 0, required = true, handler = TizenSubCommandHandler.class, usage = "Sub-command is needed")\r
-- @SubCommands({ \r
-- @SubCommand(name = "native-project", impl = CreateNativeProjectCLI.class),\r
-- @SubCommand(name = "web-project", impl = CreateWebProjectCLI.class),\r
-- @SubCommand(name = "security-profile", impl = CreateSecProfileCLI.class),\r
-- @SubCommand(name = "security-profile-item", impl = CreateSecProfileItemCLI.class),\r
-- @SubCommand(name = "certificate", impl = CreateCertificateCLI.class)\r
-- })\r
-- \r
-- private AbstractCLI tizenCLI;\r
-- \r
-- /* (non-Javadoc)\r
-- * @see org.tizen.ncli.ide.shell.TizenCLI#execute()\r
-- */\r
-- @Override\r
-- public void execute() {\r
-- log.trace("execute Create cli...");\r
-- \r
-- if( null != this.tizenCLI) {\r
-- this.tizenCLI.execute();\r
-- }\r
-- }\r
-- \r
--}\r
++package org.tizen.ncli.ide.shell;
++
++import org.kohsuke.args4j.Argument;
++import org.kohsuke.args4j.spi.SubCommand;
++import org.kohsuke.args4j.spi.SubCommandHandler;
++import org.kohsuke.args4j.spi.SubCommands;
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++import org.tizen.ncli.core.TizenSubCommand;
++import org.tizen.ncli.core.TizenSubCommandHandler;
++
++@TizenSubCommand(name="create" , usage="Create tizen resource")
++public class CreateCLI extends AbstractCLI {
++ private Logger log = LoggerFactory.getLogger(CreateCLI.class);
++
++ @Argument(index = 0, required = true, handler = TizenSubCommandHandler.class, usage = "Sub-command is needed")
++ @SubCommands({
++ @SubCommand(name = "native-project", impl = CreateNativeProjectCLI.class),
++ @SubCommand(name = "web-project", impl = CreateWebProjectCLI.class),
++ @SubCommand(name = "security-profile", impl = CreateSecProfileCLI.class),
++ @SubCommand(name = "security-profile-item", impl = CreateSecProfileItemCLI.class),
++ @SubCommand(name = "certificate", impl = CreateCertificateCLI.class)
++ })
++
++ private AbstractCLI tizenCLI;
++
++ /* (non-Javadoc)
++ * @see org.tizen.ncli.ide.shell.TizenCLI#execute()
++ */
++ @Override
++ public void execute() {
++ log.trace("execute Create cli...");
++
++ if( null != this.tizenCLI) {
++ this.tizenCLI.execute();
++ }
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.shell;\r
--\r
--import org.kohsuke.args4j.Option;\r
--import org.slf4j.Logger;\r
--import org.slf4j.LoggerFactory;\r
--import org.tizen.ncli.core.TizenSubCommand;\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--@TizenSubCommand(name="certificate" , usage="Generate certificate")\r
--public class CreateCertificateCLI extends AbstractCLI {\r
-- private Logger log = LoggerFactory.getLogger(getClass());\r
-- \r
-- @Option(name="--passwd" , aliases="{-pw}", metaVar="password" , usage="Set the password for the certificate" )\r
-- private String password;\r
-- \r
-- @Option(name="--country" , aliases="" , metaVar="" , usage="Specify country code with two letters.")\r
-- private String country;\r
-- \r
-- \r
-- public CreateCertificateCLI(){\r
-- this.isLoggingStartFinish = false;\r
-- }\r
-- \r
-- /* (non-Javadoc)\r
-- * @see org.tizen.ncli.ide.subcommands.AbstractSubCommand#call()\r
-- */\r
-- /*\r
-- * /org.tizen.common.sign/src/org/tizen/common/sign/preferences/SigningPreferencePage.java\r
-- * try {\r
-- TizenKeyCertificateGenerator.KeyCertGeneratorFromIde(\r
-- dialog.getValue( CertDataKey.Country ),\r
-- dialog.getValue( CertDataKey.State ),\r
-- dialog.getValue( CertDataKey.City ),\r
-- dialog.getValue( CertDataKey.Name ),\r
-- dialog.getValue( CertDataKey.Organization ),\r
-- dialog.getValue( CertDataKey.Department ),\r
-- dialog.getValue( CertDataKey.Email ),\r
-- SigningPathUtil.getCertificateGeneratorPath(),\r
-- dialog.getValue( CertDataKey.Password ),\r
-- dialog.getValue( CertDataKey.Alias ),\r
-- pkcsKeyStorePath );\r
-- } catch (Exception e) {\r
-- throw new InvocationTargetException( e );\r
-- } finally {\r
-- monitor.done();\r
-- }\r
-- * */\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()\r
-- */\r
-- @Override\r
-- public void execute() {\r
-- progressLog.info("This command is under developing...\nSorry about your inconvenience.");\r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.shell;
++
++import org.kohsuke.args4j.Option;
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++import org.tizen.ncli.core.TizenSubCommand;
++
++/**
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++@TizenSubCommand(name="certificate" , usage="Generate certificate")
++public class CreateCertificateCLI extends AbstractCLI {
++ private Logger log = LoggerFactory.getLogger(getClass());
++
++ @Option(name="--passwd" , aliases="{-pw}", metaVar="password" , usage="Set the password for the certificate" )
++ private String password;
++
++ @Option(name="--country" , aliases="" , metaVar="" , usage="Specify country code with two letters.")
++ private String country;
++
++
++ public CreateCertificateCLI(){
++ this.isLoggingStartFinish = false;
++ }
++
++ /* (non-Javadoc)
++ * @see org.tizen.ncli.ide.subcommands.AbstractSubCommand#call()
++ */
++ /*
++ * /org.tizen.common.sign/src/org/tizen/common/sign/preferences/SigningPreferencePage.java
++ * try {
++ TizenKeyCertificateGenerator.KeyCertGeneratorFromIde(
++ dialog.getValue( CertDataKey.Country ),
++ dialog.getValue( CertDataKey.State ),
++ dialog.getValue( CertDataKey.City ),
++ dialog.getValue( CertDataKey.Name ),
++ dialog.getValue( CertDataKey.Organization ),
++ dialog.getValue( CertDataKey.Department ),
++ dialog.getValue( CertDataKey.Email ),
++ SigningPathUtil.getCertificateGeneratorPath(),
++ dialog.getValue( CertDataKey.Password ),
++ dialog.getValue( CertDataKey.Alias ),
++ pkcsKeyStorePath );
++ } catch (Exception e) {
++ throw new InvocationTargetException( e );
++ } finally {
++ monitor.done();
++ }
++ * */
++
++ /* (non-Javadoc)
++ * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()
++ */
++ @Override
++ public void execute() {
++ progressLog.info("This command is under developing...\nSorry about your inconvenience.");
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.shell;\r
--\r
--import org.tizen.ncli.core.TizenSubCommand;\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--@TizenSubCommand(name="security-profile" , usage="Create security profile for signing")\r
--public class CreateSecProfileCLI extends AbstractCLI {\r
-- public CreateSecProfileCLI(){\r
-- this.isLoggingStartFinish = false;\r
-- }\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()\r
-- */\r
-- @Override\r
-- public void execute() {\r
-- progressLog.info("This command is under developing...\nSorry about your inconvenience");\r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.shell;
++
++import org.tizen.ncli.core.TizenSubCommand;
++
++/**
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++@TizenSubCommand(name="security-profile" , usage="Create security profile for signing")
++public class CreateSecProfileCLI extends AbstractCLI {
++ public CreateSecProfileCLI(){
++ this.isLoggingStartFinish = false;
++ }
++ /* (non-Javadoc)
++ * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()
++ */
++ @Override
++ public void execute() {
++ progressLog.info("This command is under developing...\nSorry about your inconvenience");
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.shell;\r
--\r
--import org.tizen.ncli.core.TizenSubCommand;\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--@TizenSubCommand(name="security-profile-item" , usage="Add security profile item")\r
--public class CreateSecProfileItemCLI extends AbstractCLI {\r
-- \r
-- public CreateSecProfileItemCLI(){\r
-- this.isLoggingStartFinish = false;\r
-- }\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()\r
-- */\r
-- @Override\r
-- public void execute() {\r
-- // TODO Auto-generated method stub\r
-- progressLog.info("This command is under developing...\nSorry about your inconvenience");\r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.shell;
++
++import org.tizen.ncli.core.TizenSubCommand;
++
++/**
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++@TizenSubCommand(name="security-profile-item" , usage="Add security profile item")
++public class CreateSecProfileItemCLI extends AbstractCLI {
++
++ public CreateSecProfileItemCLI(){
++ this.isLoggingStartFinish = false;
++ }
++
++ /* (non-Javadoc)
++ * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()
++ */
++ @Override
++ public void execute() {
++ // TODO Auto-generated method stub
++ progressLog.info("This command is under developing...\nSorry about your inconvenience");
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyunsik Noh <hyunsik.noh@samsung.com>\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.shell;\r
--\r
--import org.kohsuke.args4j.Option;\r
--import org.tizen.ncli.core.TizenSubCommand;\r
--import org.tizen.ncli.ide.subcommands.SignCLICommand;\r
--\r
--@TizenSubCommand(name="sign" , usage="Signing for the tizen project")\r
--public class SignCLI extends AbstractCLI {\r
-- \r
-- @Option(name = "--profile" , usage="Specify profile name that is registered in profile.xml." ,required=true)\r
-- private String profile;\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()\r
-- */\r
-- @Override\r
-- public void execute() {\r
-- log.trace("Execute SignCLI...");\r
-- \r
-- SignCLICommand command = new SignCLICommand();\r
-- \r
-- command.setProfileName(profile);\r
-- command.setWorkingDir(getRealWorkingPath());\r
-- command.runCommand();\r
-- }\r
-- \r
-- public boolean needPrintTime() {\r
-- return true;\r
-- }\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyunsik Noh <hyunsik.noh@samsung.com>
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.shell;
++
++import org.kohsuke.args4j.Option;
++import org.tizen.ncli.core.TizenSubCommand;
++import org.tizen.ncli.ide.subcommands.SignCLICommand;
++
++@TizenSubCommand(name="sign" , usage="Signing for the tizen project")
++public class SignCLI extends AbstractCLI {
++
++ @Option(name = "--profile" , usage="Specify profile name that is registered in profile.xml." ,required=true)
++ private String profile;
++
++ /* (non-Javadoc)
++ * @see org.tizen.ncli.ide.shell.AbstractCLI#execute()
++ */
++ @Override
++ public void execute() {
++ log.trace("Execute SignCLI...");
++
++ SignCLICommand command = new SignCLICommand();
++
++ command.setProfileName(profile);
++ command.setWorkingDir(getRealWorkingPath());
++ command.runCommand();
++ }
++
++ public boolean needPrintTime() {
++ return true;
++ }
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.shell;\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--public enum TizenAppType {\r
-- NATIVE,\r
-- WEB,\r
-- Hybrid\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.shell;
++
++/**
++ * @author Harry Hyeongseok Heo{@leteral <hyeongseok.heo@samsung.com>} (S-core)
++ */
++public enum TizenAppType {
++ NATIVE,
++ WEB,
++ Hybrid
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.subcommands;\r
--\r
--import java.io.File;\r
--\r
--import org.slf4j.Logger;\r
--import org.slf4j.LoggerFactory;\r
--import org.tizen.common.config.Preference;\r
--import org.tizen.common.config.provider.EnvironmentProvider;\r
--import org.tizen.common.config.provider.SystemPropertiesProvider;\r
--import org.tizen.core.ide.NullProgressMonitor;\r
--import org.tizen.core.ide.ProgressMonitor;\r
--import org.tizen.ncli.ide.CLIConstant;\r
--import org.tizen.ncli.ide.core.config.NCLIConfigLoader;\r
--import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;\r
--\r
--/**\r
-- * This class provides common environment to other SubCommand.\r
-- * \r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--abstract public class AbstractSubCommand<T> {\r
-- protected final Logger log = LoggerFactory.getLogger( AbstractSubCommand.class );\r
-- \r
-- /**\r
-- * Use this <code>progressLog</code> at notifying Users about progress of work.<br>\r
-- * Make sure you should not use any method but {@link Logger#info()}...\r
-- * */\r
-- protected final Logger progressLog = LoggerFactory.getLogger("NCLI_PROGRESS"); \r
-- protected File workingDir;\r
-- protected ProgressMonitor progressMonitor = new NullProgressMonitor();\r
--\r
-- public AbstractSubCommand(){\r
-- initializeConfig();\r
-- }\r
-- \r
-- /**\r
-- * @param workingDir the workingDir to set\r
-- */\r
-- public void setWorkingDir(File targetPath) {\r
-- this.workingDir = targetPath;\r
-- }\r
--\r
-- /**\r
-- * This method is called by CLI entry class.\r
-- * <p>\r
-- * And then call <code>call()</code> method.\r
-- * \r
-- * @return T\r
-- * @throws Exception\r
-- */\r
-- public T runCommand() {\r
-- T ret = call();\r
--\r
-- return ret;\r
-- }\r
--\r
-- /**\r
-- * \r
-- */\r
-- private void initializeConfig() {\r
-- Preference.register("OS", new EnvironmentProvider());\r
-- Preference.register("JVM", new SystemPropertiesProvider());\r
-- Preference.register(CLIConstant.TIZEN_CLI_GLOBAL_KEY, new TizenCLIConfigProvider(NCLIConfigLoader.loadGlobalConf()));\r
-- Preference.register(CLIConstant.TIZEN_CLI_LOCAL_KEY, new TizenCLIConfigProvider(NCLIConfigLoader.loadLocalConf()));\r
-- }\r
--\r
-- /**\r
-- * Execute command logic\r
-- * <p>\r
-- * This method should be called only by {@link #runCommand()}<br>\r
-- * <b>Do not call this directly</b>\r
-- * \r
-- */\r
-- protected abstract T call();\r
--\r
-- /**\r
-- * @param progressMonitor the progressMonitor to set\r
-- */\r
-- public void setProgressMonitor(ProgressMonitor progressMonitor) {\r
-- this.progressMonitor = progressMonitor;\r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.subcommands;
++
++import java.io.File;
++
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++import org.tizen.common.config.Preference;
++import org.tizen.common.config.provider.EnvironmentProvider;
++import org.tizen.common.config.provider.SystemPropertiesProvider;
++import org.tizen.core.ide.NullProgressMonitor;
++import org.tizen.core.ide.ProgressMonitor;
++import org.tizen.ncli.ide.CLIConstant;
++import org.tizen.ncli.ide.core.config.NCLIConfigLoader;
++import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;
++
++/**
++ * This class provides common environment to other SubCommand.
++ *
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++abstract public class AbstractSubCommand<T> {
++ protected final Logger log = LoggerFactory.getLogger( AbstractSubCommand.class );
++
++ /**
++ * Use this <code>progressLog</code> at notifying Users about progress of work.<br>
++ * Make sure you should not use any method but {@link Logger#info()}...
++ * */
++ protected final Logger progressLog = LoggerFactory.getLogger("NCLI_PROGRESS");
++ protected File workingDir;
++ protected ProgressMonitor progressMonitor = new NullProgressMonitor();
++
++ public AbstractSubCommand(){
++ initializeConfig();
++ }
++
++ /**
++ * @param workingDir the workingDir to set
++ */
++ public void setWorkingDir(File targetPath) {
++ this.workingDir = targetPath;
++ }
++
++ /**
++ * This method is called by CLI entry class.
++ * <p>
++ * And then call <code>call()</code> method.
++ *
++ * @return T
++ * @throws Exception
++ */
++ public T runCommand() {
++ T ret = call();
++
++ return ret;
++ }
++
++ /**
++ *
++ */
++ private void initializeConfig() {
++ Preference.register("OS", new EnvironmentProvider());
++ Preference.register("JVM", new SystemPropertiesProvider());
++ Preference.register(CLIConstant.TIZEN_CLI_GLOBAL_KEY, new TizenCLIConfigProvider(NCLIConfigLoader.loadGlobalConf()));
++ Preference.register(CLIConstant.TIZEN_CLI_LOCAL_KEY, new TizenCLIConfigProvider(NCLIConfigLoader.loadLocalConf()));
++ }
++
++ /**
++ * Execute command logic
++ * <p>
++ * This method should be called only by {@link #runCommand()}<br>
++ * <b>Do not call this directly</b>
++ *
++ */
++ protected abstract T call();
++
++ /**
++ * @param progressMonitor the progressMonitor to set
++ */
++ public void setProgressMonitor(ProgressMonitor progressMonitor) {
++ this.progressMonitor = progressMonitor;
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.subcommands;\r
--\r
--import java.io.File;\r
--import java.io.FileNotFoundException;\r
--import java.io.FileOutputStream;\r
--import java.io.IOException;\r
--import java.io.OutputStream;\r
--import java.util.HashMap;\r
--import java.util.Map;\r
--import java.util.Properties;\r
--import java.util.Set;\r
--\r
--import org.tizen.common.config.Preference;\r
--import org.tizen.common.util.Assert;\r
--import org.tizen.common.util.IOUtil;\r
--import org.tizen.ncli.ide.CLIConstant;\r
--import org.tizen.ncli.ide.config.Configuration;\r
--import org.tizen.ncli.ide.core.config.NCLIConfigLoader;\r
--import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;\r
--\r
--/**\r
-- * This class is for 'cli-config' command processing.\r
-- * \r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--public class ConfigCLICommand extends AbstractSubCommand<Configuration>{\r
-- private boolean list = false;\r
-- private boolean global = false;\r
-- private Map<String, String> properties = new HashMap<String, String>();\r
--\r
-- /**\r
-- * @param key\r
-- * @param value\r
-- */\r
-- public void setConfig(String key, String value) {\r
-- this.properties.put(key, value);\r
-- }\r
--\r
-- /**\r
-- * @param list\r
-- */\r
-- public void setList(boolean list) {\r
-- this.list = list;\r
-- }\r
--\r
-- /**\r
-- * Set if config value is set globally. <br>\r
-- * Default is false\r
-- * @param global\r
-- */\r
-- public void setGlobal(boolean global) {\r
-- this.global = global;\r
-- }\r
--\r
-- /**\r
-- * @param properties\r
-- */\r
-- public void setKeyValue(Map<String, String> properties) {\r
-- this.properties = properties;\r
-- \r
-- }\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.ncli.ide.subcommands.AbstractSubCommand#call()\r
-- */\r
-- @Override\r
-- public Configuration call() {\r
-- if(list) {\r
-- return new Configuration();\r
-- }else if(global){\r
-- log.trace("global config set call() - {}",properties);\r
-- File file = NCLIConfigLoader.getGlobalConfigFile();\r
-- Properties load = NCLIConfigLoader.loadGlobalConf();;\r
-- writeProperties2File(file, load);\r
-- Preference.register(CLIConstant.TIZEN_CLI_GLOBAL_KEY, new TizenCLIConfigProvider(NCLIConfigLoader.loadGlobalConf()));\r
-- }else {\r
-- log.trace("local config set call() - {}",properties);\r
-- File file = NCLIConfigLoader.getLocalConfigFile();\r
-- Properties load = NCLIConfigLoader.loadLocalConf();;\r
-- if( writeProperties2File(file, load) ) {\r
-- Preference.register(CLIConstant.TIZEN_CLI_LOCAL_KEY, new TizenCLIConfigProvider(NCLIConfigLoader.loadLocalConf()));\r
-- }else {\r
-- log.error("Fail to write configuration file!");\r
-- }\r
-- }\r
-- return new Configuration();\r
-- }\r
--\r
-- private boolean writeProperties2File(File file, Properties load) {\r
-- Assert.notNull(file, "There is no file to write.File is Null!");\r
-- Assert.notNull(load, "There is no properties to store.");\r
-- \r
-- updateProperties(load);\r
-- \r
-- OutputStream ous = null;\r
-- try {\r
-- ous = new FileOutputStream(file); \r
-- load.store(ous, "This is generated by Tizen CLI!");\r
-- } catch (FileNotFoundException e) {\r
-- e.printStackTrace();\r
-- return false;\r
-- } catch (IOException ie) {\r
-- ie.printStackTrace();\r
-- return false;\r
-- } finally {\r
-- IOUtil.tryClose(ous);\r
-- }\r
-- return true;\r
-- }\r
--\r
-- private void updateProperties(Properties load) {\r
-- Set<String> keySet = this.properties.keySet();\r
-- for (String key : keySet) {\r
-- String value = properties.get(key);\r
-- load.setProperty(key, value);\r
-- log.trace("key :{} , value :{}",key,value);\r
-- }\r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.subcommands;
++
++import java.io.File;
++import java.io.FileNotFoundException;
++import java.io.FileOutputStream;
++import java.io.IOException;
++import java.io.OutputStream;
++import java.util.HashMap;
++import java.util.Map;
++import java.util.Properties;
++import java.util.Set;
++
++import org.tizen.common.config.Preference;
++import org.tizen.common.util.Assert;
++import org.tizen.common.util.IOUtil;
++import org.tizen.ncli.ide.CLIConstant;
++import org.tizen.ncli.ide.config.Configuration;
++import org.tizen.ncli.ide.core.config.NCLIConfigLoader;
++import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;
++
++/**
++ * This class is for 'cli-config' command processing.
++ *
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++public class ConfigCLICommand extends AbstractSubCommand<Configuration>{
++ private boolean list = false;
++ private boolean global = false;
++ private Map<String, String> properties = new HashMap<String, String>();
++
++ /**
++ * @param key
++ * @param value
++ */
++ public void setConfig(String key, String value) {
++ this.properties.put(key, value);
++ }
++
++ /**
++ * @param list
++ */
++ public void setList(boolean list) {
++ this.list = list;
++ }
++
++ /**
++ * Set if config value is set globally. <br>
++ * Default is false
++ * @param global
++ */
++ public void setGlobal(boolean global) {
++ this.global = global;
++ }
++
++ /**
++ * @param properties
++ */
++ public void setKeyValue(Map<String, String> properties) {
++ this.properties = properties;
++
++ }
++
++ /* (non-Javadoc)
++ * @see org.tizen.ncli.ide.subcommands.AbstractSubCommand#call()
++ */
++ @Override
++ public Configuration call() {
++ if(list) {
++ return new Configuration();
++ }else if(global){
++ log.trace("global config set call() - {}",properties);
++ File file = NCLIConfigLoader.getGlobalConfigFile();
++ Properties load = NCLIConfigLoader.loadGlobalConf();;
++ writeProperties2File(file, load);
++ Preference.register(CLIConstant.TIZEN_CLI_GLOBAL_KEY, new TizenCLIConfigProvider(NCLIConfigLoader.loadGlobalConf()));
++ }else {
++ log.trace("local config set call() - {}",properties);
++ File file = NCLIConfigLoader.getLocalConfigFile();
++ Properties load = NCLIConfigLoader.loadLocalConf();;
++ if( writeProperties2File(file, load) ) {
++ Preference.register(CLIConstant.TIZEN_CLI_LOCAL_KEY, new TizenCLIConfigProvider(NCLIConfigLoader.loadLocalConf()));
++ }else {
++ log.error("Fail to write configuration file!");
++ }
++ }
++ return new Configuration();
++ }
++
++ private boolean writeProperties2File(File file, Properties load) {
++ Assert.notNull(file, "There is no file to write.File is Null!");
++ Assert.notNull(load, "There is no properties to store.");
++
++ updateProperties(load);
++
++ OutputStream ous = null;
++ try {
++ ous = new FileOutputStream(file);
++ load.store(ous, "This is generated by Tizen CLI!");
++ } catch (FileNotFoundException e) {
++ e.printStackTrace();
++ return false;
++ } catch (IOException ie) {
++ ie.printStackTrace();
++ return false;
++ } finally {
++ IOUtil.tryClose(ous);
++ }
++ return true;
++ }
++
++ private void updateProperties(Properties load) {
++ Set<String> keySet = this.properties.keySet();
++ for (String key : keySet) {
++ String value = properties.get(key);
++ load.setProperty(key, value);
++ log.trace("key :{} , value :{}",key,value);
++ }
++ }
++
++}
--<?xml version="1.0" encoding="UTF-8"?>\r
--<projectDescription>\r
-- <name>naviUIF</name>\r
-- <comment></comment>\r
-- <projects>\r
-- </projects>\r
-- <buildSpec>\r
-- <buildCommand>\r
-- <name>org.tizen.web.privilege.nature.PrivilegeBuilder</name>\r
-- <arguments>\r
-- </arguments>\r
-- </buildCommand>\r
-- <buildCommand>\r
-- <name>json.validation.builder</name>\r
-- <arguments>\r
-- </arguments>\r
-- </buildCommand>\r
-- <buildCommand>\r
-- <name>org.tizen.web.jslint.nature.JSLintBuilder</name>\r
-- <arguments>\r
-- </arguments>\r
-- </buildCommand>\r
-- <buildCommand>\r
-- <name>org.tizen.web.editor.css.nature.CSSBuilder</name>\r
-- <arguments>\r
-- </arguments>\r
-- </buildCommand>\r
-- <buildCommand>\r
-- <name>org.eclipse.wst.validation.validationbuilder</name>\r
-- <arguments>\r
-- </arguments>\r
-- </buildCommand>\r
-- <buildCommand>\r
-- <name>org.tizen.web.project.builder.WebBuilder</name>\r
-- <arguments>\r
-- <dictionary>\r
-- <key>usedLibraryType</key>\r
-- <value>WebUIFramework</value>\r
-- </dictionary>\r
-- </arguments>\r
-- </buildCommand>\r
-- </buildSpec>\r
-- <natures>\r
-- <nature>org.tizen.web.privilege.nature.PrivilegeNature</nature>\r
-- <nature>json.validation.nature</nature>\r
-- <nature>org.tizen.web.jslint.nature.JSLintNature</nature>\r
-- <nature>org.tizen.web.editor.css.nature.CSSNature</nature>\r
-- <nature>org.eclipse.wst.jsdt.core.jsNature</nature>\r
-- <nature>org.tizen.web.project.builder.WebNature</nature>\r
-- </natures>\r
--</projectDescription>\r
++<?xml version="1.0" encoding="UTF-8"?>
++<projectDescription>
++ <name>naviUIF</name>
++ <comment></comment>
++ <projects>
++ </projects>
++ <buildSpec>
++ <buildCommand>
++ <name>org.tizen.web.privilege.nature.PrivilegeBuilder</name>
++ <arguments>
++ </arguments>
++ </buildCommand>
++ <buildCommand>
++ <name>json.validation.builder</name>
++ <arguments>
++ </arguments>
++ </buildCommand>
++ <buildCommand>
++ <name>org.tizen.web.jslint.nature.JSLintBuilder</name>
++ <arguments>
++ </arguments>
++ </buildCommand>
++ <buildCommand>
++ <name>org.tizen.web.editor.css.nature.CSSBuilder</name>
++ <arguments>
++ </arguments>
++ </buildCommand>
++ <buildCommand>
++ <name>org.eclipse.wst.validation.validationbuilder</name>
++ <arguments>
++ </arguments>
++ </buildCommand>
++ <buildCommand>
++ <name>org.tizen.web.project.builder.WebBuilder</name>
++ <arguments>
++ <dictionary>
++ <key>usedLibraryType</key>
++ <value>WebUIFramework</value>
++ </dictionary>
++ </arguments>
++ </buildCommand>
++ </buildSpec>
++ <natures>
++ <nature>org.tizen.web.privilege.nature.PrivilegeNature</nature>
++ <nature>json.validation.nature</nature>
++ <nature>org.tizen.web.jslint.nature.JSLintNature</nature>
++ <nature>org.tizen.web.editor.css.nature.CSSNature</nature>
++ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
++ <nature>org.tizen.web.project.builder.WebNature</nature>
++ </natures>
++</projectDescription>
--<?xml version="1.0" encoding="UTF-8"?>\r
--<classpath>\r
-- <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>\r
-- <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">\r
-- <attributes>\r
-- <attribute name="hide" value="true"/>\r
-- </attributes>\r
-- </classpathentry>\r
-- <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>\r
-- <classpathentry kind="src" path="">\r
-- <attributes>\r
-- <attribute name="provider" value="org.eclipse.wst.jsdt.web.core.internal.project.ModuleSourcePathProvider"/>\r
-- </attributes>\r
-- </classpathentry>\r
-- <classpathentry kind="con" path="org.tizen.web.project.initializer.WebLibraryInitializer"/>\r
-- <classpathentry kind="con" path="org.tizen.web.project.initializer.W3CLibraryInitializer"/>\r
-- <classpathentry kind="con" path="org.tizen.web.project.initializer.HTML5LibraryInitializer"/>\r
-- <classpathentry kind="con" path="org.eclipselabs.jsdt.jquery.core.CoflictLibrary_1.7"/>\r
-- <classpathentry kind="con" path="org.tizen.web.project.initializer.TizenLibraryInitializer"/>\r
-- <classpathentry kind="output" path=""/>\r
--</classpath>\r
++<?xml version="1.0" encoding="UTF-8"?>
++<classpath>
++ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
++ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
++ <attributes>
++ <attribute name="hide" value="true"/>
++ </attributes>
++ </classpathentry>
++ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
++ <classpathentry kind="src" path="">
++ <attributes>
++ <attribute name="provider" value="org.eclipse.wst.jsdt.web.core.internal.project.ModuleSourcePathProvider"/>
++ </attributes>
++ </classpathentry>
++ <classpathentry kind="con" path="org.tizen.web.project.initializer.WebLibraryInitializer"/>
++ <classpathentry kind="con" path="org.tizen.web.project.initializer.W3CLibraryInitializer"/>
++ <classpathentry kind="con" path="org.tizen.web.project.initializer.HTML5LibraryInitializer"/>
++ <classpathentry kind="con" path="org.eclipselabs.jsdt.jquery.core.CoflictLibrary_1.7"/>
++ <classpathentry kind="con" path="org.tizen.web.project.initializer.TizenLibraryInitializer"/>
++ <classpathentry kind="output" path=""/>
++</classpath>
--css-profile/<project>=org.eclipse.wst.css.core.cssprofile.css3\r
--eclipse.preferences.version=1\r
++css-profile/<project>=org.eclipse.wst.css.core.cssprofile.css3
++eclipse.preferences.version=1
--DELEGATES_PREFERENCE=delegateValidatorList\r
--USER_BUILD_PREFERENCE=enabledBuildValidatorList\r
--USER_MANUAL_PREFERENCE=enabledManualValidatorList\r
--USER_PREFERENCE=overrideGlobalPreferencesfalse\r
--eclipse.preferences.version=1\r
--override=true\r
--suspend=false\r
--vf.version=3\r
++DELEGATES_PREFERENCE=delegateValidatorList
++USER_BUILD_PREFERENCE=enabledBuildValidatorList
++USER_MANUAL_PREFERENCE=enabledManualValidatorList
++USER_PREFERENCE=overrideGlobalPreferencesfalse
++eclipse.preferences.version=1
++override=true
++suspend=false
++vf.version=3
}
}
});
--\r
--}( this ));\r
++
++}( this ));
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
}
});
--/*!\r
-- * Sizzle CSS Selector Engine\r
-- * Copyright 2012 jQuery Foundation and other contributors\r
-- * Released under the MIT license\r
-- * http://sizzlejs.com/\r
-- */\r
--(function( window, undefined ) {\r
--\r
--var cachedruns,\r
-- assertGetIdNotName,\r
-- Expr,\r
-- getText,\r
-- isXML,\r
-- contains,\r
-- compile,\r
-- sortOrder,\r
-- hasDuplicate,\r
-- outermostContext,\r
--\r
-- baseHasDuplicate = true,\r
-- strundefined = "undefined",\r
--\r
-- expando = ( "sizcache" + Math.random() ).replace( ".", "" ),\r
--\r
-- Token = String,\r
-- document = window.document,\r
-- docElem = document.documentElement,\r
-- dirruns = 0,\r
-- done = 0,\r
-- pop = [].pop,\r
-- push = [].push,\r
-- slice = [].slice,\r
-- // Use a stripped-down indexOf if a native one is unavailable\r
-- indexOf = [].indexOf || function( elem ) {\r
-- var i = 0,\r
-- len = this.length;\r
-- for ( ; i < len; i++ ) {\r
-- if ( this[i] === elem ) {\r
-- return i;\r
-- }\r
-- }\r
-- return -1;\r
-- },\r
--\r
-- // Augment a function for special use by Sizzle\r
-- markFunction = function( fn, value ) {\r
-- fn[ expando ] = value == null || value;\r
-- return fn;\r
-- },\r
--\r
-- createCache = function() {\r
-- var cache = {},\r
-- keys = [];\r
--\r
-- return markFunction(function( key, value ) {\r
-- // Only keep the most recent entries\r
-- if ( keys.push( key ) > Expr.cacheLength ) {\r
-- delete cache[ keys.shift() ];\r
-- }\r
--\r
-- return (cache[ key ] = value);\r
-- }, cache );\r
-- },\r
--\r
-- classCache = createCache(),\r
-- tokenCache = createCache(),\r
-- compilerCache = createCache(),\r
--\r
-- // Regex\r
--\r
-- // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace\r
-- whitespace = "[\\x20\\t\\r\\n\\f]",\r
-- // http://www.w3.org/TR/css3-syntax/#characters\r
-- characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",\r
--\r
-- // Loosely modeled on CSS identifier characters\r
-- // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)\r
-- // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\r
-- identifier = characterEncoding.replace( "w", "w#" ),\r
--\r
-- // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors\r
-- operators = "([*^$|!~]?=)",\r
-- attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +\r
-- "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",\r
--\r
-- // Prefer arguments not in parens/brackets,\r
-- // then attribute selectors and non-pseudos (denoted by :),\r
-- // then anything else\r
-- // These preferences are here to reduce the number of selectors\r
-- // needing tokenize in the PSEUDO preFilter\r
-- pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",\r
--\r
-- // For matchExpr.POS and matchExpr.needsContext\r
-- pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +\r
-- "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",\r
--\r
-- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\r
-- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),\r
--\r
-- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),\r
-- rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),\r
-- rpseudo = new RegExp( pseudos ),\r
--\r
-- // Easily-parseable/retrievable ID or TAG or CLASS selectors\r
-- rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,\r
--\r
-- rnot = /^:not/,\r
-- rsibling = /[\x20\t\r\n\f]*[+~]/,\r
-- rendsWithNot = /:not\($/,\r
--\r
-- rheader = /h\d/i,\r
-- rinputs = /input|select|textarea|button/i,\r
--\r
-- rbackslash = /\\(?!\\)/g,\r
--\r
-- matchExpr = {\r
-- "ID": new RegExp( "^#(" + characterEncoding + ")" ),\r
-- "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),\r
-- "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),\r
-- "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),\r
-- "ATTR": new RegExp( "^" + attributes ),\r
-- "PSEUDO": new RegExp( "^" + pseudos ),\r
-- "POS": new RegExp( pos, "i" ),\r
-- "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +\r
-- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +\r
-- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),\r
-- // For use in libraries implementing .is()\r
-- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )\r
-- },\r
--\r
-- // Support\r
--\r
-- // Used for testing something on an element\r
-- assert = function( fn ) {\r
-- var div = document.createElement("div");\r
--\r
-- try {\r
-- return fn( div );\r
-- } catch (e) {\r
-- return false;\r
-- } finally {\r
-- // release memory in IE\r
-- div = null;\r
-- }\r
-- },\r
--\r
-- // Check if getElementsByTagName("*") returns only elements\r
-- assertTagNameNoComments = assert(function( div ) {\r
-- div.appendChild( document.createComment("") );\r
-- return !div.getElementsByTagName("*").length;\r
-- }),\r
--\r
-- // Check if getAttribute returns normalized href attributes\r
-- assertHrefNotNormalized = assert(function( div ) {\r
-- div.innerHTML = "<a href='#'></a>";\r
-- return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&\r
-- div.firstChild.getAttribute("href") === "#";\r
-- }),\r
--\r
-- // Check if attributes should be retrieved by attribute nodes\r
-- assertAttributes = assert(function( div ) {\r
-- div.innerHTML = "<select></select>";\r
-- var type = typeof div.lastChild.getAttribute("multiple");\r
-- // IE8 returns a string for some attributes even when not present\r
-- return type !== "boolean" && type !== "string";\r
-- }),\r
--\r
-- // Check if getElementsByClassName can be trusted\r
-- assertUsableClassName = assert(function( div ) {\r
-- // Opera can't find a second classname (in 9.6)\r
-- div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";\r
-- if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {\r
-- return false;\r
-- }\r
--\r
-- // Safari 3.2 caches class attributes and doesn't catch changes\r
-- div.lastChild.className = "e";\r
-- return div.getElementsByClassName("e").length === 2;\r
-- }),\r
--\r
-- // Check if getElementById returns elements by name\r
-- // Check if getElementsByName privileges form controls or returns elements by ID\r
-- assertUsableName = assert(function( div ) {\r
-- // Inject content\r
-- div.id = expando + 0;\r
-- div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";\r
-- docElem.insertBefore( div, docElem.firstChild );\r
--\r
-- // Test\r
-- var pass = document.getElementsByName &&\r
-- // buggy browsers will return fewer than the correct 2\r
-- document.getElementsByName( expando ).length === 2 +\r
-- // buggy browsers will return more than the correct 0\r
-- document.getElementsByName( expando + 0 ).length;\r
-- assertGetIdNotName = !document.getElementById( expando );\r
--\r
-- // Cleanup\r
-- docElem.removeChild( div );\r
--\r
-- return pass;\r
-- });\r
--\r
--// If slice is not available, provide a backup\r
--try {\r
-- slice.call( docElem.childNodes, 0 )[0].nodeType;\r
--} catch ( e ) {\r
-- slice = function( i ) {\r
-- var elem,\r
-- results = [];\r
-- for ( ; (elem = this[i]); i++ ) {\r
-- results.push( elem );\r
-- }\r
-- return results;\r
-- };\r
--}\r
--\r
--function Sizzle( selector, context, results, seed ) {\r
-- results = results || [];\r
-- context = context || document;\r
-- var match, elem, xml, m,\r
-- nodeType = context.nodeType;\r
--\r
-- if ( !selector || typeof selector !== "string" ) {\r
-- return results;\r
-- }\r
--\r
-- if ( nodeType !== 1 && nodeType !== 9 ) {\r
-- return [];\r
-- }\r
--\r
-- xml = isXML( context );\r
--\r
-- if ( !xml && !seed ) {\r
-- if ( (match = rquickExpr.exec( selector )) ) {\r
-- // Speed-up: Sizzle("#ID")\r
-- if ( (m = match[1]) ) {\r
-- if ( nodeType === 9 ) {\r
-- elem = context.getElementById( m );\r
-- // Check parentNode to catch when Blackberry 4.6 returns\r
-- // nodes that are no longer in the document #6963\r
-- if ( elem && elem.parentNode ) {\r
-- // Handle the case where IE, Opera, and Webkit return items\r
-- // by name instead of ID\r
-- if ( elem.id === m ) {\r
-- results.push( elem );\r
-- return results;\r
-- }\r
-- } else {\r
-- return results;\r
-- }\r
-- } else {\r
-- // Context is not a document\r
-- if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&\r
-- contains( context, elem ) && elem.id === m ) {\r
-- results.push( elem );\r
-- return results;\r
-- }\r
-- }\r
--\r
-- // Speed-up: Sizzle("TAG")\r
-- } else if ( match[2] ) {\r
-- push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );\r
-- return results;\r
--\r
-- // Speed-up: Sizzle(".CLASS")\r
-- } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {\r
-- push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );\r
-- return results;\r
-- }\r
-- }\r
-- }\r
--\r
-- // All others\r
-- return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );\r
--}\r
--\r
--Sizzle.matches = function( expr, elements ) {\r
-- return Sizzle( expr, null, null, elements );\r
--};\r
--\r
--Sizzle.matchesSelector = function( elem, expr ) {\r
-- return Sizzle( expr, null, null, [ elem ] ).length > 0;\r
--};\r
--\r
--// Returns a function to use in pseudos for input types\r
--function createInputPseudo( type ) {\r
-- return function( elem ) {\r
-- var name = elem.nodeName.toLowerCase();\r
-- return name === "input" && elem.type === type;\r
-- };\r
--}\r
--\r
--// Returns a function to use in pseudos for buttons\r
--function createButtonPseudo( type ) {\r
-- return function( elem ) {\r
-- var name = elem.nodeName.toLowerCase();\r
-- return (name === "input" || name === "button") && elem.type === type;\r
-- };\r
--}\r
--\r
--// Returns a function to use in pseudos for positionals\r
--function createPositionalPseudo( fn ) {\r
-- return markFunction(function( argument ) {\r
-- argument = +argument;\r
-- return markFunction(function( seed, matches ) {\r
-- var j,\r
-- matchIndexes = fn( [], seed.length, argument ),\r
-- i = matchIndexes.length;\r
--\r
-- // Match elements found at the specified indexes\r
-- while ( i-- ) {\r
-- if ( seed[ (j = matchIndexes[i]) ] ) {\r
-- seed[j] = !(matches[j] = seed[j]);\r
-- }\r
-- }\r
-- });\r
-- });\r
--}\r
--\r
--/**\r
-- * Utility function for retrieving the text value of an array of DOM nodes\r
-- * @param {Array|Element} elem\r
-- */\r
--getText = Sizzle.getText = function( elem ) {\r
-- var node,\r
-- ret = "",\r
-- i = 0,\r
-- nodeType = elem.nodeType;\r
--\r
-- if ( nodeType ) {\r
-- if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\r
-- // Use textContent for elements\r
-- // innerText usage removed for consistency of new lines (see #11153)\r
-- if ( typeof elem.textContent === "string" ) {\r
-- return elem.textContent;\r
-- } else {\r
-- // Traverse its children\r
-- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\r
-- ret += getText( elem );\r
-- }\r
-- }\r
-- } else if ( nodeType === 3 || nodeType === 4 ) {\r
-- return elem.nodeValue;\r
-- }\r
-- // Do not include comment or processing instruction nodes\r
-- } else {\r
--\r
-- // If no nodeType, this is expected to be an array\r
-- for ( ; (node = elem[i]); i++ ) {\r
-- // Do not traverse comment nodes\r
-- ret += getText( node );\r
-- }\r
-- }\r
-- return ret;\r
--};\r
--\r
--isXML = Sizzle.isXML = function( elem ) {\r
-- // documentElement is verified for cases where it doesn't yet exist\r
-- // (such as loading iframes in IE - #4833)\r
-- var documentElement = elem && (elem.ownerDocument || elem).documentElement;\r
-- return documentElement ? documentElement.nodeName !== "HTML" : false;\r
--};\r
--\r
--// Element contains another\r
--contains = Sizzle.contains = docElem.contains ?\r
-- function( a, b ) {\r
-- var adown = a.nodeType === 9 ? a.documentElement : a,\r
-- bup = b && b.parentNode;\r
-- return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );\r
-- } :\r
-- docElem.compareDocumentPosition ?\r
-- function( a, b ) {\r
-- return b && !!( a.compareDocumentPosition( b ) & 16 );\r
-- } :\r
-- function( a, b ) {\r
-- while ( (b = b.parentNode) ) {\r
-- if ( b === a ) {\r
-- return true;\r
-- }\r
-- }\r
-- return false;\r
-- };\r
--\r
--Sizzle.attr = function( elem, name ) {\r
-- var val,\r
-- xml = isXML( elem );\r
--\r
-- if ( !xml ) {\r
-- name = name.toLowerCase();\r
-- }\r
-- if ( (val = Expr.attrHandle[ name ]) ) {\r
-- return val( elem );\r
-- }\r
-- if ( xml || assertAttributes ) {\r
-- return elem.getAttribute( name );\r
-- }\r
-- val = elem.getAttributeNode( name );\r
-- return val ?\r
-- typeof elem[ name ] === "boolean" ?\r
-- elem[ name ] ? name : null :\r
-- val.specified ? val.value : null :\r
-- null;\r
--};\r
--\r
--Expr = Sizzle.selectors = {\r
--\r
-- // Can be adjusted by the user\r
-- cacheLength: 50,\r
--\r
-- createPseudo: markFunction,\r
--\r
-- match: matchExpr,\r
--\r
-- // IE6/7 return a modified href\r
-- attrHandle: assertHrefNotNormalized ?\r
-- {} :\r
-- {\r
-- "href": function( elem ) {\r
-- return elem.getAttribute( "href", 2 );\r
-- },\r
-- "type": function( elem ) {\r
-- return elem.getAttribute("type");\r
-- }\r
-- },\r
--\r
-- find: {\r
-- "ID": assertGetIdNotName ?\r
-- function( id, context, xml ) {\r
-- if ( typeof context.getElementById !== strundefined && !xml ) {\r
-- var m = context.getElementById( id );\r
-- // Check parentNode to catch when Blackberry 4.6 returns\r
-- // nodes that are no longer in the document #6963\r
-- return m && m.parentNode ? [m] : [];\r
-- }\r
-- } :\r
-- function( id, context, xml ) {\r
-- if ( typeof context.getElementById !== strundefined && !xml ) {\r
-- var m = context.getElementById( id );\r
--\r
-- return m ?\r
-- m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?\r
-- [m] :\r
-- undefined :\r
-- [];\r
-- }\r
-- },\r
--\r
-- "TAG": assertTagNameNoComments ?\r
-- function( tag, context ) {\r
-- if ( typeof context.getElementsByTagName !== strundefined ) {\r
-- return context.getElementsByTagName( tag );\r
-- }\r
-- } :\r
-- function( tag, context ) {\r
-- var results = context.getElementsByTagName( tag );\r
--\r
-- // Filter out possible comments\r
-- if ( tag === "*" ) {\r
-- var elem,\r
-- tmp = [],\r
-- i = 0;\r
--\r
-- for ( ; (elem = results[i]); i++ ) {\r
-- if ( elem.nodeType === 1 ) {\r
-- tmp.push( elem );\r
-- }\r
-- }\r
--\r
-- return tmp;\r
-- }\r
-- return results;\r
-- },\r
--\r
-- "NAME": assertUsableName && function( tag, context ) {\r
-- if ( typeof context.getElementsByName !== strundefined ) {\r
-- return context.getElementsByName( name );\r
-- }\r
-- },\r
--\r
-- "CLASS": assertUsableClassName && function( className, context, xml ) {\r
-- if ( typeof context.getElementsByClassName !== strundefined && !xml ) {\r
-- return context.getElementsByClassName( className );\r
-- }\r
-- }\r
-- },\r
--\r
-- relative: {\r
-- ">": { dir: "parentNode", first: true },\r
-- " ": { dir: "parentNode" },\r
-- "+": { dir: "previousSibling", first: true },\r
-- "~": { dir: "previousSibling" }\r
-- },\r
--\r
-- preFilter: {\r
-- "ATTR": function( match ) {\r
-- match[1] = match[1].replace( rbackslash, "" );\r
--\r
-- // Move the given value to match[3] whether quoted or unquoted\r
-- match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );\r
--\r
-- if ( match[2] === "~=" ) {\r
-- match[3] = " " + match[3] + " ";\r
-- }\r
--\r
-- return match.slice( 0, 4 );\r
-- },\r
--\r
-- "CHILD": function( match ) {\r
-- /* matches from matchExpr["CHILD"]\r
-- 1 type (only|nth|...)\r
-- 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)\r
-- 3 xn-component of xn+y argument ([+-]?\d*n|)\r
-- 4 sign of xn-component\r
-- 5 x of xn-component\r
-- 6 sign of y-component\r
-- 7 y of y-component\r
-- */\r
-- match[1] = match[1].toLowerCase();\r
--\r
-- if ( match[1] === "nth" ) {\r
-- // nth-child requires argument\r
-- if ( !match[2] ) {\r
-- Sizzle.error( match[0] );\r
-- }\r
--\r
-- // numeric x and y parameters for Expr.filter.CHILD\r
-- // remember that false/true cast respectively to 0/1\r
-- match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );\r
-- match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );\r
--\r
-- // other types prohibit arguments\r
-- } else if ( match[2] ) {\r
-- Sizzle.error( match[0] );\r
-- }\r
--\r
-- return match;\r
-- },\r
--\r
-- "PSEUDO": function( match ) {\r
-- var unquoted, excess;\r
-- if ( matchExpr["CHILD"].test( match[0] ) ) {\r
-- return null;\r
-- }\r
--\r
-- if ( match[3] ) {\r
-- match[2] = match[3];\r
-- } else if ( (unquoted = match[4]) ) {\r
-- // Only check arguments that contain a pseudo\r
-- if ( rpseudo.test(unquoted) &&\r
-- // Get excess from tokenize (recursively)\r
-- (excess = tokenize( unquoted, true )) &&\r
-- // advance to the next closing parenthesis\r
-- (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {\r
--\r
-- // excess is a negative index\r
-- unquoted = unquoted.slice( 0, excess );\r
-- match[0] = match[0].slice( 0, excess );\r
-- }\r
-- match[2] = unquoted;\r
-- }\r
--\r
-- // Return only captures needed by the pseudo filter method (type and argument)\r
-- return match.slice( 0, 3 );\r
-- }\r
-- },\r
--\r
-- filter: {\r
-- "ID": assertGetIdNotName ?\r
-- function( id ) {\r
-- id = id.replace( rbackslash, "" );\r
-- return function( elem ) {\r
-- return elem.getAttribute("id") === id;\r
-- };\r
-- } :\r
-- function( id ) {\r
-- id = id.replace( rbackslash, "" );\r
-- return function( elem ) {\r
-- var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");\r
-- return node && node.value === id;\r
-- };\r
-- },\r
--\r
-- "TAG": function( nodeName ) {\r
-- if ( nodeName === "*" ) {\r
-- return function() { return true; };\r
-- }\r
-- nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();\r
--\r
-- return function( elem ) {\r
-- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\r
-- };\r
-- },\r
--\r
-- "CLASS": function( className ) {\r
-- var pattern = classCache[ expando ][ className ];\r
-- if ( !pattern ) {\r
-- pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") );\r
-- }\r
-- return function( elem ) {\r
-- return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );\r
-- };\r
-- },\r
--\r
-- "ATTR": function( name, operator, check ) {\r
-- return function( elem, context ) {\r
-- var result = Sizzle.attr( elem, name );\r
--\r
-- if ( result == null ) {\r
-- return operator === "!=";\r
-- }\r
-- if ( !operator ) {\r
-- return true;\r
-- }\r
--\r
-- result += "";\r
--\r
-- return operator === "=" ? result === check :\r
-- operator === "!=" ? result !== check :\r
-- operator === "^=" ? check && result.indexOf( check ) === 0 :\r
-- operator === "*=" ? check && result.indexOf( check ) > -1 :\r
-- operator === "$=" ? check && result.substr( result.length - check.length ) === check :\r
-- operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :\r
-- operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :\r
-- false;\r
-- };\r
-- },\r
--\r
-- "CHILD": function( type, argument, first, last ) {\r
--\r
-- if ( type === "nth" ) {\r
-- return function( elem ) {\r
-- var node, diff,\r
-- parent = elem.parentNode;\r
--\r
-- if ( first === 1 && last === 0 ) {\r
-- return true;\r
-- }\r
--\r
-- if ( parent ) {\r
-- diff = 0;\r
-- for ( node = parent.firstChild; node; node = node.nextSibling ) {\r
-- if ( node.nodeType === 1 ) {\r
-- diff++;\r
-- if ( elem === node ) {\r
-- break;\r
-- }\r
-- }\r
-- }\r
-- }\r
--\r
-- // Incorporate the offset (or cast to NaN), then check against cycle size\r
-- diff -= last;\r
-- return diff === first || ( diff % first === 0 && diff / first >= 0 );\r
-- };\r
-- }\r
--\r
-- return function( elem ) {\r
-- var node = elem;\r
--\r
-- switch ( type ) {\r
-- case "only":\r
-- case "first":\r
-- while ( (node = node.previousSibling) ) {\r
-- if ( node.nodeType === 1 ) {\r
-- return false;\r
-- }\r
-- }\r
--\r
-- if ( type === "first" ) {\r
-- return true;\r
-- }\r
--\r
-- node = elem;\r
--\r
-- /* falls through */\r
-- case "last":\r
-- while ( (node = node.nextSibling) ) {\r
-- if ( node.nodeType === 1 ) {\r
-- return false;\r
-- }\r
-- }\r
--\r
-- return true;\r
-- }\r
-- };\r
-- },\r
--\r
-- "PSEUDO": function( pseudo, argument ) {\r
-- // pseudo-class names are case-insensitive\r
-- // http://www.w3.org/TR/selectors/#pseudo-classes\r
-- // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\r
-- // Remember that setFilters inherits from pseudos\r
-- var args,\r
-- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\r
-- Sizzle.error( "unsupported pseudo: " + pseudo );\r
--\r
-- // The user may use createPseudo to indicate that\r
-- // arguments are needed to create the filter function\r
-- // just as Sizzle does\r
-- if ( fn[ expando ] ) {\r
-- return fn( argument );\r
-- }\r
--\r
-- // But maintain support for old signatures\r
-- if ( fn.length > 1 ) {\r
-- args = [ pseudo, pseudo, "", argument ];\r
-- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\r
-- markFunction(function( seed, matches ) {\r
-- var idx,\r
-- matched = fn( seed, argument ),\r
-- i = matched.length;\r
-- while ( i-- ) {\r
-- idx = indexOf.call( seed, matched[i] );\r
-- seed[ idx ] = !( matches[ idx ] = matched[i] );\r
-- }\r
-- }) :\r
-- function( elem ) {\r
-- return fn( elem, 0, args );\r
-- };\r
-- }\r
--\r
-- return fn;\r
-- }\r
-- },\r
--\r
-- pseudos: {\r
-- "not": markFunction(function( selector ) {\r
-- // Trim the selector passed to compile\r
-- // to avoid treating leading and trailing\r
-- // spaces as combinators\r
-- var input = [],\r
-- results = [],\r
-- matcher = compile( selector.replace( rtrim, "$1" ) );\r
--\r
-- return matcher[ expando ] ?\r
-- markFunction(function( seed, matches, context, xml ) {\r
-- var elem,\r
-- unmatched = matcher( seed, null, xml, [] ),\r
-- i = seed.length;\r
--\r
-- // Match elements unmatched by `matcher`\r
-- while ( i-- ) {\r
-- if ( (elem = unmatched[i]) ) {\r
-- seed[i] = !(matches[i] = elem);\r
-- }\r
-- }\r
-- }) :\r
-- function( elem, context, xml ) {\r
-- input[0] = elem;\r
-- matcher( input, null, xml, results );\r
-- return !results.pop();\r
-- };\r
-- }),\r
--\r
-- "has": markFunction(function( selector ) {\r
-- return function( elem ) {\r
-- return Sizzle( selector, elem ).length > 0;\r
-- };\r
-- }),\r
--\r
-- "contains": markFunction(function( text ) {\r
-- return function( elem ) {\r
-- return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\r
-- };\r
-- }),\r
--\r
-- "enabled": function( elem ) {\r
-- return elem.disabled === false;\r
-- },\r
--\r
-- "disabled": function( elem ) {\r
-- return elem.disabled === true;\r
-- },\r
--\r
-- "checked": function( elem ) {\r
-- // In CSS3, :checked should return both checked and selected elements\r
-- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\r
-- var nodeName = elem.nodeName.toLowerCase();\r
-- return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);\r
-- },\r
--\r
-- "selected": function( elem ) {\r
-- // Accessing this property makes selected-by-default\r
-- // options in Safari work properly\r
-- if ( elem.parentNode ) {\r
-- elem.parentNode.selectedIndex;\r
-- }\r
--\r
-- return elem.selected === true;\r
-- },\r
--\r
-- "parent": function( elem ) {\r
-- return !Expr.pseudos["empty"]( elem );\r
-- },\r
--\r
-- "empty": function( elem ) {\r
-- // http://www.w3.org/TR/selectors/#empty-pseudo\r
-- // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),\r
-- // not comment, processing instructions, or others\r
-- // Thanks to Diego Perini for the nodeName shortcut\r
-- // Greater than "@" means alpha characters (specifically not starting with "#" or "?")\r
-- var nodeType;\r
-- elem = elem.firstChild;\r
-- while ( elem ) {\r
-- if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {\r
-- return false;\r
-- }\r
-- elem = elem.nextSibling;\r
-- }\r
-- return true;\r
-- },\r
--\r
-- "header": function( elem ) {\r
-- return rheader.test( elem.nodeName );\r
-- },\r
--\r
-- "text": function( elem ) {\r
-- var type, attr;\r
-- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)\r
-- // use getAttribute instead to test this case\r
-- return elem.nodeName.toLowerCase() === "input" &&\r
-- (type = elem.type) === "text" &&\r
-- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );\r
-- },\r
--\r
-- // Input types\r
-- "radio": createInputPseudo("radio"),\r
-- "checkbox": createInputPseudo("checkbox"),\r
-- "file": createInputPseudo("file"),\r
-- "password": createInputPseudo("password"),\r
-- "image": createInputPseudo("image"),\r
--\r
-- "submit": createButtonPseudo("submit"),\r
-- "reset": createButtonPseudo("reset"),\r
--\r
-- "button": function( elem ) {\r
-- var name = elem.nodeName.toLowerCase();\r
-- return name === "input" && elem.type === "button" || name === "button";\r
-- },\r
--\r
-- "input": function( elem ) {\r
-- return rinputs.test( elem.nodeName );\r
-- },\r
--\r
-- "focus": function( elem ) {\r
-- var doc = elem.ownerDocument;\r
-- return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);\r
-- },\r
--\r
-- "active": function( elem ) {\r
-- return elem === elem.ownerDocument.activeElement;\r
-- },\r
--\r
-- // Positional types\r
-- "first": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
-- return [ 0 ];\r
-- }),\r
--\r
-- "last": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
-- return [ length - 1 ];\r
-- }),\r
--\r
-- "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
-- return [ argument < 0 ? argument + length : argument ];\r
-- }),\r
--\r
-- "even": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
-- for ( var i = 0; i < length; i += 2 ) {\r
-- matchIndexes.push( i );\r
-- }\r
-- return matchIndexes;\r
-- }),\r
--\r
-- "odd": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
-- for ( var i = 1; i < length; i += 2 ) {\r
-- matchIndexes.push( i );\r
-- }\r
-- return matchIndexes;\r
-- }),\r
--\r
-- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
-- for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {\r
-- matchIndexes.push( i );\r
-- }\r
-- return matchIndexes;\r
-- }),\r
--\r
-- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
-- for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {\r
-- matchIndexes.push( i );\r
-- }\r
-- return matchIndexes;\r
-- })\r
-- }\r
--};\r
--\r
--function siblingCheck( a, b, ret ) {\r
-- if ( a === b ) {\r
-- return ret;\r
-- }\r
--\r
-- var cur = a.nextSibling;\r
--\r
-- while ( cur ) {\r
-- if ( cur === b ) {\r
-- return -1;\r
-- }\r
--\r
-- cur = cur.nextSibling;\r
-- }\r
--\r
-- return 1;\r
--}\r
--\r
--sortOrder = docElem.compareDocumentPosition ?\r
-- function( a, b ) {\r
-- if ( a === b ) {\r
-- hasDuplicate = true;\r
-- return 0;\r
-- }\r
--\r
-- return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?\r
-- a.compareDocumentPosition :\r
-- a.compareDocumentPosition(b) & 4\r
-- ) ? -1 : 1;\r
-- } :\r
-- function( a, b ) {\r
-- // The nodes are identical, we can exit early\r
-- if ( a === b ) {\r
-- hasDuplicate = true;\r
-- return 0;\r
--\r
-- // Fallback to using sourceIndex (in IE) if it's available on both nodes\r
-- } else if ( a.sourceIndex && b.sourceIndex ) {\r
-- return a.sourceIndex - b.sourceIndex;\r
-- }\r
--\r
-- var al, bl,\r
-- ap = [],\r
-- bp = [],\r
-- aup = a.parentNode,\r
-- bup = b.parentNode,\r
-- cur = aup;\r
--\r
-- // If the nodes are siblings (or identical) we can do a quick check\r
-- if ( aup === bup ) {\r
-- return siblingCheck( a, b );\r
--\r
-- // If no parents were found then the nodes are disconnected\r
-- } else if ( !aup ) {\r
-- return -1;\r
--\r
-- } else if ( !bup ) {\r
-- return 1;\r
-- }\r
--\r
-- // Otherwise they're somewhere else in the tree so we need\r
-- // to build up a full list of the parentNodes for comparison\r
-- while ( cur ) {\r
-- ap.unshift( cur );\r
-- cur = cur.parentNode;\r
-- }\r
--\r
-- cur = bup;\r
--\r
-- while ( cur ) {\r
-- bp.unshift( cur );\r
-- cur = cur.parentNode;\r
-- }\r
--\r
-- al = ap.length;\r
-- bl = bp.length;\r
--\r
-- // Start walking down the tree looking for a discrepancy\r
-- for ( var i = 0; i < al && i < bl; i++ ) {\r
-- if ( ap[i] !== bp[i] ) {\r
-- return siblingCheck( ap[i], bp[i] );\r
-- }\r
-- }\r
--\r
-- // We ended someplace up the tree so do a sibling check\r
-- return i === al ?\r
-- siblingCheck( a, bp[i], -1 ) :\r
-- siblingCheck( ap[i], b, 1 );\r
-- };\r
--\r
--// Always assume the presence of duplicates if sort doesn't\r
--// pass them to our comparison function (as in Google Chrome).\r
--[0, 0].sort( sortOrder );\r
--baseHasDuplicate = !hasDuplicate;\r
--\r
--// Document sorting and removing duplicates\r
--Sizzle.uniqueSort = function( results ) {\r
-- var elem,\r
-- i = 1;\r
--\r
-- hasDuplicate = baseHasDuplicate;\r
-- results.sort( sortOrder );\r
--\r
-- if ( hasDuplicate ) {\r
-- for ( ; (elem = results[i]); i++ ) {\r
-- if ( elem === results[ i - 1 ] ) {\r
-- results.splice( i--, 1 );\r
-- }\r
-- }\r
-- }\r
--\r
-- return results;\r
--};\r
--\r
--Sizzle.error = function( msg ) {\r
-- throw new Error( "Syntax error, unrecognized expression: " + msg );\r
--};\r
--\r
--function tokenize( selector, parseOnly ) {\r
-- var matched, match, tokens, type, soFar, groups, preFilters,\r
-- cached = tokenCache[ expando ][ selector ];\r
--\r
-- if ( cached ) {\r
-- return parseOnly ? 0 : cached.slice( 0 );\r
-- }\r
--\r
-- soFar = selector;\r
-- groups = [];\r
-- preFilters = Expr.preFilter;\r
--\r
-- while ( soFar ) {\r
--\r
-- // Comma and first run\r
-- if ( !matched || (match = rcomma.exec( soFar )) ) {\r
-- if ( match ) {\r
-- soFar = soFar.slice( match[0].length );\r
-- }\r
-- groups.push( tokens = [] );\r
-- }\r
--\r
-- matched = false;\r
--\r
-- // Combinators\r
-- if ( (match = rcombinators.exec( soFar )) ) {\r
-- tokens.push( matched = new Token( match.shift() ) );\r
-- soFar = soFar.slice( matched.length );\r
--\r
-- // Cast descendant combinators to space\r
-- matched.type = match[0].replace( rtrim, " " );\r
-- }\r
--\r
-- // Filters\r
-- for ( type in Expr.filter ) {\r
-- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\r
-- // The last two arguments here are (context, xml) for backCompat\r
-- (match = preFilters[ type ]( match, document, true ))) ) {\r
--\r
-- tokens.push( matched = new Token( match.shift() ) );\r
-- soFar = soFar.slice( matched.length );\r
-- matched.type = type;\r
-- matched.matches = match;\r
-- }\r
-- }\r
--\r
-- if ( !matched ) {\r
-- break;\r
-- }\r
-- }\r
--\r
-- // Return the length of the invalid excess\r
-- // if we're just parsing\r
-- // Otherwise, throw an error or return tokens\r
-- return parseOnly ?\r
-- soFar.length :\r
-- soFar ?\r
-- Sizzle.error( selector ) :\r
-- // Cache the tokens\r
-- tokenCache( selector, groups ).slice( 0 );\r
--}\r
--\r
--function addCombinator( matcher, combinator, base ) {\r
-- var dir = combinator.dir,\r
-- checkNonElements = base && combinator.dir === "parentNode",\r
-- doneName = done++;\r
--\r
-- return combinator.first ?\r
-- // Check against closest ancestor/preceding element\r
-- function( elem, context, xml ) {\r
-- while ( (elem = elem[ dir ]) ) {\r
-- if ( checkNonElements || elem.nodeType === 1 ) {\r
-- return matcher( elem, context, xml );\r
-- }\r
-- }\r
-- } :\r
--\r
-- // Check against all ancestor/preceding elements\r
-- function( elem, context, xml ) {\r
-- // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching\r
-- if ( !xml ) {\r
-- var cache,\r
-- dirkey = dirruns + " " + doneName + " ",\r
-- cachedkey = dirkey + cachedruns;\r
-- while ( (elem = elem[ dir ]) ) {\r
-- if ( checkNonElements || elem.nodeType === 1 ) {\r
-- if ( (cache = elem[ expando ]) === cachedkey ) {\r
-- return elem.sizset;\r
-- } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {\r
-- if ( elem.sizset ) {\r
-- return elem;\r
-- }\r
-- } else {\r
-- elem[ expando ] = cachedkey;\r
-- if ( matcher( elem, context, xml ) ) {\r
-- elem.sizset = true;\r
-- return elem;\r
-- }\r
-- elem.sizset = false;\r
-- }\r
-- }\r
-- }\r
-- } else {\r
-- while ( (elem = elem[ dir ]) ) {\r
-- if ( checkNonElements || elem.nodeType === 1 ) {\r
-- if ( matcher( elem, context, xml ) ) {\r
-- return elem;\r
-- }\r
-- }\r
-- }\r
-- }\r
-- };\r
--}\r
--\r
--function elementMatcher( matchers ) {\r
-- return matchers.length > 1 ?\r
-- function( elem, context, xml ) {\r
-- var i = matchers.length;\r
-- while ( i-- ) {\r
-- if ( !matchers[i]( elem, context, xml ) ) {\r
-- return false;\r
-- }\r
-- }\r
-- return true;\r
-- } :\r
-- matchers[0];\r
--}\r
--\r
--function condense( unmatched, map, filter, context, xml ) {\r
-- var elem,\r
-- newUnmatched = [],\r
-- i = 0,\r
-- len = unmatched.length,\r
-- mapped = map != null;\r
--\r
-- for ( ; i < len; i++ ) {\r
-- if ( (elem = unmatched[i]) ) {\r
-- if ( !filter || filter( elem, context, xml ) ) {\r
-- newUnmatched.push( elem );\r
-- if ( mapped ) {\r
-- map.push( i );\r
-- }\r
-- }\r
-- }\r
-- }\r
--\r
-- return newUnmatched;\r
--}\r
--\r
--function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\r
-- if ( postFilter && !postFilter[ expando ] ) {\r
-- postFilter = setMatcher( postFilter );\r
-- }\r
-- if ( postFinder && !postFinder[ expando ] ) {\r
-- postFinder = setMatcher( postFinder, postSelector );\r
-- }\r
-- return markFunction(function( seed, results, context, xml ) {\r
-- // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones\r
-- if ( seed && postFinder ) {\r
-- return;\r
-- }\r
--\r
-- var i, elem, postFilterIn,\r
-- preMap = [],\r
-- postMap = [],\r
-- preexisting = results.length,\r
--\r
-- // Get initial elements from seed or context\r
-- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),\r
--\r
-- // Prefilter to get matcher input, preserving a map for seed-results synchronization\r
-- matcherIn = preFilter && ( seed || !selector ) ?\r
-- condense( elems, preMap, preFilter, context, xml ) :\r
-- elems,\r
--\r
-- matcherOut = matcher ?\r
-- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\r
-- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?\r
--\r
-- // ...intermediate processing is necessary\r
-- [] :\r
--\r
-- // ...otherwise use results directly\r
-- results :\r
-- matcherIn;\r
--\r
-- // Find primary matches\r
-- if ( matcher ) {\r
-- matcher( matcherIn, matcherOut, context, xml );\r
-- }\r
--\r
-- // Apply postFilter\r
-- if ( postFilter ) {\r
-- postFilterIn = condense( matcherOut, postMap );\r
-- postFilter( postFilterIn, [], context, xml );\r
--\r
-- // Un-match failing elements by moving them back to matcherIn\r
-- i = postFilterIn.length;\r
-- while ( i-- ) {\r
-- if ( (elem = postFilterIn[i]) ) {\r
-- matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\r
-- }\r
-- }\r
-- }\r
--\r
-- // Keep seed and results synchronized\r
-- if ( seed ) {\r
-- // Ignore postFinder because it can't coexist with seed\r
-- i = preFilter && matcherOut.length;\r
-- while ( i-- ) {\r
-- if ( (elem = matcherOut[i]) ) {\r
-- seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);\r
-- }\r
-- }\r
-- } else {\r
-- matcherOut = condense(\r
-- matcherOut === results ?\r
-- matcherOut.splice( preexisting, matcherOut.length ) :\r
-- matcherOut\r
-- );\r
-- if ( postFinder ) {\r
-- postFinder( null, results, matcherOut, xml );\r
-- } else {\r
-- push.apply( results, matcherOut );\r
-- }\r
-- }\r
-- });\r
--}\r
--\r
--function matcherFromTokens( tokens ) {\r
-- var checkContext, matcher, j,\r
-- len = tokens.length,\r
-- leadingRelative = Expr.relative[ tokens[0].type ],\r
-- implicitRelative = leadingRelative || Expr.relative[" "],\r
-- i = leadingRelative ? 1 : 0,\r
--\r
-- // The foundational matcher ensures that elements are reachable from top-level context(s)\r
-- matchContext = addCombinator( function( elem ) {\r
-- return elem === checkContext;\r
-- }, implicitRelative, true ),\r
-- matchAnyContext = addCombinator( function( elem ) {\r
-- return indexOf.call( checkContext, elem ) > -1;\r
-- }, implicitRelative, true ),\r
-- matchers = [ function( elem, context, xml ) {\r
-- return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\r
-- (checkContext = context).nodeType ?\r
-- matchContext( elem, context, xml ) :\r
-- matchAnyContext( elem, context, xml ) );\r
-- } ];\r
--\r
-- for ( ; i < len; i++ ) {\r
-- if ( (matcher = Expr.relative[ tokens[i].type ]) ) {\r
-- matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\r
-- } else {\r
-- // The concatenated values are (context, xml) for backCompat\r
-- matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\r
--\r
-- // Return special upon seeing a positional matcher\r
-- if ( matcher[ expando ] ) {\r
-- // Find the next relative operator (if any) for proper handling\r
-- j = ++i;\r
-- for ( ; j < len; j++ ) {\r
-- if ( Expr.relative[ tokens[j].type ] ) {\r
-- break;\r
-- }\r
-- }\r
-- return setMatcher(\r
-- i > 1 && elementMatcher( matchers ),\r
-- i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),\r
-- matcher,\r
-- i < j && matcherFromTokens( tokens.slice( i, j ) ),\r
-- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\r
-- j < len && tokens.join("")\r
-- );\r
-- }\r
-- matchers.push( matcher );\r
-- }\r
-- }\r
--\r
-- return elementMatcher( matchers );\r
--}\r
--\r
--function matcherFromGroupMatchers( elementMatchers, setMatchers ) {\r
-- var bySet = setMatchers.length > 0,\r
-- byElement = elementMatchers.length > 0,\r
-- superMatcher = function( seed, context, xml, results, expandContext ) {\r
-- var elem, j, matcher,\r
-- setMatched = [],\r
-- matchedCount = 0,\r
-- i = "0",\r
-- unmatched = seed && [],\r
-- outermost = expandContext != null,\r
-- contextBackup = outermostContext,\r
-- // We must always have either seed elements or context\r
-- elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),\r
-- // Nested matchers should use non-integer dirruns\r
-- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);\r
--\r
-- if ( outermost ) {\r
-- outermostContext = context !== document && context;\r
-- cachedruns = superMatcher.el;\r
-- }\r
--\r
-- // Add elements passing elementMatchers directly to results\r
-- for ( ; (elem = elems[i]) != null; i++ ) {\r
-- if ( byElement && elem ) {\r
-- for ( j = 0; (matcher = elementMatchers[j]); j++ ) {\r
-- if ( matcher( elem, context, xml ) ) {\r
-- results.push( elem );\r
-- break;\r
-- }\r
-- }\r
-- if ( outermost ) {\r
-- dirruns = dirrunsUnique;\r
-- cachedruns = ++superMatcher.el;\r
-- }\r
-- }\r
--\r
-- // Track unmatched elements for set filters\r
-- if ( bySet ) {\r
-- // They will have gone through all possible matchers\r
-- if ( (elem = !matcher && elem) ) {\r
-- matchedCount--;\r
-- }\r
--\r
-- // Lengthen the array for every element, matched or not\r
-- if ( seed ) {\r
-- unmatched.push( elem );\r
-- }\r
-- }\r
-- }\r
--\r
-- // Apply set filters to unmatched elements\r
-- matchedCount += i;\r
-- if ( bySet && i !== matchedCount ) {\r
-- for ( j = 0; (matcher = setMatchers[j]); j++ ) {\r
-- matcher( unmatched, setMatched, context, xml );\r
-- }\r
--\r
-- if ( seed ) {\r
-- // Reintegrate element matches to eliminate the need for sorting\r
-- if ( matchedCount > 0 ) {\r
-- while ( i-- ) {\r
-- if ( !(unmatched[i] || setMatched[i]) ) {\r
-- setMatched[i] = pop.call( results );\r
-- }\r
-- }\r
-- }\r
--\r
-- // Discard index placeholder values to get only actual matches\r
-- setMatched = condense( setMatched );\r
-- }\r
--\r
-- // Add matches to results\r
-- push.apply( results, setMatched );\r
--\r
-- // Seedless set matches succeeding multiple successful matchers stipulate sorting\r
-- if ( outermost && !seed && setMatched.length > 0 &&\r
-- ( matchedCount + setMatchers.length ) > 1 ) {\r
--\r
-- Sizzle.uniqueSort( results );\r
-- }\r
-- }\r
--\r
-- // Override manipulation of globals by nested matchers\r
-- if ( outermost ) {\r
-- dirruns = dirrunsUnique;\r
-- outermostContext = contextBackup;\r
-- }\r
--\r
-- return unmatched;\r
-- };\r
--\r
-- superMatcher.el = 0;\r
-- return bySet ?\r
-- markFunction( superMatcher ) :\r
-- superMatcher;\r
--}\r
--\r
--compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {\r
-- var i,\r
-- setMatchers = [],\r
-- elementMatchers = [],\r
-- cached = compilerCache[ expando ][ selector ];\r
--\r
-- if ( !cached ) {\r
-- // Generate a function of recursive functions that can be used to check each element\r
-- if ( !group ) {\r
-- group = tokenize( selector );\r
-- }\r
-- i = group.length;\r
-- while ( i-- ) {\r
-- cached = matcherFromTokens( group[i] );\r
-- if ( cached[ expando ] ) {\r
-- setMatchers.push( cached );\r
-- } else {\r
-- elementMatchers.push( cached );\r
-- }\r
-- }\r
--\r
-- // Cache the compiled function\r
-- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\r
-- }\r
-- return cached;\r
--};\r
--\r
--function multipleContexts( selector, contexts, results, seed ) {\r
-- var i = 0,\r
-- len = contexts.length;\r
-- for ( ; i < len; i++ ) {\r
-- Sizzle( selector, contexts[i], results, seed );\r
-- }\r
-- return results;\r
--}\r
--\r
--function select( selector, context, results, seed, xml ) {\r
-- var i, tokens, token, type, find,\r
-- match = tokenize( selector ),\r
-- j = match.length;\r
--\r
-- if ( !seed ) {\r
-- // Try to minimize operations if there is only one group\r
-- if ( match.length === 1 ) {\r
--\r
-- // Take a shortcut and set the context if the root selector is an ID\r
-- tokens = match[0] = match[0].slice( 0 );\r
-- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&\r
-- context.nodeType === 9 && !xml &&\r
-- Expr.relative[ tokens[1].type ] ) {\r
--\r
-- context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];\r
-- if ( !context ) {\r
-- return results;\r
-- }\r
--\r
-- selector = selector.slice( tokens.shift().length );\r
-- }\r
--\r
-- // Fetch a seed set for right-to-left matching\r
-- for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {\r
-- token = tokens[i];\r
--\r
-- // Abort if we hit a combinator\r
-- if ( Expr.relative[ (type = token.type) ] ) {\r
-- break;\r
-- }\r
-- if ( (find = Expr.find[ type ]) ) {\r
-- // Search, expanding context for leading sibling combinators\r
-- if ( (seed = find(\r
-- token.matches[0].replace( rbackslash, "" ),\r
-- rsibling.test( tokens[0].type ) && context.parentNode || context,\r
-- xml\r
-- )) ) {\r
--\r
-- // If seed is empty or no tokens remain, we can return early\r
-- tokens.splice( i, 1 );\r
-- selector = seed.length && tokens.join("");\r
-- if ( !selector ) {\r
-- push.apply( results, slice.call( seed, 0 ) );\r
-- return results;\r
-- }\r
--\r
-- break;\r
-- }\r
-- }\r
-- }\r
-- }\r
-- }\r
--\r
-- // Compile and execute a filtering function\r
-- // Provide `match` to avoid retokenization if we modified the selector above\r
-- compile( selector, match )(\r
-- seed,\r
-- context,\r
-- xml,\r
-- results,\r
-- rsibling.test( selector )\r
-- );\r
-- return results;\r
--}\r
--\r
--if ( document.querySelectorAll ) {\r
-- (function() {\r
-- var disconnectedMatch,\r
-- oldSelect = select,\r
-- rescape = /'|\\/g,\r
-- rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,\r
--\r
-- // qSa(:focus) reports false when true (Chrome 21),\r
-- // A support test would require too much code (would include document ready)\r
-- rbuggyQSA = [":focus"],\r
--\r
-- // matchesSelector(:focus) reports false when true (Chrome 21),\r
-- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)\r
-- // A support test would require too much code (would include document ready)\r
-- // just skip matchesSelector for :active\r
-- rbuggyMatches = [ ":active", ":focus" ],\r
-- matches = docElem.matchesSelector ||\r
-- docElem.mozMatchesSelector ||\r
-- docElem.webkitMatchesSelector ||\r
-- docElem.oMatchesSelector ||\r
-- docElem.msMatchesSelector;\r
--\r
-- // Build QSA regex\r
-- // Regex strategy adopted from Diego Perini\r
-- assert(function( div ) {\r
-- // Select is set to empty string on purpose\r
-- // This is to test IE's treatment of not explictly\r
-- // setting a boolean content attribute,\r
-- // since its presence should be enough\r
-- // http://bugs.jquery.com/ticket/12359\r
-- div.innerHTML = "<select><option selected=''></option></select>";\r
--\r
-- // IE8 - Some boolean attributes are not treated correctly\r
-- if ( !div.querySelectorAll("[selected]").length ) {\r
-- rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );\r
-- }\r
--\r
-- // Webkit/Opera - :checked should return selected option elements\r
-- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\r
-- // IE8 throws error here (do not put tests after this one)\r
-- if ( !div.querySelectorAll(":checked").length ) {\r
-- rbuggyQSA.push(":checked");\r
-- }\r
-- });\r
--\r
-- assert(function( div ) {\r
--\r
-- // Opera 10-12/IE9 - ^= $= *= and empty values\r
-- // Should not select anything\r
-- div.innerHTML = "<p test=''></p>";\r
-- if ( div.querySelectorAll("[test^='']").length ) {\r
-- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );\r
-- }\r
--\r
-- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\r
-- // IE8 throws error here (do not put tests after this one)\r
-- div.innerHTML = "<input type='hidden'/>";\r
-- if ( !div.querySelectorAll(":enabled").length ) {\r
-- rbuggyQSA.push(":enabled", ":disabled");\r
-- }\r
-- });\r
--\r
-- // rbuggyQSA always contains :focus, so no need for a length check\r
-- rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );\r
--\r
-- select = function( selector, context, results, seed, xml ) {\r
-- // Only use querySelectorAll when not filtering,\r
-- // when this is not xml,\r
-- // and when no QSA bugs apply\r
-- if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\r
-- var groups, i,\r
-- old = true,\r
-- nid = expando,\r
-- newContext = context,\r
-- newSelector = context.nodeType === 9 && selector;\r
--\r
-- // qSA works strangely on Element-rooted queries\r
-- // We can work around this by specifying an extra ID on the root\r
-- // and working up from there (Thanks to Andrew Dupont for the technique)\r
-- // IE 8 doesn't work on object elements\r
-- if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {\r
-- groups = tokenize( selector );\r
--\r
-- if ( (old = context.getAttribute("id")) ) {\r
-- nid = old.replace( rescape, "\\$&" );\r
-- } else {\r
-- context.setAttribute( "id", nid );\r
-- }\r
-- nid = "[id='" + nid + "'] ";\r
--\r
-- i = groups.length;\r
-- while ( i-- ) {\r
-- groups[i] = nid + groups[i].join("");\r
-- }\r
-- newContext = rsibling.test( selector ) && context.parentNode || context;\r
-- newSelector = groups.join(",");\r
-- }\r
--\r
-- if ( newSelector ) {\r
-- try {\r
-- push.apply( results, slice.call( newContext.querySelectorAll(\r
-- newSelector\r
-- ), 0 ) );\r
-- return results;\r
-- } catch(qsaError) {\r
-- } finally {\r
-- if ( !old ) {\r
-- context.removeAttribute("id");\r
-- }\r
-- }\r
-- }\r
-- }\r
--\r
-- return oldSelect( selector, context, results, seed, xml );\r
-- };\r
--\r
-- if ( matches ) {\r
-- assert(function( div ) {\r
-- // Check to see if it's possible to do matchesSelector\r
-- // on a disconnected node (IE 9)\r
-- disconnectedMatch = matches.call( div, "div" );\r
--\r
-- // This should fail with an exception\r
-- // Gecko does not error, returns false instead\r
-- try {\r
-- matches.call( div, "[test!='']:sizzle" );\r
-- rbuggyMatches.push( "!=", pseudos );\r
-- } catch ( e ) {}\r
-- });\r
--\r
-- // rbuggyMatches always contains :active and :focus, so no need for a length check\r
-- rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );\r
--\r
-- Sizzle.matchesSelector = function( elem, expr ) {\r
-- // Make sure that attribute selectors are quoted\r
-- expr = expr.replace( rattributeQuotes, "='$1']" );\r
--\r
-- // rbuggyMatches always contains :active, so no need for an existence check\r
-- if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {\r
-- try {\r
-- var ret = matches.call( elem, expr );\r
--\r
-- // IE 9's matchesSelector returns false on disconnected nodes\r
-- if ( ret || disconnectedMatch ||\r
-- // As well, disconnected nodes are said to be in a document\r
-- // fragment in IE 9\r
-- elem.document && elem.document.nodeType !== 11 ) {\r
-- return ret;\r
-- }\r
-- } catch(e) {}\r
-- }\r
--\r
-- return Sizzle( expr, null, null, [ elem ] ).length > 0;\r
-- };\r
-- }\r
-- })();\r
--}\r
--\r
--// Deprecated\r
--Expr.pseudos["nth"] = Expr.pseudos["eq"];\r
--\r
--// Back-compat\r
--function setFilters() {}\r
--Expr.filters = setFilters.prototype = Expr.pseudos;\r
--Expr.setFilters = new setFilters();\r
--\r
++/*!
++ * Sizzle CSS Selector Engine
++ * Copyright 2012 jQuery Foundation and other contributors
++ * Released under the MIT license
++ * http://sizzlejs.com/
++ */
++(function( window, undefined ) {
++
++var cachedruns,
++ assertGetIdNotName,
++ Expr,
++ getText,
++ isXML,
++ contains,
++ compile,
++ sortOrder,
++ hasDuplicate,
++ outermostContext,
++
++ baseHasDuplicate = true,
++ strundefined = "undefined",
++
++ expando = ( "sizcache" + Math.random() ).replace( ".", "" ),
++
++ Token = String,
++ document = window.document,
++ docElem = document.documentElement,
++ dirruns = 0,
++ done = 0,
++ pop = [].pop,
++ push = [].push,
++ slice = [].slice,
++ // Use a stripped-down indexOf if a native one is unavailable
++ indexOf = [].indexOf || function( elem ) {
++ var i = 0,
++ len = this.length;
++ for ( ; i < len; i++ ) {
++ if ( this[i] === elem ) {
++ return i;
++ }
++ }
++ return -1;
++ },
++
++ // Augment a function for special use by Sizzle
++ markFunction = function( fn, value ) {
++ fn[ expando ] = value == null || value;
++ return fn;
++ },
++
++ createCache = function() {
++ var cache = {},
++ keys = [];
++
++ return markFunction(function( key, value ) {
++ // Only keep the most recent entries
++ if ( keys.push( key ) > Expr.cacheLength ) {
++ delete cache[ keys.shift() ];
++ }
++
++ return (cache[ key ] = value);
++ }, cache );
++ },
++
++ classCache = createCache(),
++ tokenCache = createCache(),
++ compilerCache = createCache(),
++
++ // Regex
++
++ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
++ whitespace = "[\\x20\\t\\r\\n\\f]",
++ // http://www.w3.org/TR/css3-syntax/#characters
++ characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",
++
++ // Loosely modeled on CSS identifier characters
++ // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)
++ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
++ identifier = characterEncoding.replace( "w", "w#" ),
++
++ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
++ operators = "([*^$|!~]?=)",
++ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
++ "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
++
++ // Prefer arguments not in parens/brackets,
++ // then attribute selectors and non-pseudos (denoted by :),
++ // then anything else
++ // These preferences are here to reduce the number of selectors
++ // needing tokenize in the PSEUDO preFilter
++ pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",
++
++ // For matchExpr.POS and matchExpr.needsContext
++ pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
++ "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",
++
++ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
++ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
++
++ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
++ rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
++ rpseudo = new RegExp( pseudos ),
++
++ // Easily-parseable/retrievable ID or TAG or CLASS selectors
++ rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
++
++ rnot = /^:not/,
++ rsibling = /[\x20\t\r\n\f]*[+~]/,
++ rendsWithNot = /:not\($/,
++
++ rheader = /h\d/i,
++ rinputs = /input|select|textarea|button/i,
++
++ rbackslash = /\\(?!\\)/g,
++
++ matchExpr = {
++ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
++ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
++ "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
++ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
++ "ATTR": new RegExp( "^" + attributes ),
++ "PSEUDO": new RegExp( "^" + pseudos ),
++ "POS": new RegExp( pos, "i" ),
++ "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +
++ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
++ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
++ // For use in libraries implementing .is()
++ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )
++ },
++
++ // Support
++
++ // Used for testing something on an element
++ assert = function( fn ) {
++ var div = document.createElement("div");
++
++ try {
++ return fn( div );
++ } catch (e) {
++ return false;
++ } finally {
++ // release memory in IE
++ div = null;
++ }
++ },
++
++ // Check if getElementsByTagName("*") returns only elements
++ assertTagNameNoComments = assert(function( div ) {
++ div.appendChild( document.createComment("") );
++ return !div.getElementsByTagName("*").length;
++ }),
++
++ // Check if getAttribute returns normalized href attributes
++ assertHrefNotNormalized = assert(function( div ) {
++ div.innerHTML = "<a href='#'></a>";
++ return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
++ div.firstChild.getAttribute("href") === "#";
++ }),
++
++ // Check if attributes should be retrieved by attribute nodes
++ assertAttributes = assert(function( div ) {
++ div.innerHTML = "<select></select>";
++ var type = typeof div.lastChild.getAttribute("multiple");
++ // IE8 returns a string for some attributes even when not present
++ return type !== "boolean" && type !== "string";
++ }),
++
++ // Check if getElementsByClassName can be trusted
++ assertUsableClassName = assert(function( div ) {
++ // Opera can't find a second classname (in 9.6)
++ div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
++ if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
++ return false;
++ }
++
++ // Safari 3.2 caches class attributes and doesn't catch changes
++ div.lastChild.className = "e";
++ return div.getElementsByClassName("e").length === 2;
++ }),
++
++ // Check if getElementById returns elements by name
++ // Check if getElementsByName privileges form controls or returns elements by ID
++ assertUsableName = assert(function( div ) {
++ // Inject content
++ div.id = expando + 0;
++ div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
++ docElem.insertBefore( div, docElem.firstChild );
++
++ // Test
++ var pass = document.getElementsByName &&
++ // buggy browsers will return fewer than the correct 2
++ document.getElementsByName( expando ).length === 2 +
++ // buggy browsers will return more than the correct 0
++ document.getElementsByName( expando + 0 ).length;
++ assertGetIdNotName = !document.getElementById( expando );
++
++ // Cleanup
++ docElem.removeChild( div );
++
++ return pass;
++ });
++
++// If slice is not available, provide a backup
++try {
++ slice.call( docElem.childNodes, 0 )[0].nodeType;
++} catch ( e ) {
++ slice = function( i ) {
++ var elem,
++ results = [];
++ for ( ; (elem = this[i]); i++ ) {
++ results.push( elem );
++ }
++ return results;
++ };
++}
++
++function Sizzle( selector, context, results, seed ) {
++ results = results || [];
++ context = context || document;
++ var match, elem, xml, m,
++ nodeType = context.nodeType;
++
++ if ( !selector || typeof selector !== "string" ) {
++ return results;
++ }
++
++ if ( nodeType !== 1 && nodeType !== 9 ) {
++ return [];
++ }
++
++ xml = isXML( context );
++
++ if ( !xml && !seed ) {
++ if ( (match = rquickExpr.exec( selector )) ) {
++ // Speed-up: Sizzle("#ID")
++ if ( (m = match[1]) ) {
++ if ( nodeType === 9 ) {
++ elem = context.getElementById( m );
++ // Check parentNode to catch when Blackberry 4.6 returns
++ // nodes that are no longer in the document #6963
++ if ( elem && elem.parentNode ) {
++ // Handle the case where IE, Opera, and Webkit return items
++ // by name instead of ID
++ if ( elem.id === m ) {
++ results.push( elem );
++ return results;
++ }
++ } else {
++ return results;
++ }
++ } else {
++ // Context is not a document
++ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
++ contains( context, elem ) && elem.id === m ) {
++ results.push( elem );
++ return results;
++ }
++ }
++
++ // Speed-up: Sizzle("TAG")
++ } else if ( match[2] ) {
++ push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
++ return results;
++
++ // Speed-up: Sizzle(".CLASS")
++ } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {
++ push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
++ return results;
++ }
++ }
++ }
++
++ // All others
++ return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );
++}
++
++Sizzle.matches = function( expr, elements ) {
++ return Sizzle( expr, null, null, elements );
++};
++
++Sizzle.matchesSelector = function( elem, expr ) {
++ return Sizzle( expr, null, null, [ elem ] ).length > 0;
++};
++
++// Returns a function to use in pseudos for input types
++function createInputPseudo( type ) {
++ return function( elem ) {
++ var name = elem.nodeName.toLowerCase();
++ return name === "input" && elem.type === type;
++ };
++}
++
++// Returns a function to use in pseudos for buttons
++function createButtonPseudo( type ) {
++ return function( elem ) {
++ var name = elem.nodeName.toLowerCase();
++ return (name === "input" || name === "button") && elem.type === type;
++ };
++}
++
++// Returns a function to use in pseudos for positionals
++function createPositionalPseudo( fn ) {
++ return markFunction(function( argument ) {
++ argument = +argument;
++ return markFunction(function( seed, matches ) {
++ var j,
++ matchIndexes = fn( [], seed.length, argument ),
++ i = matchIndexes.length;
++
++ // Match elements found at the specified indexes
++ while ( i-- ) {
++ if ( seed[ (j = matchIndexes[i]) ] ) {
++ seed[j] = !(matches[j] = seed[j]);
++ }
++ }
++ });
++ });
++}
++
++/**
++ * Utility function for retrieving the text value of an array of DOM nodes
++ * @param {Array|Element} elem
++ */
++getText = Sizzle.getText = function( elem ) {
++ var node,
++ ret = "",
++ i = 0,
++ nodeType = elem.nodeType;
++
++ if ( nodeType ) {
++ if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
++ // Use textContent for elements
++ // innerText usage removed for consistency of new lines (see #11153)
++ if ( typeof elem.textContent === "string" ) {
++ return elem.textContent;
++ } else {
++ // Traverse its children
++ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
++ ret += getText( elem );
++ }
++ }
++ } else if ( nodeType === 3 || nodeType === 4 ) {
++ return elem.nodeValue;
++ }
++ // Do not include comment or processing instruction nodes
++ } else {
++
++ // If no nodeType, this is expected to be an array
++ for ( ; (node = elem[i]); i++ ) {
++ // Do not traverse comment nodes
++ ret += getText( node );
++ }
++ }
++ return ret;
++};
++
++isXML = Sizzle.isXML = function( elem ) {
++ // documentElement is verified for cases where it doesn't yet exist
++ // (such as loading iframes in IE - #4833)
++ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
++ return documentElement ? documentElement.nodeName !== "HTML" : false;
++};
++
++// Element contains another
++contains = Sizzle.contains = docElem.contains ?
++ function( a, b ) {
++ var adown = a.nodeType === 9 ? a.documentElement : a,
++ bup = b && b.parentNode;
++ return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );
++ } :
++ docElem.compareDocumentPosition ?
++ function( a, b ) {
++ return b && !!( a.compareDocumentPosition( b ) & 16 );
++ } :
++ function( a, b ) {
++ while ( (b = b.parentNode) ) {
++ if ( b === a ) {
++ return true;
++ }
++ }
++ return false;
++ };
++
++Sizzle.attr = function( elem, name ) {
++ var val,
++ xml = isXML( elem );
++
++ if ( !xml ) {
++ name = name.toLowerCase();
++ }
++ if ( (val = Expr.attrHandle[ name ]) ) {
++ return val( elem );
++ }
++ if ( xml || assertAttributes ) {
++ return elem.getAttribute( name );
++ }
++ val = elem.getAttributeNode( name );
++ return val ?
++ typeof elem[ name ] === "boolean" ?
++ elem[ name ] ? name : null :
++ val.specified ? val.value : null :
++ null;
++};
++
++Expr = Sizzle.selectors = {
++
++ // Can be adjusted by the user
++ cacheLength: 50,
++
++ createPseudo: markFunction,
++
++ match: matchExpr,
++
++ // IE6/7 return a modified href
++ attrHandle: assertHrefNotNormalized ?
++ {} :
++ {
++ "href": function( elem ) {
++ return elem.getAttribute( "href", 2 );
++ },
++ "type": function( elem ) {
++ return elem.getAttribute("type");
++ }
++ },
++
++ find: {
++ "ID": assertGetIdNotName ?
++ function( id, context, xml ) {
++ if ( typeof context.getElementById !== strundefined && !xml ) {
++ var m = context.getElementById( id );
++ // Check parentNode to catch when Blackberry 4.6 returns
++ // nodes that are no longer in the document #6963
++ return m && m.parentNode ? [m] : [];
++ }
++ } :
++ function( id, context, xml ) {
++ if ( typeof context.getElementById !== strundefined && !xml ) {
++ var m = context.getElementById( id );
++
++ return m ?
++ m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
++ [m] :
++ undefined :
++ [];
++ }
++ },
++
++ "TAG": assertTagNameNoComments ?
++ function( tag, context ) {
++ if ( typeof context.getElementsByTagName !== strundefined ) {
++ return context.getElementsByTagName( tag );
++ }
++ } :
++ function( tag, context ) {
++ var results = context.getElementsByTagName( tag );
++
++ // Filter out possible comments
++ if ( tag === "*" ) {
++ var elem,
++ tmp = [],
++ i = 0;
++
++ for ( ; (elem = results[i]); i++ ) {
++ if ( elem.nodeType === 1 ) {
++ tmp.push( elem );
++ }
++ }
++
++ return tmp;
++ }
++ return results;
++ },
++
++ "NAME": assertUsableName && function( tag, context ) {
++ if ( typeof context.getElementsByName !== strundefined ) {
++ return context.getElementsByName( name );
++ }
++ },
++
++ "CLASS": assertUsableClassName && function( className, context, xml ) {
++ if ( typeof context.getElementsByClassName !== strundefined && !xml ) {
++ return context.getElementsByClassName( className );
++ }
++ }
++ },
++
++ relative: {
++ ">": { dir: "parentNode", first: true },
++ " ": { dir: "parentNode" },
++ "+": { dir: "previousSibling", first: true },
++ "~": { dir: "previousSibling" }
++ },
++
++ preFilter: {
++ "ATTR": function( match ) {
++ match[1] = match[1].replace( rbackslash, "" );
++
++ // Move the given value to match[3] whether quoted or unquoted
++ match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );
++
++ if ( match[2] === "~=" ) {
++ match[3] = " " + match[3] + " ";
++ }
++
++ return match.slice( 0, 4 );
++ },
++
++ "CHILD": function( match ) {
++ /* matches from matchExpr["CHILD"]
++ 1 type (only|nth|...)
++ 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
++ 3 xn-component of xn+y argument ([+-]?\d*n|)
++ 4 sign of xn-component
++ 5 x of xn-component
++ 6 sign of y-component
++ 7 y of y-component
++ */
++ match[1] = match[1].toLowerCase();
++
++ if ( match[1] === "nth" ) {
++ // nth-child requires argument
++ if ( !match[2] ) {
++ Sizzle.error( match[0] );
++ }
++
++ // numeric x and y parameters for Expr.filter.CHILD
++ // remember that false/true cast respectively to 0/1
++ match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );
++ match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );
++
++ // other types prohibit arguments
++ } else if ( match[2] ) {
++ Sizzle.error( match[0] );
++ }
++
++ return match;
++ },
++
++ "PSEUDO": function( match ) {
++ var unquoted, excess;
++ if ( matchExpr["CHILD"].test( match[0] ) ) {
++ return null;
++ }
++
++ if ( match[3] ) {
++ match[2] = match[3];
++ } else if ( (unquoted = match[4]) ) {
++ // Only check arguments that contain a pseudo
++ if ( rpseudo.test(unquoted) &&
++ // Get excess from tokenize (recursively)
++ (excess = tokenize( unquoted, true )) &&
++ // advance to the next closing parenthesis
++ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
++
++ // excess is a negative index
++ unquoted = unquoted.slice( 0, excess );
++ match[0] = match[0].slice( 0, excess );
++ }
++ match[2] = unquoted;
++ }
++
++ // Return only captures needed by the pseudo filter method (type and argument)
++ return match.slice( 0, 3 );
++ }
++ },
++
++ filter: {
++ "ID": assertGetIdNotName ?
++ function( id ) {
++ id = id.replace( rbackslash, "" );
++ return function( elem ) {
++ return elem.getAttribute("id") === id;
++ };
++ } :
++ function( id ) {
++ id = id.replace( rbackslash, "" );
++ return function( elem ) {
++ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
++ return node && node.value === id;
++ };
++ },
++
++ "TAG": function( nodeName ) {
++ if ( nodeName === "*" ) {
++ return function() { return true; };
++ }
++ nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();
++
++ return function( elem ) {
++ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
++ };
++ },
++
++ "CLASS": function( className ) {
++ var pattern = classCache[ expando ][ className ];
++ if ( !pattern ) {
++ pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") );
++ }
++ return function( elem ) {
++ return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
++ };
++ },
++
++ "ATTR": function( name, operator, check ) {
++ return function( elem, context ) {
++ var result = Sizzle.attr( elem, name );
++
++ if ( result == null ) {
++ return operator === "!=";
++ }
++ if ( !operator ) {
++ return true;
++ }
++
++ result += "";
++
++ return operator === "=" ? result === check :
++ operator === "!=" ? result !== check :
++ operator === "^=" ? check && result.indexOf( check ) === 0 :
++ operator === "*=" ? check && result.indexOf( check ) > -1 :
++ operator === "$=" ? check && result.substr( result.length - check.length ) === check :
++ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
++ operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
++ false;
++ };
++ },
++
++ "CHILD": function( type, argument, first, last ) {
++
++ if ( type === "nth" ) {
++ return function( elem ) {
++ var node, diff,
++ parent = elem.parentNode;
++
++ if ( first === 1 && last === 0 ) {
++ return true;
++ }
++
++ if ( parent ) {
++ diff = 0;
++ for ( node = parent.firstChild; node; node = node.nextSibling ) {
++ if ( node.nodeType === 1 ) {
++ diff++;
++ if ( elem === node ) {
++ break;
++ }
++ }
++ }
++ }
++
++ // Incorporate the offset (or cast to NaN), then check against cycle size
++ diff -= last;
++ return diff === first || ( diff % first === 0 && diff / first >= 0 );
++ };
++ }
++
++ return function( elem ) {
++ var node = elem;
++
++ switch ( type ) {
++ case "only":
++ case "first":
++ while ( (node = node.previousSibling) ) {
++ if ( node.nodeType === 1 ) {
++ return false;
++ }
++ }
++
++ if ( type === "first" ) {
++ return true;
++ }
++
++ node = elem;
++
++ /* falls through */
++ case "last":
++ while ( (node = node.nextSibling) ) {
++ if ( node.nodeType === 1 ) {
++ return false;
++ }
++ }
++
++ return true;
++ }
++ };
++ },
++
++ "PSEUDO": function( pseudo, argument ) {
++ // pseudo-class names are case-insensitive
++ // http://www.w3.org/TR/selectors/#pseudo-classes
++ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
++ // Remember that setFilters inherits from pseudos
++ var args,
++ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
++ Sizzle.error( "unsupported pseudo: " + pseudo );
++
++ // The user may use createPseudo to indicate that
++ // arguments are needed to create the filter function
++ // just as Sizzle does
++ if ( fn[ expando ] ) {
++ return fn( argument );
++ }
++
++ // But maintain support for old signatures
++ if ( fn.length > 1 ) {
++ args = [ pseudo, pseudo, "", argument ];
++ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
++ markFunction(function( seed, matches ) {
++ var idx,
++ matched = fn( seed, argument ),
++ i = matched.length;
++ while ( i-- ) {
++ idx = indexOf.call( seed, matched[i] );
++ seed[ idx ] = !( matches[ idx ] = matched[i] );
++ }
++ }) :
++ function( elem ) {
++ return fn( elem, 0, args );
++ };
++ }
++
++ return fn;
++ }
++ },
++
++ pseudos: {
++ "not": markFunction(function( selector ) {
++ // Trim the selector passed to compile
++ // to avoid treating leading and trailing
++ // spaces as combinators
++ var input = [],
++ results = [],
++ matcher = compile( selector.replace( rtrim, "$1" ) );
++
++ return matcher[ expando ] ?
++ markFunction(function( seed, matches, context, xml ) {
++ var elem,
++ unmatched = matcher( seed, null, xml, [] ),
++ i = seed.length;
++
++ // Match elements unmatched by `matcher`
++ while ( i-- ) {
++ if ( (elem = unmatched[i]) ) {
++ seed[i] = !(matches[i] = elem);
++ }
++ }
++ }) :
++ function( elem, context, xml ) {
++ input[0] = elem;
++ matcher( input, null, xml, results );
++ return !results.pop();
++ };
++ }),
++
++ "has": markFunction(function( selector ) {
++ return function( elem ) {
++ return Sizzle( selector, elem ).length > 0;
++ };
++ }),
++
++ "contains": markFunction(function( text ) {
++ return function( elem ) {
++ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
++ };
++ }),
++
++ "enabled": function( elem ) {
++ return elem.disabled === false;
++ },
++
++ "disabled": function( elem ) {
++ return elem.disabled === true;
++ },
++
++ "checked": function( elem ) {
++ // In CSS3, :checked should return both checked and selected elements
++ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
++ var nodeName = elem.nodeName.toLowerCase();
++ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
++ },
++
++ "selected": function( elem ) {
++ // Accessing this property makes selected-by-default
++ // options in Safari work properly
++ if ( elem.parentNode ) {
++ elem.parentNode.selectedIndex;
++ }
++
++ return elem.selected === true;
++ },
++
++ "parent": function( elem ) {
++ return !Expr.pseudos["empty"]( elem );
++ },
++
++ "empty": function( elem ) {
++ // http://www.w3.org/TR/selectors/#empty-pseudo
++ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
++ // not comment, processing instructions, or others
++ // Thanks to Diego Perini for the nodeName shortcut
++ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
++ var nodeType;
++ elem = elem.firstChild;
++ while ( elem ) {
++ if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {
++ return false;
++ }
++ elem = elem.nextSibling;
++ }
++ return true;
++ },
++
++ "header": function( elem ) {
++ return rheader.test( elem.nodeName );
++ },
++
++ "text": function( elem ) {
++ var type, attr;
++ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
++ // use getAttribute instead to test this case
++ return elem.nodeName.toLowerCase() === "input" &&
++ (type = elem.type) === "text" &&
++ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );
++ },
++
++ // Input types
++ "radio": createInputPseudo("radio"),
++ "checkbox": createInputPseudo("checkbox"),
++ "file": createInputPseudo("file"),
++ "password": createInputPseudo("password"),
++ "image": createInputPseudo("image"),
++
++ "submit": createButtonPseudo("submit"),
++ "reset": createButtonPseudo("reset"),
++
++ "button": function( elem ) {
++ var name = elem.nodeName.toLowerCase();
++ return name === "input" && elem.type === "button" || name === "button";
++ },
++
++ "input": function( elem ) {
++ return rinputs.test( elem.nodeName );
++ },
++
++ "focus": function( elem ) {
++ var doc = elem.ownerDocument;
++ return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);
++ },
++
++ "active": function( elem ) {
++ return elem === elem.ownerDocument.activeElement;
++ },
++
++ // Positional types
++ "first": createPositionalPseudo(function( matchIndexes, length, argument ) {
++ return [ 0 ];
++ }),
++
++ "last": createPositionalPseudo(function( matchIndexes, length, argument ) {
++ return [ length - 1 ];
++ }),
++
++ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
++ return [ argument < 0 ? argument + length : argument ];
++ }),
++
++ "even": createPositionalPseudo(function( matchIndexes, length, argument ) {
++ for ( var i = 0; i < length; i += 2 ) {
++ matchIndexes.push( i );
++ }
++ return matchIndexes;
++ }),
++
++ "odd": createPositionalPseudo(function( matchIndexes, length, argument ) {
++ for ( var i = 1; i < length; i += 2 ) {
++ matchIndexes.push( i );
++ }
++ return matchIndexes;
++ }),
++
++ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
++ for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {
++ matchIndexes.push( i );
++ }
++ return matchIndexes;
++ }),
++
++ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
++ for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {
++ matchIndexes.push( i );
++ }
++ return matchIndexes;
++ })
++ }
++};
++
++function siblingCheck( a, b, ret ) {
++ if ( a === b ) {
++ return ret;
++ }
++
++ var cur = a.nextSibling;
++
++ while ( cur ) {
++ if ( cur === b ) {
++ return -1;
++ }
++
++ cur = cur.nextSibling;
++ }
++
++ return 1;
++}
++
++sortOrder = docElem.compareDocumentPosition ?
++ function( a, b ) {
++ if ( a === b ) {
++ hasDuplicate = true;
++ return 0;
++ }
++
++ return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?
++ a.compareDocumentPosition :
++ a.compareDocumentPosition(b) & 4
++ ) ? -1 : 1;
++ } :
++ function( a, b ) {
++ // The nodes are identical, we can exit early
++ if ( a === b ) {
++ hasDuplicate = true;
++ return 0;
++
++ // Fallback to using sourceIndex (in IE) if it's available on both nodes
++ } else if ( a.sourceIndex && b.sourceIndex ) {
++ return a.sourceIndex - b.sourceIndex;
++ }
++
++ var al, bl,
++ ap = [],
++ bp = [],
++ aup = a.parentNode,
++ bup = b.parentNode,
++ cur = aup;
++
++ // If the nodes are siblings (or identical) we can do a quick check
++ if ( aup === bup ) {
++ return siblingCheck( a, b );
++
++ // If no parents were found then the nodes are disconnected
++ } else if ( !aup ) {
++ return -1;
++
++ } else if ( !bup ) {
++ return 1;
++ }
++
++ // Otherwise they're somewhere else in the tree so we need
++ // to build up a full list of the parentNodes for comparison
++ while ( cur ) {
++ ap.unshift( cur );
++ cur = cur.parentNode;
++ }
++
++ cur = bup;
++
++ while ( cur ) {
++ bp.unshift( cur );
++ cur = cur.parentNode;
++ }
++
++ al = ap.length;
++ bl = bp.length;
++
++ // Start walking down the tree looking for a discrepancy
++ for ( var i = 0; i < al && i < bl; i++ ) {
++ if ( ap[i] !== bp[i] ) {
++ return siblingCheck( ap[i], bp[i] );
++ }
++ }
++
++ // We ended someplace up the tree so do a sibling check
++ return i === al ?
++ siblingCheck( a, bp[i], -1 ) :
++ siblingCheck( ap[i], b, 1 );
++ };
++
++// Always assume the presence of duplicates if sort doesn't
++// pass them to our comparison function (as in Google Chrome).
++[0, 0].sort( sortOrder );
++baseHasDuplicate = !hasDuplicate;
++
++// Document sorting and removing duplicates
++Sizzle.uniqueSort = function( results ) {
++ var elem,
++ i = 1;
++
++ hasDuplicate = baseHasDuplicate;
++ results.sort( sortOrder );
++
++ if ( hasDuplicate ) {
++ for ( ; (elem = results[i]); i++ ) {
++ if ( elem === results[ i - 1 ] ) {
++ results.splice( i--, 1 );
++ }
++ }
++ }
++
++ return results;
++};
++
++Sizzle.error = function( msg ) {
++ throw new Error( "Syntax error, unrecognized expression: " + msg );
++};
++
++function tokenize( selector, parseOnly ) {
++ var matched, match, tokens, type, soFar, groups, preFilters,
++ cached = tokenCache[ expando ][ selector ];
++
++ if ( cached ) {
++ return parseOnly ? 0 : cached.slice( 0 );
++ }
++
++ soFar = selector;
++ groups = [];
++ preFilters = Expr.preFilter;
++
++ while ( soFar ) {
++
++ // Comma and first run
++ if ( !matched || (match = rcomma.exec( soFar )) ) {
++ if ( match ) {
++ soFar = soFar.slice( match[0].length );
++ }
++ groups.push( tokens = [] );
++ }
++
++ matched = false;
++
++ // Combinators
++ if ( (match = rcombinators.exec( soFar )) ) {
++ tokens.push( matched = new Token( match.shift() ) );
++ soFar = soFar.slice( matched.length );
++
++ // Cast descendant combinators to space
++ matched.type = match[0].replace( rtrim, " " );
++ }
++
++ // Filters
++ for ( type in Expr.filter ) {
++ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
++ // The last two arguments here are (context, xml) for backCompat
++ (match = preFilters[ type ]( match, document, true ))) ) {
++
++ tokens.push( matched = new Token( match.shift() ) );
++ soFar = soFar.slice( matched.length );
++ matched.type = type;
++ matched.matches = match;
++ }
++ }
++
++ if ( !matched ) {
++ break;
++ }
++ }
++
++ // Return the length of the invalid excess
++ // if we're just parsing
++ // Otherwise, throw an error or return tokens
++ return parseOnly ?
++ soFar.length :
++ soFar ?
++ Sizzle.error( selector ) :
++ // Cache the tokens
++ tokenCache( selector, groups ).slice( 0 );
++}
++
++function addCombinator( matcher, combinator, base ) {
++ var dir = combinator.dir,
++ checkNonElements = base && combinator.dir === "parentNode",
++ doneName = done++;
++
++ return combinator.first ?
++ // Check against closest ancestor/preceding element
++ function( elem, context, xml ) {
++ while ( (elem = elem[ dir ]) ) {
++ if ( checkNonElements || elem.nodeType === 1 ) {
++ return matcher( elem, context, xml );
++ }
++ }
++ } :
++
++ // Check against all ancestor/preceding elements
++ function( elem, context, xml ) {
++ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
++ if ( !xml ) {
++ var cache,
++ dirkey = dirruns + " " + doneName + " ",
++ cachedkey = dirkey + cachedruns;
++ while ( (elem = elem[ dir ]) ) {
++ if ( checkNonElements || elem.nodeType === 1 ) {
++ if ( (cache = elem[ expando ]) === cachedkey ) {
++ return elem.sizset;
++ } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {
++ if ( elem.sizset ) {
++ return elem;
++ }
++ } else {
++ elem[ expando ] = cachedkey;
++ if ( matcher( elem, context, xml ) ) {
++ elem.sizset = true;
++ return elem;
++ }
++ elem.sizset = false;
++ }
++ }
++ }
++ } else {
++ while ( (elem = elem[ dir ]) ) {
++ if ( checkNonElements || elem.nodeType === 1 ) {
++ if ( matcher( elem, context, xml ) ) {
++ return elem;
++ }
++ }
++ }
++ }
++ };
++}
++
++function elementMatcher( matchers ) {
++ return matchers.length > 1 ?
++ function( elem, context, xml ) {
++ var i = matchers.length;
++ while ( i-- ) {
++ if ( !matchers[i]( elem, context, xml ) ) {
++ return false;
++ }
++ }
++ return true;
++ } :
++ matchers[0];
++}
++
++function condense( unmatched, map, filter, context, xml ) {
++ var elem,
++ newUnmatched = [],
++ i = 0,
++ len = unmatched.length,
++ mapped = map != null;
++
++ for ( ; i < len; i++ ) {
++ if ( (elem = unmatched[i]) ) {
++ if ( !filter || filter( elem, context, xml ) ) {
++ newUnmatched.push( elem );
++ if ( mapped ) {
++ map.push( i );
++ }
++ }
++ }
++ }
++
++ return newUnmatched;
++}
++
++function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
++ if ( postFilter && !postFilter[ expando ] ) {
++ postFilter = setMatcher( postFilter );
++ }
++ if ( postFinder && !postFinder[ expando ] ) {
++ postFinder = setMatcher( postFinder, postSelector );
++ }
++ return markFunction(function( seed, results, context, xml ) {
++ // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones
++ if ( seed && postFinder ) {
++ return;
++ }
++
++ var i, elem, postFilterIn,
++ preMap = [],
++ postMap = [],
++ preexisting = results.length,
++
++ // Get initial elements from seed or context
++ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),
++
++ // Prefilter to get matcher input, preserving a map for seed-results synchronization
++ matcherIn = preFilter && ( seed || !selector ) ?
++ condense( elems, preMap, preFilter, context, xml ) :
++ elems,
++
++ matcherOut = matcher ?
++ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
++ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
++
++ // ...intermediate processing is necessary
++ [] :
++
++ // ...otherwise use results directly
++ results :
++ matcherIn;
++
++ // Find primary matches
++ if ( matcher ) {
++ matcher( matcherIn, matcherOut, context, xml );
++ }
++
++ // Apply postFilter
++ if ( postFilter ) {
++ postFilterIn = condense( matcherOut, postMap );
++ postFilter( postFilterIn, [], context, xml );
++
++ // Un-match failing elements by moving them back to matcherIn
++ i = postFilterIn.length;
++ while ( i-- ) {
++ if ( (elem = postFilterIn[i]) ) {
++ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
++ }
++ }
++ }
++
++ // Keep seed and results synchronized
++ if ( seed ) {
++ // Ignore postFinder because it can't coexist with seed
++ i = preFilter && matcherOut.length;
++ while ( i-- ) {
++ if ( (elem = matcherOut[i]) ) {
++ seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);
++ }
++ }
++ } else {
++ matcherOut = condense(
++ matcherOut === results ?
++ matcherOut.splice( preexisting, matcherOut.length ) :
++ matcherOut
++ );
++ if ( postFinder ) {
++ postFinder( null, results, matcherOut, xml );
++ } else {
++ push.apply( results, matcherOut );
++ }
++ }
++ });
++}
++
++function matcherFromTokens( tokens ) {
++ var checkContext, matcher, j,
++ len = tokens.length,
++ leadingRelative = Expr.relative[ tokens[0].type ],
++ implicitRelative = leadingRelative || Expr.relative[" "],
++ i = leadingRelative ? 1 : 0,
++
++ // The foundational matcher ensures that elements are reachable from top-level context(s)
++ matchContext = addCombinator( function( elem ) {
++ return elem === checkContext;
++ }, implicitRelative, true ),
++ matchAnyContext = addCombinator( function( elem ) {
++ return indexOf.call( checkContext, elem ) > -1;
++ }, implicitRelative, true ),
++ matchers = [ function( elem, context, xml ) {
++ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
++ (checkContext = context).nodeType ?
++ matchContext( elem, context, xml ) :
++ matchAnyContext( elem, context, xml ) );
++ } ];
++
++ for ( ; i < len; i++ ) {
++ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
++ matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
++ } else {
++ // The concatenated values are (context, xml) for backCompat
++ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
++
++ // Return special upon seeing a positional matcher
++ if ( matcher[ expando ] ) {
++ // Find the next relative operator (if any) for proper handling
++ j = ++i;
++ for ( ; j < len; j++ ) {
++ if ( Expr.relative[ tokens[j].type ] ) {
++ break;
++ }
++ }
++ return setMatcher(
++ i > 1 && elementMatcher( matchers ),
++ i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),
++ matcher,
++ i < j && matcherFromTokens( tokens.slice( i, j ) ),
++ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
++ j < len && tokens.join("")
++ );
++ }
++ matchers.push( matcher );
++ }
++ }
++
++ return elementMatcher( matchers );
++}
++
++function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
++ var bySet = setMatchers.length > 0,
++ byElement = elementMatchers.length > 0,
++ superMatcher = function( seed, context, xml, results, expandContext ) {
++ var elem, j, matcher,
++ setMatched = [],
++ matchedCount = 0,
++ i = "0",
++ unmatched = seed && [],
++ outermost = expandContext != null,
++ contextBackup = outermostContext,
++ // We must always have either seed elements or context
++ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
++ // Nested matchers should use non-integer dirruns
++ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
++
++ if ( outermost ) {
++ outermostContext = context !== document && context;
++ cachedruns = superMatcher.el;
++ }
++
++ // Add elements passing elementMatchers directly to results
++ for ( ; (elem = elems[i]) != null; i++ ) {
++ if ( byElement && elem ) {
++ for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
++ if ( matcher( elem, context, xml ) ) {
++ results.push( elem );
++ break;
++ }
++ }
++ if ( outermost ) {
++ dirruns = dirrunsUnique;
++ cachedruns = ++superMatcher.el;
++ }
++ }
++
++ // Track unmatched elements for set filters
++ if ( bySet ) {
++ // They will have gone through all possible matchers
++ if ( (elem = !matcher && elem) ) {
++ matchedCount--;
++ }
++
++ // Lengthen the array for every element, matched or not
++ if ( seed ) {
++ unmatched.push( elem );
++ }
++ }
++ }
++
++ // Apply set filters to unmatched elements
++ matchedCount += i;
++ if ( bySet && i !== matchedCount ) {
++ for ( j = 0; (matcher = setMatchers[j]); j++ ) {
++ matcher( unmatched, setMatched, context, xml );
++ }
++
++ if ( seed ) {
++ // Reintegrate element matches to eliminate the need for sorting
++ if ( matchedCount > 0 ) {
++ while ( i-- ) {
++ if ( !(unmatched[i] || setMatched[i]) ) {
++ setMatched[i] = pop.call( results );
++ }
++ }
++ }
++
++ // Discard index placeholder values to get only actual matches
++ setMatched = condense( setMatched );
++ }
++
++ // Add matches to results
++ push.apply( results, setMatched );
++
++ // Seedless set matches succeeding multiple successful matchers stipulate sorting
++ if ( outermost && !seed && setMatched.length > 0 &&
++ ( matchedCount + setMatchers.length ) > 1 ) {
++
++ Sizzle.uniqueSort( results );
++ }
++ }
++
++ // Override manipulation of globals by nested matchers
++ if ( outermost ) {
++ dirruns = dirrunsUnique;
++ outermostContext = contextBackup;
++ }
++
++ return unmatched;
++ };
++
++ superMatcher.el = 0;
++ return bySet ?
++ markFunction( superMatcher ) :
++ superMatcher;
++}
++
++compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
++ var i,
++ setMatchers = [],
++ elementMatchers = [],
++ cached = compilerCache[ expando ][ selector ];
++
++ if ( !cached ) {
++ // Generate a function of recursive functions that can be used to check each element
++ if ( !group ) {
++ group = tokenize( selector );
++ }
++ i = group.length;
++ while ( i-- ) {
++ cached = matcherFromTokens( group[i] );
++ if ( cached[ expando ] ) {
++ setMatchers.push( cached );
++ } else {
++ elementMatchers.push( cached );
++ }
++ }
++
++ // Cache the compiled function
++ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
++ }
++ return cached;
++};
++
++function multipleContexts( selector, contexts, results, seed ) {
++ var i = 0,
++ len = contexts.length;
++ for ( ; i < len; i++ ) {
++ Sizzle( selector, contexts[i], results, seed );
++ }
++ return results;
++}
++
++function select( selector, context, results, seed, xml ) {
++ var i, tokens, token, type, find,
++ match = tokenize( selector ),
++ j = match.length;
++
++ if ( !seed ) {
++ // Try to minimize operations if there is only one group
++ if ( match.length === 1 ) {
++
++ // Take a shortcut and set the context if the root selector is an ID
++ tokens = match[0] = match[0].slice( 0 );
++ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
++ context.nodeType === 9 && !xml &&
++ Expr.relative[ tokens[1].type ] ) {
++
++ context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];
++ if ( !context ) {
++ return results;
++ }
++
++ selector = selector.slice( tokens.shift().length );
++ }
++
++ // Fetch a seed set for right-to-left matching
++ for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {
++ token = tokens[i];
++
++ // Abort if we hit a combinator
++ if ( Expr.relative[ (type = token.type) ] ) {
++ break;
++ }
++ if ( (find = Expr.find[ type ]) ) {
++ // Search, expanding context for leading sibling combinators
++ if ( (seed = find(
++ token.matches[0].replace( rbackslash, "" ),
++ rsibling.test( tokens[0].type ) && context.parentNode || context,
++ xml
++ )) ) {
++
++ // If seed is empty or no tokens remain, we can return early
++ tokens.splice( i, 1 );
++ selector = seed.length && tokens.join("");
++ if ( !selector ) {
++ push.apply( results, slice.call( seed, 0 ) );
++ return results;
++ }
++
++ break;
++ }
++ }
++ }
++ }
++ }
++
++ // Compile and execute a filtering function
++ // Provide `match` to avoid retokenization if we modified the selector above
++ compile( selector, match )(
++ seed,
++ context,
++ xml,
++ results,
++ rsibling.test( selector )
++ );
++ return results;
++}
++
++if ( document.querySelectorAll ) {
++ (function() {
++ var disconnectedMatch,
++ oldSelect = select,
++ rescape = /'|\\/g,
++ rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
++
++ // qSa(:focus) reports false when true (Chrome 21),
++ // A support test would require too much code (would include document ready)
++ rbuggyQSA = [":focus"],
++
++ // matchesSelector(:focus) reports false when true (Chrome 21),
++ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
++ // A support test would require too much code (would include document ready)
++ // just skip matchesSelector for :active
++ rbuggyMatches = [ ":active", ":focus" ],
++ matches = docElem.matchesSelector ||
++ docElem.mozMatchesSelector ||
++ docElem.webkitMatchesSelector ||
++ docElem.oMatchesSelector ||
++ docElem.msMatchesSelector;
++
++ // Build QSA regex
++ // Regex strategy adopted from Diego Perini
++ assert(function( div ) {
++ // Select is set to empty string on purpose
++ // This is to test IE's treatment of not explictly
++ // setting a boolean content attribute,
++ // since its presence should be enough
++ // http://bugs.jquery.com/ticket/12359
++ div.innerHTML = "<select><option selected=''></option></select>";
++
++ // IE8 - Some boolean attributes are not treated correctly
++ if ( !div.querySelectorAll("[selected]").length ) {
++ rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
++ }
++
++ // Webkit/Opera - :checked should return selected option elements
++ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
++ // IE8 throws error here (do not put tests after this one)
++ if ( !div.querySelectorAll(":checked").length ) {
++ rbuggyQSA.push(":checked");
++ }
++ });
++
++ assert(function( div ) {
++
++ // Opera 10-12/IE9 - ^= $= *= and empty values
++ // Should not select anything
++ div.innerHTML = "<p test=''></p>";
++ if ( div.querySelectorAll("[test^='']").length ) {
++ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
++ }
++
++ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
++ // IE8 throws error here (do not put tests after this one)
++ div.innerHTML = "<input type='hidden'/>";
++ if ( !div.querySelectorAll(":enabled").length ) {
++ rbuggyQSA.push(":enabled", ":disabled");
++ }
++ });
++
++ // rbuggyQSA always contains :focus, so no need for a length check
++ rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );
++
++ select = function( selector, context, results, seed, xml ) {
++ // Only use querySelectorAll when not filtering,
++ // when this is not xml,
++ // and when no QSA bugs apply
++ if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
++ var groups, i,
++ old = true,
++ nid = expando,
++ newContext = context,
++ newSelector = context.nodeType === 9 && selector;
++
++ // qSA works strangely on Element-rooted queries
++ // We can work around this by specifying an extra ID on the root
++ // and working up from there (Thanks to Andrew Dupont for the technique)
++ // IE 8 doesn't work on object elements
++ if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
++ groups = tokenize( selector );
++
++ if ( (old = context.getAttribute("id")) ) {
++ nid = old.replace( rescape, "\\$&" );
++ } else {
++ context.setAttribute( "id", nid );
++ }
++ nid = "[id='" + nid + "'] ";
++
++ i = groups.length;
++ while ( i-- ) {
++ groups[i] = nid + groups[i].join("");
++ }
++ newContext = rsibling.test( selector ) && context.parentNode || context;
++ newSelector = groups.join(",");
++ }
++
++ if ( newSelector ) {
++ try {
++ push.apply( results, slice.call( newContext.querySelectorAll(
++ newSelector
++ ), 0 ) );
++ return results;
++ } catch(qsaError) {
++ } finally {
++ if ( !old ) {
++ context.removeAttribute("id");
++ }
++ }
++ }
++ }
++
++ return oldSelect( selector, context, results, seed, xml );
++ };
++
++ if ( matches ) {
++ assert(function( div ) {
++ // Check to see if it's possible to do matchesSelector
++ // on a disconnected node (IE 9)
++ disconnectedMatch = matches.call( div, "div" );
++
++ // This should fail with an exception
++ // Gecko does not error, returns false instead
++ try {
++ matches.call( div, "[test!='']:sizzle" );
++ rbuggyMatches.push( "!=", pseudos );
++ } catch ( e ) {}
++ });
++
++ // rbuggyMatches always contains :active and :focus, so no need for a length check
++ rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );
++
++ Sizzle.matchesSelector = function( elem, expr ) {
++ // Make sure that attribute selectors are quoted
++ expr = expr.replace( rattributeQuotes, "='$1']" );
++
++ // rbuggyMatches always contains :active, so no need for an existence check
++ if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {
++ try {
++ var ret = matches.call( elem, expr );
++
++ // IE 9's matchesSelector returns false on disconnected nodes
++ if ( ret || disconnectedMatch ||
++ // As well, disconnected nodes are said to be in a document
++ // fragment in IE 9
++ elem.document && elem.document.nodeType !== 11 ) {
++ return ret;
++ }
++ } catch(e) {}
++ }
++
++ return Sizzle( expr, null, null, [ elem ] ).length > 0;
++ };
++ }
++ })();
++}
++
++// Deprecated
++Expr.pseudos["nth"] = Expr.pseudos["eq"];
++
++// Back-compat
++function setFilters() {}
++Expr.filters = setFilters.prototype = Expr.pseudos;
++Expr.setFilters = new setFilters();
++
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
jQuery.find = Sizzle;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
--\r
--\r
--})( window );\r
++
++
++})( window );
var runtil = /Until$/,
rparentsprev = /^(?:parents|prev(?:Until|All))/,
isSimple = /^.[^:#\[\.,]*$/,
--//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);\r
--//>>description: Checkbox widget\r
--//>>label: Checkbox\r
--//>>group: Tizen:Widgets\r
--define( [\r
-- "jqm/widgets/forms/checkboxradio"\r
-- ], function ( ) {\r
--} );\r
--//>>excludeEnd("jqmBuildExclude");\r
--\r
--/**\r
-- @class Checkbox\r
-- The check box widget shows a list of options on the screen where one or more can be selected. Check boxes can be used in Tizen as described in the jQueryMobile documentation for check boxes.<br/> To add a check box widget to the application, use the following code:\r
--\r
-- <input type="checkbox" name="mycheck" id="check-test" class="favorite" />\r
-- <label for="check-test">Favorite</label>\r
-- <input type="checkbox" name="check-favorite" id="check-test2" checked="checked" disabled="disabled" class="favorite" />\r
-- <label for="check-test2">Favorite Checked, Disabled</label>\r
--\r
-- The check box can define callbacks for events as described in the jQueryMobile documentation for check box events.\r
-- You can use methods with the check box as described in the jQueryMobile documentation for check box methods.\r
--\r
--*/\r
--/**\r
-- @property {String} class\r
-- Defines the check box style. <br/> The default value is check. If the value is set to favorite, a star-shaped check box is created.\r
--*/\r
--\r
--//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);\r
--} );\r
--//>>excludeEnd("jqmBuildExclude");\r
++//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
++//>>description: Checkbox widget
++//>>label: Checkbox
++//>>group: Tizen:Widgets
++define( [
++ "jqm/widgets/forms/checkboxradio"
++ ], function ( ) {
++} );
++//>>excludeEnd("jqmBuildExclude");
++
++/**
++ @class Checkbox
++ The check box widget shows a list of options on the screen where one or more can be selected. Check boxes can be used in Tizen as described in the jQueryMobile documentation for check boxes.<br/> To add a check box widget to the application, use the following code:
++
++ <input type="checkbox" name="mycheck" id="check-test" class="favorite" />
++ <label for="check-test">Favorite</label>
++ <input type="checkbox" name="check-favorite" id="check-test2" checked="checked" disabled="disabled" class="favorite" />
++ <label for="check-test2">Favorite Checked, Disabled</label>
++
++ The check box can define callbacks for events as described in the jQueryMobile documentation for check box events.
++ You can use methods with the check box as described in the jQueryMobile documentation for check box methods.
++
++*/
++/**
++ @property {String} class
++ Defines the check box style. <br/> The default value is check. If the value is set to favorite, a star-shaped check box is created.
++*/
++
++//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
++} );
++//>>excludeEnd("jqmBuildExclude");
} ( jQuery, window, document ) );
--\r
--/**\r
-- @class Checkbox\r
-- The check box widget shows a list of options on the screen where one or more can be selected. Check boxes can be used in Tizen as described in the jQueryMobile documentation for check boxes.<br/> To add a check box widget to the application, use the following code:\r
--\r
-- <input type="checkbox" name="mycheck" id="check-test" class="favorite" />\r
-- <label for="check-test">Favorite</label>\r
-- <input type="checkbox" name="check-favorite" id="check-test2" checked="checked" disabled="disabled" class="favorite" />\r
-- <label for="check-test2">Favorite Checked, Disabled</label>\r
--\r
-- The check box can define callbacks for events as described in the jQueryMobile documentation for check box events.\r
-- You can use methods with the check box as described in the jQueryMobile documentation for check box methods.\r
--\r
--*/\r
--/**\r
-- @property {String} class\r
-- Defines the check box style. <br/> The default value is check. If the value is set to favorite, a star-shaped check box is created.\r
--*/\r
--\r
++
++/**
++ @class Checkbox
++ The check box widget shows a list of options on the screen where one or more can be selected. Check boxes can be used in Tizen as described in the jQueryMobile documentation for check boxes.<br/> To add a check box widget to the application, use the following code:
++
++ <input type="checkbox" name="mycheck" id="check-test" class="favorite" />
++ <label for="check-test">Favorite</label>
++ <input type="checkbox" name="check-favorite" id="check-test2" checked="checked" disabled="disabled" class="favorite" />
++ <label for="check-test2">Favorite Checked, Disabled</label>
++
++ The check box can define callbacks for events as described in the jQueryMobile documentation for check box events.
++ You can use methods with the check box as described in the jQueryMobile documentation for check box methods.
++
++*/
++/**
++ @property {String} class
++ Defines the check box style. <br/> The default value is check. If the value is set to favorite, a star-shaped check box is created.
++*/
++
/* ***************************************************************************
--global.key1=This is global value1\r
--global.key2=This is global value2\r
--global.key1.subkey1=This is global subkey value1\r
++global.key1=This is global value1
++global.key2=This is global value2
++global.key1.subkey1=This is global subkey value1
--global.key1=This is local value1\r
--local.key2=This is global value2\r
--local.key1.subkey1=This is local subkey value1\r
++global.key1=This is local value1
++local.key2=This is global value2
++local.key1.subkey1=This is local subkey value1
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.core.config;\r
--\r
--import static org.junit.Assert.assertEquals;\r
--import static org.junit.Assert.assertNotNull;\r
--import static org.powermock.api.mockito.PowerMockito.mock;\r
--import static org.powermock.api.mockito.PowerMockito.mockStatic;\r
--import static org.powermock.api.mockito.PowerMockito.when;\r
--import static org.powermock.api.mockito.PowerMockito.whenNew;\r
--\r
--import java.io.File;\r
--import java.io.FileInputStream;\r
--import java.util.Properties;\r
--\r
--import org.junit.Before;\r
--import org.junit.Test;\r
--import org.junit.runner.RunWith;\r
--import org.powermock.core.classloader.annotations.PrepareForTest;\r
--import org.powermock.modules.junit4.PowerMockRunner;\r
--import org.tizen.common.core.application.InstallPathConfig;\r
--\r
--\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- *\r
-- * \r
-- */\r
--//@PowerMockIgnore({ "org.apache.log4j.*", "org.slf4j.Logger" })\r
--@RunWith(PowerMockRunner.class)\r
--@PrepareForTest({ InstallPathConfig.class ,NCLIConfigLoader.class })\r
--public class NCLIConfigLoaderTest {\r
-- private static final String TIZEN_CLI_CONFIG = ".tizen-cli-config";\r
-- private static final String HOME_USER = "/home/user/";\r
-- private static final String TIZEN_SDK_TOOLS = "/tizen-sdk/tools";\r
--\r
-- @Before\r
-- public void setUp() {\r
-- mockStatic(InstallPathConfig.class);\r
-- when(InstallPathConfig.getToolsPath()).thenReturn(TIZEN_SDK_TOOLS);\r
-- \r
-- mockStatic(System.class);\r
-- when(System.getProperty("user.home")).thenReturn(HOME_USER);\r
-- \r
-- }\r
--\r
-- /**\r
-- * Test method for {@link org.tizen.ncli.ide.core.config.NCLIConfigLoader#loadLocalConf()}.\r
-- * @throws Exception \r
-- */\r
-- @Test\r
-- public void testLoadLocalConf() throws Exception {\r
-- File mockFile = mock(File.class);\r
-- whenNew(File.class).withAnyArguments().thenReturn(mockFile);\r
-- when(mockFile.exists()).thenReturn(true);\r
-- \r
-- FileInputStream mockStream = mock(FileInputStream.class);\r
-- whenNew(FileInputStream.class).withArguments(mockFile).thenReturn(mockStream);\r
-- \r
-- Properties loadLocalConf = NCLIConfigLoader.loadLocalConf();\r
-- \r
-- assertNotNull(loadLocalConf);\r
-- }\r
--\r
-- /**\r
-- * Test method for {@link org.tizen.ncli.ide.core.config.NCLIConfigLoader#getLocalConfigFile()}.\r
-- * @throws Exception \r
-- */\r
-- @Test\r
-- public void testGetLocalConfigFile() throws Exception {\r
-- File mockFile = mock(File.class);\r
-- whenNew(File.class).withArguments(TIZEN_SDK_TOOLS+"/"+TIZEN_CLI_CONFIG).thenReturn(mockFile);\r
-- when(mockFile.exists()).thenReturn(true);\r
-- when(mockFile.getParent()).thenReturn(TIZEN_SDK_TOOLS);\r
-- when(mockFile.getName()).thenReturn(TIZEN_CLI_CONFIG);\r
-- \r
-- \r
-- File localConfigFile = NCLIConfigLoader.getLocalConfigFile();\r
-- assertEquals(TIZEN_SDK_TOOLS, localConfigFile.getParent());\r
-- assertEquals(TIZEN_CLI_CONFIG, localConfigFile.getName());\r
-- }\r
--\r
-- /**\r
-- * Test method for {@link org.tizen.ncli.ide.core.config.NCLIConfigLoader#loadGlobalConf()}.\r
-- * @throws Exception \r
-- */\r
-- @Test\r
-- public void testLoadGlobalConf() throws Exception {\r
-- File mockFile = mock(File.class);\r
-- whenNew(File.class).withAnyArguments().thenReturn(mockFile);\r
-- when(mockFile.exists()).thenReturn(true);\r
-- \r
-- FileInputStream mockStream = mock(FileInputStream.class);\r
-- whenNew(FileInputStream.class).withArguments(mockFile).thenReturn(mockStream);\r
-- \r
-- Properties loadGlobalConf = NCLIConfigLoader.loadGlobalConf();\r
-- assertNotNull(loadGlobalConf);\r
-- \r
-- }\r
--\r
-- /**\r
-- * Test method for {@link org.tizen.ncli.ide.core.config.NCLIConfigLoader#getGlobalConfigFile()}.\r
-- * @throws Exception \r
-- */\r
-- @Test\r
-- public void testGetGlobalConfigFile() throws Exception {\r
-- File mockFile = mock(File.class);\r
-- whenNew(File.class).withAnyArguments().thenReturn(mockFile);\r
-- when(mockFile.exists()).thenReturn(true);\r
-- when(mockFile.getParent()).thenReturn(HOME_USER);\r
-- when(mockFile.getName()).thenReturn(TIZEN_CLI_CONFIG);\r
-- \r
-- \r
-- File globalConfigFile = NCLIConfigLoader.getGlobalConfigFile();\r
-- assertEquals(mockFile.getParent(), globalConfigFile.getParent());\r
-- assertEquals(TIZEN_CLI_CONFIG, globalConfigFile.getName());\r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.core.config;
++
++import static org.junit.Assert.assertEquals;
++import static org.junit.Assert.assertNotNull;
++import static org.powermock.api.mockito.PowerMockito.mock;
++import static org.powermock.api.mockito.PowerMockito.mockStatic;
++import static org.powermock.api.mockito.PowerMockito.when;
++import static org.powermock.api.mockito.PowerMockito.whenNew;
++
++import java.io.File;
++import java.io.FileInputStream;
++import java.util.Properties;
++
++import org.junit.Before;
++import org.junit.Test;
++import org.junit.runner.RunWith;
++import org.powermock.core.classloader.annotations.PrepareForTest;
++import org.powermock.modules.junit4.PowerMockRunner;
++import org.tizen.common.core.application.InstallPathConfig;
++
++
++
++/**
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ *
++ *
++ */
++//@PowerMockIgnore({ "org.apache.log4j.*", "org.slf4j.Logger" })
++@RunWith(PowerMockRunner.class)
++@PrepareForTest({ InstallPathConfig.class ,NCLIConfigLoader.class })
++public class NCLIConfigLoaderTest {
++ private static final String TIZEN_CLI_CONFIG = ".tizen-cli-config";
++ private static final String HOME_USER = "/home/user/";
++ private static final String TIZEN_SDK_TOOLS = "/tizen-sdk/tools";
++
++ @Before
++ public void setUp() {
++ mockStatic(InstallPathConfig.class);
++ when(InstallPathConfig.getToolsPath()).thenReturn(TIZEN_SDK_TOOLS);
++
++ mockStatic(System.class);
++ when(System.getProperty("user.home")).thenReturn(HOME_USER);
++
++ }
++
++ /**
++ * Test method for {@link org.tizen.ncli.ide.core.config.NCLIConfigLoader#loadLocalConf()}.
++ * @throws Exception
++ */
++ @Test
++ public void testLoadLocalConf() throws Exception {
++ File mockFile = mock(File.class);
++ whenNew(File.class).withAnyArguments().thenReturn(mockFile);
++ when(mockFile.exists()).thenReturn(true);
++
++ FileInputStream mockStream = mock(FileInputStream.class);
++ whenNew(FileInputStream.class).withArguments(mockFile).thenReturn(mockStream);
++
++ Properties loadLocalConf = NCLIConfigLoader.loadLocalConf();
++
++ assertNotNull(loadLocalConf);
++ }
++
++ /**
++ * Test method for {@link org.tizen.ncli.ide.core.config.NCLIConfigLoader#getLocalConfigFile()}.
++ * @throws Exception
++ */
++ @Test
++ public void testGetLocalConfigFile() throws Exception {
++ File mockFile = mock(File.class);
++ whenNew(File.class).withArguments(TIZEN_SDK_TOOLS+"/"+TIZEN_CLI_CONFIG).thenReturn(mockFile);
++ when(mockFile.exists()).thenReturn(true);
++ when(mockFile.getParent()).thenReturn(TIZEN_SDK_TOOLS);
++ when(mockFile.getName()).thenReturn(TIZEN_CLI_CONFIG);
++
++
++ File localConfigFile = NCLIConfigLoader.getLocalConfigFile();
++ assertEquals(TIZEN_SDK_TOOLS, localConfigFile.getParent());
++ assertEquals(TIZEN_CLI_CONFIG, localConfigFile.getName());
++ }
++
++ /**
++ * Test method for {@link org.tizen.ncli.ide.core.config.NCLIConfigLoader#loadGlobalConf()}.
++ * @throws Exception
++ */
++ @Test
++ public void testLoadGlobalConf() throws Exception {
++ File mockFile = mock(File.class);
++ whenNew(File.class).withAnyArguments().thenReturn(mockFile);
++ when(mockFile.exists()).thenReturn(true);
++
++ FileInputStream mockStream = mock(FileInputStream.class);
++ whenNew(FileInputStream.class).withArguments(mockFile).thenReturn(mockStream);
++
++ Properties loadGlobalConf = NCLIConfigLoader.loadGlobalConf();
++ assertNotNull(loadGlobalConf);
++
++ }
++
++ /**
++ * Test method for {@link org.tizen.ncli.ide.core.config.NCLIConfigLoader#getGlobalConfigFile()}.
++ * @throws Exception
++ */
++ @Test
++ public void testGetGlobalConfigFile() throws Exception {
++ File mockFile = mock(File.class);
++ whenNew(File.class).withAnyArguments().thenReturn(mockFile);
++ when(mockFile.exists()).thenReturn(true);
++ when(mockFile.getParent()).thenReturn(HOME_USER);
++ when(mockFile.getName()).thenReturn(TIZEN_CLI_CONFIG);
++
++
++ File globalConfigFile = NCLIConfigLoader.getGlobalConfigFile();
++ assertEquals(mockFile.getParent(), globalConfigFile.getParent());
++ assertEquals(TIZEN_CLI_CONFIG, globalConfigFile.getName());
++ }
++
++}
--package org.tizen.ncli.ide.shell;\r
--\r
--import java.io.IOException;\r
--import java.io.OutputStream;\r
--import java.util.Locale;\r
--\r
--import static org.junit.Assert.*;\r
--import org.junit.After;\r
--import org.junit.Before;\r
--\r
--import org.kohsuke.args4j.CmdLineParser;\r
--import org.slf4j.Logger;\r
--import org.slf4j.LoggerFactory;\r
--\r
--\r
--\r
--/**\r
-- * Base class for Args4J Tests.\r
-- * It instantiates the test object, the CmdLineParser for\r
-- * that test object and provides a String array for passing\r
-- * to the parser.\r
-- *\r
-- * @author Jan Materne\r
-- */\r
--public abstract class Args4JTestBase<T>{\r
--\r
-- CmdLineParser parser;\r
-- String[] args;\r
-- T testObject;\r
-- Logger log = LoggerFactory.getLogger(getClass());\r
-- \r
-- private Locale defaultLocale;\r
--\r
-- /**\r
-- * Specifies which concrete object to return as test object.\r
-- * @return the test object\r
-- */\r
-- public abstract T getTestObject();\r
-- \r
-- /**\r
-- * Setter for args in a vararg manner.\r
-- * @param args\r
-- */\r
-- public void setArgs(String... args) {\r
-- this.args = args;\r
-- }\r
-- \r
-- /**\r
-- * Returns the Locale to use for the tests.\r
-- * Defaults to use the US-Locale but should be overwritten by classes\r
-- * which tests I18N. \r
-- */ \r
-- public Locale getLocale() {\r
-- return Locale.US;\r
-- }\r
--\r
-- /**\r
-- * Initializes the testObject and the parser for that object.\r
-- * @see junit.framework.TestCase#setUp()\r
-- */\r
-- @Before\r
-- public void setUp() throws Exception {\r
-- defaultLocale = Locale.getDefault();\r
-- Locale.setDefault(getLocale());\r
-- testObject = getTestObject();\r
-- parser = createParser();\r
-- }\r
--\r
-- protected CmdLineParser createParser() {\r
-- return new CmdLineParser(testObject);\r
-- }\r
--\r
-- /**\r
-- * Restores the environment, namely the default Locale.\r
-- */ \r
-- @After\r
-- public void tearDown() throws Exception {\r
-- Locale.setDefault(defaultLocale);\r
-- }\r
--\r
-- /**\r
-- * Checks the number of lines of the parsers usage message.\r
-- * @param expectedLength\r
-- * @see TestCase#assertEquals(String, int, int)\r
-- * @see Args4JTestBase#getUsageMessage()\r
-- */\r
-- public void assertUsageLength(int expectedLength) {\r
-- assertEquals("Wrong amount of lines in usage message", expectedLength, getUsageMessage().length);\r
-- }\r
-- \r
-- /**\r
-- * Asserts that a given text is part of the usage message.\r
-- * @param message Error message if the text is not found.\r
-- * @param containingText Text to search for.\r
-- */\r
-- public void assertUsageContains(String message, String containingText) {\r
-- boolean contains = false;\r
-- for (String line : getUsageMessage()) {\r
-- if (line.contains(containingText)) {\r
-- contains = true;\r
-- break;\r
-- }\r
-- }\r
-- if (!contains) {\r
-- throw new AssertionError(message);\r
-- }\r
-- }\r
--\r
-- /**\r
-- * Extracts the usage message from the parser as String array.\r
-- * @return the usage message\r
-- * @see CmdLineParser#printUsage(OutputStream)\r
-- */\r
-- public String[] getUsageMessage() {\r
-- Stream2String s2s = new Stream2String();\r
-- parser.printUsage(s2s);\r
-- return s2s.getString().split(System.getProperty("line.separator"));\r
-- }\r
--\r
-- /**\r
-- * Utility class for capturing an OutputStream into a String.\r
-- * @author Jan Materne\r
-- */\r
-- private class Stream2String extends OutputStream {\r
-- private StringBuffer sb = new StringBuffer();\r
--\r
-- @Override\r
-- public void write(int b) throws IOException {\r
-- sb.append((char)b);\r
-- }\r
--\r
-- public String getString() {\r
-- return sb.toString();\r
-- }\r
-- }\r
--\r
++package org.tizen.ncli.ide.shell;
++
++import java.io.IOException;
++import java.io.OutputStream;
++import java.util.Locale;
++
++import static org.junit.Assert.*;
++import org.junit.After;
++import org.junit.Before;
++
++import org.kohsuke.args4j.CmdLineParser;
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++
++
++
++/**
++ * Base class for Args4J Tests.
++ * It instantiates the test object, the CmdLineParser for
++ * that test object and provides a String array for passing
++ * to the parser.
++ *
++ * @author Jan Materne
++ */
++public abstract class Args4JTestBase<T>{
++
++ CmdLineParser parser;
++ String[] args;
++ T testObject;
++ Logger log = LoggerFactory.getLogger(getClass());
++
++ private Locale defaultLocale;
++
++ /**
++ * Specifies which concrete object to return as test object.
++ * @return the test object
++ */
++ public abstract T getTestObject();
++
++ /**
++ * Setter for args in a vararg manner.
++ * @param args
++ */
++ public void setArgs(String... args) {
++ this.args = args;
++ }
++
++ /**
++ * Returns the Locale to use for the tests.
++ * Defaults to use the US-Locale but should be overwritten by classes
++ * which tests I18N.
++ */
++ public Locale getLocale() {
++ return Locale.US;
++ }
++
++ /**
++ * Initializes the testObject and the parser for that object.
++ * @see junit.framework.TestCase#setUp()
++ */
++ @Before
++ public void setUp() throws Exception {
++ defaultLocale = Locale.getDefault();
++ Locale.setDefault(getLocale());
++ testObject = getTestObject();
++ parser = createParser();
++ }
++
++ protected CmdLineParser createParser() {
++ return new CmdLineParser(testObject);
++ }
++
++ /**
++ * Restores the environment, namely the default Locale.
++ */
++ @After
++ public void tearDown() throws Exception {
++ Locale.setDefault(defaultLocale);
++ }
++
++ /**
++ * Checks the number of lines of the parsers usage message.
++ * @param expectedLength
++ * @see TestCase#assertEquals(String, int, int)
++ * @see Args4JTestBase#getUsageMessage()
++ */
++ public void assertUsageLength(int expectedLength) {
++ assertEquals("Wrong amount of lines in usage message", expectedLength, getUsageMessage().length);
++ }
++
++ /**
++ * Asserts that a given text is part of the usage message.
++ * @param message Error message if the text is not found.
++ * @param containingText Text to search for.
++ */
++ public void assertUsageContains(String message, String containingText) {
++ boolean contains = false;
++ for (String line : getUsageMessage()) {
++ if (line.contains(containingText)) {
++ contains = true;
++ break;
++ }
++ }
++ if (!contains) {
++ throw new AssertionError(message);
++ }
++ }
++
++ /**
++ * Extracts the usage message from the parser as String array.
++ * @return the usage message
++ * @see CmdLineParser#printUsage(OutputStream)
++ */
++ public String[] getUsageMessage() {
++ Stream2String s2s = new Stream2String();
++ parser.printUsage(s2s);
++ return s2s.getString().split(System.getProperty("line.separator"));
++ }
++
++ /**
++ * Utility class for capturing an OutputStream into a String.
++ * @author Jan Materne
++ */
++ private class Stream2String extends OutputStream {
++ private StringBuffer sb = new StringBuffer();
++
++ @Override
++ public void write(int b) throws IOException {
++ sb.append((char)b);
++ }
++
++ public String getString() {
++ return sb.toString();
++ }
++ }
++
}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.shell;\r
--\r
--import static org.junit.Assert.*;\r
--import org.junit.Test;\r
--import org.kohsuke.args4j.CmdLineException;\r
--import org.tizen.ncli.ide.shell.ConfigCLI;\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--public class ConfigCLITest extends Args4JTestBase<ConfigCLI>{\r
--\r
-- @Test\r
-- public void test_wrong_option() throws Exception {\r
-- String [] wrongOptions = {"-ggg"};\r
-- try {\r
-- parser.parseArgument(wrongOptions);\r
-- } catch (CmdLineException e) {\r
-- assertNotNull(e);\r
-- log.error(e.toString());\r
-- assertTrue(e.toString().contains("is not a valid option"));\r
-- }\r
-- }\r
-- \r
-- \r
-- /**\r
-- * Test method for {@link org.tizen.ncli.ide.shell.ConfigCLI#execute()}.\r
-- */\r
-- @Test\r
-- public void test_list_Execute() throws Exception{\r
-- String [] args = {"-l"};\r
-- \r
-- try {\r
-- parser.parseArgument(args);\r
-- } catch (CmdLineException e) {\r
-- fail(e.getMessage());\r
-- }\r
-- testObject.execute();\r
-- }\r
-- \r
-- @Test\r
-- public void test_no_option() throws Exception{\r
-- String [] args = {""};\r
-- \r
-- try {\r
-- parser.parseArgument(args);\r
-- } catch (CmdLineException e) {\r
-- e.printStackTrace();\r
-- assertNotNull(e);\r
-- }\r
-- }\r
--\r
--\r
--\r
-- /* (non-Javadoc)\r
-- * @see org.tizen.ncli.ide.shell.Args4JTestBase#getTestObject()\r
-- */\r
-- @Override\r
-- public ConfigCLI getTestObject() {\r
-- return new ConfigCLI();\r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.shell;
++
++import static org.junit.Assert.*;
++import org.junit.Test;
++import org.kohsuke.args4j.CmdLineException;
++import org.tizen.ncli.ide.shell.ConfigCLI;
++
++/**
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++public class ConfigCLITest extends Args4JTestBase<ConfigCLI>{
++
++ @Test
++ public void test_wrong_option() throws Exception {
++ String [] wrongOptions = {"-ggg"};
++ try {
++ parser.parseArgument(wrongOptions);
++ } catch (CmdLineException e) {
++ assertNotNull(e);
++ log.error(e.toString());
++ assertTrue(e.toString().contains("is not a valid option"));
++ }
++ }
++
++
++ /**
++ * Test method for {@link org.tizen.ncli.ide.shell.ConfigCLI#execute()}.
++ */
++ @Test
++ public void test_list_Execute() throws Exception{
++ String [] args = {"-l"};
++
++ try {
++ parser.parseArgument(args);
++ } catch (CmdLineException e) {
++ fail(e.getMessage());
++ }
++ testObject.execute();
++ }
++
++ @Test
++ public void test_no_option() throws Exception{
++ String [] args = {""};
++
++ try {
++ parser.parseArgument(args);
++ } catch (CmdLineException e) {
++ e.printStackTrace();
++ assertNotNull(e);
++ }
++ }
++
++
++
++ /* (non-Javadoc)
++ * @see org.tizen.ncli.ide.shell.Args4JTestBase#getTestObject()
++ */
++ @Override
++ public ConfigCLI getTestObject() {
++ return new ConfigCLI();
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.subcommands;\r
--\r
--import static org.junit.Assert.*;\r
--\r
--import java.io.File;\r
--import java.util.ArrayList;\r
--import java.util.List;\r
--\r
--import org.junit.Test;\r
--import org.tizen.core.ide.BuildWebParameter;\r
--\r
--/**\r
-- * Test basic method of {@link BuildWebCLICommand}\r
-- * \r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- * \r
-- * \r
-- */\r
--public class BuildWebCLICommandTest {\r
--\r
-- /**\r
-- * Test method for {@link org.tizen.ncli.ide.subcommands.BuildWebCLICommand#setOptimize(boolean)}.\r
-- */\r
-- @Test\r
-- public void testSetOptimize() {\r
-- BuildWebCLICommand command = new BuildWebCLICommand();\r
-- command.setOptimize(false);\r
--\r
-- BuildWebParameter buildData = command.runCommand();\r
-- assertNotNull(buildData);\r
-- assertEquals(false, buildData.isOptimize());\r
--\r
-- }\r
--\r
-- /**\r
-- * Test method for {@link org.tizen.ncli.ide.subcommands.BuildWebCLICommand#setOutputName(java.lang.String)}.\r
-- */\r
-- @Test\r
-- public void testSetOutputName() {\r
-- BuildWebCLICommand command = new BuildWebCLICommand();\r
-- command.setOutputName("TestBuildResult");\r
--\r
-- BuildWebParameter buildData = command.runCommand();\r
-- assertNotNull(buildData);\r
-- assertEquals("TestBuildResult", buildData.getOutputName());\r
-- }\r
--\r
-- /**\r
-- * Test method for {@link org.tizen.ncli.ide.subcommands.BuildWebCLICommand#setExcludeUIFW(boolean)}.\r
-- */\r
-- @Test\r
-- public void testSetExcludeUIFW() {\r
-- BuildWebCLICommand command = new BuildWebCLICommand();\r
-- command.setExcludeUIFW(true);\r
--\r
-- BuildWebParameter buildData = command.runCommand();\r
-- assertNotNull(buildData);\r
-- assertEquals(true, buildData.isExcludeUIFW());\r
-- }\r
--\r
-- /**\r
-- * Test method for {@link org.tizen.ncli.ide.subcommands.BuildWebCLICommand#setExcludeList(java.util.List)}.\r
-- */\r
-- @Test\r
-- public void testSetExcludeList() {\r
-- BuildWebCLICommand command = new BuildWebCLICommand();\r
-- List<String> excludeList = new ArrayList<String>();\r
-- excludeList.add(".git");\r
--\r
-- command.setExcludeList(excludeList);\r
--\r
-- BuildWebParameter buildData = command.runCommand();\r
-- assertNotNull(buildData);\r
-- assertEquals(".git", buildData.getExcludeList().get(0));\r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.subcommands;
++
++import static org.junit.Assert.*;
++
++import java.io.File;
++import java.util.ArrayList;
++import java.util.List;
++
++import org.junit.Test;
++import org.tizen.core.ide.BuildWebParameter;
++
++/**
++ * Test basic method of {@link BuildWebCLICommand}
++ *
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ *
++ *
++ */
++public class BuildWebCLICommandTest {
++
++ /**
++ * Test method for {@link org.tizen.ncli.ide.subcommands.BuildWebCLICommand#setOptimize(boolean)}.
++ */
++ @Test
++ public void testSetOptimize() {
++ BuildWebCLICommand command = new BuildWebCLICommand();
++ command.setOptimize(false);
++
++ BuildWebParameter buildData = command.runCommand();
++ assertNotNull(buildData);
++ assertEquals(false, buildData.isOptimize());
++
++ }
++
++ /**
++ * Test method for {@link org.tizen.ncli.ide.subcommands.BuildWebCLICommand#setOutputName(java.lang.String)}.
++ */
++ @Test
++ public void testSetOutputName() {
++ BuildWebCLICommand command = new BuildWebCLICommand();
++ command.setOutputName("TestBuildResult");
++
++ BuildWebParameter buildData = command.runCommand();
++ assertNotNull(buildData);
++ assertEquals("TestBuildResult", buildData.getOutputName());
++ }
++
++ /**
++ * Test method for {@link org.tizen.ncli.ide.subcommands.BuildWebCLICommand#setExcludeUIFW(boolean)}.
++ */
++ @Test
++ public void testSetExcludeUIFW() {
++ BuildWebCLICommand command = new BuildWebCLICommand();
++ command.setExcludeUIFW(true);
++
++ BuildWebParameter buildData = command.runCommand();
++ assertNotNull(buildData);
++ assertEquals(true, buildData.isExcludeUIFW());
++ }
++
++ /**
++ * Test method for {@link org.tizen.ncli.ide.subcommands.BuildWebCLICommand#setExcludeList(java.util.List)}.
++ */
++ @Test
++ public void testSetExcludeList() {
++ BuildWebCLICommand command = new BuildWebCLICommand();
++ List<String> excludeList = new ArrayList<String>();
++ excludeList.add(".git");
++
++ command.setExcludeList(excludeList);
++
++ BuildWebParameter buildData = command.runCommand();
++ assertNotNull(buildData);
++ assertEquals(".git", buildData.getExcludeList().get(0));
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.subcommands;\r
--\r
--import java.io.File;\r
--import java.io.IOException;\r
--import java.io.InputStream;\r
--import java.util.Properties;\r
--\r
--import org.junit.BeforeClass;\r
--import org.slf4j.Logger;\r
--import org.slf4j.LoggerFactory;\r
--import org.tizen.common.util.IOUtil;\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--public class CommonCLISubCommandTest {\r
--\r
-- protected static Logger log = LoggerFactory.getLogger(CommonCLISubCommandTest.class);\r
-- protected static Properties testGlobalProp = new Properties();\r
-- protected static Properties testLocalProp = new Properties();\r
--\r
-- @BeforeClass\r
-- public static void prepare_once() {\r
-- testGlobalProp.put("global.key1", "This is global value1");\r
-- testGlobalProp.put("global.key2", "This is global value2");\r
-- testGlobalProp.put("global.key1.subkey1", "This is global subkey value1");\r
-- \r
-- testLocalProp.put("global.key1", "This is local value1");\r
-- testLocalProp.put("local.key2", "This is global value2");\r
-- testLocalProp.put("local.key1.subkey1", "This is local subkey value1");\r
-- \r
-- }\r
--\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.subcommands;
++
++import java.io.File;
++import java.io.IOException;
++import java.io.InputStream;
++import java.util.Properties;
++
++import org.junit.BeforeClass;
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++import org.tizen.common.util.IOUtil;
++
++/**
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++public class CommonCLISubCommandTest {
++
++ protected static Logger log = LoggerFactory.getLogger(CommonCLISubCommandTest.class);
++ protected static Properties testGlobalProp = new Properties();
++ protected static Properties testLocalProp = new Properties();
++
++ @BeforeClass
++ public static void prepare_once() {
++ testGlobalProp.put("global.key1", "This is global value1");
++ testGlobalProp.put("global.key2", "This is global value2");
++ testGlobalProp.put("global.key1.subkey1", "This is global subkey value1");
++
++ testLocalProp.put("global.key1", "This is local value1");
++ testLocalProp.put("local.key2", "This is global value2");
++ testLocalProp.put("local.key1.subkey1", "This is local subkey value1");
++
++ }
++
}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--\r
--package org.tizen.ncli.ide.subcommands;\r
--\r
--import static org.junit.Assert.*;\r
--import static org.powermock.api.mockito.PowerMockito.doAnswer;\r
--import static org.powermock.api.mockito.PowerMockito.spy;\r
--\r
--import java.util.Collection;\r
--import java.util.HashSet;\r
--\r
--import org.junit.Test;\r
--import org.junit.runner.RunWith;\r
--import org.mockito.invocation.InvocationOnMock;\r
--import org.mockito.stubbing.Answer;\r
--import org.powermock.core.classloader.annotations.PowerMockIgnore;\r
--import org.powermock.core.classloader.annotations.PrepareForTest;\r
--import org.powermock.modules.junit4.PowerMockRunner;\r
--import org.tizen.common.config.Preference;\r
--import org.tizen.common.config.provider.EnvironmentProvider;\r
--import org.tizen.common.config.provider.SystemPropertiesProvider;\r
--import org.tizen.ncli.ide.config.Configuration;\r
--import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;\r
--\r
--/**\r
-- * Test class for {@link ConfigCLICommand} <br>\r
-- * In this test case , only test <tt>list</tt> option.\r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- * \r
-- */\r
--@PowerMockIgnore({ "org.apache.log4j.*", "org.slf4j.Logger" })\r
--@RunWith(PowerMockRunner.class)\r
--@PrepareForTest(TizenCLIConfigProvider.class)\r
--public class ConfigCommandListTest extends CommonCLISubCommandTest{\r
--\r
-- @Test\r
-- public void test_listConfig() throws Exception {\r
--\r
-- final TizenCLIConfigProvider globalProvider = new TizenCLIConfigProvider(testGlobalProp);\r
-- final TizenCLIConfigProvider localProvider = new TizenCLIConfigProvider(testLocalProp);\r
--\r
-- ConfigCLICommand configCmd = spy(new ConfigCLICommand());\r
--\r
-- doAnswer(new Answer<Object>() {\r
--\r
-- @Override\r
-- public Object answer(InvocationOnMock invocation) throws Throwable {\r
-- Preference.register("OS", new EnvironmentProvider());\r
-- Preference.register("JVM", new SystemPropertiesProvider());\r
-- Preference.register("TIZEN.CLI.GLOBAL", globalProvider);\r
-- Preference.register("TIZEN.CLI.LOCAL", localProvider);\r
-- return "run command called";\r
-- }\r
--\r
-- }).when(configCmd, "runCommand");\r
--\r
-- assertEquals("run command called", configCmd.runCommand());\r
-- \r
-- configCmd.setList(true);\r
-- \r
-- Configuration cliConfig = configCmd.call();\r
-- assertNotNull(cliConfig);\r
-- \r
-- Collection<String> expectedGlobalKeys = new HashSet<String>();\r
-- expectedGlobalKeys.add("global.key1");\r
-- expectedGlobalKeys.add("global.key2");\r
-- expectedGlobalKeys.add("global.key1.subkey1");\r
-- assertTrue(cliConfig.getGlobalKeys().containsAll(expectedGlobalKeys));\r
-- \r
-- Collection<String> expectedLocalKeys = new HashSet<String>();\r
-- expectedLocalKeys.add("global.key1");\r
-- expectedLocalKeys.add("local.key2");\r
-- expectedLocalKeys.add("local.key1.subkey1"); \r
-- \r
-- assertTrue(cliConfig.getLocalKeys().containsAll(expectedLocalKeys));\r
-- \r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++
++package org.tizen.ncli.ide.subcommands;
++
++import static org.junit.Assert.*;
++import static org.powermock.api.mockito.PowerMockito.doAnswer;
++import static org.powermock.api.mockito.PowerMockito.spy;
++
++import java.util.Collection;
++import java.util.HashSet;
++
++import org.junit.Test;
++import org.junit.runner.RunWith;
++import org.mockito.invocation.InvocationOnMock;
++import org.mockito.stubbing.Answer;
++import org.powermock.core.classloader.annotations.PowerMockIgnore;
++import org.powermock.core.classloader.annotations.PrepareForTest;
++import org.powermock.modules.junit4.PowerMockRunner;
++import org.tizen.common.config.Preference;
++import org.tizen.common.config.provider.EnvironmentProvider;
++import org.tizen.common.config.provider.SystemPropertiesProvider;
++import org.tizen.ncli.ide.config.Configuration;
++import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;
++
++/**
++ * Test class for {@link ConfigCLICommand} <br>
++ * In this test case , only test <tt>list</tt> option.
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ *
++ */
++@PowerMockIgnore({ "org.apache.log4j.*", "org.slf4j.Logger" })
++@RunWith(PowerMockRunner.class)
++@PrepareForTest(TizenCLIConfigProvider.class)
++public class ConfigCommandListTest extends CommonCLISubCommandTest{
++
++ @Test
++ public void test_listConfig() throws Exception {
++
++ final TizenCLIConfigProvider globalProvider = new TizenCLIConfigProvider(testGlobalProp);
++ final TizenCLIConfigProvider localProvider = new TizenCLIConfigProvider(testLocalProp);
++
++ ConfigCLICommand configCmd = spy(new ConfigCLICommand());
++
++ doAnswer(new Answer<Object>() {
++
++ @Override
++ public Object answer(InvocationOnMock invocation) throws Throwable {
++ Preference.register("OS", new EnvironmentProvider());
++ Preference.register("JVM", new SystemPropertiesProvider());
++ Preference.register("TIZEN.CLI.GLOBAL", globalProvider);
++ Preference.register("TIZEN.CLI.LOCAL", localProvider);
++ return "run command called";
++ }
++
++ }).when(configCmd, "runCommand");
++
++ assertEquals("run command called", configCmd.runCommand());
++
++ configCmd.setList(true);
++
++ Configuration cliConfig = configCmd.call();
++ assertNotNull(cliConfig);
++
++ Collection<String> expectedGlobalKeys = new HashSet<String>();
++ expectedGlobalKeys.add("global.key1");
++ expectedGlobalKeys.add("global.key2");
++ expectedGlobalKeys.add("global.key1.subkey1");
++ assertTrue(cliConfig.getGlobalKeys().containsAll(expectedGlobalKeys));
++
++ Collection<String> expectedLocalKeys = new HashSet<String>();
++ expectedLocalKeys.add("global.key1");
++ expectedLocalKeys.add("local.key2");
++ expectedLocalKeys.add("local.key1.subkey1");
++
++ assertTrue(cliConfig.getLocalKeys().containsAll(expectedLocalKeys));
++
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.subcommands;\r
--\r
--import static org.junit.Assert.*;\r
--import static org.powermock.api.mockito.PowerMockito.*;\r
--\r
--import java.io.File;\r
--import java.io.FileInputStream;\r
--import java.io.FileOutputStream;\r
--import java.io.InputStream;\r
--import java.io.OutputStream;\r
--import java.util.Collection;\r
--import java.util.HashSet;\r
--import java.util.Properties;\r
--\r
--import org.junit.Before;\r
--import org.junit.Test;\r
--import org.junit.internal.runners.statements.Fail;\r
--import org.junit.runner.RunWith;\r
--import org.mockito.invocation.InvocationOnMock;\r
--import org.mockito.stubbing.Answer;\r
--import org.powermock.core.classloader.annotations.PowerMockIgnore;\r
--import org.powermock.core.classloader.annotations.PrepareForTest;\r
--import org.powermock.modules.junit4.PowerMockRunner;\r
--import org.tizen.common.config.Preference;\r
--import org.tizen.common.config.provider.EnvironmentProvider;\r
--import org.tizen.common.config.provider.SystemPropertiesProvider;\r
--import org.tizen.common.util.IOUtil;\r
--import org.tizen.ncli.ide.CLIConstant;\r
--import org.tizen.ncli.ide.config.Configuration;\r
--import org.tizen.ncli.ide.core.config.NCLIConfigLoader;\r
--import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;\r
--\r
--/**\r
-- * Test class for {@link ConfigCLICommand} <br>\r
-- * \r
-- * In this class , setting global or local configuration is tested.\r
-- * \r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- * \r
-- */\r
--@PowerMockIgnore({ "org.apache.log4j.*", "org.slf4j.Logger" })\r
--@RunWith(PowerMockRunner.class)\r
--@PrepareForTest(NCLIConfigLoader.class)\r
--public class ConfigCommandTest extends CommonCLISubCommandTest {\r
--\r
-- @Before\r
-- public void setUp() {\r
--\r
-- }\r
--\r
-- @PrepareForTest({ NCLIConfigLoader.class, ConfigCLICommand.class })\r
-- @Test\r
-- public void test_setLocalConfig() throws Exception {\r
--\r
-- File testFile = mock(File.class);\r
-- whenNew(File.class).withAnyArguments().thenReturn(testFile);\r
-- when(testFile.getName()).thenReturn(".tizen-cli-config");\r
-- when(testFile.getPath()).thenReturn("/tizen-sdk/tools/.tizen-cli-config");\r
-- when(testFile.exists()).thenReturn(true);\r
-- when(testFile.canWrite()).thenReturn(true);\r
--\r
-- FileOutputStream mockFileOutputStream = mock(FileOutputStream.class);\r
-- whenNew(FileOutputStream.class).withAnyArguments().thenReturn(mockFileOutputStream);\r
--\r
-- // Mocking NCLIConfigLoader\r
-- mockStatic(NCLIConfigLoader.class);\r
-- when(NCLIConfigLoader.getLocalConfigFile()).thenReturn(testFile);\r
-- when(NCLIConfigLoader.loadLocalConf()).thenReturn(testLocalProp);\r
--\r
-- ConfigCLICommand configCmd = new ConfigCLICommand();\r
--\r
-- configCmd.setConfig("local.key.test", "this is LOCAL test value");\r
-- // method for test\r
-- Configuration cliConfig = configCmd.call();\r
-- assertEquals("this is LOCAL test value", cliConfig.getLocalValue("local.key.test"));\r
--\r
-- }\r
--\r
-- @PrepareForTest({ NCLIConfigLoader.class, ConfigCLICommand.class })\r
-- @Test\r
-- public void test_setGlobalConfig() throws Exception {\r
-- File testFile = mock(File.class);\r
-- whenNew(File.class).withAnyArguments().thenReturn(testFile);\r
-- when(testFile.getName()).thenReturn(".tizen-cli-config");\r
-- when(testFile.getPath()).thenReturn("/home/user/.tizen-cli-config");\r
-- when(testFile.exists()).thenReturn(true);\r
-- when(testFile.canWrite()).thenReturn(true);\r
--\r
-- FileOutputStream mockFileOutputStream = mock(FileOutputStream.class);\r
-- whenNew(FileOutputStream.class).withAnyArguments().thenReturn(mockFileOutputStream);\r
--\r
-- // Mocking NCLIConfigLoader\r
-- mockStatic(NCLIConfigLoader.class);\r
-- when(NCLIConfigLoader.getGlobalConfigFile()).thenReturn(testFile);\r
-- when(NCLIConfigLoader.loadGlobalConf()).thenReturn(testGlobalProp);\r
--\r
-- ConfigCLICommand configCmd = new ConfigCLICommand();\r
--\r
-- configCmd.setConfig("global.key.test", "this is GLOBAL test value");\r
-- configCmd.setGlobal(true);\r
-- // method for test\r
-- Configuration cliConfig = configCmd.call();\r
-- assertEquals("this is GLOBAL test value", cliConfig.getGlobalValue("global.key.test"));\r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.subcommands;
++
++import static org.junit.Assert.*;
++import static org.powermock.api.mockito.PowerMockito.*;
++
++import java.io.File;
++import java.io.FileInputStream;
++import java.io.FileOutputStream;
++import java.io.InputStream;
++import java.io.OutputStream;
++import java.util.Collection;
++import java.util.HashSet;
++import java.util.Properties;
++
++import org.junit.Before;
++import org.junit.Test;
++import org.junit.internal.runners.statements.Fail;
++import org.junit.runner.RunWith;
++import org.mockito.invocation.InvocationOnMock;
++import org.mockito.stubbing.Answer;
++import org.powermock.core.classloader.annotations.PowerMockIgnore;
++import org.powermock.core.classloader.annotations.PrepareForTest;
++import org.powermock.modules.junit4.PowerMockRunner;
++import org.tizen.common.config.Preference;
++import org.tizen.common.config.provider.EnvironmentProvider;
++import org.tizen.common.config.provider.SystemPropertiesProvider;
++import org.tizen.common.util.IOUtil;
++import org.tizen.ncli.ide.CLIConstant;
++import org.tizen.ncli.ide.config.Configuration;
++import org.tizen.ncli.ide.core.config.NCLIConfigLoader;
++import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;
++
++/**
++ * Test class for {@link ConfigCLICommand} <br>
++ *
++ * In this class , setting global or local configuration is tested.
++ *
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ *
++ */
++@PowerMockIgnore({ "org.apache.log4j.*", "org.slf4j.Logger" })
++@RunWith(PowerMockRunner.class)
++@PrepareForTest(NCLIConfigLoader.class)
++public class ConfigCommandTest extends CommonCLISubCommandTest {
++
++ @Before
++ public void setUp() {
++
++ }
++
++ @PrepareForTest({ NCLIConfigLoader.class, ConfigCLICommand.class })
++ @Test
++ public void test_setLocalConfig() throws Exception {
++
++ File testFile = mock(File.class);
++ whenNew(File.class).withAnyArguments().thenReturn(testFile);
++ when(testFile.getName()).thenReturn(".tizen-cli-config");
++ when(testFile.getPath()).thenReturn("/tizen-sdk/tools/.tizen-cli-config");
++ when(testFile.exists()).thenReturn(true);
++ when(testFile.canWrite()).thenReturn(true);
++
++ FileOutputStream mockFileOutputStream = mock(FileOutputStream.class);
++ whenNew(FileOutputStream.class).withAnyArguments().thenReturn(mockFileOutputStream);
++
++ // Mocking NCLIConfigLoader
++ mockStatic(NCLIConfigLoader.class);
++ when(NCLIConfigLoader.getLocalConfigFile()).thenReturn(testFile);
++ when(NCLIConfigLoader.loadLocalConf()).thenReturn(testLocalProp);
++
++ ConfigCLICommand configCmd = new ConfigCLICommand();
++
++ configCmd.setConfig("local.key.test", "this is LOCAL test value");
++ // method for test
++ Configuration cliConfig = configCmd.call();
++ assertEquals("this is LOCAL test value", cliConfig.getLocalValue("local.key.test"));
++
++ }
++
++ @PrepareForTest({ NCLIConfigLoader.class, ConfigCLICommand.class })
++ @Test
++ public void test_setGlobalConfig() throws Exception {
++ File testFile = mock(File.class);
++ whenNew(File.class).withAnyArguments().thenReturn(testFile);
++ when(testFile.getName()).thenReturn(".tizen-cli-config");
++ when(testFile.getPath()).thenReturn("/home/user/.tizen-cli-config");
++ when(testFile.exists()).thenReturn(true);
++ when(testFile.canWrite()).thenReturn(true);
++
++ FileOutputStream mockFileOutputStream = mock(FileOutputStream.class);
++ whenNew(FileOutputStream.class).withAnyArguments().thenReturn(mockFileOutputStream);
++
++ // Mocking NCLIConfigLoader
++ mockStatic(NCLIConfigLoader.class);
++ when(NCLIConfigLoader.getGlobalConfigFile()).thenReturn(testFile);
++ when(NCLIConfigLoader.loadGlobalConf()).thenReturn(testGlobalProp);
++
++ ConfigCLICommand configCmd = new ConfigCLICommand();
++
++ configCmd.setConfig("global.key.test", "this is GLOBAL test value");
++ configCmd.setGlobal(true);
++ // method for test
++ Configuration cliConfig = configCmd.call();
++ assertEquals("this is GLOBAL test value", cliConfig.getGlobalValue("global.key.test"));
++ }
++
++}
--/*\r
-- * IDE\r
-- *\r
-- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
-- *\r
-- * Contact:\r
-- * Hyeongseok Heo <hyeongseok.heo@samsung.com>\r
-- * Kangho Kim <kh5325.kim@samsung.com>\r
-- * \r
-- * Licensed under the Apache License, Version 2.0 (the "License");\r
-- * you may not use this file except in compliance with the License.\r
-- * You may obtain a copy of the License at\r
-- *\r
-- * http://www.apache.org/licenses/LICENSE-2.0\r
-- *\r
-- * Unless required by applicable law or agreed to in writing, software\r
-- * distributed under the License is distributed on an "AS IS" BASIS,\r
-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-- * See the License for the specific language governing permissions and\r
-- * limitations under the License.\r
-- *\r
-- * Contributors:\r
-- * - S-Core Co., Ltd\r
-- */\r
--package org.tizen.ncli.ide.subcommands;\r
--\r
--import static org.junit.Assert.assertEquals;\r
--import static org.junit.Assert.assertTrue;\r
--\r
--import java.util.Collection;\r
--import java.util.Collections;\r
--import java.util.HashSet;\r
--\r
--import org.junit.Test;\r
--import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;\r
--\r
--/**\r
-- * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)\r
-- */\r
--public class TizenCLIConfigProviderTest extends CommonCLISubCommandTest {\r
-- @Test\r
-- public void test_getKey() throws Exception {\r
-- log.trace("test_getKey");\r
-- HashSet<String> keySet = new HashSet<String>();\r
-- keySet.add("global.key1");\r
-- keySet.add("global.key1");\r
-- keySet.add("global.key1.subkey1");\r
-- \r
-- Collection<String> expectKeys = Collections.unmodifiableCollection(keySet);\r
-- \r
-- TizenCLIConfigProvider cliProvider = new TizenCLIConfigProvider(testGlobalProp); \r
-- Collection<String> keys = cliProvider.keys();\r
-- \r
-- assertTrue(keys.containsAll(expectKeys));\r
-- }\r
-- \r
-- @Test\r
-- public void test_getValue() {\r
-- TizenCLIConfigProvider cliProvider = new TizenCLIConfigProvider(testGlobalProp);\r
-- assertEquals("This is global value1", cliProvider.get("global.key1"));\r
-- assertEquals("This is global value2", cliProvider.get("global.key2"));\r
-- assertEquals("This is global subkey value1", cliProvider.get("global.key1.subkey1"));\r
-- }\r
--\r
--}\r
++/*
++ * IDE
++ *
++ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
++ *
++ * Contact:
++ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
++ * Kangho Kim <kh5325.kim@samsung.com>
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ *
++ * Contributors:
++ * - S-Core Co., Ltd
++ */
++package org.tizen.ncli.ide.subcommands;
++
++import static org.junit.Assert.assertEquals;
++import static org.junit.Assert.assertTrue;
++
++import java.util.Collection;
++import java.util.Collections;
++import java.util.HashSet;
++
++import org.junit.Test;
++import org.tizen.ncli.ide.core.config.TizenCLIConfigProvider;
++
++/**
++ * @author Harry Hyeongseok Heo{@literal <hyeongseok.heo@samsung.com>} (S-core)
++ */
++public class TizenCLIConfigProviderTest extends CommonCLISubCommandTest {
++ @Test
++ public void test_getKey() throws Exception {
++ log.trace("test_getKey");
++ HashSet<String> keySet = new HashSet<String>();
++ keySet.add("global.key1");
++ keySet.add("global.key1");
++ keySet.add("global.key1.subkey1");
++
++ Collection<String> expectKeys = Collections.unmodifiableCollection(keySet);
++
++ TizenCLIConfigProvider cliProvider = new TizenCLIConfigProvider(testGlobalProp);
++ Collection<String> keys = cliProvider.keys();
++
++ assertTrue(keys.containsAll(expectKeys));
++ }
++
++ @Test
++ public void test_getValue() {
++ TizenCLIConfigProvider cliProvider = new TizenCLIConfigProvider(testGlobalProp);
++ assertEquals("This is global value1", cliProvider.get("global.key1"));
++ assertEquals("This is global value2", cliProvider.get("global.key2"));
++ assertEquals("This is global subkey value1", cliProvider.get("global.key1.subkey1"));
++ }
++
++}
--@echo off\r
--\r
--REM variable\r
--set CURRENT_WORKSPACE_PATH=%cd%\r
--set HOME_PATH=%~dp0..\\r
--set LIB_PATH=%HOME_PATH%lib-ncli\r
--\r
--set CONFIG_PATH=%HOME_PATH%conf-ncli\r
--set LOG_CONF_FILE=log4j-progress.xml\r
--set LOG_OPT=-Dlog4j.configuration=%LOG_CONF_FILE%\r
--\r
--set HAVE_ARGS=false\r
--set CLASSPATH=\r
--set ARGS=\r
--\r
--REM check args\r
--call:ARGS_SHIFT %*\r
--\r
--REM check args\r
--call:ARGS_CHECK %*\r
--\r
--REM running command\r
--call:_run_command %*\r
--\r
--REM method call end\r
--:END_STEP\r
--goto:eof\r
--\r
--REM command line shift method\r
--:ARGS_SHIFT\r
--if [%1]==[] goto AFTER_LOOP\r
--set ARGS=%ARGS% %1\r
--set HAVE_ARGS=true\r
--SHIFT\r
--goto ARGS_SHIFT\r
--:AFTER_LOOP\r
--goto:END_STEP\r
--\r
--REM arguements check method\r
--:ARGS_CHECK\r
--if %HAVE_ARGS% == true goto ADD_ARGS\r
--goto REMOVE_ARGS\r
--goto:END_STEP\r
--\r
--REM add workspace\r
--:ADD_ARGS\r
--set ARGS=%ARGS% --current-workspace-path %CURRENT_WORKSPACE_PATH%\r
--goto:END_STEP\r
--\r
--REM arguements check method\r
--:REMOVE_ARGS\r
--set ARGS=\r
--goto:END_STEP\r
--\r
--REM command excute method\r
--:_run_command\r
--\r
-- FOR /f "tokens=*" %%i IN ('dir %LIB_PATH% /B') DO ( call:CONCAT %LIB_PATH%\%%i )\r
--\r
-- set CLASSPATH=%CONFIG_PATH%;%CLASSPATH%\r
--\r
-- set MAIN=org.tizen.ncli.ide.shell.Main\r
-- set EXEC=java %LOG_OPT% -Djava.library.path=%LIB_PATH%\spawner -cp %CONFIG_PATH%;%CLASSPATH% %MAIN% %ARGS%\r
--\r
-- %EXEC%\r
--goto:eof\r
--\r
--\r
--REM concatenation lib\r
--:CONCAT\r
-- set CLASSPATH=%CLASSPATH%%1;\r
--goto:END_STEP\r
++@echo off
++
++REM variable
++set CURRENT_WORKSPACE_PATH=%cd%
++set HOME_PATH=%~dp0..\
++set LIB_PATH=%HOME_PATH%lib-ncli
++
++set CONFIG_PATH=%HOME_PATH%conf-ncli
++set LOG_CONF_FILE=log4j-progress.xml
++set LOG_OPT=-Dlog4j.configuration=%LOG_CONF_FILE%
++
++set HAVE_ARGS=false
++set CLASSPATH=
++set ARGS=
++
++REM check args
++call:ARGS_SHIFT %*
++
++REM check args
++call:ARGS_CHECK %*
++
++REM running command
++call:_run_command %*
++
++REM method call end
++:END_STEP
++goto:eof
++
++REM command line shift method
++:ARGS_SHIFT
++if [%1]==[] goto AFTER_LOOP
++set ARGS=%ARGS% %1
++set HAVE_ARGS=true
++SHIFT
++goto ARGS_SHIFT
++:AFTER_LOOP
++goto:END_STEP
++
++REM arguements check method
++:ARGS_CHECK
++if %HAVE_ARGS% == true goto ADD_ARGS
++goto REMOVE_ARGS
++goto:END_STEP
++
++REM add workspace
++:ADD_ARGS
++set ARGS=%ARGS% --current-workspace-path %CURRENT_WORKSPACE_PATH%
++goto:END_STEP
++
++REM arguements check method
++:REMOVE_ARGS
++set ARGS=
++goto:END_STEP
++
++REM command excute method
++:_run_command
++
++ FOR /f "tokens=*" %%i IN ('dir %LIB_PATH% /B') DO ( call:CONCAT %LIB_PATH%\%%i )
++
++ set CLASSPATH=%CONFIG_PATH%;%CLASSPATH%
++
++ set MAIN=org.tizen.ncli.ide.shell.Main
++ set EXEC=java %LOG_OPT% -Djava.library.path=%LIB_PATH%\spawner -cp %CONFIG_PATH%;%CLASSPATH% %MAIN% %ARGS%
++
++ %EXEC%
++goto:eof
++
++
++REM concatenation lib
++:CONCAT
++ set CLASSPATH=%CLASSPATH%%1;
++goto:END_STEP
--1. tizen.sh \r
--2. Main - entry point of Tizen new cli\r
--3. Command handler\r
++1. tizen.sh
++2. Main - entry point of Tizen new cli
++3. Command handler
4. Sub command handler