diff options
author | Sungho Park <chywoo.park@samsung.com> | 2012-02-27 21:19:55 +0900 |
---|---|---|
committer | Sungho Park <chywoo.park@samsung.com> | 2012-02-27 21:19:55 +0900 |
commit | 76116242bead64170dc7cffe4a32290ab8d92d5e (patch) | |
tree | cf68c8225db6c58be87d41b971819e74cbc7f0e9 | |
download | nativeplatform-eplugin-76116242bead64170dc7cffe4a32290ab8d92d5e.tar.gz nativeplatform-eplugin-76116242bead64170dc7cffe4a32290ab8d92d5e.tar.bz2 nativeplatform-eplugin-76116242bead64170dc7cffe4a32290ab8d92d5e.zip |
Initialize
122 files changed, 10090 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 00000000..acaf5c72 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,7 @@ +Kangho Kim <kh5325.kim@samsung.com> +Namkoong Ho <ho.namkoong@samsung.com> +YoonKi Park <yoonki.park@samsung.com> +Taeyoung Son <taeyoung2.son@samsung.com> +Hyunsik Noh <hyunsik.noh@samsung.com> +Gun Kim <gune.kim@samsung.com> +HyunGoo Kang <hyungoo1.kang@samsung.com> diff --git a/LICENSE-2.0.htm b/LICENSE-2.0.htm new file mode 100644 index 00000000..e52d995c --- /dev/null +++ b/LICENSE-2.0.htm @@ -0,0 +1,388 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> + <head> + <title>Apache License, Version 2.0</title> + + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" /> + + <link rel="stylesheet" type="text/css" media="screen" href="/css/style.css"> + <link rel="stylesheet" type="text/css" media="screen" href="/css/code.css"> + + <script type="text/javascript" src="/js/jquery.js"></script> + <script type="text/javascript" src="/js/apache_boot.js"></script> + + + + + <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. --> + </head> + + <body> + <div id="page" class="container_16"> + <div id="header" class="grid_8"> + <img src="/images/feather-small.gif" alt="The Apache Software Foundation"> + <h1>The Apache Software Foundation</h1> + <h2>Apache License, Version 2.0</h2> + </div> + <div id="nav" class="grid_8"> + <ul> + <!-- <li><a href="/" title="Welcome!">Home</a></li> --> + <li><a href="/foundation/" title="The Foundation">Foundation</a></li> + <li><a href="http://projects.apache.org" title="The Projects">Projects</a></li> + <li><a href="http://people.apache.org" title="The People">People</a></li> + <li><a href="/foundation/getinvolved.html" title="Get Involved">Get Involved</a></li> + <li><a href="/dyn/closer.cgi" title="Download">Download</a></li> + <li><a href="/foundation/sponsorship.html" title="Support Apache">Support Apache</a></li> + </ul> + <p><a href="/">Home</a> » <a href="/licenses/">Licenses</a></p> + <form name="search" id="search" action="http://www.google.com/search" method="get"> + <input value="*.apache.org" name="sitesearch" type="hidden"/> + <input type="text" name="q" id="query"> + <input type="submit" id="submit" value="Search"> + </form> + </div> + <div class="clear"></div> + <div id="content" class="grid_16"><div class="section-content"><p>Apache License<br></br>Version 2.0, January 2004<br></br> +<a href="http://www.apache.org/licenses/">http://www.apache.org/licenses/</a> </p> +<p>TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION</p> +<p><strong><a name="definitions">1. Definitions</a></strong>.</p> +<p>"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document.</p> +<p>"Licensor" shall mean the copyright owner or entity authorized by the +copyright owner that is granting the License.</p> +<p>"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.</p> +<p>"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License.</p> +<p>"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, +and configuration files.</p> +<p>"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.</p> +<p>"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).</p> +<p>"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.</p> +<p>"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."</p> +<p>"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.</p> +<p><strong><a name="copyright">2. Grant of Copyright License</a></strong>. 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.</p> +<p><strong><a name="patent">3. Grant of Patent License</a></strong>. 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.</p> +<p><strong><a name="redistribution">4. Redistribution</a></strong>. 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:</p> +<ol> +<li> +<p>You must give any other recipients of the Work or Derivative Works a +copy of this License; and</p> +</li> +<li> +<p>You must cause any modified files to carry prominent notices stating +that You changed the files; and</p> +</li> +<li> +<p>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</p> +</li> +<li> +<p>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.</p> +</li> +</ol> +<p><strong><a name="contributions">5. Submission of Contributions</a></strong>. 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.</p> +<p><strong><a name="trademarks">6. Trademarks</a></strong>. 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.</p> +<p><strong><a name="no-warranty">7. Disclaimer of Warranty</a></strong>. 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.</p> +<p><strong><a name="no-liability">8. Limitation of Liability</a></strong>. 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.</p> +<p><strong><a name="additional">9. Accepting Warranty or Additional Liability</a></strong>. +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.</p> +<p>END OF TERMS AND CONDITIONS</p> +<h1 id="apply">APPENDIX: How to apply the Apache License to your work</h1> +<p>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.</p> +<div class="codehilite"><pre> 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. +</pre></div></div></div> + <div class="clear"></div> + </div> + <div id="footer" class="container_16"> + <div class="links grid_16"> + <div class="grid_3"> + <h4>Projects</h4> + <ul> +<li><a href="http://httpd.apache.org/" title="Apache Web Server (httpd)">HTTP Server</a></li> +<li><a href="http://abdera.apache.org/" title="Atom Publishing Protocol Implementation">Abdera</a></li> +<li><a href="http://activemq.apache.org/" title="Distributed Messaging System">ActiveMQ</a></li> +<li><a href="http://ant.apache.org/" title="Java-based build tool">Ant</a></li> +<li><a href="http://apr.apache.org/" title="Apache Portable Runtime libraries">APR</a></li> +<li><a href="http://archiva.apache.org/" title="Build Artifact Repository Manager">Archiva</a></li> +<li><a href="http://aries.apache.org/" title="Enterprise OSGi application programming model">Aries</a></li> +<li><a href="http://avro.apache.org/" title="A Serialization System">Avro</a></li> +<li><a href="http://axis.apache.org/" title="Java SOAP Engine">Axis</a></li> +<li><a href="http://buildr.apache.org/" title="Simple and intuitive build system for Java applications">Buildr</a></li> +<li><a href="http://camel.apache.org/" title="Spring based Integration Framework which implements the Enterprise Integration Patterns">Camel</a></li> +<li><a href="http://cassandra.apache.org/" title="Highly scalable second-generation distributed database">Cassandra</a></li> +<li><a href="http://cayenne.apache.org/" title="User-friendly Java ORM with Tools">Cayenne</a></li> +<li><a href="http://chemistry.apache.org/" title="CMIS (Content Managment Interoperability Services) Clients and Servers">Chemistry</a></li> +<li><a href="http://click.apache.org/" title="User-friendly page and component oriented web framework">Click</a></li> +<li><a href="http://cocoon.apache.org/" title="Web development framework: separation of concerns, component-based">Cocoon</a></li> +<li><a href="http://commons.apache.org/" title="Reusable Java components">Commons</a></li> +<li><a href="http://continuum.apache.org/" title="Continuous Integration and Build Server">Continuum</a></li> +<li><a href="http://couchdb.apache.org/" title="RESTful document database">CouchDB</a></li> +<li><a href="http://cxf.apache.org/" title="Service Framework">CXF</a></li> +<li><a href="http://db.apache.org/" title="Database access">DB</a></li> +<li><a href="http://deltacloud.apache.org/" title="RESTful cloud management interface">Deltacloud</a></li> +<li><a href="http://directory.apache.org/" title="Apache Directory Server">Directory</a></li> +<li><a href="http://esme.apache.org/" title="Enterprise Social Messaging Environment">ESME</a></li> +<li><a href="http://felix.apache.org/" title="OSGi Framework and components.">Felix</a></li> +<li><a href="http://forrest.apache.org/" title="Aggregated multi-channel documentation, separation of concerns">Forrest</a></li> +<li><a href="http://geronimo.apache.org/" title="Java2, Enterprise Edition (J2EE) container">Geronimo</a></li> +<li><a href="http://gump.apache.org/" title="Continuous integration of open source projects">Gump</a></li> +<li><a href="http://hadoop.apache.org/" title="Distributed computing platform">Hadoop</a></li> +<li><a href="http://hbase.apache.org/" title="Hadoop Database">HBase</a></li> +<li><a href="http://hive.apache.org/" title="Data warehouse infrastructure using the Hadoop Database">Hive</a></li> +<li><a href="http://hc.apache.org/" title="Java toolset of low level HTTP components">HttpComponents</a></li> +<li><a href="http://jackrabbit.apache.org/" title="Content Repository for Java">Jackrabbit</a></li> +<li><a href="http://jakarta.apache.org/" title="Server-side Java">Jakarta</a></li> +<li><a href="http://james.apache.org/" title="Java Apache Mail Enterprise Server">James</a></li> +<li><a href="http://jmeter.apache.org/" title="Java performance and functional testing">JMeter</a></li> +<li><a href="http://juddi.apache.org/" title="Java implementation of the Universal Description, Discovery, and Integration specification">jUDDI</a></li> +<li><a href="http://karaf.apache.org/" title="Server-side OSGi distribution">Karaf</a></li> +<li><a href="http://lenya.apache.org/" title="Content Management System">Lenya</a></li> +<li><a href="http://libcloud.apache.org/" title="Unified interface to the cloud">Libcloud</a></li> +<li><a href="http://logging.apache.org/" title="Cross-language logging services">Logging</a></li> +<li><a href="http://lucene.apache.org/" title="Search engine library">Lucene</a></li> +<li><a href="http://mahout.apache.org/" title="Scalable machine learning library">Mahout</a></li> +<li><a href="http://maven.apache.org/" title="Java project management and comprehension tools">Maven</a></li> +<li><a href="http://mina.apache.org/" title="Multipurpose Infrastructure for Network Application">MINA</a></li> +<li><a href="http://myfaces.apache.org/" title="JavaServer(tm) Faces implementation and components">MyFaces</a></li> +<li><a href="http://nutch.apache.org/" title="Open Source Web Search Software">Nutch</a></li> +<li><a href="http://ode.apache.org/" title="Orchestration Director Engine: Business Process Management (BPM), Process Orchestration and Workflow through service compositioni.">ODE</a></li> +<li><a href="http://oodt.apache.org/" title="Object Oriented Data Technology (middleware metadata)">OODT</a></li> +<li><a href="http://ofbiz.apache.org/" title="Open for Business: enterprise automation software">OFBiz</a></li> +<li><a href="http://openejb.apache.org/" title="OpenEJB: a modular, configurable, and extendable EJB Container System and Server">OpenEJB</a></li> +<li><a href="http://openjpa.apache.org/" title="OpenJPA: Object Relational Mapping for Java">OpenJPA</a></li> +<li><a href="http://openwebbeans.apache.org/" title="OpenWebBeans: JSR-299 Context and Dependency Injection for Java EE Platform Implementation">OpenWebBeans</a></li> +<li><a href="http://pdfbox.apache.org/" title="Java library for working with PDF documents">PDFBox</a></li> +<li><a href="http://perl.apache.org/" title="Dynamic websites using Perl">Perl</a></li> +<li><a href="http://pig.apache.org/" title="Platform for analyzing large data sets">Pig</a></li> +<li><a href="http://pivot.apache.org/" title="Rich Internet applications in Java">Pivot</a></li> +<li><a href="http://poi.apache.org/" title="Java API for OLE 2 Compound and OOXML Documents">POI</a></li> +<li><a href="http://portals.apache.org/" title="Portal technology">Portals</a></li> +<li><a href="http://qpid.apache.org/" title="Multiple language implementation of the latest Advanced Message Queuing Protocol (AMQP)">Qpid</a></li> +<li><a href="http://river.apache.org/" title="Jini service oriented architecture">River</a></li> +<li><a href="http://roller.apache.org/" title="Java blog server">Roller</a></li> +<li><a href="http://santuario.apache.org/" title="XML Security in Java and C++">Santuario</a></li> +<li><a href="http://servicemix.apache.org/" title="Enterprise Service Bus">ServiceMix</a></li> +<li><a href="http://shindig.apache.org/" title="Opensocial Reference Implementation">Shindig</a></li> +<li><a href="http://shiro.apache.org/" title="Powerful and easy-to-use application security framework">Shiro</a></li> +<li><a href="http://sling.apache.org/" title="Web Framework for JCR Content Repositories">Sling</a></li> +<li><a href="http://spamassassin.apache.org/" title="Mail filter to identify spam">SpamAssassin</a></li> +<li><a href="http://stdcxx.apache.org/" title="Apache C++ Standard Library">STDCXX</a></li> +<li><a href="http://struts.apache.org/" title="Model 2 framework for building Java web applications">Struts</a></li> +<li><a href="http://subversion.apache.org/" title="Version Control">Subversion</a></li> +<li><a href="http://synapse.apache.org/" title="Enterprise Service Bus and Mediation Framework">Synapse</a></li> +<li><a href="http://tapestry.apache.org/" title="Component-based Java Web Application Framework">Tapestry</a></li> +<li><a href="http://tcl.apache.org/" title="Dynamic websites using TCL">Tcl</a></li> +<li><a href="http://thrift.apache.org/" title="Framework for scalable cross-language services development">Thrift</a></li> +<li><a href="http://tika.apache.org" title="Content Analysis and Detection Toolkit">Tika</a></li> +<li><a href="http://tiles.apache.org/" title="A templating framework for web application user interfaces">Tiles</a></li> +<li><a href="http://tomcat.apache.org/" title="A Java Servlet and JSP Container">Tomcat</a></li> +<li><a href="http://trafficserver.apache.org/" title="A fast, scalable and extensible HTTP/1.1 compliant caching proxy server">Traffic Server</a></li> +<li><a href="http://turbine.apache.org/" title="A Java Servlet Web Application Framework and associated component library">Turbine</a></li> +<li><a href="http://tuscany.apache.org/" title="An SCA based Service Composition Framework">Tuscany</a></li> +<li><a href="http://uima.apache.org/" title="Framework and annotators for unstructured information analysis">UIMA</a></li> +<li><a href="http://velocity.apache.org/" title="A Java Templating Engine">Velocity</a></li> +<li><a href="http://ws.apache.org/">Web Services</a></li> +<li><a href="http://whirr.apache.org/" title="Libraries for running Cloud Services">Whirr</a></li> +<li><a href="http://wicket.apache.org/" title="Component-based Java Web Application Framework.">Wicket</a></li> +<li><a href="http://xalan.apache.org/" title="XSLT processors in Java and C++">Xalan</a></li> +<li><a href="http://xerces.apache.org/" title="XML parsers in Java, C++ and Perl">Xerces</a></li> +<li><a href="http://xml.apache.org/" title="XML solutions focused on the web">XML</a></li> +<li><a href="http://xmlbeans.apache.org/" title="XML-Java binding tool">XMLBeans</a></li> +<li><a href="http://xmlgraphics.apache.org/" title="Conversion from XML to graphical output">XML Graphics</a></li> +<li><a href="http://zookeeper.apache.org/" title="Centralized service for maintaining configuration information">ZooKeeper</a></li> +</ul> + </div> + <div class="grid_3"> + <h4>Foundation</h4> + <ul> + <li><a href="/foundation/faq.html">FAQ</a></li> + <li><a href="/licenses/" title="Overview of the Apache Licenese">Licenses</a></li> + <li><a href="/foundation/marks/" title="Apache marks policies and listing">Trademarks</a></li> + <li><a href="/foundation/news.html" title="Official news feed of Foundation announcements">News</a></li> + <li><a href="/press/" title="Press, Media, and Analyst contact">Press Inquiries</a></li> + <li><a href="/foundation/records/" title="Formal corporate records and board meeting minutes">Public Records</a></li> + <li><a href="/foundation/sponsorship.html" title="Sponsor the Foundation">Sponsorship</a></li> + <li><a href="/foundation/contributing.html" title="Donate to the Foundation">Donations</a></li> + <li><a href="/foundation/buy_stuff.html" title="Buy Apache branded merchandise">Buy Stuff</a></li> + <li><a href="/foundation/thanks.html" title="Thank you to our Sponsors">Thanks</a></li> + <li><a href="/foundation/contact.html" title="Contact Us">Contact</a></li> + </ul> + </div> + <div class="grid_3 suffix_1"> + <h4>Foundation Projects</h4> + <ul> + <li><a href="http://attic.apache.org/" title="Inactive projects repository">Attic</a></li> + <li><a href="/foundation/conferences.html" title="Meetings of developers and users">Conferences</a></li> + <li><a href="http://community.apache.org/" title="Helping newcomers to the ASF">Community Development</a></li> + <li><a href="http://incubator.apache.org/" title="Shepherd for new projects">Incubator</a></li> + <li><a href="/dev/" title="ASF Infrastructure: Operations and howto documents for PMCs and contributors">Infrastructure</a></li> + <li><a href="/jcp/" title="Apache and the Java Community Process">JCP</a></li> + <li><a href="http://labs.apache.org/" title="The Innovation Laboratories of the Apache Software Foundation">Labs</a></li> + <li><a href="/legal/" title="Legal Affairs">Legal Affairs</a></li> + <li><a href="/press/" title="Public Relations">Public Relations</a></li> + <li><a href="/security/" title="Security">Security</a></li> + <li><a href="/travel/" title="Travel Assistance">Travel Assistance</a></li> + </ul> + </div> + + <div class="grid_3"> + <h4>Community</h4> + <ul> + <li><a href="http://people.apache.org/" title="Apache committer homepages">People</a></li> + <li><a href="/memorials/" title="In memoriam of past committers">Memorials</a></li> + <li><a href="http://feathercast.org/" title="Apache Podcasts">Feathercast</a></li> + <li><a href="http://blogs.apache.org/" title="Apache Project Blogs">Project Blogs</a></li> + <li><a href="http://planet.apache.org/committers/" title="Apache Committers' Blogs">PlanetApache</a></li> + </ul> + </div> + <div class="grid_3"> + <h4>How It Works</h4> + <ul> + <li><a href="/foundation/how-it-works.html">Introduction</a></li> + <li><a href="/foundation/how-it-works.html#meritocracy">Meritocracy</a></li> + <li><a href="/foundation/how-it-works.html#structure">Structure</a></li> + <li><a href="/foundation/how-it-works.html#roles">Roles</a></li> + <li><a href="/foundation/how-it-works.html#management">Collaboration</a></li> + <li><a href="/foundation/how-it-works.html#incubator">Incubator</a></li> + <li><a href="/foundation/how-it-works.html#other">Other entities</a></li> + <li><a href="/foundation/glossary.html">Glossary</a></li> + <li><a href="/foundation/voting.html">Voting</a></li> + </ul> + </div> + </div> + <div class="clear"></div> + + </div> + <div id="copyright" class="container_16"> + <p>Copyright © 2011 The Apache Software Foundation, Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.<br/>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.</p> + </div> + </body> +</html> @@ -0,0 +1 @@ +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. diff --git a/builder/build.properties.clean b/builder/build.properties.clean new file mode 100644 index 00000000..49e836ff --- /dev/null +++ b/builder/build.properties.clean @@ -0,0 +1,260 @@ +############################################################################### +# Copyright (c) 2003, 2006 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +##################### +# Parameters describing how and where to execute the build. +# Typical users need only update the following properties: +# baseLocation - where things you are building against are installed +# bootclasspath - The base jars to compile against (typicaly rt.jar) +# configs - the list of {os, ws, arch} configurations to build. +# +# Of course any of the settings here can be overridden by spec'ing +# them on the command line (e.g., -DbaseLocation=d:/eclipse + +#The type of the top level element we are building, generally "feature" +topLevelElementType=feature +#The id of the top level element we are building +topLevelElementId=org.tizen.nativeplatform.feature + +############# PRODUCT/PACKAGING CONTROL ############# +#product=/com.samsung.freshide/SLPSDK.product +#runPackager=true + +#Set the name of the archive that will result from the product build. +#archiveNamePrefix= + +# The prefix that will be used in the generated archive. +archivePrefix="Do not touch here." + +# The location underwhich all of the build output will be collected. +collectingFolder=${archivePrefix} + +# The list of {os, ws, arch} configurations to build. This +# value is a '&' separated list of ',' separate triples. For example, +# configs=win32,win32,x86 & linux,motif,x86 +# By default the value is *,*,* +configs="Do not touch here." +#configs=win32, win32, x86 & \ +# win32,win32,x86_64 & \ +# win32,win32,wpf & \ +# linux, gtk, ppc & \ +# linux, gtk, x86 & \ +# linux, gtk, x86_64 & \ +# linux, motif, x86 & \ +# solaris, motif, sparc & \ +# solaris, gtk, sparc & \ +# aix, motif, ppc & \ +# hpux, motif, ia64_32 & \ +# macosx, carbon, ppc & \ +# macosx, carbon, x86 & \ +# macosx, cocoa, ppc & \ +# macosx, cocoa, x86 & \ +# macosx, cocoa, x86_64 + +# By default PDE creates one archive (result) per entry listed in the configs property. +# Setting this value to true will cause PDE to only create one output containing all +# artifacts for all the platforms listed in the configs property. +# To control the output format for the group, add a "group, group, group - <format>" entry to the +# archivesFormat. +#groupConfigurations=true + +#The format of the archive. By default a zip is created using antZip. +#The list can only contain the configuration for which the desired format is different than zip. +#archivesFormat=win32, win32, x86 - antZip& \ +# linux, gtk, ppc - antZip &\ +# linux, gtk, x86 - antZip& \ +# linux, gtk, x86_64 - antZip& \ +# linux, motif, x86 - antZip& \ +# solaris, motif, sparc - antZip& \ +# solaris, gtk, sparc - antZip& \ +# aix, motif, ppc - antZip& \ +# hpux, motif, PA_RISC - antZip& \ +# macosx, carbon, ppc - antZip + +#Allow cycles involving at most one bundle that needs to be compiled with the rest being binary bundles. +allowBinaryCycles=true + +#Sort bundles depenedencies across all features instead of just within a given feature. +#flattenDependencies = true + +#Parallel compilation, requires flattenedDependencies=true +#parallelCompilation=true +#parallelThreadCount= +#parallelThreadsPerProcessor= + +#Set to true if you want the output to be ready for an update jar (no site.xml generated) +#outputUpdateJars = false + +#Set to true for Jnlp generation +#codebase should be a URL that will be used as the root of all relative URLs in the output. +#generateJnlp=false +#jnlp.codebase=<codebase url> +#jnlp.j2se=<j2se version> +#jnlp.locale=<a locale> +#jnlp.generateOfflineAllowed=true or false generate <offlineAllowed/> attribute in the generated features +#jnlp.configs=${configs} #uncomment to filter the content of the generated jnlp files based on the configuration being built + +#Set to true if you want to sign jars +#signJars=false +#sign.alias=<alias> +#sign.keystore=<keystore location> +#sign.storepass=<keystore password> +#sign.keypass=<key password> + +#Arguments to send to the zip executable +#zipargs= + +#Arguments to send to the tar executable +#tarargs= + +#Control the creation of a file containing the version included in each configuration - on by default +#generateVersionsLists=false + +############## BUILD NAMING CONTROL ################ +# The directory into which the build elements are fetched and where +# the build takes place. +buildDirectory="Do not touch here" + +# Type of build. Used in naming the build output. Typically this value is +# one of I, N, M, S, ... +buildType="Do not touch here" + +# ID of the build. Used in naming the build output. +buildId="Do not touch here" + +# Label for the build. Used in naming the build output +buildLabel=${buildType}.${buildId} + +# Timestamp for the build. Used in naming the build output +timestamp=007 + +#The value to be used for the qualifier of a plugin or feature when you want to override the value computed by pde. +#The value will only be applied to plugin or features indicating build.properties, qualifier = context +#forceContextQualifier=<the value for the qualifier> + +#Enable / disable the generation of a suffix for the features that use .qualifier. +#The generated suffix is computed according to the content of the feature +#generateFeatureVersionSuffix=true + +############# BASE CONTROL ############# +# Settings for the base Eclipse components and Java class libraries +# against which you are building. +# Base location for anything the build needs to compile against. For example, +# in most RCP app or a plug-in, the baseLocation should be the location of a previously +# installed Eclipse against which the application or plug-in code will be compiled and the RCP delta pack. + +base="Do not touch here" +baseLocation="Do not touch here" + + +#Folder containing repositories whose content is needed to compile against +#repoBaseLocation=${base}/repos +#Folder where the content of the repositories from ${repoBaseLocation} will be made available as a form suitable to be compiled against +#transformedRepoLocation=${base}/transformedRepos + +#Os/Ws/Arch/nl of the eclipse specified by baseLocation +baseos=linux +basews=gtk +basearch=x86 + +#this property indicates whether you want the set of plug-ins and features to be considered during the build to be limited to the ones reachable from the features / plugins being built +filteredDependencyCheck=false + +#this property indicates whether the resolution should be done in development mode (i.e. ignore multiple bundles with singletons) +resolution.devMode=false + +#pluginPath is a list of locations in which to find plugins and features. This list is separated by the platform file separator (; or :) +#a location is one of: +#- the location of the jar or folder that is the plugin or feature : /path/to/foo.jar or /path/to/foo +#- a directory that contains a /plugins or /features subdirectory +#- the location of a feature.xml, or for 2.1 style plugins, the plugin.xml or fragment.xml +#pluginPath= + +skipBase=true +eclipseURL=<url for eclipse download site> +eclipseBuildId=<Id of Eclipse build to get> +eclipseBaseURL=${eclipseURL}/eclipse-platform-${eclipseBuildId}-win32.zip + + +############# MAP FILE CONTROL ################ +# This section defines CVS tags to use when fetching the map files from the repository. +# If you want to fetch the map file from repository / location, change the getMapFiles target in the customTargets.xml + +skipMaps=true +mapsRepo=:pserver:anonymous@example.com/path/to/repo +mapsRoot=path/to/maps +mapsCheckoutTag=HEAD + +#tagMaps=true +mapsTagTag=v${buildId} + + +############ REPOSITORY CONTROL ############### +# This section defines properties parameterizing the repositories where plugins, fragments +# bundles and features are being obtained from. + +# The tags to use when fetching elements to build. +# By default thebuilder will use whatever is in the maps. +# This value takes the form of a comma separated list of repository identifier (like used in the map files) and the +# overriding value +# For example fetchTag=CVS=HEAD, SVN=v20050101 +# fetchTag=HEAD +skipFetch=true + + +############# P2 OPTIONS ############## +#p2.gathering = true +#p2.compress=true + +############# JAVA COMPILER OPTIONS ############## +# The location of the Java jars to compile against. Typically the rt.jar for your JDK/JRE +#bootclasspath=${java.home}/lib/rt.jar + +# specific JRE locations to compile against. These values are used to compile bundles specifying a +# Bundle-RequiredExecutionEnvironment. Uncomment and set values for environments that you support +#CDC-1.0/Foundation-1.0= /path/to/rt.jar +#CDC-1.1/Foundation-1.1= +#OSGi/Minimum-1.0= +#OSGi/Minimum-1.1= +#JRE-1.1= +#J2SE-1.2= +#J2SE-1.3= +#J2SE-1.4= +#J2SE-1.5= +#JavaSE-1.6= +#PersonalJava-1.1= +#PersonalJava-1.2= +#CDC-1.0/PersonalBasis-1.0= +#CDC-1.0/PersonalJava-1.0= +#CDC-1.1/PersonalBasis-1.1= +#CDC-1.1/PersonalJava-1.1= + +# Specify the output format of the compiler log when eclipse jdt is used +logExtension=.log + +# Whether or not to include debug info in the output jars +javacDebugInfo=true + +# Whether or not to fail the build if there are compiler errors +javacFailOnError=true + +# Enable or disable verbose mode of the compiler +javacVerbose=false + +# Extra arguments for the compiler. These are specific to the java compiler being used. +#compilerArg= + +# Default value for the version of the source code. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacSource in build.properties +javacSource=1.6 + +# Default value for the version of the byte code targeted. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacTarget in build.properties. +javacTarget=1.6 + + diff --git a/builder/customTargets.xml b/builder/customTargets.xml new file mode 100644 index 00000000..6a42e92a --- /dev/null +++ b/builder/customTargets.xml @@ -0,0 +1,187 @@ +<project name="Build specific targets and properties" default="noDefault"> + + <!-- ===================================================================== --> + <!-- Run a given ${target} on all elements being built --> + <!-- Add on <ant> task for each top level element being built. --> + <!-- ===================================================================== --> + <available property="allElementsFile" file="${builder}/allElements.xml" value="${builder}/allElements.xml"/> + <property name="allElementsFile" location="${eclipse.pdebuild.templates}/headless-build/allElements.xml"/> + + <import file="${allElementsFile}" /> + <target name="allElements"> + <ant antfile="${genericTargets}" target="${target}"> + <property name="type" value="${topLevelElementType}"/> + <property name="id" value="${topLevelElementId}"/> + </ant> + </target> + + <target + name="assemble.${topLevelElementId}.linux.gtk.x86"> + <ant antfile="{$assembleScriptName}" dir="${buildDirectory}"/> + </target> + <target + name="assemble.${topLevelElementId}.win32.win32.x86"> + <ant antfile="{$assembleScriptName}" dir="${buildDirectory}"/> + </target> + + <!-- ===================================================================== --> + <!-- ===================================================================== --> + <target name="getBaseComponents" depends="checkLocalBase" unless="skipBase"> + <get src="${eclipseBaseURL}" dest="${buildDirectory}/../temp-base.zip" /> + <unzip dest="${base}" overwrite="true" src="${buildDirectory}/../temp-base.zip" /> + </target> + + <target name="checkLocalBase"> + <available file="${base}" property="skipBase" /> + </target> + + <!-- ===================================================================== --> + <!-- Check out map files from correct repository --> + <!-- Replace values for mapsCheckoutTag as desired. --> + <!-- ===================================================================== --> + <target name="getMapFiles" depends="checkLocalMaps" unless="skipMaps"> + <property name="mapsCheckoutTag" value="HEAD" /> + <cvs cvsRoot="${mapsRepo}" package="${mapsRoot}" dest="${buildDirectory}/maps" tag="${mapsCheckoutTag}" /> + </target> + + <target name="checkLocalMaps"> + <available property="skipMaps" file="${buildDirectory}/maps" /> + </target> + + <target name="tagMapFiles" if="tagMaps"> + <cvs dest="${buildDirectory}/maps/${mapsRoot}" command="tag ${mapsTagTag}" /> + </target> + + <!-- ===================================================================== --> + + <target name="clean" unless="noclean"> + <antcall target="allElements"> + <param name="target" value="cleanElement" /> + </antcall> + </target> + + <target name="gatherLogs"> + <mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" /> + <antcall target="allElements"> + <param name="target" value="gatherLogs" /> + </antcall> + <unzip dest="${buildDirectory}/${buildLabel}/compilelogs" overwrite="true"> + <fileset dir="${buildDirectory}/features"> + <include name="**/*.log.zip" /> + </fileset> + </unzip> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do before setup --> + <!-- ===================================================================== --> + <target name="preSetup"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do after setup but before starting the build proper --> + <!-- ===================================================================== --> + <target name="postSetup"> + <antcall target="getBaseComponents" /> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do before fetching the build elements --> + <!-- ===================================================================== --> + <target name="preFetch"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do after fetching the build elements --> + <!-- ===================================================================== --> + <target name="postFetch"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do before the repositories are being processed --> + <!-- ===================================================================== --> + <target name="preProcessRepos"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do after the repositories have been processed --> + <!-- ===================================================================== --> + <target name="postProcessRepos"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do before generating the build scripts. --> + <!-- ===================================================================== --> + <target name="preGenerate"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do after generating the build scripts. --> + <!-- ===================================================================== --> + <target name="postGenerate"> + <antcall target="clean" /> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do before running the build.xmls for the elements being built. --> + <!-- ===================================================================== --> + <target name="preProcess"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do after running the build.xmls for the elements being built. --> + <!-- ===================================================================== --> + <target name="postProcess"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do before running assemble. --> + <!-- ===================================================================== --> + <target name="preAssemble"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do after running assemble. --> + <!-- ===================================================================== --> + <target name="postAssemble"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do before running package. --> + <!-- ===================================================================== --> + <target name="prePackage"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do after running package. --> + <!-- ===================================================================== --> + <target name="postPackage"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do after the build is done. --> + <!-- ===================================================================== --> + <target name="postBuild"> + <antcall target="gatherLogs" /> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do to test the build results --> + <!-- ===================================================================== --> + <target name="test"> + </target> + + <!-- ===================================================================== --> + <!-- Steps to do to publish the build results --> + <!-- ===================================================================== --> + <target name="publish"> + </target> + + <!-- ===================================================================== --> + <!-- Default target --> + <!-- ===================================================================== --> + <target name="noDefault"> + <echo message="You must specify a target when invoking this file" /> + </target> + +</project> diff --git a/org.tizen.nativeplatform.feature/.project b/org.tizen.nativeplatform.feature/.project new file mode 100644 index 00000000..4402609f --- /dev/null +++ b/org.tizen.nativeplatform.feature/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.tizen.nativeplatform.feature</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.pde.FeatureBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.FeatureNature</nature> + </natures> +</projectDescription> diff --git a/org.tizen.nativeplatform.feature/LICENSE-2.0.htm b/org.tizen.nativeplatform.feature/LICENSE-2.0.htm new file mode 100644 index 00000000..f7ca6564 --- /dev/null +++ b/org.tizen.nativeplatform.feature/LICENSE-2.0.htm @@ -0,0 +1,191 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> + <head> + <title>Apache License, Version 2.0</title> + + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" /> + + <link rel="stylesheet" type="text/css" media="screen" href="/css/style.css"> + <link rel="stylesheet" type="text/css" media="screen" href="/css/code.css"> + + <script type="text/javascript" src="/js/jquery.js"></script> + <script type="text/javascript" src="/js/apache_boot.js"></script> + + + + + <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. --> + </head> + + <body> + <div id="page" class="container_16"> + <div id="header" class="grid_8"> + <h1>The Apache Software Foundation</h1> + <h2>Apache License, Version 2.0</h2> + </div> + + <div class="clear"></div> + <div id="content" class="grid_16"><div class="section-content"><p>Apache License<br></br>Version 2.0, January 2004<br></br> +<a href="http://www.apache.org/licenses/">http://www.apache.org/licenses/</a> </p> +<p>TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION</p> +<p><strong><a name="definitions">1. Definitions</a></strong>.</p> +<p>"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document.</p> +<p>"Licensor" shall mean the copyright owner or entity authorized by the +copyright owner that is granting the License.</p> +<p>"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.</p> +<p>"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License.</p> +<p>"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, +and configuration files.</p> +<p>"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.</p> +<p>"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).</p> +<p>"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.</p> +<p>"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."</p> +<p>"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.</p> +<p><strong><a name="copyright">2. Grant of Copyright License</a></strong>. 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.</p> +<p><strong><a name="patent">3. Grant of Patent License</a></strong>. 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.</p> +<p><strong><a name="redistribution">4. Redistribution</a></strong>. 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:</p> +<ol> +<li> +<p>You must give any other recipients of the Work or Derivative Works a +copy of this License; and</p> +</li> +<li> +<p>You must cause any modified files to carry prominent notices stating +that You changed the files; and</p> +</li> +<li> +<p>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</p> +</li> +<li> +<p>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.</p> +</li> +</ol> +<p><strong><a name="contributions">5. Submission of Contributions</a></strong>. 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.</p> +<p><strong><a name="trademarks">6. Trademarks</a></strong>. 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.</p> +<p><strong><a name="no-warranty">7. Disclaimer of Warranty</a></strong>. 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.</p> +<p><strong><a name="no-liability">8. Limitation of Liability</a></strong>. 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.</p> +<p><strong><a name="additional">9. Accepting Warranty or Additional Liability</a></strong>. +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.</p> +<p>END OF TERMS AND CONDITIONS</p> + + <div class="clear"></div> + + </div> + <div id="copyright" class="container_16"> + <p>Copyright © 2011 The Apache Software Foundation, Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.<br/>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.</p> + </div> + </body> +</html> diff --git a/org.tizen.nativeplatform.feature/build.properties b/org.tizen.nativeplatform.feature/build.properties new file mode 100644 index 00000000..ab46e7f8 --- /dev/null +++ b/org.tizen.nativeplatform.feature/build.properties @@ -0,0 +1,5 @@ +bin.includes = feature.xml,\ + LICENSE-2.0.htm,\ + license.html +root = rootfiles +
\ No newline at end of file diff --git a/org.tizen.nativeplatform.feature/feature.xml b/org.tizen.nativeplatform.feature/feature.xml new file mode 100644 index 00000000..ef8f9fcc --- /dev/null +++ b/org.tizen.nativeplatform.feature/feature.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<feature + id="org.tizen.nativeplatform.feature" + label="Tizen Native Platform" + version="0.20.0.qualifier" + provider-name="Samsung" + plugin="org.tizen.base.platform" + license-feature="org.tizen.base.feature"> + + <description> + Tizen SDK's Native platform plugin + </description> + + <copyright> + Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + </copyright> + + <license url="http://www.example.com/license"> + [Enter License Description here.] + </license> + + <plugin + id="org.tizen.nativeplatform" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + +</feature> diff --git a/org.tizen.nativeplatform.feature/license.html b/org.tizen.nativeplatform.feature/license.html new file mode 100644 index 00000000..03d90e24 --- /dev/null +++ b/org.tizen.nativeplatform.feature/license.html @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<title>Tizen SOFTWARE DEVELOPMENT KIT ("SDK") LICENSE AGREEMENT</title> +</head> + +<body lang="EN-US"> +<p align="center">Tizen SDK</p><br /><br /> + +Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components. All open source software portions (“Open Source Software”) are licensed under the open source licenses that accompany such Open Source Software.<br /><br /> + +The licenses governing the Open Source Software are available at: <a href="http://developer.tizen.org/download/tizen_sdk_opensource_license.html">http://developer.tizen.org/download/tizen_sdk_opensource_license.html</a><br /><br /> + +Except for the Open Source Software contained in Tizen SDK, all other software portions contained in Tizen SDK are governed by the terms and conditions of the Tizen Software Development Kit License Agreement, available at: <a href="http://developer.tizen.org/download/samsung_sdk_license.html">http://developer.tizen.org/download/samsung_sdk_license.html</a><br /><br /> + +You may access and download Tizen SDK Open Source Software at: <a href="http://developer.tizen.org/download/tizenopensdk.tar.gz">http://developer.tizen.org/download/tizenopensdk.tar.gz</a><br /><br /> + +BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE OPEN SOURCE SOFTWARE LICENSE TERMS AND THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT. IF YOU DO NOT AGREE WITH THE OPEN SOURCE SOFTWARE LICENSE TERMS OR THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT, YOU MAY NOT DOWNLOAD OR USE TIZEN SDK.<br /><br /> +</body> +</html> diff --git a/org.tizen.nativeplatform.feature/rootfiles/snippets/Comments/File Comment.xml b/org.tizen.nativeplatform.feature/rootfiles/snippets/Comments/File Comment.xml new file mode 100644 index 00000000..b64316f4 --- /dev/null +++ b/org.tizen.nativeplatform.feature/rootfiles/snippets/Comments/File Comment.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<snippet filetemplate="false" extension="cfm"> +<name>File Comment</name> +<help>describe file information</help> +<starttext><![CDATA[/** + * @file $${CURRENTFILE} + * @brief $${file information} + * + * @author $${name} ($${e-mail}) + * @version $${Revision} + */]]></starttext> +<endtext><![CDATA[]]></endtext> +</snippet>
\ No newline at end of file diff --git a/org.tizen.nativeplatform.feature/rootfiles/snippets/Comments/Project Comment.xml b/org.tizen.nativeplatform.feature/rootfiles/snippets/Comments/Project Comment.xml new file mode 100644 index 00000000..c0175f12 --- /dev/null +++ b/org.tizen.nativeplatform.feature/rootfiles/snippets/Comments/Project Comment.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<snippet filetemplate="false" extension="cfm"> +<name>Project Comment</name> +<help>describe project information</help> +<starttext><![CDATA[/* + * $${project name} + * + * $${lisence information} + * + * $${supplementary information} + */]]></starttext> +<endtext><![CDATA[]]></endtext> +</snippet>
\ No newline at end of file diff --git a/org.tizen.nativeplatform.feature/rootfiles/snippets/keyCombos.properties b/org.tizen.nativeplatform.feature/rootfiles/snippets/keyCombos.properties new file mode 100644 index 00000000..212a7f8a --- /dev/null +++ b/org.tizen.nativeplatform.feature/rootfiles/snippets/keyCombos.properties @@ -0,0 +1,10 @@ +#These key combos are used by the cfeclipse plugin. +#Tue Jul 26 16:12:05 KST 2011 +fc=/Comments/File Comment.xml +lim=/Log/Log INFO message.xml +clm=/Localization/Create a localized message.xml +lwm=/Log/Log WARNING message.xml +lem=/Log/Log ERROR message.xml +lvm=/Log/Log VERBOSE message.xml +pc=/Comments/Project Comment.xml +ldm=/Log/Log DEBUG message.xml diff --git a/org.tizen.nativeplatform/.classpath b/org.tizen.nativeplatform/.classpath new file mode 100644 index 00000000..ad32c83a --- /dev/null +++ b/org.tizen.nativeplatform/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/org.tizen.nativeplatform/.project b/org.tizen.nativeplatform/.project new file mode 100644 index 00000000..7ab51274 --- /dev/null +++ b/org.tizen.nativeplatform/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.tizen.nativeplatform</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> diff --git a/org.tizen.nativeplatform/.settings/org.eclipse.jdt.core.prefs b/org.tizen.nativeplatform/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..26a0e0bf --- /dev/null +++ b/org.tizen.nativeplatform/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Wed Jul 20 14:43:03 KST 2011 +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.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.tizen.nativeplatform/META-INF/MANIFEST.MF b/org.tizen.nativeplatform/META-INF/MANIFEST.MF new file mode 100644 index 00000000..a6686e15 --- /dev/null +++ b/org.tizen.nativeplatform/META-INF/MANIFEST.MF @@ -0,0 +1,38 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Native Inhouse +Bundle-SymbolicName: org.tizen.nativeplatform;singleton:=true +Bundle-Version: 1.0.0 +Bundle-Activator: org.tizen.nativeplatform.Activator +Bundle-Vendor: Samsung +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.cdt.managedbuilder.core;bundle-version="7.0.2", + org.eclipse.core.resources;bundle-version="3.6.1", + org.eclipse.cdt.core;bundle-version="5.2.1", + org.eclipse.cdt.managedbuilder.ui;bundle-version="7.0.0", + org.tizen.common;bundle-version="1.3.20", + org.eclipse.ui.console;bundle-version="3.5.0", + org.eclipse.cdt.ui;bundle-version="5.2.2", + org.eclipse.debug.ui, + org.tizen.common.connection, + org.tizen.nativecommon;bundle-version="1.0.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy +Import-Package: org.eclipse.cdt.debug.core, + org.eclipse.cdt.debug.core.cdi, + org.eclipse.cdt.debug.core.cdi.model, + org.eclipse.cdt.debug.internal.ui.launch, + org.eclipse.cdt.debug.mi.core, + org.eclipse.cdt.debug.ui, + org.eclipse.cdt.launch, + org.eclipse.cdt.launch.internal.ui, + org.eclipse.cdt.launch.ui, + org.eclipse.core.expressions, + org.eclipse.debug.core, + org.eclipse.debug.core.model, + org.eclipse.debug.ui, + org.eclipse.debug.ui.sourcelookup, + org.eclipse.ui, + org.eclipse.ui.dialogs, + org.tizen.common.connection diff --git a/org.tizen.nativeplatform/about.html b/org.tizen.nativeplatform/about.html new file mode 100644 index 00000000..20a744ae --- /dev/null +++ b/org.tizen.nativeplatform/about.html @@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>May, 2011</p> +<h3>Tizen SDK</h3> + +<p><a href="https://developer.tizen.org/" target="_blank">Tizen SDK</a> +is a set of Eclipse plug-ins that helps programmers to develop applications for +the mobile platform.</p> + +<h3>License</h3> + +<p>See <a href="about_files/LICENSE-2.0.htm">Apache License, Version 2.0</a>.</p> + +<h3>Note</h3> +<p>jericho-html-3.1.jar, xpp3-1.1.4.jar, xstream-1.3.1.jar are under the Apache license Version 2.0. You can find a copy of the Apache License at <a href="http://www.apache.org/licenses/">http://www.apache.org/licenses/</a></p> + +</body> +</html>
\ No newline at end of file diff --git a/org.tizen.nativeplatform/about_files/LICENSE-2.0.htm b/org.tizen.nativeplatform/about_files/LICENSE-2.0.htm new file mode 100644 index 00000000..f7ca6564 --- /dev/null +++ b/org.tizen.nativeplatform/about_files/LICENSE-2.0.htm @@ -0,0 +1,191 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> + <head> + <title>Apache License, Version 2.0</title> + + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" /> + + <link rel="stylesheet" type="text/css" media="screen" href="/css/style.css"> + <link rel="stylesheet" type="text/css" media="screen" href="/css/code.css"> + + <script type="text/javascript" src="/js/jquery.js"></script> + <script type="text/javascript" src="/js/apache_boot.js"></script> + + + + + <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. --> + </head> + + <body> + <div id="page" class="container_16"> + <div id="header" class="grid_8"> + <h1>The Apache Software Foundation</h1> + <h2>Apache License, Version 2.0</h2> + </div> + + <div class="clear"></div> + <div id="content" class="grid_16"><div class="section-content"><p>Apache License<br></br>Version 2.0, January 2004<br></br> +<a href="http://www.apache.org/licenses/">http://www.apache.org/licenses/</a> </p> +<p>TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION</p> +<p><strong><a name="definitions">1. Definitions</a></strong>.</p> +<p>"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document.</p> +<p>"Licensor" shall mean the copyright owner or entity authorized by the +copyright owner that is granting the License.</p> +<p>"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.</p> +<p>"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License.</p> +<p>"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, +and configuration files.</p> +<p>"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.</p> +<p>"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).</p> +<p>"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.</p> +<p>"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."</p> +<p>"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.</p> +<p><strong><a name="copyright">2. Grant of Copyright License</a></strong>. 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.</p> +<p><strong><a name="patent">3. Grant of Patent License</a></strong>. 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.</p> +<p><strong><a name="redistribution">4. Redistribution</a></strong>. 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:</p> +<ol> +<li> +<p>You must give any other recipients of the Work or Derivative Works a +copy of this License; and</p> +</li> +<li> +<p>You must cause any modified files to carry prominent notices stating +that You changed the files; and</p> +</li> +<li> +<p>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</p> +</li> +<li> +<p>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.</p> +</li> +</ol> +<p><strong><a name="contributions">5. Submission of Contributions</a></strong>. 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.</p> +<p><strong><a name="trademarks">6. Trademarks</a></strong>. 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.</p> +<p><strong><a name="no-warranty">7. Disclaimer of Warranty</a></strong>. 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.</p> +<p><strong><a name="no-liability">8. Limitation of Liability</a></strong>. 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.</p> +<p><strong><a name="additional">9. Accepting Warranty or Additional Liability</a></strong>. +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.</p> +<p>END OF TERMS AND CONDITIONS</p> + + <div class="clear"></div> + + </div> + <div id="copyright" class="container_16"> + <p>Copyright © 2011 The Apache Software Foundation, Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.<br/>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.</p> + </div> + </body> +</html> diff --git a/org.tizen.nativeplatform/build.properties b/org.tizen.nativeplatform/build.properties new file mode 100644 index 00000000..3b874924 --- /dev/null +++ b/org.tizen.nativeplatform/build.properties @@ -0,0 +1,10 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + icons/,\ + templates/,\ + plugin.properties,\ + about.html,\ + about_files/ diff --git a/org.tizen.nativeplatform/icons/Tizen_Custom_Debian_ConfigurationType_Image.gif b/org.tizen.nativeplatform/icons/Tizen_Custom_Debian_ConfigurationType_Image.gif Binary files differnew file mode 100644 index 00000000..f198283d --- /dev/null +++ b/org.tizen.nativeplatform/icons/Tizen_Custom_Debian_ConfigurationType_Image.gif diff --git a/org.tizen.nativeplatform/icons/Tizen_Custom_Debian_ConfigurationType_Image_Attach.gif b/org.tizen.nativeplatform/icons/Tizen_Custom_Debian_ConfigurationType_Image_Attach.gif Binary files differnew file mode 100644 index 00000000..f198283d --- /dev/null +++ b/org.tizen.nativeplatform/icons/Tizen_Custom_Debian_ConfigurationType_Image_Attach.gif diff --git a/org.tizen.nativeplatform/icons/Tizen_Custom_Debian_ConfigurationType_Image_Core.gif b/org.tizen.nativeplatform/icons/Tizen_Custom_Debian_ConfigurationType_Image_Core.gif Binary files differnew file mode 100644 index 00000000..f198283d --- /dev/null +++ b/org.tizen.nativeplatform/icons/Tizen_Custom_Debian_ConfigurationType_Image_Core.gif diff --git a/org.tizen.nativeplatform/icons/Tizen_Native_Application_ConfigurationType_Image.gif b/org.tizen.nativeplatform/icons/Tizen_Native_Application_ConfigurationType_Image.gif Binary files differnew file mode 100644 index 00000000..f198283d --- /dev/null +++ b/org.tizen.nativeplatform/icons/Tizen_Native_Application_ConfigurationType_Image.gif diff --git a/org.tizen.nativeplatform/icons/Tizen_Native_Application_ConfigurationType_Image_Attach.gif b/org.tizen.nativeplatform/icons/Tizen_Native_Application_ConfigurationType_Image_Attach.gif Binary files differnew file mode 100644 index 00000000..f198283d --- /dev/null +++ b/org.tizen.nativeplatform/icons/Tizen_Native_Application_ConfigurationType_Image_Attach.gif diff --git a/org.tizen.nativeplatform/icons/Tizen_Native_Application_ConfigurationType_Image_Core.gif b/org.tizen.nativeplatform/icons/Tizen_Native_Application_ConfigurationType_Image_Core.gif Binary files differnew file mode 100644 index 00000000..f198283d --- /dev/null +++ b/org.tizen.nativeplatform/icons/Tizen_Native_Application_ConfigurationType_Image_Core.gif diff --git a/org.tizen.nativeplatform/icons/af.png b/org.tizen.nativeplatform/icons/af.png Binary files differnew file mode 100644 index 00000000..bcd0ce8a --- /dev/null +++ b/org.tizen.nativeplatform/icons/af.png diff --git a/org.tizen.nativeplatform/icons/branding/perspective.png b/org.tizen.nativeplatform/icons/branding/perspective.png Binary files differnew file mode 100644 index 00000000..c40edcc5 --- /dev/null +++ b/org.tizen.nativeplatform/icons/branding/perspective.png diff --git a/org.tizen.nativeplatform/icons/build_configs.gif b/org.tizen.nativeplatform/icons/build_configs.gif Binary files differnew file mode 100644 index 00000000..c984fba7 --- /dev/null +++ b/org.tizen.nativeplatform/icons/build_configs.gif diff --git a/org.tizen.nativeplatform/icons/c_app.gif b/org.tizen.nativeplatform/icons/c_app.gif Binary files differnew file mode 100644 index 00000000..504ef509 --- /dev/null +++ b/org.tizen.nativeplatform/icons/c_app.gif diff --git a/org.tizen.nativeplatform/icons/c_file_obj.gif b/org.tizen.nativeplatform/icons/c_file_obj.gif Binary files differnew file mode 100644 index 00000000..bd603cff --- /dev/null +++ b/org.tizen.nativeplatform/icons/c_file_obj.gif diff --git a/org.tizen.nativeplatform/icons/device.gif b/org.tizen.nativeplatform/icons/device.gif Binary files differnew file mode 100644 index 00000000..abedbb00 --- /dev/null +++ b/org.tizen.nativeplatform/icons/device.gif diff --git a/org.tizen.nativeplatform/icons/device_view.gif b/org.tizen.nativeplatform/icons/device_view.gif Binary files differnew file mode 100644 index 00000000..111e3f9e --- /dev/null +++ b/org.tizen.nativeplatform/icons/device_view.gif diff --git a/org.tizen.nativeplatform/icons/directory.gif b/org.tizen.nativeplatform/icons/directory.gif Binary files differnew file mode 100644 index 00000000..5e0cb945 --- /dev/null +++ b/org.tizen.nativeplatform/icons/directory.gif diff --git a/org.tizen.nativeplatform/icons/directory_link.gif b/org.tizen.nativeplatform/icons/directory_link.gif Binary files differnew file mode 100644 index 00000000..ac837477 --- /dev/null +++ b/org.tizen.nativeplatform/icons/directory_link.gif diff --git a/org.tizen.nativeplatform/icons/duchain.gif b/org.tizen.nativeplatform/icons/duchain.gif Binary files differnew file mode 100644 index 00000000..b441cfd8 --- /dev/null +++ b/org.tizen.nativeplatform/icons/duchain.gif diff --git a/org.tizen.nativeplatform/icons/editors/debug.gif b/org.tizen.nativeplatform/icons/editors/debug.gif Binary files differnew file mode 100644 index 00000000..d90a29fe --- /dev/null +++ b/org.tizen.nativeplatform/icons/editors/debug.gif diff --git a/org.tizen.nativeplatform/icons/editors/help.gif b/org.tizen.nativeplatform/icons/editors/help.gif Binary files differnew file mode 100644 index 00000000..ae2c4c0a --- /dev/null +++ b/org.tizen.nativeplatform/icons/editors/help.gif diff --git a/org.tizen.nativeplatform/icons/editors/refresh.gif b/org.tizen.nativeplatform/icons/editors/refresh.gif Binary files differnew file mode 100644 index 00000000..e3831471 --- /dev/null +++ b/org.tizen.nativeplatform/icons/editors/refresh.gif diff --git a/org.tizen.nativeplatform/icons/editors/run.gif b/org.tizen.nativeplatform/icons/editors/run.gif Binary files differnew file mode 100644 index 00000000..57f41022 --- /dev/null +++ b/org.tizen.nativeplatform/icons/editors/run.gif diff --git a/org.tizen.nativeplatform/icons/emulator.gif b/org.tizen.nativeplatform/icons/emulator.gif Binary files differnew file mode 100644 index 00000000..7559ba16 --- /dev/null +++ b/org.tizen.nativeplatform/icons/emulator.gif diff --git a/org.tizen.nativeplatform/icons/external_browser.gif b/org.tizen.nativeplatform/icons/external_browser.gif Binary files differnew file mode 100644 index 00000000..71c98731 --- /dev/null +++ b/org.tizen.nativeplatform/icons/external_browser.gif diff --git a/org.tizen.nativeplatform/icons/file.gif b/org.tizen.nativeplatform/icons/file.gif Binary files differnew file mode 100644 index 00000000..b84737e9 --- /dev/null +++ b/org.tizen.nativeplatform/icons/file.gif diff --git a/org.tizen.nativeplatform/icons/file_link.gif b/org.tizen.nativeplatform/icons/file_link.gif Binary files differnew file mode 100644 index 00000000..e77773d7 --- /dev/null +++ b/org.tizen.nativeplatform/icons/file_link.gif diff --git a/org.tizen.nativeplatform/icons/folder_search.gif b/org.tizen.nativeplatform/icons/folder_search.gif Binary files differnew file mode 100644 index 00000000..0a03c7b4 --- /dev/null +++ b/org.tizen.nativeplatform/icons/folder_search.gif diff --git a/org.tizen.nativeplatform/icons/form_banner.gif b/org.tizen.nativeplatform/icons/form_banner.gif Binary files differnew file mode 100644 index 00000000..aebc0b2a --- /dev/null +++ b/org.tizen.nativeplatform/icons/form_banner.gif diff --git a/org.tizen.nativeplatform/icons/icon_application.png b/org.tizen.nativeplatform/icons/icon_application.png Binary files differnew file mode 100644 index 00000000..ef74fd1f --- /dev/null +++ b/org.tizen.nativeplatform/icons/icon_application.png diff --git a/org.tizen.nativeplatform/icons/import_wizard.png b/org.tizen.nativeplatform/icons/import_wizard.png Binary files differnew file mode 100644 index 00000000..bc567601 --- /dev/null +++ b/org.tizen.nativeplatform/icons/import_wizard.png diff --git a/org.tizen.nativeplatform/icons/large_image.gif b/org.tizen.nativeplatform/icons/large_image.gif Binary files differnew file mode 100644 index 00000000..c5c94ee9 --- /dev/null +++ b/org.tizen.nativeplatform/icons/large_image.gif diff --git a/org.tizen.nativeplatform/icons/list-delete.gif b/org.tizen.nativeplatform/icons/list-delete.gif Binary files differnew file mode 100644 index 00000000..af59a0b1 --- /dev/null +++ b/org.tizen.nativeplatform/icons/list-delete.gif diff --git a/org.tizen.nativeplatform/icons/localization/Error.png b/org.tizen.nativeplatform/icons/localization/Error.png Binary files differnew file mode 100644 index 00000000..f7df6912 --- /dev/null +++ b/org.tizen.nativeplatform/icons/localization/Error.png diff --git a/org.tizen.nativeplatform/icons/localization/POFileEditor_import.gif b/org.tizen.nativeplatform/icons/localization/POFileEditor_import.gif Binary files differnew file mode 100644 index 00000000..37dc14e5 --- /dev/null +++ b/org.tizen.nativeplatform/icons/localization/POFileEditor_import.gif diff --git a/org.tizen.nativeplatform/icons/newc_app.gif b/org.tizen.nativeplatform/icons/newc_app.gif Binary files differnew file mode 100644 index 00000000..5d2ba0f0 --- /dev/null +++ b/org.tizen.nativeplatform/icons/newc_app.gif diff --git a/org.tizen.nativeplatform/icons/package.png b/org.tizen.nativeplatform/icons/package.png Binary files differnew file mode 100644 index 00000000..1d37a5fe --- /dev/null +++ b/org.tizen.nativeplatform/icons/package.png diff --git a/org.tizen.nativeplatform/icons/package_installer.gif b/org.tizen.nativeplatform/icons/package_installer.gif Binary files differnew file mode 100644 index 00000000..f08a7f2d --- /dev/null +++ b/org.tizen.nativeplatform/icons/package_installer.gif diff --git a/org.tizen.nativeplatform/icons/packagelist_to_table.gif b/org.tizen.nativeplatform/icons/packagelist_to_table.gif Binary files differnew file mode 100644 index 00000000..9a92931d --- /dev/null +++ b/org.tizen.nativeplatform/icons/packagelist_to_table.gif diff --git a/org.tizen.nativeplatform/icons/remove.png b/org.tizen.nativeplatform/icons/remove.png Binary files differnew file mode 100644 index 00000000..fd972e9b --- /dev/null +++ b/org.tizen.nativeplatform/icons/remove.png diff --git a/org.tizen.nativeplatform/icons/sample.gif b/org.tizen.nativeplatform/icons/sample.gif Binary files differnew file mode 100644 index 00000000..34fb3c9d --- /dev/null +++ b/org.tizen.nativeplatform/icons/sample.gif diff --git a/org.tizen.nativeplatform/icons/spreadsheet.gif b/org.tizen.nativeplatform/icons/spreadsheet.gif Binary files differnew file mode 100644 index 00000000..33212b20 --- /dev/null +++ b/org.tizen.nativeplatform/icons/spreadsheet.gif diff --git a/org.tizen.nativeplatform/icons/th_horizontal.gif b/org.tizen.nativeplatform/icons/th_horizontal.gif Binary files differnew file mode 100644 index 00000000..f4c14a4e --- /dev/null +++ b/org.tizen.nativeplatform/icons/th_horizontal.gif diff --git a/org.tizen.nativeplatform/plugin.properties b/org.tizen.nativeplatform/plugin.properties new file mode 100644 index 00000000..a1f5f1f6 --- /dev/null +++ b/org.tizen.nativeplatform/plugin.properties @@ -0,0 +1,7 @@ +# Tizen Presentation +SLPPresentation.themelabel = Tizen Presentation +SLPPresentation.themedescription = Colors and fonts used by Tizen +SLPPresentation.editorlabel = Editor +SLPPresentation.editordescription = This font is used by Tizen's editors +SLPPresentation.fontlabel = Tizen C/C++ Editor Text Font +SLPPresentation.fontdescription = The C/C++ editor text font is used by C/C++ editors. diff --git a/org.tizen.nativeplatform/plugin.xml b/org.tizen.nativeplatform/plugin.xml new file mode 100644 index 00000000..643c46c4 --- /dev/null +++ b/org.tizen.nativeplatform/plugin.xml @@ -0,0 +1,702 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plugin> +<!-- build start --> + <extension + point="org.eclipse.cdt.managedbuilder.core.buildDefinitions"> + <toolChain + configurationEnvironmentSupplier="org.tizen.nativeplatform.build.PlatformConfigurationEnvVarSupplier" + id="com.samsung.slp.toolchain.custom.debian.base" + isAbstract="true" + osList="linux,win32" + superClass="com.samsung.slp.toolchain.gnu.base.common"> + <builder + autoBuildTarget="build" + buildfileGenerator="org.tizen.nativeplatform.build.PlatformMakeGenerator" + cleanBuildTarget="clean" + command="sbi-make" + commandLauncher="org.tizen.nativecommon.build.CommonBuildCommandLauncher" + id="com.samsung.slp.builder.custom.debian" + incrementalBuildTarget="build" + name="SLP Custom Debian builder"> + </builder> + </toolChain> + <toolChain + id="com.samsung.slp.toolchain.custom.debian" + isAbstract="false" + name="GCC-4.5(SBOX2)" + osList="linux,win32" + superClass="com.samsung.slp.toolchain.custom.debian.base"> + <supportedProperties> + <property + id="org.eclipse.cdt.build.core.buildArtefactType"> + <value + id="com.samsung.slp.buildArtefactType.custom.debian"> + </value> + </property> + </supportedProperties> + </toolChain> + <projectType + buildArtefactType="com.samsung.slp.buildArtefactType.custom.debian" + id="com.samsung.slp.project.custom.debian" + isAbstract="true" + isTest="false"> + <configuration + cleanCommand="rm -f" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.config.custom.debian.emulator" + name="Tizen-Emulator"> + <toolChain + id="com.samsung.slp.toolchain.custom.debian.emulator" + superClass="com.samsung.slp.toolchain.custom.debian"> + </toolChain> + </configuration> + <configuration + cleanCommand="rm -f" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.config.custom.debian.device" + name="Tizen-Device"> + <toolChain + id="com.samsung.slp.toolchain.custom.debian.device" + superClass="com.samsung.slp.toolchain.custom.debian"> + </toolChain> + </configuration> + </projectType> + </extension> + + <extension + id="com.samsung.slp.build.info.custom.debian" + point="org.eclipse.cdt.managedbuilder.core.buildProperties"> + <propertyValue + id="com.samsung.slp.buildArtefactType.custom.debian" + name="SLP Custom Debian Package" + property="org.eclipse.cdt.build.core.buildArtefactType"> + </propertyValue> + </extension> + + <extension + point="org.eclipse.cdt.core.templates"> + <template + filterPattern=".*" + id="org.tizen.nativeapp.templates.custom.debian.EmptyProject" + location="templates/InhouseFrameworkPackages/EmptyProject/template.xml" + projectType="com.samsung.slp.nativeide.buildArtefactType.cdeb"> + </template> + <template + filterPattern=".*" + id="org.tizen.nativeapp.templates.custom.debian.HelloWorldProject" + location="templates/InhouseFrameworkPackages/HelloWorldProject/template.xml" + projectType="com.samsung.slp.nativeide.buildArtefactType.cdeb"> + </template> + <template + filterPattern=".*" + id="org.tizen.nativeapp.templates.custom.debian.EmptyProjectOld" + location="templates/CustomDebianPackages/EmptyProject/template.xml" + projectType="com.samsung.slp.buildArtefactType.custom.debian"> + </template> + <template + filterPattern=".*" + id="org.tizen.nativeapp.templates.custom.debian.HelloWorldProjectOld" + location="templates/CustomDebianPackages/HelloWorldProject/template.xml" + projectType="com.samsung.slp.buildArtefactType.custom.debian"> + </template> + </extension> + + <extension + point="org.eclipse.cdt.core.templateAssociations"> + <template + id="org.tizen.nativeapp.templates.custom.debian.HelloWorldProjectOld"> + <toolChain + id="com.samsung.slp.toolchain.custom.debian"> + </toolChain> + </template> + </extension> + + <extension + point="org.eclipse.ui.commands"> + <command + name="Build System" + id="org.tizen.nativeplatform.pkgInstall.commandid.rootstrapmgr"> + </command> + </extension> + + <extension + point="org.eclipse.ui.handlers"> + <handler + commandId="org.tizen.nativeplatform.pkgInstall.commandid.rootstrapmgr" + class="org.tizen.nativeplatform.pkgInstall.PackageManagerRootstrapHandler"> + </handler> + </extension> +<!-- + <extension + point="org.eclipse.cdt.managedbuilder.core.buildDefinitions"> + <toolChain + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.slp.base" + isAbstract="false" + name="[SBOX2] GCC-4.5" + osList="linux" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gnu.slp.base"> + </toolChain> + + <projectType + buildArtefactType="com.samsung.slp.nativeide.buildArtefactType.app" + id="com.samsung.slp.nativeide.target.sbi.gcc45sbox2.app" + isAbstract="true" + isTest="false"> + <configuration + buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" + cleanCommand="rm -rf" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.nativeide.config.sbi.gcc45sbox2.app.debug.emulator" + name="Debug-Tizen-Emulator"> + <toolChain + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.app.debug.emulator" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.slp.base"> + </toolChain> + </configuration> + <configuration + buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" + cleanCommand="rm -rf" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.nativeide.config.sbi.gcc45sbox2.app.debug.device" + name="Debug-Tizen-Device"> + <toolChain + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.app.debug.device" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.slp.base"> + </toolChain> + </configuration> + <configuration + buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" + cleanCommand="rm -rf" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.nativeide.config.sbi.gcc45sbox2.app.release" + name="Release"> + <toolChain + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.app.release" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.slp.base"> + </toolChain> + </configuration> + </projectType> + + <projectType + buildArtefactType="com.samsung.slp.nativeide.buildArtefactType.sharedLib" + id="com.samsung.slp.nativeide.target.sbi.gcc45sbox2.so" + isAbstract="true" + isTest="false"> + <configuration + buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" + cleanCommand="rm -f" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.nativeide.config.sbi.gcc45sbox2.so.debug.emulator" + name="Debug-Tizen-Emulator"> + <toolChain + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.so.debug.emulator" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.slp.base"> + </toolChain> + </configuration> + <configuration + buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" + cleanCommand="rm -f" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.nativeide.config.sbi.gcc45sbox2.so.debug.device" + name="Debug-Tizen-Device"> + <toolChain + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.so.debug.device" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.slp.base"> + </toolChain> + </configuration> + <configuration + buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" + cleanCommand="rm -f" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.nativeide.config.sbi.gcc45sbox2.so.release" + name="Release"> + <toolChain + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.so.release" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.slp.base"> + </toolChain> + </configuration> + </projectType> + + <projectType + buildArtefactType="com.samsung.slp.nativeide.buildArtefactType.staticLib" + id="com.samsung.slp.nativeide.target.sbi.gcc45sbox2.lib" + isAbstract="true" + isTest="false"> + <configuration + buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" + cleanCommand="rm -f" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.nativeide.config.sbi.gcc45sbox2.lib.debug.emulator" + name="Debug-Tizen-Emulator"> + <toolChain + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.lib.debug.emulator" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.slp.base"> + </toolChain> + </configuration> + <configuration + buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" + cleanCommand="rm -f" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.nativeide.config.sbi.gcc45sbox2.lib.debug.device" + name="Debug-Tizen-Device"> + <toolChain + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.lib.debug.device" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.slp.base"> + </toolChain> + </configuration> + <configuration + buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" + cleanCommand="rm -f" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.nativeide.config.sbi.gcc45sbox2.lib.release" + name="Release"> + <toolChain + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.lib.release" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.slp.base"> + </toolChain> + </configuration> + </projectType> + </extension> +--> + + <extension + point="org.eclipse.cdt.managedbuilder.core.buildDefinitions"> + <toolChain + configurationEnvironmentSupplier="org.tizen.nativeplatform.build.PlatformConfigurationEnvVarSupplier" + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.cdeb.base" + isAbstract="false" + name="[SBOX2] GCC-4.5 Custom Debian" + osList="linux" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gnu.base"> + <builder + autoBuildTarget="build" + buildfileGenerator="org.tizen.nativeplatform.build.PlatformMakeGenerator" + cleanBuildTarget="clean" + command="sbi-make" + commandLauncher="org.tizen.nativecommon.build.CommonBuildCommandLauncher" + id="org.tizen.nativeapp.target.sbi.gcc45sbox2.builder.cdeb" + incrementalBuildTarget="build" + name="Tizen Custom Debian Builder"> + </builder> + <tool + id="com.samsung.slp.nativeide.tool.sbi.gnu.archiver.cdeb.base" + superClass="com.samsung.slp.nativeide.tool.sbi.gnu.archiver.base"> + <enablement + type="ALL"> + <false/> + </enablement> + </tool> + <tool + id="com.samsung.slp.nativeide.tool.sbi.gnu.cpp.compiler.cdeb.base" + superClass="com.samsung.slp.nativeide.tool.sbi.gnu.cpp.compiler.base"> + <enablement + type="ALL"> + <false/> + </enablement> + </tool> + <tool + id="com.samsung.slp.nativeide.tool.sbi.gnu.c.compiler.cdeb.base" + superClass="com.samsung.slp.nativeide.tool.sbi.gnu.c.compiler.base"> + <enablement + type="ALL"> + <false/> + </enablement> + </tool> + <tool + id="com.samsung.slp.nativeide.tool.sbi.gnu.c.linker.cdeb.base" + superClass="com.samsung.slp.nativeide.tool.sbi.gnu.c.linker.base"> + <enablement + type="ALL"> + <false/> + </enablement> + </tool> + <tool + id="com.samsung.slp.nativeide.tool.sbi.gnu.cpp.linker.cdeb.base" + superClass="com.samsung.slp.nativeide.tool.sbi.gnu.cpp.linker.base"> + <enablement + type="ALL"> + <false/> + </enablement> + </tool> + <tool + id="com.samsung.tizen.nativeapp.tool.sbi.gnu.assembler.cdeb.base" + superClass="com.samsung.tizen.nativeapp.tool.sbi.gnu.assembler.base"> + <enablement + type="ALL"> + <false/> + </enablement> + </tool> + </toolChain> + + <projectType + buildArtefactType="com.samsung.slp.nativeide.buildArtefactType.cdeb" + id="com.samsung.slp.nativebuild.target.sbi.gcc45sbox2.cdeb" + isAbstract="false" + isTest="false"> + <configuration + cleanCommand="rm -f" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.nativeide.config.sbi.gcc45sbox2.cdeb.emulator" + name="Tizen-Emulator"> + <toolChain + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.cdeb.emulator" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.cdeb.base"> + </toolChain> + </configuration> + <configuration + cleanCommand="rm -f" + errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" + id="com.samsung.slp.nativeide.config.sbi.gcc45sbox2.cdeb.device" + name="Tizen-Device"> + <toolChain + id="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.cdeb.device" + superClass="com.samsung.slp.nativeide.toolchain.sbi.gcc45sbox2.cdeb.base"> + </toolChain> + </configuration> + </projectType> + </extension> + + <extension + point="org.eclipse.cdt.managedbuilder.core.buildProperties"> + <propertyValue + id="com.samsung.slp.nativeide.buildArtefactType.cdeb" + name="Tizen Custom Debian Project" + property="org.eclipse.cdt.build.core.buildArtefactType"> + </propertyValue> + </extension> + + <extension + point="org.eclipse.cdt.managedbuilder.core.projectConverter"> + <converter + class="org.tizen.nativeplatform.build.PlatformProjectConverter" + fromId="com.samsung.slp.project.custom.debian" + id="com.samsung.tizen.nativeapp.converter.cdeb" + mbsVersion="4.0.0" + name="Upgrade Tizen Custom Debian Project, GCC-4.5(SBOX2)" + toId="com.samsung.slp.nativebuild.target.sbi.gcc45sbox2.cdeb"> + </converter> + </extension> +<!-- build end --> + +<!-- wizard start --> + <extension + point="org.eclipse.ui.newWizards"> + <wizard + category="org.tizen.nativeapp.newCategory" + class="org.tizen.nativeplatform.wizards.TizenDebianProjectWizard" + finalPerspective="org.tizen.nativeapp.perspective" + icon="icons/newc_app.gif" + id="org.tizen.nativeapp.newCategory.customWizard" + name="Tizen Custom Debian Project" + preferredPerspectives="org.tizen.nativeapp.perspective" + project="true"> + </wizard> + </extension> +<!-- wizard end --> + +<!-- launching & debugging start --> + <extension + id="org.tizen.nativeapp.elmscaletool" + name="org.tizen.nativeapp.elmscaletool" + point="org.tizen.common.connection.tools"> + <tools + packagename="elmscalegetter" + sourcepath="/SDK/develop-tool"> + </tools> + </extension> + + <extension + point="org.eclipse.debug.core.launchConfigurationTypes"> + <launchConfigurationType + delegate="org.tizen.nativeplatform.launch.TizenDebianLaunchDelegate" + id="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationType" + name="Tizen Custom Debian Project" + public="true"/> + + <launchConfigurationType + delegate="org.tizen.nativeplatform.launch.TizenDebianLaunchDelegateForAttach" + id="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForAttach" + name="Tizen Custom Debian Project - Attach" + public="true"/> + + <launchConfigurationType + delegate="org.tizen.nativeplatform.launch.TizenDebianLaunchDelegateForCore" + id="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForCore" + name="Tizen Custom Debian Project - Coredump" + public="true"/> + </extension> + + <extension + point="org.eclipse.debug.ui.launchConfigurationTypeImages"> + <launchConfigurationTypeImage + icon="icons/Tizen_Custom_Debian_ConfigurationType_Image.gif" + configTypeID="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationType" + id="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationType.image"/> + + <launchConfigurationTypeImage + icon="icons/Tizen_Custom_Debian_ConfigurationType_Image_Attach.gif" + configTypeID="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForAttach" + id="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForAttach.image"/> + + <launchConfigurationTypeImage + icon="icons/Tizen_Custom_Debian_ConfigurationType_Image_Core.gif" + configTypeID="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForCore" + id="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForCore.image"/> + </extension> + + <extension + point="org.eclipse.debug.core.launchDelegates"> + <launchDelegate + delegate="org.tizen.nativeplatform.launch.TizenDebianLaunchDelegate" + id="org.tizen.nativeplatform.launch.TizenDebianLaunchDelegate" + modes="run,debug" + name="Tizen Custom Debian Project" + delegateDescription="The Tizen Custom Debian Project Launcher supports running Tizen application on device" + sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator" + sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer" + type="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationType"/> + + <launchDelegate + delegate="org.tizen.nativeplatform.launch.TizenDebianLaunchDelegateForAttach" + id="org.tizen.nativeplatform.launch.TizenDebianLaunchDelegateForAttach" + modes="debug" + name="Tizen Custom Debian Project - Attach" + delegateDescription="The Tizen Custom Debian Project Launcher supports attach debugging Tizen process on device" + sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator" + sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer" + type="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForAttach"/> + + <launchDelegate + delegate="org.tizen.nativeplatform.launch.TizenDebianLaunchDelegateForCore" + id="org.tizen.nativeplatform.launch.TizenDebianLaunchDelegateForCore" + modes="debug" + name="Tizen Custom Debian Project - Coredump" + delegateDescription="The Tizen Custom Debian Project Launcher supports coredump debugging" + sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator" + sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer" + type="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForCore"/> + </extension> + + <extension + point="org.eclipse.debug.ui.launchConfigurationTabGroups"> + <launchConfigurationTabGroup + class="org.tizen.nativeplatform.launch.ui.TizenDebianLaunchConfigurationTabGroup" + id="org.tizen.nativeplatform.launch.ui.TizenDebianLaunchConfigurationTabGroup" + type="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationType"/> + + <launchConfigurationTabGroup + class="org.tizen.nativeplatform.launch.ui.TizenDebianLaunchConfigurationForAttachTabGroup" + id="org.tizen.nativeplatform.launch.ui.TizenDebianLaunchConfigurationForAttachTabGroup" + type="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForAttach"/> + + <launchConfigurationTabGroup + class="org.tizen.nativeplatform.launch.ui.TizenDebianLaunchConfigurationForCoreTabGroup" + id="org.tizen.nativeplatform.launch.ui.TizenDebianLaunchConfigurationForCoreTabGroup" + type="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForCore"/> + </extension> + + <extension + point="org.eclipse.debug.ui.launchConfigurationTabs"> + <tab + id="org.tizen.nativeplatform.launch.ui.TizenDebianMainTab" + group="org.tizen.nativeplatform.launch.ui.TizenDebianLaunchConfigurationTabGroup" + name="Tizen Custom Debian Project Main Tab" + class="org.tizen.nativeplatform.launch.ui.TizenDebianMainTab"> + <associatedDelegate delegate="org.tizen.nativeplatform.launch.TizenDebianLaunchDelegate"/> + </tab> + + <tab + id="org.tizen.nativeplatform.launch.ui.TizenDebianMainTab" + group="org.tizen.nativeplatform.launch.ui.TizenDebianLaunchConfigurationForAttachTabGroup" + name="Tizen Custom Debian Project Main Tab" + class="org.tizen.nativeplatform.launch.ui.TizenDebianMainTab"> + <associatedDelegate delegate="org.tizen.nativeplatform.launch.TizenDebianLaunchDelegateForAttach"/> + </tab> + + <tab + id="org.tizen.nativeplatform.launch.ui.TizenDebianMainCoreTab" + group="org.tizen.nativeplatform.launch.ui.TizenDebianLaunchConfigurationForCoreTabGroup" + name="Tizen Custom Debian Project main tab for coredump" + class="org.tizen.nativeplatform.launch.ui.TizenDebianMainCoreTab"> + <associatedDelegate delegate="org.tizen.nativeplatform.launch.TizenDebianLaunchDelegateForCore"/> + </tab> + </extension> + + <extension + point="org.eclipse.core.expressions.propertyTesters"> + <propertyTester + namespace="org.tizen.nativeplatform.launch.ui.shortcut" + properties="isTizenCustomDebianProject, belongTizenCustomDebianProject" + type="org.eclipse.core.resources.IResource" + class="org.tizen.nativeplatform.launch.ui.shortcut.TizenDebianPropertyTester" + id="org.tizen.nativeplatform.launch.ui.shortcut.TizenDebianPropertyTester"/> + </extension> + + <extension + point="org.eclipse.debug.ui.launchShortcuts"> + <shortcut + label="Tizen Custom Debian Project" + icon="icons/Tizen_Custom_Debian_ConfigurationType_Image.gif" + modes="run,debug" + class="org.tizen.nativeplatform.launch.ui.shortcut.TizenDebianProjectLaunchShortcut" + id="org.tizen.nativeplatform.launch.ui.shortcut.TizenDebianProjectLaunchShortcut"> + <contextualLaunch> + <enablement> + <with variable="selection"> + <count value="1"/> + <iterate> + <or> + <and> + <instanceof value="org.eclipse.ui.IFileEditorInput"/> + <adapt type="org.eclipse.core.resources.IResource"> + <test + forcePluginActivation="true" + property="org.tizen.nativeplatform.launch.ui.shortcut.belongTizenCustomDebianProject"/> + </adapt> + </and> + <and> + <instanceof value="org.eclipse.core.resources.IProject"/> + <test + forcePluginActivation="true" + property="org.tizen.nativeplatform.launch.ui.shortcut.isTizenCustomDebianProject"/> + </and> + </or> + </iterate> + </with> + </enablement> + </contextualLaunch> + <description + mode="run" + description="Runs a Tizen Custom Debian Project"/> + <description + mode="debug" + description="Debugs a Tizen Custom Debian Project"/> + <configurationType + id="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationType"> + </configurationType> + </shortcut> + + <shortcut + label="Tizen Custom Debian Project - Attach" + icon="icons/Tizen_Custom_Debian_ConfigurationType_Image_Attach.gif" + modes="debug" + class="org.tizen.nativeplatform.launch.ui.shortcut.TizenDebianProjectAttachLaunchShortcut" + id="org.tizen.nativeplatform.launch.ui.shortcut.TizenDebianProjectAttachLaunchShortcut"> + <contextualLaunch> + <enablement> + <with variable="selection"> + <count value="1"/> + <iterate> + <or> + <and> + <instanceof value="org.eclipse.ui.IFileEditorInput"/> + <adapt type="org.eclipse.core.resources.IResource"> + <test + forcePluginActivation="true" + property="org.tizen.nativeplatform.launch.ui.shortcut.belongTizenCustomDebianProject"/> + </adapt> + </and> + <and> + <instanceof value="org.eclipse.core.resources.IProject"/> + <test + forcePluginActivation="true" + property="org.tizen.nativeplatform.launch.ui.shortcut.isTizenCustomDebianProject"/> + </and> + </or> + </iterate> + </with> + </enablement> + </contextualLaunch> + <description + mode="debug" + description="Attach Debugs a Tizen Custom Debian Project"/> + <configurationType + id="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForAttach"> + </configurationType> + </shortcut> + + <shortcut + label="Tizen Custom Debian Project - Coredump" + icon="icons/Tizen_Custom_Debian_ConfigurationType_Image_Core.gif" + modes="debug" + class="org.tizen.nativeplatform.launch.ui.shortcut.TizenDebianProjectCoredumpLaunchShortcut" + id="org.tizen.nativeapp.launch.ui.shortcut.TizenDebianProjectCoredumpLaunchShortcut"> + <contextualLaunch> + <enablement> + <with variable="selection"> + <count value="1"/> + <iterate> + <or> + <and> + <instanceof value="org.eclipse.ui.IFileEditorInput"/> + <adapt type="org.eclipse.core.resources.IResource"> + <test + forcePluginActivation="true" + property="org.tizen.nativeplatform.launch.ui.shortcut.belongTizenCustomDebianProject"/> + </adapt> + </and> + <and> + <instanceof value="org.eclipse.core.resources.IProject"/> + <test + forcePluginActivation="true" + property="org.tizen.nativeplatform.launch.ui.shortcut.isTizenCustomDebianProject"/> + </and> + </or> + </iterate> + </with> + </enablement> + </contextualLaunch> + <description + mode="debug" + description="Coredump Debugs a Tizen Custom Debian Project"/> + <configurationType + id="org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForCore"> + </configurationType> + </shortcut> + </extension> +<!-- launching & debugging end --> + +<!-- package manager start --> + <extension + point="org.eclipse.ui.menus"> + <menuContribution + locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions"> + <toolbar + id="org.tizen.nativeplatform.pkgInstall.pkgtoolbar"> + <command + commandId="org.tizen.nativeplatform.pkgInstall.commandid.rootstrapmgr" + icon="icons/package_installer.gif" + tooltip="Launch Package Manager" + id="org.tizen.nativeplatform.pkgInatall.pkgtoolbar.pcommand.rootstrap"> + <visibleWhen + checkEnabled="false"> + <with variable="activeWorkbenchWindow.activePerspective"> + <equals value="org.tizen.nativeapp.perspective"/> + </with> + </visibleWhen> + </command> + </toolbar> + </menuContribution> + </extension> + + <extension + point="org.eclipse.ui.actionSets"> + <actionSet + label="Package Manager ActionSet" + visible="true" + id="org.tizen.nativeplatform.pkginstall.actionset"> + <menu + label="Package Manager" + path="additions" + id="org.tizen.nativeplatform.pkginstall.menuid"> + </menu> + <action + id="org.tizen.nativeplatform.pkginstall.action" + label="Package Manager" + menubarPath="window/additions" + class="org.tizen.nativeplatform.pkgInstall.DialogActionDelegate"> + </action> + </actionSet> + </extension> +<!-- package manager end --> +</plugin> diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/Activator.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/Activator.java new file mode 100644 index 00000000..27866a94 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/Activator.java @@ -0,0 +1,111 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; +import org.tizen.nativecommon.build.ProjectTypeManager; +import org.tizen.nativeplatform.build.CustomDebianProjectDependentBuilderOld; +import org.tizen.nativeplatform.build.PlatformConfigurationManager; +import org.tizen.nativeplatform.build.PlatformProjectDependentBuilder; +import org.tizen.nativeplatform.build.PlatformProjectDependentPackager; + + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.tizen.nativeplatform"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + + ProjectTypeManager.registerProjectArtifactType( + PlatformConfigurationManager.OLD_SLP_CUSTOM_DEBIAN_ARTIFACT_TYPE, + CustomDebianProjectDependentBuilderOld.getInstance(), + PlatformProjectDependentPackager.getInstance(), + false); + + ProjectTypeManager.registerProjectArtifactType( + PlatformConfigurationManager.TIZEN_CUSTOM_DEBIAN_ARTIFACT_TYPE, + PlatformProjectDependentBuilder.getInstance(), + PlatformProjectDependentPackager.getInstance(), + true); + + //SLPProjectTypeManager.registerBuilder("SLP Custom Debian Package", CustomDebianProjectDependentBuilder.getInstance() ); + //SLPProjectTypeManager.registerBuilder("SLP Inhouse Framework Package", InhouseFrameworkProjectDependentBuilder.getInstance() ); + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path + * + * @param path the path + * @return the image descriptor + */ + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } +} + diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/CustomDebianConfigurationOld.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/CustomDebianConfigurationOld.java new file mode 100644 index 00000000..e81d9987 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/CustomDebianConfigurationOld.java @@ -0,0 +1,183 @@ +/* +* Native Platform +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.build; + +import java.util.ArrayList; + +import org.eclipse.cdt.core.CCProjectNature; +import org.eclipse.cdt.core.settings.model.ICResourceDescription; +import org.eclipse.cdt.managedbuilder.core.BuildException; +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.IFileInfo; +import org.eclipse.cdt.managedbuilder.core.IFolderInfo; +import org.eclipse.cdt.managedbuilder.core.IResourceInfo; +import org.eclipse.cdt.managedbuilder.core.ITool; +import org.eclipse.cdt.managedbuilder.core.IToolChain; +import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; +import org.eclipse.cdt.managedbuilder.internal.core.ToolChain; +import org.eclipse.cdt.managedbuilder.tcmodification.IFolderInfoModification; +import org.eclipse.cdt.managedbuilder.tcmodification.IToolChainModificationManager; +import org.eclipse.cdt.managedbuilder.tcmodification.IToolListModification; +import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.tizen.nativecommon.build.CommonConfigurationOld; + + + + +@SuppressWarnings("restriction") +public class CustomDebianConfigurationOld extends CommonConfigurationOld +{ + // get compiler flags + public static String getAllCFlags( IConfiguration config ) + { + return getAllCompilerFlags( config, SBI_BASE_C_COMPILER_TOOL_ID ); + } + + + public static String getAllCPPFlags( IConfiguration config ) + { + return getAllCompilerFlags( config, SBI_BASE_CPP_COMPILER_TOOL_ID ); + } + + + protected static String getAllCompilerFlags( IConfiguration config, String compilerId ) { + + ITool compilerTool = config.getToolsBySuperClassId(compilerId)[0]; + + String compilerFlags = ""; + + try { + compilerFlags = compilerTool.getToolFlags(); + + // skip "-c" option and replace double quotes + String[] flags = compilerFlags.split(" "); + compilerFlags = ""; + for( int i = 0; i < flags.length ; i ++ ) { + + if ( flags[i].compareTo("-c") == 0 ) { + continue; + } + + flags[i] = flags[i].replace("\"", "\\\""); + compilerFlags = compilerFlags + " " + flags[i]; + } + } catch (BuildException e) { + e.printStackTrace(); + } + + compilerFlags = compilerFlags.trim(); + return compilerFlags; + } + + + + + protected static boolean isCPPProject( IConfiguration config ) + { + try { + IProject project = (IProject)config.getOwner(); + + if ( project.hasNature( CCProjectNature.CC_NATURE_ID ) ) + return true; + } catch (CoreException e1) { + e1.printStackTrace(); + } + + return false; + } + + + + public static void changeToolchain( IConfiguration config, ICResourceDescription cfgd, String toolchainNameInCfg) { + IToolChainModificationManager tcmmgr = ManagedBuildManager.getToolChainModificationManager(); + IToolChain[] r_tcs = ManagedBuildManager.getRealToolChains(); + IToolChain[] v_tcs; + + IResourceInfo ri = config.getResourceInfo(cfgd.getPath(), false); + IToolListModification mod; + + if (ri instanceof IFolderInfo) { + mod = tcmmgr.createModification((IFolderInfo)ri); + } else { + mod = tcmmgr.createModification((IFileInfo)ri); + } + + IToolChain realToolChain = null; + if (ri instanceof IFolderInfo) { + IToolChain toolChainInstance = ((IFolderInfoModification)mod).getToolChain(); + realToolChain = ManagedBuildManager.getRealToolChain(toolChainInstance); + if (realToolChain==null) + realToolChain = toolChainInstance; + } + + boolean isMng = config.getBuilder().isManagedBuildOn(); + ArrayList<IToolChain> list = new ArrayList<IToolChain>(); + + IToolChain[] tcs = r_tcs; + IFolderInfoModification fim = (IFolderInfoModification)mod; + tcs = fim.getCompatibleToolChains(); + IToolChain[] tcs1 = new IToolChain[tcs.length + 1]; + System.arraycopy(tcs, 0, tcs1, 0, tcs.length); + tcs1[tcs.length] = realToolChain; // add existing toolchain + tcs = tcs1; + + for (IToolChain tc : tcs) { + if ( tc.isSystemObject() && !(((ToolChain)tc).isPreferenceToolChain() && !isMng) ) { + // NO TOOLCHAIN + continue; + } + list.add(tc); + } + + v_tcs = list.toArray(new IToolChain[list.size()]); + int x = 0; + IFolderInfoModification foim = (IFolderInfoModification)mod; + + for (int i = 0 ; i < v_tcs.length ; i++) { + if (v_tcs[i].getName().equals(toolchainNameInCfg)) { + x = i; + break; + } + } + + IToolChain tc = v_tcs[x]; + if (tc == null) return; + + + foim.setToolChain(tc); + + try { + mod.apply(); + } catch (CoreException e) { + ManagedBuilderUIPlugin.log(e); + } + } +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/CustomDebianProjectDependentBuilderOld.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/CustomDebianProjectDependentBuilderOld.java new file mode 100644 index 00000000..1a1f77bb --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/CustomDebianProjectDependentBuilderOld.java @@ -0,0 +1,129 @@ +/* +* Native Platform +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.build; + +import org.eclipse.cdt.core.settings.model.ICResourceDescription; +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.core.resources.IProject; +import org.tizen.nativecommon.build.CommonProjectDependentBuilder; +import org.tizen.nativecommon.build.exception.SBIException; + + +public class CustomDebianProjectDependentBuilderOld extends CommonProjectDependentBuilder { + + private static CustomDebianProjectDependentBuilderOld instance = new CustomDebianProjectDependentBuilderOld(); + + public static final CommonProjectDependentBuilder getInstance() { + return instance; + } + + public static final CommonProjectDependentBuilder getInstance(IProject project) { + instance.setProject(project); + return instance; + } + + private CustomDebianProjectDependentBuilderOld() { + super(); + } + + private CustomDebianProjectDependentBuilderOld(IProject project) { + super(project); + } + + @Override + protected String getElfInfoOption() { + return "-s -W"; + } + + @Override + protected String getConfigureOption() { + + String options = String.format(" "); + + return options; + } + + @Override + protected String getMakeOption() { + // TODO Auto-generated method stub + return ""; + } + + @Override + protected String getCleanOption() { + // TODO Auto-generated method stub + return ""; + } + + @Override + public String getTargetID() { + IConfiguration config = getConfiguration(); + return CustomDebianConfigurationOld.getBuildTargetName(config); + } + + @Override + public String getTargetID(IConfiguration config) { + return CustomDebianConfigurationOld.getBuildTargetName(config); + } + + @Override + protected String getDebugOption(String[] arrOption) { + String gdbOptions = "-gdb-options=\'"; + for (int i = 0 ; i < arrOption.length ; i++) { + gdbOptions = gdbOptions.concat(arrOption[i] + " "); + } + gdbOptions = gdbOptions.concat("\' "); + + String sysroot=""; + try { + sysroot = String.format("-sysroot=%s", getSbi().getRootstrapPath(getTargetID()) ); + } catch (SBIException e) { + e.printStackTrace(); + } + + return gdbOptions + sysroot; + } + + @Override + public void setBuildTargetID(IConfiguration config, String targetId) { + CustomDebianConfigurationOld.setBuildTargetName(config, targetId); + } + + @Override + public void setToolCommand(IConfiguration config, String rootstrapCfgName) { + CustomDebianConfigurationOld.setToolCommand(config, rootstrapCfgName); + } + + @Override + public void changeToolchain(IConfiguration config, + ICResourceDescription cfgd, String toolchainNameInCfg) { + CustomDebianConfigurationOld.changeToolchain(config, cfgd, toolchainNameInCfg); + } + +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformConfigurationEnvVarSupplier.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformConfigurationEnvVarSupplier.java new file mode 100644 index 00000000..eaf3639e --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformConfigurationEnvVarSupplier.java @@ -0,0 +1,62 @@ +/* +* Native Platform +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.build; + +import java.util.ArrayList; + +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable; +import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier; +import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider; +import org.eclipse.cdt.managedbuilder.internal.envvar.BuildEnvVar; + +public class PlatformConfigurationEnvVarSupplier implements + IConfigurationEnvironmentVariableSupplier { + + @Override + public IBuildEnvironmentVariable getVariable(String variableName, + IConfiguration configuration, IEnvironmentVariableProvider provider) { + // set "SBI_SYSROOT" variable + String sysrootPath = PlatformConfigurationManager.getRootstrapPath( configuration ); + return new BuildEnvVar("SBI_SYSROOT", sysrootPath, IBuildEnvironmentVariable.ENVVAR_REPLACE, null ); + } + + @Override + public IBuildEnvironmentVariable[] getVariables( + IConfiguration configuration, IEnvironmentVariableProvider provider) { + + ArrayList<IBuildEnvironmentVariable> list = new ArrayList<IBuildEnvironmentVariable>(); + + // set "SBI_SYSROOT" variable + String sysrootPath = PlatformConfigurationManager.getRootstrapPath( configuration ); + list.add( new BuildEnvVar("SBI_SYSROOT", sysrootPath, IBuildEnvironmentVariable.ENVVAR_REPLACE, null ) ); + return list.toArray( new IBuildEnvironmentVariable[0] ); + } + +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformConfigurationManager.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformConfigurationManager.java new file mode 100644 index 00000000..66360c7e --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformConfigurationManager.java @@ -0,0 +1,301 @@ +/* +* Native Platform +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.build; + +import java.util.ArrayList; + +import org.eclipse.cdt.core.CCProjectNature; +import org.eclipse.cdt.core.settings.model.ICResourceDescription; +import org.eclipse.cdt.managedbuilder.core.BuildException; +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.IFileInfo; +import org.eclipse.cdt.managedbuilder.core.IFolderInfo; +import org.eclipse.cdt.managedbuilder.core.IResourceInfo; +import org.eclipse.cdt.managedbuilder.core.ITool; +import org.eclipse.cdt.managedbuilder.core.IToolChain; +import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; +import org.eclipse.cdt.managedbuilder.internal.core.ToolChain; +import org.eclipse.cdt.managedbuilder.tcmodification.IFolderInfoModification; +import org.eclipse.cdt.managedbuilder.tcmodification.IToolChainModificationManager; +import org.eclipse.cdt.managedbuilder.tcmodification.IToolListModification; +import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.tizen.nativecommon.build.CommonConfigurationManager; +import org.tizen.nativecommon.build.SmartBuildInterface; +import org.tizen.nativecommon.build.exception.SBIException; + + + + +@SuppressWarnings("restriction") +public class PlatformConfigurationManager extends CommonConfigurationManager +{ + // ProjectInfo + public static final String CURRENT_SLP_PROJECT_VERSION = "1.0.0"; + public static final String TIZEN_CUSTOM_DEBIAN_ARTIFACT_TYPE = "com.samsung.slp.nativeide.buildArtefactType.cdeb"; + public static final String OLD_SLP_CUSTOM_DEBIAN_ARTIFACT_TYPE = "com.samsung.slp.project.custom.debian"; + + // SBI Compatibility + public static final String SBI_PROJECT_TYPE_ID = "com.samsung.slp.nativebuild.target.sbi.gcc45sbox2.cdeb"; + public static final String SBI_DEFAULT_I386_CONFIGRATION_ID = "com.samsung.slp.nativeide.config.sbi.gcc45sbox2.cdeb.emulator"; + public static final String SBI_DEFAULT_ARM_CONFIGRATION_ID = "com.samsung.slp.nativeide.config.sbi.gcc45sbox2.cdeb.device"; + public static final String SBI_DEFAULT_TARGET_NAME = "tizen-device-1.0.sb2_gcc45sbox2.armel.cdeb"; + public static final String SBI_ARM_TOOLCHAIN_NAME = "gcc45sbox2.armel.cdeb"; + public static final String SBI_ARM_SBOX2_TOOLCHAIN_NAME = "gcc45sbox2.armel.cdeb"; + public static final String SBI_ARM_ROOTSTRAP_NAME = "tizen-device-1.0.sb2"; + public static final String SBI_I386_TOOLCHAIN_NAME = "gcc45sbox2.i386.cdeb"; + public static final String SBI_I386_SBOX2_TOOLCHAIN_NAME = "gcc45sbox2.i386.cdeb"; + public static final String SBI_I386_ROOTSTRAP_NAME = "tizen-emulator-1.0.sb2"; + + // get compiler flags + public static String getAllCFlags( IConfiguration config ) + { + // TODO: should be removed + if ( isOldConfiguration(config) ) { + return CustomDebianConfigurationOld.getAllCFlags(config); + } + + return getAllCompilerFlags( config, SBI_BASE_C_COMPILER_TOOL_ID ); + } + + + public static String getAllCPPFlags( IConfiguration config ) + { + // TODO: should be removed + if ( isOldConfiguration(config) ) { + return CustomDebianConfigurationOld.getAllCPPFlags(config); + } + + return getAllCompilerFlags( config, SBI_BASE_CPP_COMPILER_TOOL_ID ); + } + + + protected static String getAllCompilerFlags( IConfiguration config, String compilerId ) { + + ITool compilerTool = config.getToolsBySuperClassId(compilerId)[0]; + + String compilerFlags = ""; + + try { + compilerFlags = compilerTool.getToolFlags(); + + // skip "-c" option and replace double quotes + String[] flags = compilerFlags.split(" "); + compilerFlags = ""; + for( int i = 0; i < flags.length ; i ++ ) { + + if ( flags[i].compareTo("-c") == 0 ) { + continue; + } + + flags[i] = flags[i].replace("\"", "\\\""); + compilerFlags = compilerFlags + " " + flags[i]; + } + } catch (BuildException e) { + e.printStackTrace(); + } + + compilerFlags = compilerFlags.trim(); + return compilerFlags; + } + + + + + protected static boolean isCPPProject( IConfiguration config ) + { + try { + IProject project = (IProject)config.getOwner(); + + if ( project.hasNature( CCProjectNature.CC_NATURE_ID ) ) + return true; + } catch (CoreException e1) { + e1.printStackTrace(); + } + + return false; + } + + + + public static void changeToolchain( IConfiguration config, ICResourceDescription cfgd, String toolchainNameInCfg) { + // TODO: should be removed + if ( isOldConfiguration(config) ) { + CustomDebianConfigurationOld.changeToolchain(config, cfgd, toolchainNameInCfg ); + return; + } + + IToolChainModificationManager tcmmgr = ManagedBuildManager.getToolChainModificationManager(); + IToolChain[] r_tcs = ManagedBuildManager.getRealToolChains(); + IToolChain[] v_tcs; + + IResourceInfo ri = config.getResourceInfo(cfgd.getPath(), false); + IToolListModification mod; + + if (ri instanceof IFolderInfo) { + mod = tcmmgr.createModification((IFolderInfo)ri); + } else { + mod = tcmmgr.createModification((IFileInfo)ri); + } + + IToolChain realToolChain = null; + if (ri instanceof IFolderInfo) { + IToolChain toolChainInstance = ((IFolderInfoModification)mod).getToolChain(); + realToolChain = ManagedBuildManager.getRealToolChain(toolChainInstance); + if (realToolChain==null) + realToolChain = toolChainInstance; + } + + boolean isMng = config.getBuilder().isManagedBuildOn(); + ArrayList<IToolChain> list = new ArrayList<IToolChain>(); + + IToolChain[] tcs = r_tcs; + IFolderInfoModification fim = (IFolderInfoModification)mod; + tcs = fim.getCompatibleToolChains(); + IToolChain[] tcs1 = new IToolChain[tcs.length + 1]; + System.arraycopy(tcs, 0, tcs1, 0, tcs.length); + tcs1[tcs.length] = realToolChain; // add existing toolchain + tcs = tcs1; + + for (IToolChain tc : tcs) { + if ( tc.isSystemObject() && !(((ToolChain)tc).isPreferenceToolChain() && !isMng) ) { + // NO TOOLCHAIN + continue; + } + list.add(tc); + } + + v_tcs = list.toArray(new IToolChain[list.size()]); + int x = 0; + IFolderInfoModification foim = (IFolderInfoModification)mod; + + for (int i = 0 ; i < v_tcs.length ; i++) { + if (v_tcs[i].getName().equals(toolchainNameInCfg)) { + x = i; + break; + } + } + + IToolChain tc = v_tcs[x]; + if (tc == null) return; + + + foim.setToolChain(tc); + + try { + mod.apply(); + } catch (CoreException e) { + ManagedBuilderUIPlugin.log(e); + } + } + + + public static String updateBuildTargetConfiguration( IConfiguration config ) throws SBIException { + + // get target name + String targetID = getBuildTargetName( config ); + + // if targetID is null, set default target name + if ( targetID == null ) { + targetID = SBI_DEFAULT_TARGET_NAME; + } + + SmartBuildInterface sbi = SmartBuildInterface.getInstance(); + + // if target exist , just return + if ( sbi.checkTargetID(targetID)) { + return targetID; + } + + String rootstrapID = sbi.getRootstrapIDFromTargetID(targetID); + String toolchainID = sbi.getToolchainIDFromTargetID(targetID); + + // check rootstrap name + if ( !sbi.checkRootstrapID(rootstrapID) ) { + // set default + if ( config.getName().contains(SBI_DEVICE_CONFIG_SUFFIX) ) { + rootstrapID = SBI_ARM_ROOTSTRAP_NAME; + } else { + rootstrapID = SBI_I386_ROOTSTRAP_NAME; + } + } + + // check toolchain name + if ( !sbi.checkToolchainID(toolchainID) ) { + // change "gcc-4.5.3-i386.sb2" , "gcc-4.5-i386.cdeb.sb2" + if ( ( toolchainID.equals("gcc-4.5.3-i386.sb2") || toolchainID.equals("gcc-4.5-i386.cdeb.sb2") ) && + sbi.checkToolchainID( SBI_I386_SBOX2_TOOLCHAIN_NAME ) ) { + toolchainID = SBI_I386_SBOX2_TOOLCHAIN_NAME; + } + // change "gcc-4.5.3-armel.sb2" , "gcc-4.5-armel.cdeb.sb2" + else if ( ( toolchainID.equals("gcc-4.5.3-armel.sb2") || toolchainID.equals("gcc-4.5-armel.cdeb.sb2") ) && + sbi.checkToolchainID( SBI_ARM_SBOX2_TOOLCHAIN_NAME ) ) { + toolchainID = SBI_ARM_SBOX2_TOOLCHAIN_NAME; + } else { + // set default + if ( config.getName().contains(SBI_DEVICE_CONFIG_SUFFIX) ) { + toolchainID = SBI_ARM_TOOLCHAIN_NAME; + } else { + toolchainID = SBI_I386_TOOLCHAIN_NAME; + } + } + } + + // create target name && update configuration + targetID = sbi.makeTargetID( rootstrapID, toolchainID ); + setBuildTargetName(config, targetID); + + // if target exist, create + if ( !sbi.checkTargetID(targetID)) { + sbi.writeTargetCfgFile(targetID); + } + + return targetID; + } + + + + public static String getRootstrapPath( IConfiguration config ) { + + try { + + // if not exist, update target configuration + String targetID = updateBuildTargetConfiguration( config ); + + // return rootstrap + SmartBuildInterface sbi = SmartBuildInterface.getInstance(); + return sbi.getRootstrapPath(targetID); + + } catch (SBIException e) { + e.printStackTrace(); + return "/"; + } + } +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformMakeGenerator.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformMakeGenerator.java new file mode 100644 index 00000000..2276e207 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformMakeGenerator.java @@ -0,0 +1,208 @@ +/* +* Native Platform +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.build; +import org.eclipse.cdt.managedbuilder.core.IBuilder; +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; +import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; +import org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator2; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceDelta; +import org.eclipse.core.resources.IResourceStatus; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.MultiStatus; +import org.eclipse.core.runtime.Path; +import org.tizen.nativecommon.build.exception.SBIException; + + +public class PlatformMakeGenerator implements IManagedBuilderMakefileGenerator2 { + + private IProject project; + private IPath topBuildDir; + private IConfiguration config; + + public final static String SBI_MESSAGE_NEED_PROJECT_CONVERSION = + "Old project type detected!\nPlease upgrade your project.\n" + + " 1. Open the popup-menu by clicking right mouse button on your project\n" + + " 2. Select \"Convert To...\" menu item to open a project converter dialog.\n" + + " 3. Select \"Upgrade Tizen .....\" item on the dialog.\n" + + " 4. Check if all project options are set correctly.\n" + + " (Some options may not be transferred automatically)"; + + + @Override + public void generateDependencies() throws CoreException { + return; + } + + @Override + public MultiStatus generateMakefiles(IResourceDelta delta) + throws CoreException { + + if ( PlatformConfigurationManager.isOldConfiguration( config ) ) { + + //SBIException ex = new SBIException(SLPApplicationProjectConverter.SBI_MESSAGE_NEED_PROJECT_CONVERSION); + SBIException ex = new SBIException(SBI_MESSAGE_NEED_PROJECT_CONVERSION); + ex.showErrorDialog(); + + throw new CoreException( new MultiStatus( + ManagedBuilderCorePlugin.getUniqueIdentifier(), + IStatus.ERROR, + new String(String.format("Build failed! Please upgrade project!" )), + null) ); + } + + // if Makefile does not exist, regenerate "Makefile" + IFolder configDir = project.getFolder( config.getName() ); + if ( !configDir.exists() ) + return regenerateMakefiles(); + + return new MultiStatus( + ManagedBuilderCorePlugin.getUniqueIdentifier(), + IStatus.OK, + new String(), + null); + } + + @Override + public IPath getBuildWorkingDir() { + // return project folder + if ( topBuildDir != null ) { + return topBuildDir.removeFirstSegments(1).removeLastSegments(1); + } + return null; + } + + @Override + public String getMakefileName() { + return null; + } + + @Override + public void initialize(IProject project, IManagedBuildInfo info, + IProgressMonitor monitor) { + this.project = project; + this.topBuildDir = project.getFolder(info.getConfigurationName()).getFullPath(); + this.config = info.getDefaultConfiguration(); + + return ; + } + + @Override + public boolean isGeneratedResource(IResource resource) { + return false; + } + + @Override + public void regenerateDependencies(boolean force) throws CoreException { + return; + } + + @Override + public MultiStatus regenerateMakefiles() throws CoreException { + + if ( PlatformConfigurationManager.isOldConfiguration( config ) ) { + + //SBIException ex = new SBIException(SLPApplicationProjectConverter.SBI_MESSAGE_NEED_PROJECT_CONVERSION); + SBIException ex = new SBIException(SBI_MESSAGE_NEED_PROJECT_CONVERSION); + ex.showErrorDialog(); + + throw new CoreException( new MultiStatus( + ManagedBuilderCorePlugin.getUniqueIdentifier(), + IStatus.ERROR, + new String(String.format("Build failed! Please upgrade project!" )), + null) ); + } + + // Check topdir folder exist + topBuildDir = createDirectory(config.getName()); + + return new MultiStatus( + ManagedBuilderCorePlugin.getUniqueIdentifier(), + IStatus.OK, + new String(), + null); + } + + @Override + public void initialize(int buildKind, IConfiguration cfg, IBuilder builder, + IProgressMonitor monitor) { + this.project = cfg.getOwner().getProject(); + this.config = cfg; + topBuildDir = project.getFolder(cfg.getName()).getFullPath(); + } + + + // function for creating directory from GnuMakefileGenerateor + private IPath createDirectory(String dirName) throws CoreException { + // Create or get the handle for the build directory + IFolder folder = project.getFolder(dirName); + + // should be checked later + if (folder.exists()) { + folder.delete(true, null); + } + + if (!folder.exists()) { + // Make sure that parent folders exist + IPath parentPath = (new Path(dirName)).removeLastSegments(1); + // Assume that the parent exists if the path is empty + if (!parentPath.isEmpty()) { + IFolder parent = project.getFolder(parentPath); + if (!parent.exists()) { + createDirectory(parentPath.toString()); + } + } + + // Now make the requested folder + try { + folder.create(true, true, null); + } + catch (CoreException e) { + if (e.getStatus().getCode() == IResourceStatus.PATH_OCCUPIED) + folder.refreshLocal(IResource.DEPTH_ZERO, null); + else + throw e; + } + + // Make sure the folder is marked as derived so it is not added to CM + if (!folder.isDerived()) { + folder.setDerived(true); + } + } + + return folder.getFullPath(); + } + +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformProjectConverter.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformProjectConverter.java new file mode 100644 index 00000000..819f040d --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformProjectConverter.java @@ -0,0 +1,183 @@ +/* +* Native Platform +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.build; + +import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; +import org.eclipse.cdt.core.settings.model.ICProjectDescription; +import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager; +import org.eclipse.cdt.core.settings.model.WriteAccessException; +import org.eclipse.cdt.core.settings.model.extension.CConfigurationData; +import org.eclipse.cdt.managedbuilder.core.IBuildObject; +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.IConvertManagedBuildObject; +import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; +import org.eclipse.cdt.managedbuilder.core.IProjectType; +import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; +import org.eclipse.cdt.managedbuilder.internal.core.Configuration; +import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.tizen.nativecommon.build.SmartBuildInterface; +import org.tizen.nativecommon.build.exception.SBIException; + + +@SuppressWarnings("restriction") +public class PlatformProjectConverter implements IConvertManagedBuildObject { + + IProject project; + ManagedProject mProject; + ICProjectDescription projDesc; + + public PlatformProjectConverter() { + } + + @Override + public IBuildObject convert(IBuildObject buildObj, String fromId, + String toId, boolean isConfirmed) { + + if (buildObj instanceof ManagedProject ) { + mProject = (ManagedProject)buildObj; + project = (IProject)mProject.getOwner(); + ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager(); + projDesc = mngr.getProjectDescription(project, true); + IManagedBuildInfo info = ManagedBuildManager.getBuildInfo( project ) ; + SmartBuildInterface sbi = SmartBuildInterface.getInstance(); + + // convert project type + IProjectType newProjType = ManagedBuildManager.getProjectType( toId ); + mProject.setProjectType( newProjType ); + mProject.setName(newProjType.getName()); + + try { + // convert Configuration id + for ( IConfiguration config : mProject.getConfigurations() ) { + Configuration c = (Configuration) config; + + IFolder f = project.getFolder(c.getName()); + if (f.exists()) { + f.delete(true, null); + } + + Configuration newConfig = createNewConfiguration( config , toId ); + String newTargetName = getNewBuildTargetName( config , toId ); + + // target name + if (!sbi.checkTargetID(newTargetName)) { + sbi.writeTargetCfgFile(newTargetName); + } + PlatformConfigurationManager.setBuildTargetName(newConfig, newTargetName); + + // remove old configuration + mProject.removeConfiguration(c.getId()); + } + + mngr.setProjectDescription(project, projDesc); + info.setDefaultConfiguration(mProject.getConfigurations()[0].getName()); + + } catch (WriteAccessException e) { + e.printStackTrace(); + } catch (CoreException e) { + e.printStackTrace(); + } catch (SBIException e) { + e.showErrorDialog(); + } + + // update .cproject + ManagedBuildManager.saveBuildInfo( project, true ); + + try { + project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); + } catch (CoreException e) { + e.printStackTrace(); + } + return mProject; + } + + return buildObj; + } + + + protected Configuration createNewConfiguration( IConfiguration config , String toId ) throws WriteAccessException, CoreException { + + Configuration parentConfig = null; + if ( toId.equals(PlatformConfigurationManager.SBI_PROJECT_TYPE_ID) ) { + if ( config.getParent().getId().contains("custom.debian.emulator") ) { + parentConfig = (Configuration)ManagedBuildManager.getExtensionConfiguration( PlatformConfigurationManager.SBI_DEFAULT_I386_CONFIGRATION_ID ); + } else if ( config.getParent().getId().contains("custom.debian.device") ) { + parentConfig = (Configuration) ManagedBuildManager.getExtensionConfiguration( PlatformConfigurationManager.SBI_DEFAULT_ARM_CONFIGRATION_ID ); + } else { + parentConfig = (Configuration)ManagedBuildManager.getExtensionConfiguration( PlatformConfigurationManager.SBI_DEFAULT_ARM_CONFIGRATION_ID ); + } + } else { + parentConfig = (Configuration)ManagedBuildManager.getExtensionConfiguration( PlatformConfigurationManager.SBI_DEFAULT_ARM_CONFIGRATION_ID ); + } + + String id = ManagedBuildManager.calculateChildId( parentConfig.getId(), null); + + Configuration newConfig = new Configuration((ManagedProject)config.getManagedProject(), (Configuration)parentConfig, id, false, true); + + CConfigurationData data = newConfig.getConfigurationData(); + ICConfigurationDescription cfgDes = projDesc.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data); + + newConfig.setConfigurationDescription(cfgDes); + newConfig.exportArtifactInfo(); + newConfig.setName(config.getName()); + newConfig.setArtifactName(config.getArtifactName()); + + return newConfig; + } + + + protected String getNewBuildTargetName( IConfiguration config , String toId ) { + String newTargetName = null; + + if ( toId.equals(PlatformConfigurationManager.SBI_PROJECT_TYPE_ID) ) { + if ( config.getParent().getId().contains("custom.debian.emulator") ) { + newTargetName = SmartBuildInterface.makeTargetID( + PlatformConfigurationManager.SBI_I386_ROOTSTRAP_NAME, + PlatformConfigurationManager.SBI_I386_TOOLCHAIN_NAME) ; + } else if ( config.getParent().getId().contains("custom.debian.device") ) { + newTargetName = SmartBuildInterface.makeTargetID( + PlatformConfigurationManager.SBI_ARM_ROOTSTRAP_NAME, + PlatformConfigurationManager.SBI_ARM_TOOLCHAIN_NAME) ; + } else { + newTargetName = PlatformConfigurationManager.SBI_DEFAULT_TARGET_NAME; + } + } else { + newTargetName = PlatformConfigurationManager.SBI_DEFAULT_TARGET_NAME; + } + + return newTargetName; + } + +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformProjectDependentBuilder.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformProjectDependentBuilder.java new file mode 100644 index 00000000..bf5ce7a2 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformProjectDependentBuilder.java @@ -0,0 +1,130 @@ +/* +* Native Platform +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.build; + +import org.eclipse.cdt.core.settings.model.ICResourceDescription; +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.core.resources.IProject; +import org.tizen.nativecommon.build.CommonProjectDependentBuilder; +import org.tizen.nativecommon.build.exception.SBIException; + + +public class PlatformProjectDependentBuilder extends CommonProjectDependentBuilder { + + private static PlatformProjectDependentBuilder instance = new PlatformProjectDependentBuilder(); + + public static final CommonProjectDependentBuilder getInstance() { + return instance; + } + + public static final CommonProjectDependentBuilder getInstance(IProject project) { + instance.setProject(project); + return instance; + } + + private PlatformProjectDependentBuilder() { + super(); + } + + private PlatformProjectDependentBuilder(IProject project) { + super(project); + } + + @Override + protected String getElfInfoOption() { + return "-s -W"; + } + + @Override + protected String getConfigureOption() { + + String options = String.format(" "); + + return options; + } + + @Override + protected String getMakeOption() { + // TODO Auto-generated method stub + return ""; + } + + @Override + protected String getCleanOption() { + // TODO Auto-generated method stub + return ""; + } + + @Override + public String getTargetID() { + IConfiguration config = getConfiguration(); + return PlatformConfigurationManager.getBuildTargetName(config); + } + + @Override + public String getTargetID(IConfiguration config) { + return PlatformConfigurationManager.getBuildTargetName(config); + } + + + @Override + protected String getDebugOption(String[] arrOption) { + String gdbOptions = "-gdb-options=\'"; + for (int i = 0 ; i < arrOption.length ; i++) { + gdbOptions = gdbOptions.concat(arrOption[i] + " "); + } + gdbOptions = gdbOptions.concat("\' "); + + String sysroot=""; + try { + sysroot = String.format("-sysroot=%s", getSbi().getRootstrapPath(getTargetID()) ); + } catch (SBIException e) { + e.printStackTrace(); + } + + return gdbOptions + sysroot; + } + + @Override + public void setBuildTargetID(IConfiguration config, String targetId) { + PlatformConfigurationManager.setBuildTargetName(config, targetId); + } + + @Override + public void setToolCommand(IConfiguration config, String rootstrapCfgName) { + PlatformConfigurationManager.setToolCommand(config, rootstrapCfgName); + } + + @Override + public void changeToolchain(IConfiguration config, + ICResourceDescription cfgd, String toolchainNameInCfg) { + PlatformConfigurationManager.changeToolchain(config, cfgd, toolchainNameInCfg); + } + +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformProjectDependentPackager.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformProjectDependentPackager.java new file mode 100644 index 00000000..fb248c34 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformProjectDependentPackager.java @@ -0,0 +1,149 @@ +/* +* Native Platform +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.build; + +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; +import org.eclipse.core.resources.IProject; +import org.tizen.nativecommon.build.CommonProjectDependentPackager; +import org.tizen.nativecommon.build.exception.SBIException; + + +public class PlatformProjectDependentPackager extends CommonProjectDependentPackager { + + private static PlatformProjectDependentPackager instance = new PlatformProjectDependentPackager(); + + public static final CommonProjectDependentPackager getInstance() { + return instance; + } + + public static final CommonProjectDependentPackager getInstance(IProject project) { + instance.setProject(project); + return instance; + } + + private PlatformProjectDependentPackager() { + super(); + } + + private PlatformProjectDependentPackager(IProject project) { + super(project); + } + + @Override + public String getPackageOption() { + String workingDir = getWorkingDir(); + + String options = String.format( + "-WORKING_DIR=%s", + workingDir ); + + return options; + } + + @Override + public String getPackageOption(IConfiguration config) { + String workingDir = getWorkingDir(config); + + String options = String.format( + "-WORKING_DIR=%s", + workingDir ); + + return options; + } + + public void buildPackage() throws SBIException { + + String targetID = getTargetID(); + String projectDir = getProjectPath(); + String options = getPackageOption(); + + sbi.actionConsole("buildpackage", options, targetID, projectDir, "Packaging" ); + } + + + public void buildPackage(String configName) throws SBIException { + + IConfiguration[] configurations = ManagedBuildManager.getBuildInfo(project).getManagedProject().getConfigurations(); + IConfiguration config = null; + + for (IConfiguration c : configurations) { + if (c.getName().equals(configName) ) { + config = c; + break; + } + } + + String targetID = getTargetID(config); + String projectDir = getProjectPath(); + String options = getPackageOption(config); + + sbi.actionConsole("buildpackage", options, targetID, projectDir, "Packaging" ); + } + + public void buildPackageDependencyCheck() throws SBIException { + + String targetID = getTargetID(); + String projectDir = getProjectPath(); + String options = getPackageDependencyCheckOption(); + + sbi.actionConsole("checkbuilddeps", options, targetID, projectDir, "Packaging" ); + } + + @Override + public String getTargetID() { + IConfiguration config = getConfiguration(); + return PlatformConfigurationManager.getBuildTargetName(config); + } + + @Override + public String getTargetID(IConfiguration config) { + return PlatformConfigurationManager.getBuildTargetName(config); + } + + @Override + public boolean isDependencyCheckSuppoted() { + return true; + } + + @Override + protected String getPackageDependencyCheckOption() { + return ""; + } + + @Override + public boolean isPackageCheckSuppoted() { + return false; + } + + @Override + public boolean checkPackageFile() { + return false; + } +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegate.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegate.java new file mode 100644 index 00000000..ef01062e --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegate.java @@ -0,0 +1,516 @@ +/* +* NativeCommon +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch; + +import java.io.File; +import java.io.FilenameFilter; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; +import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; +import org.eclipse.cdt.core.settings.model.ICProjectDescription; +import org.eclipse.cdt.debug.core.CDIDebugModel; +import org.eclipse.cdt.debug.core.ICDIDebugger2; +import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; +import org.eclipse.cdt.debug.core.cdi.ICDISession; +import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; +import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants; +import org.eclipse.cdt.launch.AbstractCLaunchDelegate; +import org.eclipse.cdt.launch.LaunchUtils; +import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; +import org.eclipse.cdt.ui.newui.CDTPropertyManager; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.SubProgressMonitor; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.debug.core.model.IProcess; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.window.Window; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.dialogs.TwoPaneElementSelector; + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.debugtools.DebugTool; +import org.tizen.common.util.LocalPortChecker; + +import org.tizen.nativecommon.build.CommonConfigurationManager; +import org.tizen.nativecommon.build.CommonProjectDependentBuilder; +import org.tizen.nativecommon.build.ProjectTypeManager; +import org.tizen.nativecommon.build.SmartBuildInterface; +import org.tizen.nativecommon.build.exception.SBIException; +import org.tizen.nativecommon.launch.TizenDebugger; +import org.tizen.nativecommon.launch.TizenLaunchConfigurationConstants; +import org.tizen.nativecommon.launch.TizenLaunchMessages; +import org.tizen.nativecommon.launch.TizenUIThreadForConfirmMessage; +import org.tizen.nativeplatform.Activator; +import org.tizen.sdblib.IDevice; + +public class TizenDebianLaunchDelegate extends AbstractCLaunchDelegate { + protected static final String PACKAGE_EXTENSION = ".deb"; + protected static final String CMD_RESULT_CHECK = "; echo $?;"; + protected static final String GDBSERVER_DIR = "gdbserver"; + protected static final String GDBSERVER_BIN = "gdbserver"; + protected IConfiguration selectedConfig; + protected IDevice currentDevice; + protected String executeResult = ""; + protected static final String LOCALHOST = "127.0.0.1"; + protected static final String ENVIRONMENT_SETTING_CMD = "export "; + protected int localDebugPort = -1; + protected ICDISession debugSession; + protected static final String ELM_SCALE_GETTER = "/home/developer/sdk_tools/elm_scale_getter/get_elm_scale "; + protected static final int defaultTimeOut = 60000; + + protected String getPluginID() { + return Activator.PLUGIN_ID; + } + + public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { + if (monitor == null) + monitor = new NullProgressMonitor(); + try { + monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION, 20); + monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION); + + activateProgressView(); + + verifyDeviceReachability(getProject(config), new SubProgressMonitor(monitor, 8)); + verifyBuildConfiguration(config, mode, new SubProgressMonitor(monitor, 1)); + + if (mode.equals(ILaunchManager.DEBUG_MODE)) { + verifyTizenDebianProjectSettings(config); + setDebugConfigAttributes(config); + setDefaultSourceLocator(launch, config); + IBinaryObject exeFile = getBinaryObject(config); + launchApplicationForDebug(launch, config, exeFile, new SubProgressMonitor(monitor, 10)); + } else { + launchApplicationForRun(config, launch, new SubProgressMonitor(monitor, 10)); + } + } finally { + if (mode.equals(ILaunchManager.DEBUG_MODE)) { + processPostDebug(config); + } else { + if (!launch.isTerminated()) + launch.terminate(); + ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); + launchManager.removeLaunch(launch); + } + monitor.done(); + } + } + + protected void processPostDebug(ILaunchConfiguration config) + throws CoreException { + if (debugSession != null) { + try { + Process process = debugSession.getSessionProcess(); + if (process != null) + process.waitFor(); + } catch (Exception e) { + // do nothing + } + } + ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); + String gdbserverPort = wc.getAttribute(TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT, TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT); + if (localDebugPort != -1) { + try { + currentDevice.removeForward(localDebugPort, Integer.parseInt(gdbserverPort)); + } catch (Exception e) { + // do nothing + } + } + } + + protected void verifyTizenDebianProjectSettings(ILaunchConfiguration config) throws CoreException { + String appPath = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); + IPath hostPath = getHostPath(appPath, config); + if (hostPath != null) { + if (hostPath.toFile().exists()) + return; + else + newCoreException(TizenDebianLaunchMessages.CANNOT_FIND_EXECUTABLE_IN_A_HOST_ROOTSTRAP, null); + } else { + newCoreException(TizenDebianLaunchMessages.CANNOT_FIND_EXECUTABLE_IN_A_HOST_ROOTSTRAP, null); + } + } + + protected void verifyBuildConfiguration(ILaunchConfiguration config, String mode, IProgressMonitor monitor) throws CoreException { + // FIXME : Match by deviceType, not buildTargetArchitecture. + IProject project = getProject(config); + String buildConfigName = getBuildConfigName(config); + + IConfiguration configuration = getBuildConfiguration(buildConfigName, project); + //String buildTargetArchitecture = SLPConfigurationManager.getArchitecture(configuration); + //String buildTargetArchitecture = CommonConfigurationOld.getArchitecture(configuration); + String buildTargetArchitecture = CommonConfigurationManager.getArchitecture(configuration); + if (currentDevice.isEmulator()) { + if(!buildTargetArchitecture.equals("i386")) + resolveProblematicConfiguration(config, "i386"); + } else { + if(!buildTargetArchitecture.equals("armel")) + resolveProblematicConfiguration(config, "armel"); + } + } + + protected void resolveProblematicConfiguration(ILaunchConfiguration config, final String arch) throws CoreException { + final IProject project = getProject(config); + Display.getDefault().syncExec(new Runnable() { + public void run() { + selectedConfig = selectBuildConfiguration(project, arch); + } + }); + + if (selectedConfig == null) + newCoreException(TizenLaunchMessages.BUILD_CONFIGURATION_DOES_NOT_MATCH_WITH_CURRENT_DEVICE_TYPE, null); + + ICProjectDescription projDes = CDTPropertyManager.getProjectDescription(project); + ICConfigurationDescription cDesc = projDes.getConfigurationByName(selectedConfig.getName()); + ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, cDesc.getConfiguration().getId()); + wc.doSave(); + } + + protected IConfiguration selectBuildConfiguration(IProject project, String arch) { + Shell shell = LaunchUIPlugin.getShell(); + + ILabelProvider topprovider = new LabelProvider() { + public String getText(Object element) { + IConfiguration buildConfig = (IConfiguration)element; + return buildConfig.getName(); + } + }; + + ILabelProvider downprovider = new LabelProvider() { + public String getText(Object element) { + IConfiguration buildConfig = (IConfiguration)element; + return buildConfig.getName(); + } + }; + + TwoPaneElementSelector dlg = new TwoPaneElementSelector(shell, topprovider, downprovider); + dlg.setTitle("Select a new build configuration"); //$NON-NLS-1$ + dlg.setMessage("Build configuration doesn't match with current active device.\nSelect a new build configuration to launch"); //$NON-NLS-1$ + + IConfiguration[] configurations = ManagedBuildManager.getBuildInfo(project).getManagedProject().getConfigurations(); + List<IConfiguration> adaptableConfigs = new ArrayList<IConfiguration>(0); + for(IConfiguration c : configurations) { + //String buildTargetArchitecture = SLPConfigurationManager.getArchitecture(c); + //String buildTargetArchitecture = CommonConfigurationOld.getArchitecture(c); + String buildTargetArchitecture = CommonConfigurationManager.getArchitecture(c); + if (buildTargetArchitecture.equals(arch)) + adaptableConfigs.add(c); + } + + dlg.setElements(adaptableConfigs.toArray()); + + if (dlg.open() == Window.OK) { + IConfiguration selectedConfig = (IConfiguration)dlg.getFirstResult(); + return selectedConfig; + } + + return null; + } + + protected IConfiguration getBuildConfiguration(String buildConfigName, IProject project) throws CoreException { + IConfiguration configuration = null; + IConfiguration[] configurations = ManagedBuildManager.getBuildInfo(project).getManagedProject().getConfigurations(); + for (IConfiguration c : configurations) { + if (c.getName().equals(buildConfigName) ) { + configuration = c; + break; + } + } + if (configuration == null) + newCoreException(TizenLaunchMessages.BUILD_CONFIGURATION_DOES_NOT_MATCH_WITH_CURRENT_DEVICE_TYPE, null); + + return configuration; + } + + protected String getBuildConfigName(ILaunchConfiguration config) throws CoreException { + IProject project = getProject(config); + + String buildConfigName = config.getAttribute(TizenLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_NAME, ""); + + if (buildConfigName.isEmpty()) { + IConfiguration configuration = ManagedBuildManager.getBuildInfo(project).getDefaultConfiguration(); + return configuration.getName(); + } else + return buildConfigName; + } + + + protected boolean resolveProblematicConfiguration(IProject project, IConfiguration problematicConfig, String arch, String mode) { + TizenUIThreadForConfirmMessage runnable = new TizenUIThreadForConfirmMessage(project, problematicConfig, arch, mode); + Display.getDefault().syncExec(runnable); + if(runnable.getResult()) { + ManagedBuildManager.getBuildInfo( project ).setDefaultConfiguration(runnable.getSuitableConfigName()); + return true; + } else { + return false; + } + } + + protected void verifyDeviceReachability(IProject project, IProgressMonitor monitor) throws CoreException { + try { + monitor.beginTask(TizenLaunchMessages.PREPARE_TO_LAUNCH, 1); + monitor.subTask(TizenLaunchMessages.PREPARE_TO_LAUNCH); + + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + if (currentDevice == null) + newCoreException(TizenLaunchMessages.CANNOT_CONNECT_TO_DEVICE, null); + if (currentDevice.isOffline()) + newCoreException(TizenLaunchMessages.CANNOT_CONNECT_TO_DEVICE, null); + } finally { + monitor.done(); + } + } + + protected void launchApplicationForRun(ILaunchConfiguration config, ILaunch launch, + IProgressMonitor monitor) throws CoreException { + try { + monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION, 10); + monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION); + String envCmd = setEnvironments(config); + String execArg = setArguments(config); + currentDevice.executeShellCommand(envCmd + execArg); + } catch (Exception e) { + newCoreException(TizenLaunchMessages.CANNOT_LAUNCH, e); + } finally { + monitor.done(); + } + } + + protected void launchApplicationForDebug(ILaunch launch, ILaunchConfiguration config, IBinaryObject exeFile, IProgressMonitor monitor) throws CoreException, OperationCanceledException { + try { + monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION, 10); + monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION); + launchApplicationWithGDBServer(launch, config, new SubProgressMonitor(monitor, 1)); + launchApplicationWithGDBClient(launch, config, exeFile, new SubProgressMonitor(monitor, 1)); + } finally { + monitor.done(); + } + } + + protected void launchApplicationWithGDBServer(ILaunch launch, ILaunchConfiguration config, IProgressMonitor monitor) throws CoreException { + try { + monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBSERVER, 1); + monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBSERVER); + String gdbserverPort = config.getAttribute(TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT, TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT); + String gdbserverCmd = DebugTool.TOOLS_TARGET_PATH + "/" + GDBSERVER_DIR + "/" + GDBSERVER_BIN + " :" + gdbserverPort; + String execArg = setArguments(config); + String envCmd = setEnvironments(config); + String command = envCmd + gdbserverCmd + " " + execArg; + currentDevice.executeShellCommand(command); + } catch (Exception e) { + newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null); + } finally { + monitor.done(); + } + } + + protected void launchApplicationWithGDBClient(ILaunch launch, ILaunchConfiguration config, IBinaryObject exeFile, IProgressMonitor monitor) throws CoreException { + try { + monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBCLIENT, 1); + monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBCLIENT); + + TizenDebugger debugger = new TizenDebugger(); + debugSession = ((ICDIDebugger2)debugger).createSession(launch, exeFile.getPath().toFile(), new SubProgressMonitor(monitor, 1)); + if(debugSession == null) + newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT, null); + + boolean attrDebuggerStopAtMain = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false); + String attrDebuggerStopAtMainSymbol = null; + if (attrDebuggerStopAtMain) + attrDebuggerStopAtMainSymbol = launch.getLaunchConfiguration().getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT); + + ICDITarget[] targetArray = debugSession.getTargets(); + for (int i = 0; i < targetArray.length; i++) { + Process proc = targetArray[i].getProcess(); + IProcess iproc = null; + if (proc != null) + iproc = DebugPlugin.newProcess(launch, proc, exeFile.getName(), null); + IProject project = getProject(config); + CDIDebugModel.newDebugTarget(launch, project, targetArray[i], + "Tizen debugger", + iproc, exeFile, true, false, attrDebuggerStopAtMainSymbol, true); + } + } catch (Exception e) { + newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT, e); + } finally { + monitor.done(); + } + } + + protected void setDebugConfigAttributes(ILaunchConfiguration config) throws CoreException { + ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); + wc.setAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP, true); + wc.setAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_HOST, LOCALHOST); + String gdbserverPort = wc.getAttribute(TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT, TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN); + try { + localDebugPort = getDebugPort(); + if (localDebugPort < 0) + newCoreException(TizenLaunchMessages.CANNOT_CREATE_FORWARD, null); + currentDevice.createForward(localDebugPort, Integer.parseInt(gdbserverPort)); + String localPort = Integer.valueOf(localDebugPort).toString(); + wc.setAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, localPort); + wc.doSave(); + } catch (Exception e) { + newCoreException(TizenLaunchMessages.CANNOT_CREATE_FORWARD, e); + } + } + + protected int getDebugPort() { + int debugPortBase = -1; + if (currentDevice.isEmulator()) + debugPortBase = 26102; + else + debugPortBase = 26202; + + int port = debugPortBase; + while ((port < 65535) && !LocalPortChecker.isPortAvailable(port)) { + port += 10; + } + + if (LocalPortChecker.isPortAvailable(port)) + return port; + else + return -1; + } + + protected String setEnvironments(ILaunchConfiguration config) throws Exception { + String envs = ""; + String[] envArray = getEnvironment(config); + for (String env : envArray) + envs = ENVIRONMENT_SETTING_CMD + env + " && "; + return envs; + } + + protected String setArguments(ILaunchConfiguration config) throws CoreException { + String appPath = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); + String arguments = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, ""); + String executableWithArguments= ""; + if (!arguments.equals("")) + executableWithArguments = appPath + " " + arguments; + else + executableWithArguments = appPath; + return executableWithArguments; + } + + protected void activateProgressView() { + Display.getDefault().syncExec(new Runnable() { + public void run() { + try { + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.ui.views.ProgressView"); + } catch (PartInitException e) { + e.printStackTrace(); + } + } + }); + } + + protected File findFirstFilebyExtension(File searchPath, String ext) { + File[] allFiles = searchPath.listFiles(new ExtFilter(ext)); + if (allFiles == null || allFiles.length == 0) + return null; + + return allFiles[0]; + } + + protected class ExtFilter implements FilenameFilter { + protected String ext; + + public ExtFilter(String ext) { + this.ext = ext; + } + + public boolean accept(File dir, String name) { + return name.endsWith(ext); + } + } + + protected void newCoreException(String message, Throwable exception) throws CoreException { + Status status = new Status(Status.ERROR, Activator.PLUGIN_ID, message, exception); + throw new CoreException(status); + } + + protected void refreshResources(IProject project) throws CoreException { + if(!project.isSynchronized(IResource.DEPTH_INFINITE)) + project.refreshLocal(IResource.DEPTH_INFINITE, null); + } + + protected IBinaryObject getBinaryObject(ILaunchConfiguration config) throws CoreException { + String appPath = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); + IPath hostPath = getHostPath(appPath, config); + IBinaryObject binaryObject = LaunchUtils.getBinary(getProject(config), hostPath); + return binaryObject; + } + + protected IProject getProject(ILaunchConfiguration config) throws CoreException { + String projectName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); + if (projectName == null || projectName.equals("")) + newCoreException(TizenDebianLaunchMessages.CANNOT_FIND_PROJECT_NAME, null); + return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); + } + + protected IPath getHostPath(String exePath, ILaunchConfiguration config) throws CoreException { + CommonProjectDependentBuilder builder = ProjectTypeManager.getProjectBuilderInstance(getProject(config)); + String targetID = builder.getTargetID(); + + String rootstrapPath = ""; + try { + rootstrapPath = SmartBuildInterface.getInstance().getRootstrapPath(targetID); + } catch (SBIException e) { + newCoreException(TizenDebianLaunchMessages.CANNOT_FIND_HOST_ROOTSTRAP_PATH, e); + } + + if (!rootstrapPath.equals("")) + rootstrapPath = rootstrapPath.concat(exePath); + + return new Path(rootstrapPath); + } +}
\ No newline at end of file diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegateForAttach.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegateForAttach.java new file mode 100644 index 00000000..444ec90d --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegateForAttach.java @@ -0,0 +1,171 @@ +/* +* Native Platform +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch; + +import org.eclipse.cdt.core.IProcessInfo; +import org.eclipse.cdt.core.IProcessList; +import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; +import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants; +import org.eclipse.cdt.launch.internal.ui.LaunchImages; +import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.window.Window; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.dialogs.TwoPaneElementSelector; + +import org.tizen.common.connection.debugtools.DebugTool; +import org.tizen.nativecommon.launch.TizenDeviceProcessList; +import org.tizen.nativecommon.launch.TizenLaunchConfigurationConstants; +import org.tizen.nativecommon.launch.TizenLaunchMessages; + +public class TizenDebianLaunchDelegateForAttach extends TizenDebianLaunchDelegate { + protected Integer pid = Integer.valueOf(-1); + protected final String ATTACH_OPTION = " --attach "; + + @Override + protected void setDebugConfigAttributes(ILaunchConfiguration config) throws CoreException { + ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); + wc.setAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP, true); + wc.setAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_HOST, LOCALHOST); + String gdbserverPort = wc.getAttribute(TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT, TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH); + try { + int localDebugPort = getDebugPort(); + if (localDebugPort < 0) + newCoreException(TizenLaunchMessages.CANNOT_CREATE_FORWARD, null); + currentDevice.createForward(localDebugPort, Integer.parseInt(gdbserverPort)); + String localPort = Integer.valueOf(localDebugPort).toString(); + wc.setAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, localPort); + wc.doSave(); + } catch (Exception e) { + newCoreException(TizenLaunchMessages.CANNOT_CREATE_FORWARD, e); + } + } + + @Override + protected void launchApplicationWithGDBServer(ILaunch launch, ILaunchConfiguration config, IProgressMonitor monitor) throws CoreException { + try { + monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBSERVER, 1); + monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBSERVER); + + setPID(); + if (pid.equals(Integer.valueOf(-1)) || pid.equals(Integer.valueOf(0))) + newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER + ICDTLaunchConfigurationConstants.ERR_NO_PROCESSID, null); + + String gdbserverPort = config.getAttribute(TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT, TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT); + String commandArguments = ":" + gdbserverPort + ATTACH_OPTION + pid; + String gdbserverCmd = DebugTool.TOOLS_TARGET_PATH + "/" + GDBSERVER_DIR + "/" + GDBSERVER_BIN + " " + commandArguments; + String envCmd = setEnvironments(config); + String command = envCmd + gdbserverCmd; + currentDevice.executeShellCommand(command); + } catch (Exception e) { + newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null); + } finally { + monitor.done(); + } + } + + private void setPID() { + Display.getDefault().syncExec(new Runnable() { + public void run() { + pid = promptForProcessID(); + } + }); + } + + private Integer promptForProcessID() { + try { + return selectProcess(); + } catch (CoreException e) { + return Integer.valueOf(-1); + } + } + + private Integer selectProcess() throws CoreException { + Shell shell = LaunchUIPlugin.getShell(); + if (shell == null) + newCoreException(TizenLaunchMessages.CANNOT_LAUNCH, null); + + ILabelProvider topprovider = new LabelProvider() { + public String getText(Object element) { + IProcessInfo pinfo = (IProcessInfo)element; + IPath ppath = new Path(pinfo.getName()); + return ppath.lastSegment() + " - " + pinfo.getPid(); //$NON-NLS-1$ + } + + public Image getImage(Object element) { + return LaunchImages.get(LaunchImages.IMG_OBJS_EXEC); + } + }; + + ILabelProvider downprovider = new LabelProvider() { + public String getText(Object element) { + IProcessInfo info = (IProcessInfo)element; + return info.getName(); + } + + public Image getImage(Object element) { + return LaunchImages.get(LaunchImages.IMG_OBJS_EXEC); + } + }; + + TwoPaneElementSelector dlg = new TwoPaneElementSelector(shell, topprovider, downprovider); + dlg.setTitle("Select Process"); //$NON-NLS-1$ + dlg.setMessage("Select a Process to attach debugger to:"); //$NON-NLS-1$ + + IProcessList processList = null; + processList = new TizenDeviceProcessList(currentDevice); + + IProcessInfo pInfos[] = null; + pInfos = processList.getProcessList(); + + if(pInfos == null) + newCoreException(TizenLaunchMessages.CANNOT_LAUNCH, null); + + dlg.setElements(pInfos); + + if (dlg.open() == Window.OK) { + IProcessInfo info = (IProcessInfo)dlg.getFirstResult(); + if (info != null) + return Integer.valueOf(info.getPid()); + } + + return Integer.valueOf(-1); + } +}
\ No newline at end of file diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegateForCore.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegateForCore.java new file mode 100644 index 00000000..de157006 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegateForCore.java @@ -0,0 +1,228 @@ +/* +* Native Platform +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; +import org.eclipse.cdt.core.model.ICProject; +import org.eclipse.cdt.debug.core.CDIDebugModel; +import org.eclipse.cdt.debug.core.CDebugUtils; +import org.eclipse.cdt.debug.core.ICDIDebugger2; +import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; +import org.eclipse.cdt.debug.core.ICDebugConfiguration; +import org.eclipse.cdt.debug.core.cdi.ICDISession; +import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; +import org.eclipse.cdt.debug.mi.core.GDBCDIDebugger2; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.SubProgressMonitor; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.debug.core.model.IProcess; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +import org.tizen.common.connection.ui.TizenRemoteFileDialog; +import org.tizen.common.connection.ui.TizenRemoteFileDialog.TizenRemoteFileDialogResult; +import org.tizen.nativecommon.launch.TizenLaunchMessages; +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.MultiLineReceiver; +import org.tizen.sdblib.SyncService; +import org.tizen.sdblib.SyncService.SyncResult; + +public class TizenDebianLaunchDelegateForCore extends TizenDebianLaunchDelegate { + protected final static String DEFAULT_CORE_DIR = "/opt/bs/core"; + private FileEntry coreDir = null; + + @Override + protected void setDebugConfigAttributes(ILaunchConfiguration config) throws CoreException { + ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE); + wc.doSave(); + } + + @Override + protected void launchApplicationForDebug(ILaunch launch, ILaunchConfiguration config, IBinaryObject exeFile, IProgressMonitor monitor) throws CoreException, OperationCanceledException { + try { + monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION, 10); + monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION); + launchApplicationWithGDBClient(launch, config, exeFile, new SubProgressMonitor(monitor, 10)); + } finally { + monitor.done(); + } + } + + @Override + protected void launchApplicationWithGDBClient(ILaunch launch, ILaunchConfiguration config, IBinaryObject exeFile, IProgressMonitor monitor) throws CoreException { + ILaunchConfigurationWorkingCopy workingCopy = null; + try { + monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBCLIENT, 2); + monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBCLIENT); + + ICDebugConfiguration debugConfiguration = getDebugConfig(config); + String strPath = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, ""); + + if (strPath == null || strPath.length() == 0) { + IProject project = getProject(config); + FileEntry remotePath = promptForCoreFilePath(project, debugConfiguration); + if(remotePath == null) + newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT, null); + String projectPath = project.getLocation().toOSString(); + String coreFilePath = projectPath + "/core." + project.getName(); + boolean isSuccess = false; + try { + isSuccess = downloadCoreFile(remotePath, coreFilePath, new SubProgressMonitor(monitor, 1)); + } catch (IOException e) { + newCoreException(TizenLaunchMessages.CANNOT_FIND_CORE_FILE, e); + } + + if(isSuccess == false) + newCoreException(TizenLaunchMessages.CANNOT_FIND_CORE_FILE, null); + + File coreFile = new File(coreFilePath.toString()); + IPath corePath = new Path(coreFilePath.toString()); + ICProject cproject = CDebugUtils.verifyCProject(config); + IBinaryObject core = verifyBinary(cproject, corePath); + if (!coreFile.canRead() || !(core.getType() == IBinaryObject.CORE)) + newCoreException(TizenLaunchMessages.INVALID_CORE_FILE, null); + + // Call again the launch delegate with the core file which user has selected. + workingCopy = config.getWorkingCopy(); + workingCopy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, coreFilePath); + workingCopy.launch(ILaunchManager.DEBUG_MODE, new SubProgressMonitor(monitor, 1)); + workingCopy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, ""); + workingCopy.doSave(); + // Coredump debugging finishes here. + return; + } + String appPath = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); + IPath hostPath = getHostPath(appPath, config); + + GDBCDIDebugger2 debugger = new GDBCDIDebugger2(); + ICDISession debugSession = ((ICDIDebugger2)debugger).createSession(launch, hostPath.toFile(), new SubProgressMonitor(monitor, 1)); + if(debugSession == null) + newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT, null); + + ICDITarget[] targetArray = debugSession.getTargets(); + Process proc = null; + IProcess iproc = null; + for (int i = 0; i < targetArray.length; i++) { + proc = targetArray[i].getProcess(); + + if (proc != null) + iproc = DebugPlugin.newProcess(launch, proc, exeFile.getName(), null); + + IProject project = getProject(config); + CDIDebugModel.newDebugTarget(launch, project, targetArray[i], + "Tizen debugger", + iproc, exeFile, true, false, "false", true); + monitor.worked(1); + } + } catch (Exception e) { + newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT, e); + } finally { + if (workingCopy != null) { + workingCopy.setAttribute( ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, ""); + workingCopy.doSave(); + } + monitor.done(); + } + } + + private FileEntry promptForCoreFilePath(final IProject project, ICDebugConfiguration debugConfig) throws CoreException { + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window == null) { + IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); + window = windows[0]; + } + + final Shell shell = window.getShell(); + if (shell != null) { + shell.getDisplay().syncExec(new Runnable() { + public void run() { + TizenRemoteFileDialog dlg = new TizenRemoteFileDialog(shell, "Select a directory where exist coredump file", currentDevice, true, DEFAULT_CORE_DIR); + if (dlg.open() == TizenRemoteFileDialogResult.OK) + coreDir = dlg.getSelectedFileEntry(); + else + coreDir = null; + } + }); + } + return coreDir; + } + + private boolean downloadCoreFile(FileEntry coreDir, String destFilePath, IProgressMonitor monitor) throws IOException { + if (coreDir == null) + return false; + String command = "ls -lt " + coreDir.getFullPath(); + currentDevice.executeShellCommand(command, new MultiLineReceiver() { + @Override + public void processNewLines(String[] lines) { + for (String line : lines) { + if (line.contains("core")) { + executeResult = line.substring(line.indexOf("core")); + break; + } + } + } + }); + + if (!executeResult.startsWith("core")) + return false; + + FileEntry[] coreFiles = coreDir.getFileListingService().getChildren(coreDir, true, null); + FileEntry found = null; + for (FileEntry file : coreFiles) { + if (file.getName().equals(executeResult)) { + found = file; + break; + } + } + + if (found == null) + return false; + + SyncResult result = currentDevice.getSyncService().pullFile(found.getFullPath(), destFilePath, true, SyncService.getNullProgressMonitor()); + + if (result.getCode() == SyncService.RESULT_OK) + return true; + else + return false; + } +}
\ No newline at end of file diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchMessages.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchMessages.java new file mode 100644 index 00000000..35705c82 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchMessages.java @@ -0,0 +1,61 @@ +/* +* Native Platform +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch; + +import org.eclipse.osgi.util.NLS; + +public class TizenDebianLaunchMessages extends NLS { + static { + NLS.initializeMessages(TizenDebianLaunchMessages.class.getName(), TizenDebianLaunchMessages.class); + } + // error messages + public static String CANNOT_FIND_PROJECT_NAME; + public static String CANNOT_CONNECT_TO_DEVICE; + public static String CANNOT_FIND_EXECUTABLE_IN_A_HOST_ROOTSTRAP; + public static String CANNOT_CREATE_PACKAGE; + public static String CANNOT_TRANSFER_FILE; + public static String CANNOT_INSTALL; + public static String CANNOT_LAUNCH; + public static String CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER; + public static String CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT; + public static String BUILD_CONFIGURATION_DOES_NOT_MATCH_WITH_CURRENT_DEVICE_TYPE; + public static String CANNOT_FIND_HOST_ROOTSTRAP_PATH; + public static String CANNOT_FIND_DEBIAN_CONTROL_FILE; + public static String CANNOT_FIND_PACKAGE_SECTION_IN_CONTROL_FILE; + public static String OPERATION_CANCELED; + // non-error messages + public static String LAUNCH_APPLICATION; + public static String LAUNCH_APPLICATION_WITH_GDBSERVER; + public static String LAUNCH_APPLICATION_WITH_GDBCLIENT; + public static String PREPARE_TO_LAUNCH; + public static String START_DEPLOY_PROCESS; + public static String CREATE_PACKAGE; + public static String TRANSFER_PACKAGE; + public static String INSTALL_PACKAGE; +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchMessages.properties b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchMessages.properties new file mode 100644 index 00000000..831e591b --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchMessages.properties @@ -0,0 +1,23 @@ +CANNOT_FIND_PROJECT_NAME = Cannot find a project name. +CANNOT_CONNECT_TO_DEVICE = Cannot connect to a device. +CANNOT_FIND_EXECUTABLE_IN_A_HOST_ROOTSTRAP = Cannot find binary file in a host rootstrap. +CANNOT_CREATE_PACKAGE = Cannot create package. +CANNOT_TRANSFER_FILE = Cannot transfer file. +CANNOT_INSTALL = Cannot install application. +CANNOT_LAUNCH = Cannot launch application. +CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER = Cannot launch application with GDBServer. +CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT = Cannot launch application with GDBClient. +BUILD_CONFIGURATION_DOES_NOT_MATCH_WITH_CURRENT_DEVICE_TYPE = Build configuration does not match with current device type. Select correct device or build configuration. +CANNOT_FIND_HOST_ROOTSTRAP_PATH = Cannot find host rootstrap path. +CANNOT_FIND_DEBIAN_CONTROL_FILE = Cannot find debian control file. +CANNOT_FIND_PACKAGE_SECTION_IN_CONTROL_FILE = Cannot find package section in control file. +OPERATION_CANCELED = Operation canceled. + +LAUNCH_APPLICATION = Launching Application... +LAUNCH_APPLICATION_WITH_GDBSERVER = Launching application with GDBServer... +LAUNCH_APPLICATION_WITH_GDBCLIENT = Launching application with GDBClient... +PREPARE_TO_LAUNCH = Preparing to launch... +START_DEPLOY_PROCESS = Start deploy process... +CREATE_PACKAGE = Creating package... +TRANSFER_PACKAGE = Transferring package... +INSTALL_PACKAGE = Installing package... diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianLaunchConfigurationForAttachTabGroup.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianLaunchConfigurationForAttachTabGroup.java new file mode 100644 index 00000000..ef937a50 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianLaunchConfigurationForAttachTabGroup.java @@ -0,0 +1,45 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch.ui; + +import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; +import org.eclipse.debug.ui.ILaunchConfigurationDialog; +import org.eclipse.debug.ui.ILaunchConfigurationTab; +import org.eclipse.debug.ui.sourcelookup.SourceLookupTab; +import org.tizen.nativecommon.launch.ui.TizenDebuggerTab; + + +public class TizenDebianLaunchConfigurationForAttachTabGroup extends AbstractLaunchConfigurationTabGroup { + @Override + public void createTabs(ILaunchConfigurationDialog dialog, String mode) { + ILaunchConfigurationTab[] tabs = null; + tabs = new ILaunchConfigurationTab[] { new TizenDebuggerTab(true), new SourceLookupTab() }; + setTabs(tabs); + } +}
\ No newline at end of file diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianLaunchConfigurationForCoreTabGroup.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianLaunchConfigurationForCoreTabGroup.java new file mode 100644 index 00000000..2ba3d043 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianLaunchConfigurationForCoreTabGroup.java @@ -0,0 +1,45 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch.ui; + +import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; +import org.eclipse.debug.ui.ILaunchConfigurationDialog; +import org.eclipse.debug.ui.ILaunchConfigurationTab; +import org.eclipse.debug.ui.sourcelookup.SourceLookupTab; +import org.tizen.nativecommon.launch.ui.TizenDebuggerForCoreTab; + + +public class TizenDebianLaunchConfigurationForCoreTabGroup extends AbstractLaunchConfigurationTabGroup { + @Override + public void createTabs(ILaunchConfigurationDialog dialog, String mode) { + ILaunchConfigurationTab[] tabs = null; + tabs = new ILaunchConfigurationTab[] { new TizenDebuggerForCoreTab(), new SourceLookupTab() }; + setTabs(tabs); + } +}
\ No newline at end of file diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianLaunchConfigurationTabGroup.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianLaunchConfigurationTabGroup.java new file mode 100644 index 00000000..0412fb59 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianLaunchConfigurationTabGroup.java @@ -0,0 +1,50 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch.ui; + +import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; +import org.eclipse.debug.ui.ILaunchConfigurationDialog; +import org.eclipse.debug.ui.ILaunchConfigurationTab; +import org.eclipse.debug.ui.sourcelookup.SourceLookupTab; +import org.tizen.nativecommon.launch.ui.TizenDebuggerTab; + + +public class TizenDebianLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup { + @Override + public void createTabs(ILaunchConfigurationDialog dialog, String mode) { + ILaunchConfigurationTab[] tabs = null; + + if (mode.equals("debug")) + tabs = new ILaunchConfigurationTab[] { new TizenDebuggerTab(false), new SourceLookupTab() }; + else + tabs = new ILaunchConfigurationTab[] {}; + + setTabs(tabs); + } +}
\ No newline at end of file diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianMainCoreTab.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianMainCoreTab.java new file mode 100644 index 00000000..3aa804b3 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianMainCoreTab.java @@ -0,0 +1,35 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch.ui; + +public class TizenDebianMainCoreTab extends TizenDebianMainTab { + public TizenDebianMainCoreTab() { + super(true); + } +}
\ No newline at end of file diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianMainTab.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianMainTab.java new file mode 100644 index 00000000..9fab2533 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/TizenDebianMainTab.java @@ -0,0 +1,266 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch.ui; + +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; +import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants; +import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; +import org.eclipse.cdt.launch.ui.CMainTab; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.MessageBox; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.ui.TizenRemoteFileDialog; +import org.tizen.common.connection.ui.TizenRemoteFileDialog.TizenRemoteFileDialogResult; +import org.tizen.nativecommon.launch.TizenLaunchMessages; + +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.IDevice; + +public class TizenDebianMainTab extends CMainTab { + private Label fProgLabel; + private Text fProgText; + private boolean fSpecifyCoreFile; + private static final String LABEL_TEXT = "Tizen Application Path :"; + private static final String DEFAULT_APP_PATH = "/opt/apps/"; + private static final String REMOTE_BROWSE = "Remote Browse..."; + private static final String SELECT_AN_APPLICATION = "Select an Application"; + private String filePath = ""; + + public TizenDebianMainTab() { + this(false); + } + + public TizenDebianMainTab(boolean specifyCoreFile) { + fSpecifyCoreFile = specifyCoreFile; + } + + @Override + public void createControl(Composite parent) { + Composite comp = new Composite(parent, SWT.NONE); + setControl(comp); + + GridLayout topLayout = new GridLayout(); + comp.setLayout(topLayout); + + createVerticalSpacer(comp, 1); + createExeFileField(comp, 1); + createProjectGroup(comp, 1); + if (fSpecifyCoreFile) + createCoreFileGroup(comp, 1); + createVerticalSpacer(comp, 1); + } + + @Override + protected String handleBrowseButtonSelected() { + FileDialog fileDialog = new FileDialog(getShell(), SWT.NONE); + if (fProgText != null) + fileDialog.setFileName(fProgText.getText()); + else if (fCoreText != null) + fileDialog.setFileName(fCoreText.getText()); + return fileDialog.open(); + } + + private void createExeFileField(Composite parent, int colSpan) { + Composite mainComp = new Composite(parent, SWT.NONE); + GridLayout mainLayout = new GridLayout(); + mainLayout.numColumns = 3; + mainLayout.marginHeight = 0; + mainLayout.marginWidth = 0; + mainComp.setLayout(mainLayout); + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + gd.horizontalSpan = colSpan; + mainComp.setLayoutData(gd); + fProgLabel = new Label(mainComp, SWT.NONE); + fProgLabel.setText(LABEL_TEXT); // $NON-NLS-1$ + gd = new GridData(); + gd.horizontalSpan = 3; + fProgLabel.setLayoutData(gd); + fProgText = new Text(mainComp, SWT.SINGLE | SWT.BORDER); + gd = new GridData(GridData.FILL_HORIZONTAL); + fProgText.setLayoutData(gd); + fProgText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent evt) { + updateLaunchConfigurationDialog(); + } + }); + + Button fBrowseForBinaryButton; + fBrowseForBinaryButton = createPushButton(mainComp, REMOTE_BROWSE, null); //$NON-NLS-1$ + fBrowseForBinaryButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent evt) { + handleRemoteBrowseButtonSelected(); + updateLaunchConfigurationDialog(); + } + }); + } + + protected void handleRemoteBrowseButtonSelected() { + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window == null) { + IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); + window = windows[0]; + } + + final Shell shell = window.getShell(); + if (shell != null) { + IDevice device = ConnectionPlugin.getDefault().getCurrentDevice(); + if (device == null) { + MessageBox msgBox = new MessageBox(shell, SWT.ICON_INFORMATION); + msgBox.setMessage(TizenLaunchMessages.CANNOT_CONNECT_TO_DEVICE); + msgBox.open(); + return; + } + + shell.getDisplay().syncExec( new Runnable() { + public void run() { + IDevice device = ConnectionPlugin.getDefault().getCurrentDevice(); + TizenRemoteFileDialog dlg = new TizenRemoteFileDialog(shell, SELECT_AN_APPLICATION, device, false, DEFAULT_APP_PATH); + if(dlg.open() == TizenRemoteFileDialogResult.OK) { + FileEntry selectedFile = dlg.getSelectedFileEntry(); + filePath = selectedFile.getFullPath(); + fProgText.setText(filePath); + } else + filePath = null; + } + }); + } + return; + } + + + @Override + public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { + configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, true); + configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, false); + configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH, ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_DISABLED); + ICElement cElement = null; + cElement = getContext(configuration, getPlatform(configuration)); + if (cElement != null) + initializeCProject(cElement, configuration); + } + + @Override + public void initializeFrom(ILaunchConfiguration configuration) { + updateProgramFromConfig(configuration); + updateProjectFromConfig(configuration); + if (fSpecifyCoreFile) + updateCoreFromConfig(configuration); + } + + @Override + public boolean isValid(ILaunchConfiguration config) { + setErrorMessage(null); + setMessage(null); + + String name = fProjText.getText().trim(); + if (name.length() == 0) { + setErrorMessage(TizenLaunchMessages.TizenMainTab_Project_not_specified); + return false; + } + if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) { + setErrorMessage(TizenLaunchMessages.Launch_common_Project_does_not_exist); + return false; + } + IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); + if (!project.isOpen()) { + setErrorMessage(TizenLaunchMessages.TizenMainTab_Project_must_be_opened); + return false; + } + + if (fProgText != null) + name = fProgText.getText().trim(); + + if (name.length() == 0) { + setErrorMessage(TizenLaunchMessages.TizenMainTab_Program_not_specified); + return false; + } + if (name.equals(".") || name.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$ + setErrorMessage(TizenLaunchMessages.TizenMainTab_Program_does_not_exist); + return false; + } + + //FIXME:: For enabling apply button. but the button is enabled when change more than 2 characters. + try { + ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, name); + wc.doSave(); + } catch (CoreException ce) { + LaunchUIPlugin.log(ce); + } + + return true; + } + + @Override + protected void updateProjectFromConfig(ILaunchConfiguration config) { + String projectName = EMPTY_STRING; + try { + projectName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, EMPTY_STRING); + } catch (CoreException ce) { + LaunchUIPlugin.log(ce); + } + fProjText.setText(projectName); + } + + @Override + protected void updateProgramFromConfig(ILaunchConfiguration config) { + if (fProgText != null) + { + String programName = EMPTY_STRING; + try { + programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EMPTY_STRING); + } catch (CoreException ce) { + LaunchUIPlugin.log(ce); + } + fProgText.setText(programName); + } + } +}
\ No newline at end of file diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenDebianProjectAttachLaunchShortcut.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenDebianProjectAttachLaunchShortcut.java new file mode 100644 index 00000000..45891f53 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenDebianProjectAttachLaunchShortcut.java @@ -0,0 +1,252 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch.ui.shortcut; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; +import org.eclipse.cdt.core.settings.model.ICProjectDescription; +import org.eclipse.cdt.debug.core.CDebugCorePlugin; +import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; +import org.eclipse.cdt.debug.core.ICDebugConfiguration; +import org.eclipse.cdt.debug.internal.ui.launch.CApplicationLaunchShortcut; +import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants; +import org.eclipse.cdt.debug.ui.CDebugUIPlugin; +import org.eclipse.cdt.debug.ui.ICDebuggerPage; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.window.Window; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.dialogs.ElementListSelectionDialog; +import org.tizen.nativecommon.launch.TizenLaunchConfigurationConstants; +import org.tizen.nativeplatform.Activator; +import org.tizen.nativeplatform.launch.TizenDebianLaunchMessages; + + + + +public class TizenDebianProjectAttachLaunchShortcut extends CApplicationLaunchShortcut { + private static final String APPLICATION_PATH_INPUT_DIALOG_TITLE = "Input Tizen Application Path"; + private static final String APPLICATION_PATH_INPUT_DIALOG_TEXT = "Input Tizen Application Path : "; + + public void launch(IProject project, String mode) { + searchAndLaunch(new Object[] {project}, mode); + } + + @Override + public void launch(IEditorPart editor, String mode) { + searchAndLaunch(new Object[] { editor.getEditorInput()}, mode); + } + + @Override + public void launch(ISelection selection, String mode) { + if (selection instanceof IStructuredSelection) { + searchAndLaunch(((IStructuredSelection) selection).toArray(), mode); + } + } + + private void searchAndLaunch(final Object[] elements, String mode) { + if (elements != null && elements.length > 0) { + int nElements = elements.length; + for (int i = 0; i < nElements; i++) { + if (elements[i] instanceof IAdaptable) { + IResource r = (IResource) ((IAdaptable) elements[i]).getAdapter(IResource.class); + if (r != null) { + IProject project = r.getProject(); + if (project != null) { + ILaunchConfiguration config = findLaunchConfiguration(project, mode); + if (config != null) { + DebugUITools.launch(config, mode); + } + } + } + } + } + } + } + + protected ILaunchConfiguration findLaunchConfiguration(IProject project, String mode) { + ILaunchConfiguration configuration = null; + // Set the default debugger based on the active toolchain on the project (if possible) + ICDebugConfiguration debugConfig = null; + ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(project); + ICConfigurationDescription configDesc = projDesc.getActiveConfiguration(); + String configId = configDesc.getId(); + ICDebugConfiguration[] debugConfigs = CDebugCorePlugin.getDefault().getActiveDebugConfigurations(); + int matchLength = 0; + for (int i = 0; i < debugConfigs.length; ++i) { + ICDebugConfiguration dc = debugConfigs[i]; + String[] patterns = dc.getSupportedBuildConfigPatterns(); + if (patterns != null) { + for (int j = 0; j < patterns.length; ++j) { + if (patterns[j].length() > matchLength && configId.matches(patterns[j])) { + debugConfig = dc; + matchLength = patterns[j].length(); + } + } + } + } + + if ( debugConfig == null ) { + // Prompt the user if more then 1 debugger. + String os = Platform.getOS(); + debugConfigs = CDebugCorePlugin.getDefault().getActiveDebugConfigurations(); + List<ICDebugConfiguration> debugList = new ArrayList<ICDebugConfiguration>(debugConfigs.length); + for (int i = 0; i < debugConfigs.length; i++) { + String platform = debugConfigs[i].getPlatform(); + if (debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) { + if (debugConfigs[i].getName().contains("Tizen")) //$NON-NLS-1$ + debugList.add(debugConfigs[i]); + } + } + debugConfigs = (ICDebugConfiguration[]) debugList.toArray(new ICDebugConfiguration[0]); + if (debugConfigs.length == 1) + debugConfig = debugConfigs[0]; + else if (debugConfigs.length > 1) + debugConfig = chooseDebugConfig(debugConfigs, mode); + } + + configuration = createConfiguration(project, debugConfig, mode); + + return configuration; + } + + private ICDebugConfiguration chooseDebugConfig(ICDebugConfiguration[] debugConfigs, String mode) { + ILabelProvider provider = new LabelProvider() { + public String getText(Object element) { + if (element == null) { + return ""; //$NON-NLS-1$ + } else if (element instanceof ICDebugConfiguration) { + return ((ICDebugConfiguration) element).getName(); + } + return element.toString(); + } + }; + ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), provider); + dialog.setElements(debugConfigs); + dialog.setTitle(getDebugConfigDialogTitleString(debugConfigs, mode)); + dialog.setMessage(getDebugConfigDialogMessageString(debugConfigs, mode)); + dialog.setMultipleSelection(false); + int result = dialog.open(); + provider.dispose(); + if (result == Window.OK) { + return (ICDebugConfiguration) dialog.getFirstResult(); + } + return null; + } + + protected ILaunchConfiguration createConfiguration(IProject project, ICDebugConfiguration debugConfig, String mode) { + ILaunchConfiguration config = null; + try { + String projectName = project.getProjectRelativePath().toString(); + ILaunchConfigurationType configType = getCLaunchConfigType(); + ILaunchConfigurationWorkingCopy wc = + configType.newInstance(null, getLaunchManager().generateLaunchConfigurationName(project.getName())); + String programName = getProgramName(); + if (programName != null) + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, programName); + + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName()); + wc.setMappedResources(new IResource[] {project}); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, TizenLaunchConfigurationConstants.DEBUGGER_ID); + wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_COMMAND_FACTORY, TizenLaunchConfigurationConstants.COMMAND_FACTORY_ID); + wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, true); + wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, false); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH, ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_DISABLED); + + + ICProjectDescription projDes = CCorePlugin.getDefault().getProjectDescription(project); + if (projDes != null) { + String buildConfigID = projDes.getActiveConfiguration().getId(); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, buildConfigID); + } + + // Load up the debugger page to set the defaults. There should probably be a separate + // extension point for this. + ICDebuggerPage page = CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID()); + page.setDefaults(wc); + + config = wc.doSave(); + } catch (CoreException ce) { + CDebugUIPlugin.log(ce); + } + return config; + } + + private String getProgramName() throws CoreException { + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window == null) { + IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); + window = windows[0]; + } + final Shell shell = window.getShell(); + + TizenPathInputDialog dlg = new TizenPathInputDialog(shell, + APPLICATION_PATH_INPUT_DIALOG_TITLE, + APPLICATION_PATH_INPUT_DIALOG_TEXT, + null); + if (Window.OK == dlg.open()) + return dlg.getValue(); + else + newCoreException(TizenDebianLaunchMessages.OPERATION_CANCELED, null); + + return null; + } + + private void newCoreException(String message, Throwable exception) throws CoreException { + Status status = new Status(Status.ERROR, Activator.PLUGIN_ID, message, exception); + throw new CoreException(status); + } + + @Override + protected ILaunchConfigurationType getCLaunchConfigType() { + return getLaunchManager().getLaunchConfigurationType("org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForAttach"); + } +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenDebianProjectCoredumpLaunchShortcut.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenDebianProjectCoredumpLaunchShortcut.java new file mode 100644 index 00000000..f9f594e6 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenDebianProjectCoredumpLaunchShortcut.java @@ -0,0 +1,251 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch.ui.shortcut; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; +import org.eclipse.cdt.core.settings.model.ICProjectDescription; +import org.eclipse.cdt.debug.core.CDebugCorePlugin; +import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; +import org.eclipse.cdt.debug.core.ICDebugConfiguration; +import org.eclipse.cdt.debug.internal.ui.launch.CApplicationLaunchShortcut; +import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants; +import org.eclipse.cdt.debug.ui.CDebugUIPlugin; +import org.eclipse.cdt.debug.ui.ICDebuggerPage; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.window.Window; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.dialogs.ElementListSelectionDialog; +import org.tizen.nativecommon.launch.TizenLaunchConfigurationConstants; +import org.tizen.nativeplatform.Activator; +import org.tizen.nativeplatform.launch.TizenDebianLaunchMessages; + + + + +public class TizenDebianProjectCoredumpLaunchShortcut extends CApplicationLaunchShortcut { + private static final String APPLICATION_PATH_INPUT_DIALOG_TITLE = "Input Tizen Application Path"; + private static final String APPLICATION_PATH_INPUT_DIALOG_TEXT = "Input Tizen Application Path : "; + + public void launch(IProject project, String mode) { + searchAndLaunch(new Object[] {project}, mode); + } + + @Override + public void launch(IEditorPart editor, String mode) { + searchAndLaunch(new Object[] { editor.getEditorInput()}, mode); + } + + @Override + public void launch(ISelection selection, String mode) { + if (selection instanceof IStructuredSelection) { + searchAndLaunch(((IStructuredSelection) selection).toArray(), mode); + } + } + + private void searchAndLaunch(final Object[] elements, String mode) { + if (elements != null && elements.length > 0) { + int nElements = elements.length; + for (int i = 0; i < nElements; i++) { + if (elements[i] instanceof IAdaptable) { + IResource r = (IResource) ((IAdaptable) elements[i]).getAdapter(IResource.class); + if (r != null) { + IProject project = r.getProject(); + if (project != null) { + ILaunchConfiguration config = findLaunchConfiguration(project, mode); + if (config != null) { + DebugUITools.launch(config, mode); + } + } + } + } + } + } + } + + protected ILaunchConfiguration findLaunchConfiguration(IProject project, String mode) { + ILaunchConfiguration configuration = null; + // Set the default debugger based on the active toolchain on the project (if possible) + ICDebugConfiguration debugConfig = null; + ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(project); + ICConfigurationDescription configDesc = projDesc.getActiveConfiguration(); + String configId = configDesc.getId(); + ICDebugConfiguration[] debugConfigs = CDebugCorePlugin.getDefault().getActiveDebugConfigurations(); + int matchLength = 0; + for (int i = 0; i < debugConfigs.length; ++i) { + ICDebugConfiguration dc = debugConfigs[i]; + String[] patterns = dc.getSupportedBuildConfigPatterns(); + if (patterns != null) { + for (int j = 0; j < patterns.length; ++j) { + if (patterns[j].length() > matchLength && configId.matches(patterns[j])) { + debugConfig = dc; + matchLength = patterns[j].length(); + } + } + } + } + + if ( debugConfig == null ) { + // Prompt the user if more then 1 debugger. + String os = Platform.getOS(); + debugConfigs = CDebugCorePlugin.getDefault().getActiveDebugConfigurations(); + List<ICDebugConfiguration> debugList = new ArrayList<ICDebugConfiguration>(debugConfigs.length); + for (int i = 0; i < debugConfigs.length; i++) { + String platform = debugConfigs[i].getPlatform(); + if (debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) { + if (debugConfigs[i].getName().contains("Tizen")) //$NON-NLS-1$ + debugList.add(debugConfigs[i]); + } + } + debugConfigs = (ICDebugConfiguration[]) debugList.toArray(new ICDebugConfiguration[0]); + if (debugConfigs.length == 1) + debugConfig = debugConfigs[0]; + else if (debugConfigs.length > 1) + debugConfig = chooseDebugConfig(debugConfigs, mode); + } + + configuration = createConfiguration(project, debugConfig, mode); + + return configuration; + } + + private ICDebugConfiguration chooseDebugConfig(ICDebugConfiguration[] debugConfigs, String mode) { + ILabelProvider provider = new LabelProvider() { + public String getText(Object element) { + if (element == null) { + return ""; //$NON-NLS-1$ + } else if (element instanceof ICDebugConfiguration) { + return ((ICDebugConfiguration) element).getName(); + } + return element.toString(); + } + }; + ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), provider); + dialog.setElements(debugConfigs); + dialog.setTitle(getDebugConfigDialogTitleString(debugConfigs, mode)); + dialog.setMessage(getDebugConfigDialogMessageString(debugConfigs, mode)); + dialog.setMultipleSelection(false); + int result = dialog.open(); + provider.dispose(); + if (result == Window.OK) { + return (ICDebugConfiguration) dialog.getFirstResult(); + } + return null; + } + + protected ILaunchConfiguration createConfiguration(IProject project, ICDebugConfiguration debugConfig, String mode) { + ILaunchConfiguration config = null; + try { + String projectName = project.getProjectRelativePath().toString(); + ILaunchConfigurationType configType = getCLaunchConfigType(); + ILaunchConfigurationWorkingCopy wc = + configType.newInstance(null, getLaunchManager().generateLaunchConfigurationName(project.getName())); + String programName = getProgramName(); + if (programName != null) + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, programName); + + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName()); + wc.setMappedResources(new IResource[] {project}); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, TizenLaunchConfigurationConstants.DEBUGGER_ID); + wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_COMMAND_FACTORY, TizenLaunchConfigurationConstants.COMMAND_FACTORY_ID); + wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, true); + wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, false); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH, ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_DISABLED); + + ICProjectDescription projDes = CCorePlugin.getDefault().getProjectDescription(project); + if (projDes != null) { + String buildConfigID = projDes.getActiveConfiguration().getId(); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, buildConfigID); + } + + // Load up the debugger page to set the defaults. There should probably be a separate + // extension point for this. + ICDebuggerPage page = CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID()); + page.setDefaults(wc); + + config = wc.doSave(); + } catch (CoreException ce) { + CDebugUIPlugin.log(ce); + } + return config; + } + + private String getProgramName() throws CoreException { + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window == null) { + IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); + window = windows[0]; + } + final Shell shell = window.getShell(); + + TizenPathInputDialog dlg = new TizenPathInputDialog(shell, + APPLICATION_PATH_INPUT_DIALOG_TITLE, + APPLICATION_PATH_INPUT_DIALOG_TEXT, + null); + if (Window.OK == dlg.open()) + return dlg.getValue(); + else + newCoreException(TizenDebianLaunchMessages.OPERATION_CANCELED, null); + + return null; + } + + private void newCoreException(String message, Throwable exception) throws CoreException { + Status status = new Status(Status.ERROR, Activator.PLUGIN_ID, message, exception); + throw new CoreException(status); + } + + @Override + protected ILaunchConfigurationType getCLaunchConfigType() { + return getLaunchManager().getLaunchConfigurationType("org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationTypeForCore"); + } +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenDebianProjectLaunchShortcut.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenDebianProjectLaunchShortcut.java new file mode 100644 index 00000000..ee1847f7 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenDebianProjectLaunchShortcut.java @@ -0,0 +1,251 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch.ui.shortcut; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; +import org.eclipse.cdt.core.settings.model.ICProjectDescription; +import org.eclipse.cdt.debug.core.CDebugCorePlugin; +import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; +import org.eclipse.cdt.debug.core.ICDebugConfiguration; +import org.eclipse.cdt.debug.internal.ui.launch.CApplicationLaunchShortcut; +import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants; +import org.eclipse.cdt.debug.ui.CDebugUIPlugin; +import org.eclipse.cdt.debug.ui.ICDebuggerPage; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.window.Window; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.dialogs.ElementListSelectionDialog; +import org.tizen.nativecommon.launch.TizenLaunchConfigurationConstants; +import org.tizen.nativeplatform.Activator; +import org.tizen.nativeplatform.launch.TizenDebianLaunchMessages; + + + + +public class TizenDebianProjectLaunchShortcut extends CApplicationLaunchShortcut { + private static final String APPLICATION_PATH_INPUT_DIALOG_TITLE = "Input Tizen Application Path"; + private static final String APPLICATION_PATH_INPUT_DIALOG_TEXT = "Input Tizen Application Path : "; + + public void launch(IProject project, String mode) { + searchAndLaunch(new Object[] {project}, mode); + } + + @Override + public void launch(IEditorPart editor, String mode) { + searchAndLaunch(new Object[] { editor.getEditorInput()}, mode); + } + + @Override + public void launch(ISelection selection, String mode) { + if (selection instanceof IStructuredSelection) { + searchAndLaunch(((IStructuredSelection) selection).toArray(), mode); + } + } + + private void searchAndLaunch(final Object[] elements, String mode) { + if (elements != null && elements.length > 0) { + int nElements = elements.length; + for (int i = 0; i < nElements; i++) { + if (elements[i] instanceof IAdaptable) { + IResource r = (IResource) ((IAdaptable) elements[i]).getAdapter(IResource.class); + if (r != null) { + IProject project = r.getProject(); + if (project != null) { + ILaunchConfiguration config = findLaunchConfiguration(project, mode); + if (config != null) { + DebugUITools.launch(config, mode); + } + } + } + } + } + } + } + + protected ILaunchConfiguration findLaunchConfiguration(IProject project, String mode) { + ILaunchConfiguration configuration = null; + // Set the default debugger based on the active toolchain on the project (if possible) + ICDebugConfiguration debugConfig = null; + ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(project); + ICConfigurationDescription configDesc = projDesc.getActiveConfiguration(); + String configId = configDesc.getId(); + ICDebugConfiguration[] debugConfigs = CDebugCorePlugin.getDefault().getActiveDebugConfigurations(); + int matchLength = 0; + for (int i = 0; i < debugConfigs.length; ++i) { + ICDebugConfiguration dc = debugConfigs[i]; + String[] patterns = dc.getSupportedBuildConfigPatterns(); + if (patterns != null) { + for (int j = 0; j < patterns.length; ++j) { + if (patterns[j].length() > matchLength && configId.matches(patterns[j])) { + debugConfig = dc; + matchLength = patterns[j].length(); + } + } + } + } + + if ( debugConfig == null ) { + // Prompt the user if more then 1 debugger. + String os = Platform.getOS(); + debugConfigs = CDebugCorePlugin.getDefault().getActiveDebugConfigurations(); + List<ICDebugConfiguration> debugList = new ArrayList<ICDebugConfiguration>(debugConfigs.length); + for (int i = 0; i < debugConfigs.length; i++) { + String platform = debugConfigs[i].getPlatform(); + if (debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) { + if (debugConfigs[i].getName().contains("Tizen")) //$NON-NLS-1$ + debugList.add(debugConfigs[i]); + } + } + debugConfigs = (ICDebugConfiguration[]) debugList.toArray(new ICDebugConfiguration[0]); + if (debugConfigs.length == 1) + debugConfig = debugConfigs[0]; + else if (debugConfigs.length > 1) + debugConfig = chooseDebugConfig(debugConfigs, mode); + } + + configuration = createConfiguration(project, debugConfig, mode); + + return configuration; + } + + private ICDebugConfiguration chooseDebugConfig(ICDebugConfiguration[] debugConfigs, String mode) { + ILabelProvider provider = new LabelProvider() { + public String getText(Object element) { + if (element == null) { + return ""; //$NON-NLS-1$ + } else if (element instanceof ICDebugConfiguration) { + return ((ICDebugConfiguration) element).getName(); + } + return element.toString(); + } + }; + ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), provider); + dialog.setElements(debugConfigs); + dialog.setTitle(getDebugConfigDialogTitleString(debugConfigs, mode)); + dialog.setMessage(getDebugConfigDialogMessageString(debugConfigs, mode)); + dialog.setMultipleSelection(false); + int result = dialog.open(); + provider.dispose(); + if (result == Window.OK) { + return (ICDebugConfiguration) dialog.getFirstResult(); + } + return null; + } + + protected ILaunchConfiguration createConfiguration(IProject project, ICDebugConfiguration debugConfig, String mode) { + ILaunchConfiguration config = null; + try { + String projectName = project.getProjectRelativePath().toString(); + ILaunchConfigurationType configType = getCLaunchConfigType(); + ILaunchConfigurationWorkingCopy wc = + configType.newInstance(null, getLaunchManager().generateLaunchConfigurationName(project.getName())); + String programName = getProgramName(); + if (programName != null) + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, programName); + + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName()); + wc.setMappedResources(new IResource[] {project}); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, TizenLaunchConfigurationConstants.DEBUGGER_ID); + wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_COMMAND_FACTORY, TizenLaunchConfigurationConstants.COMMAND_FACTORY_ID); + wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, true); + wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, false); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH, ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_DISABLED); + + ICProjectDescription projDes = CCorePlugin.getDefault().getProjectDescription(project); + if (projDes != null) { + String buildConfigID = projDes.getActiveConfiguration().getId(); + wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, buildConfigID); + } + + // Load up the debugger page to set the defaults. There should probably be a separate + // extension point for this. + ICDebuggerPage page = CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID()); + page.setDefaults(wc); + + config = wc.doSave(); + } catch (CoreException ce) { + CDebugUIPlugin.log(ce); + } + return config; + } + + private String getProgramName() throws CoreException { + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window == null) { + IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); + window = windows[0]; + } + final Shell shell = window.getShell(); + + TizenPathInputDialog dlg = new TizenPathInputDialog(shell, + APPLICATION_PATH_INPUT_DIALOG_TITLE, + APPLICATION_PATH_INPUT_DIALOG_TEXT, + null); + if (Window.OK == dlg.open()) + return dlg.getValue(); + else + newCoreException(TizenDebianLaunchMessages.OPERATION_CANCELED, null); + + return null; + } + + private void newCoreException(String message, Throwable exception) throws CoreException { + Status status = new Status(Status.ERROR, Activator.PLUGIN_ID, message, exception); + throw new CoreException(status); + } + + @Override + protected ILaunchConfigurationType getCLaunchConfigType() { + return getLaunchManager().getLaunchConfigurationType("org.tizen.nativeplatform.launch.TizenDebianLaunchConfigurationType"); + } +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenDebianPropertyTester.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenDebianPropertyTester.java new file mode 100644 index 00000000..8d72e61e --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenDebianPropertyTester.java @@ -0,0 +1,74 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch.ui.shortcut; + +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; +import org.eclipse.cdt.managedbuilder.core.IManagedProject; +import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; +import org.eclipse.core.expressions.PropertyTester; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.tizen.nativeplatform.build.PlatformConfigurationManager; + + + + +public class TizenDebianPropertyTester extends PropertyTester { + @Override + public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { + if ("isTizenCustomDebianProject".equals(property)) { + if (receiver instanceof IProject) { + IProject project = (IProject)receiver; + return testProject(project); + } + } else if ("belongTizenCustomDebianProject".equals(property)) { + if (receiver instanceof IResource) { + IResource r = (IResource)receiver; + IProject project = r.getProject(); + return testProject(project); + } + } + return false; + } + + private boolean testProject(IProject project) { + IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); + if (info == null) + return false; + IConfiguration cfg = info.getDefaultConfiguration(); + IManagedProject managedProject = cfg.getManagedProject(); + String projectArtifactType = managedProject.getProjectType().getBuildArtefactType().getId(); + if (projectArtifactType.equals(PlatformConfigurationManager.TIZEN_CUSTOM_DEBIAN_ARTIFACT_TYPE) || + projectArtifactType.equals(PlatformConfigurationManager.OLD_SLP_CUSTOM_DEBIAN_ARTIFACT_TYPE)) + return true; + else + return false; + } +}
\ No newline at end of file diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenPathInputDialog.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenPathInputDialog.java new file mode 100644 index 00000000..b7904392 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/TizenPathInputDialog.java @@ -0,0 +1,284 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.launch.ui.shortcut; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.MessageBox; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.ui.TizenRemoteFileDialog; +import org.tizen.common.connection.ui.TizenRemoteFileDialog.TizenRemoteFileDialogResult; +import org.tizen.nativecommon.launch.TizenLaunchMessages; + +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.IDevice; + +public class TizenPathInputDialog extends Dialog { + /** + * The title of the dialog. + */ + private String title; + + /** + * The message to display, or <code>null</code> if none. + */ + private String message; + + /** + * The input value; the empty string by default. + */ + private String value = "";//$NON-NLS-1$ + + /** + * Ok button widget. + */ + private Button okButton; + + /** + * Input text widget. + */ + private Text text; + + private String filePath = ""; + + private static final String DEFAULT_APP_PATH = "/opt/apps/"; + private static final String REMOTE_BROWSE = "Remote Browse..."; + private static final String SELECT_AN_APPLICATION = "Select an Application"; + private static final String SELECT_A_FILE = "Select a file"; + private static final String SELECT_A_FILE_TO_RUN = "Select a file"; + + public TizenPathInputDialog(Shell parentShell, String dialogTitle, + String dialogMessage, String initialValue) { + super(parentShell); + this.title = dialogTitle; + message = dialogMessage; + if (initialValue == null) { + value = "";//$NON-NLS-1$ + } else { + value = initialValue; + } + } + + /* + * (non-Javadoc) Method declared on Dialog. + */ + protected void buttonPressed(int buttonId) { + if (buttonId == IDialogConstants.OK_ID) { + value = text.getText(); + } else { + value = null; + } + super.buttonPressed(buttonId); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) + */ + protected void configureShell(Shell shell) { + super.configureShell(shell); + if (title != null) { + shell.setText(title); + } + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) + */ + protected void createButtonsForButtonBar(Composite parent) { + // create OK and Cancel buttons by default + okButton = createButton(parent, IDialogConstants.OK_ID, + IDialogConstants.OK_LABEL, true); + createButton(parent, IDialogConstants.CANCEL_ID, + IDialogConstants.CANCEL_LABEL, false); + //do this here because setting the text will set enablement on the ok + // button + text.setFocus(); + if (value != null) { + text.setText(value); + text.selectAll(); + } + } + + /* + * (non-Javadoc) Method declared on Dialog. + */ + protected Control createDialogArea(Composite parent) { + // create composite + Composite composite = (Composite) super.createDialogArea(parent); + // create message + if (message != null) { + Label label = new Label(composite, SWT.WRAP); + label.setText(message); + GridData data = new GridData(GridData.GRAB_HORIZONTAL + | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL + | GridData.VERTICAL_ALIGN_CENTER); + data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); + label.setLayoutData(data); + label.setFont(parent.getFont()); + } + + Composite pathComp = new Composite(composite, SWT.NONE); + GridLayout pathLayout = new GridLayout(); + pathLayout.numColumns = 2; + pathComp.setLayout(pathLayout); + text = new Text(pathComp, getInputTextStyle()); + GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); + data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); + text.setLayoutData(data); + + Button browseButton; + browseButton = createPushButton(pathComp, REMOTE_BROWSE, null); + browseButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent evt) { + String path = handleBrowseButtonSelected(); + if (path != null) { + text.setText(path); + } + } + }); + applyDialogFont(composite); + return composite; + } + + /** + * Returns the error message label. + * + * @return the error message label + * @deprecated use setErrorMessage(String) instead + */ + protected Label getErrorMessageLabel() { + return null; + } + + /** + * Returns the ok button. + * + * @return the ok button + */ + protected Button getOkButton() { + return okButton; + } + + /** + * Returns the text area. + * + * @return the text area + */ + protected Text getText() { + return text; + } + + /** + * Returns the string typed into this input dialog. + * + * @return the input string + */ + public String getValue() { + return value; + } + + /** + * Returns the style bits that should be used for the input text field. + * Defaults to a single line entry. Subclasses may override. + * + * @return the integer style bits that should be used when creating the + * input text + * + * @since 3.4 + */ + protected int getInputTextStyle() { + return SWT.SINGLE | SWT.BORDER; + } + + public static Button createPushButton(Composite parent, String label, Image image) { + Button button = new Button(parent, SWT.PUSH); + button.setFont(parent.getFont()); + if (image != null) { + button.setImage(image); + } + if (label != null) { + button.setText(label); + } + GridData gd = new GridData(); + button.setLayoutData(gd); + return button; + } + + protected String handleBrowseButtonSelected() { + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window == null) { + IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); + window = windows[0]; + } + + final Shell shell = window.getShell(); + if (shell != null) { + IDevice device = ConnectionPlugin.getDefault().getCurrentDevice(); + if (device == null) { + MessageBox msgBox = new MessageBox(shell, SWT.ICON_INFORMATION); + msgBox.setMessage(TizenLaunchMessages.CANNOT_CONNECT_TO_DEVICE); + msgBox.open(); + return null; + } + + shell.getDisplay().syncExec( new Runnable() { + public void run() { + IDevice device = ConnectionPlugin.getDefault().getCurrentDevice(); + TizenRemoteFileDialog dlg = new TizenRemoteFileDialog(shell, SELECT_AN_APPLICATION, device, false, DEFAULT_APP_PATH); + if(dlg.open() == TizenRemoteFileDialogResult.OK) { + FileEntry selectedFile = dlg.getSelectedFileEntry(); + filePath = selectedFile.getFullPath(); + } else + filePath = null; + } + }); + } + return filePath; + } +}
\ No newline at end of file diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/DialogActionDelegate.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/DialogActionDelegate.java new file mode 100644 index 00000000..42ea43f6 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/DialogActionDelegate.java @@ -0,0 +1,106 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.pkgInstall; + +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.IManagedProject; +import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; +import org.eclipse.core.resources.IProject; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; + +import org.tizen.common.connection.ConnectionPlugin; + + +import org.tizen.nativecommon.build.CurrentEnabledProject; +import org.tizen.nativeplatform.build.PlatformConfigurationManager; +import org.tizen.sdblib.IDevice; + +public class DialogActionDelegate implements IWorkbenchWindowActionDelegate { + private IWorkbenchWindow window; + + PackageManager pkgdlg; + String target = null; + boolean enableRootstrap = true; + boolean eanbleTarget = true; + @Override + public void run(IAction arg0) { + // TODO Auto-generated method stub + //DeviceMachine machine = DeviceManager.getSelectedDevice(); + IDevice device = ConnectionPlugin.getDefault().getCurrentDevice(); + if (device == null) { + eanbleTarget = false; + } else { + target = device.getSerialNumber(); + if (target == null) { + eanbleTarget = false; + } + } + + IProject project = CurrentEnabledProject.getCurrentProject(); + if (project == null) { + enableRootstrap = false; + } else { + IConfiguration cfg =ManagedBuildManager.getBuildInfo( project ).getDefaultConfiguration(); + IManagedProject managedProject = cfg.getManagedProject(); + String projectArtifactType = managedProject.getProjectType().getBuildArtefactType().getId(); + if (!projectArtifactType.equals(PlatformConfigurationManager.TIZEN_CUSTOM_DEBIAN_ARTIFACT_TYPE) && + !projectArtifactType.equals(PlatformConfigurationManager.OLD_SLP_CUSTOM_DEBIAN_ARTIFACT_TYPE)) { + enableRootstrap = false; + }else + enableRootstrap = true; + } + + pkgdlg = new PackageManager(window.getShell(), target, enableRootstrap, eanbleTarget); + pkgdlg.open(); + + } + + @Override + public void selectionChanged(IAction arg0, ISelection arg1) { + // TODO Auto-generated method stub + + } + + @Override + public void dispose() { + // TODO Auto-generated method stub + } + + @Override + public void init(IWorkbenchWindow arg0) { + // TODO Auto-generated method stub + this.window = arg0; + this.enableRootstrap = true; + this.eanbleTarget = true; + } + +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PackageCommander.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PackageCommander.java new file mode 100644 index 00000000..a0917945 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PackageCommander.java @@ -0,0 +1,653 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.pkgInstall; + +import java.io.File; +import java.io.FileWriter; +import java.io.OutputStream; + +import org.tizen.common.util.HostUtil; + +import org.tizen.nativecommon.build.SmartBuildInterface; +import org.tizen.nativecommon.build.exception.SBIException; +import org.tizen.sdblib.IDevice; + +public class PackageCommander { + + private final static SmartBuildInterface sbi = SmartBuildInterface.getInstance(); + private final static int MAX_TIMEOUT = 60000; + private final static int VERIFY_SSHCONN_TIMEOUT = 30000; + + public PackageCommander() { + } + + public static String getCurrentSourceListForRootstrap(String targetID) throws SBIException { + + String result = ""; + + try { + result = sbi.actionStdOut("command", + String.format("-mode=emulate -cmd=\'cat /etc/apt/sources.list\' -path=." ), + targetID, null ); + } catch (SBIException e) { + e.printStackTrace(); + } + + return result.trim(); + } + + public static String getCurrentSourceListForRealTarget(IDevice device, PackageManagerOuputReceiver rec) { + String command = "cat /etc/apt/sources.list"; + String result = ""; + + if (device != null) { + try { + device.executeShellCommand(command, rec, MAX_TIMEOUT); + for (String line : rec.getLog()) { + result = result + line + "\n"; + } + + } catch (Exception e) { + e.printStackTrace(); + } + + if (device.isEmulator()) { + String[] splitResult = result.split("\n"); + if (splitResult.length > 1) { + result = splitResult[1]; + } else if (splitResult.length == 1){ + result = splitResult[0]; + } + } + + } + + return result.trim(); + } + + public static void changeSourceListForRealTarget(String sourceList, IDevice device) { + String command = String.format("echo \"%s\" > /etc/apt/sources.list", sourceList); + + if (device != null) { + try { + device.executeShellCommand(command); + //result = session.run(command, null); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + public static void changeSourceListForRootstrap(String targetID, String sourceList) { + if (targetID == null) { + return; + } + + try { + String rootstrapPath = sbi.getRootstrapPath(targetID); + String sourcesListFile = rootstrapPath + "/etc/apt/sources.list"; + + /** "echo" command is not used on shell.execute() **/ + // String command = String.format("/bin/echo \"%s\" > %s/etc/apt/sources.list", sourceList, rootstrapPath); + + + File file = new File(sourcesListFile); + FileWriter writer = new FileWriter(file); + writer.write(sourceList); + writer.close(); + } catch(SBIException e) { + e.printStackTrace(); + } catch(Exception e1) { + e1.printStackTrace(); + } + } + + public static void resolveDpkgInterruptForRootstrap(String targetID, + OutputStream stdoutStream, OutputStream stderrStream) { + if (targetID == null) { + return; + } + + String command = "dpkg --configure -a"; + + try { + sbi.actionStdOut("command", + String.format("-mode=emulate -cmd=\'%s\' -path=.", command ), + targetID, null ); + } catch (SBIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public static void aptGetUpdateForRootstrap(String targetID, + OutputStream stdoutStream, OutputStream stderrStream) { + if (targetID == null) { + return; + } + + String command = "apt-get update"; + + try { + sbi.actionStream("command", + String.format("-mode=emulate -cmd=\'%s\' -path=.", command ), + targetID, null, stdoutStream, stderrStream ); + } catch (SBIException e) { + // TODO Auto-generated catch block + e.setMessage("Failed to update. please check console view."); + e.printStackTrace(); + e.showErrorDialog(); + } + } + + public static boolean verifySshConnectionForRootstrap(String targetID, String remoteAddr) { + String command = "ssh -oStrictHostKeyChecking=no " + remoteAddr + " exit"; + int result = 0; + + if (targetID == null) { + return false; + } + + try { + result = sbi.actionReturnExitValue("command", + String.format("-mode=emulate -cmd=\'%s\' -path=.", command ), + targetID, null ); + } catch (SBIException e) { + // TODO Auto-generated catch block + e.setMessage(String.format("Failed to execute \"%s\"", command)); + e.printStackTrace(); + e.showErrorDialog(); + } + + if (result != 0) { + SBIException e = new SBIException( + String.format("Failed to connect \"%s\".", remoteAddr)); + e.showErrorDialog(); + return false; + } + return true; + } + + public static void aptGetUpgradeForRootstrap(String targetID, + OutputStream stdoutStream, OutputStream stderrStream) { + + if (targetID == null) { + return; + } + + String command = "apt-get --force-yes -y dist-upgrade"; + try { + sbi.actionStream("command", + String.format("-mode=emulate -cmd=\'%s\' -path=.", command ), + targetID, null, stdoutStream, stderrStream ); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + + public static void aptGetInstallForRootstrap(String targetID, String pkgList, + OutputStream stdoutStream, OutputStream stderrStream) { + if (targetID == null) { + return; + } + + String command = String.format("apt-get --force-yes -y install %s", pkgList); + try { + sbi.actionStream("command", + String.format("-mode=emulate -cmd=\'%s\' -path=.", command ), + targetID, null, stdoutStream, stderrStream ); + } catch (SBIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + + public static void aptGetInstallForTarget(String pkgName, IDevice device, PackageManagerOuputReceiver rec) { + String command = String.format("apt-get --force-yes -y install %s", pkgName); + + if (device != null) { + try { + device.executeShellCommand(command, rec, MAX_TIMEOUT); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + + public static void dpkgInstallForRootstrap(String targetID, String debList, + OutputStream stdoutStream, OutputStream stderrStream) { + + if (targetID == null) { + return ; + } + + String command = String.format("dpkg -i %s", debList); + try { + sbi.actionStream("command", + String.format("-mode=emulate -cmd=\'%s\' -path=.", command ), + targetID, null, stdoutStream, stderrStream ); + } catch (SBIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public static void aptGetUpdateForRealTarget(IDevice device, PackageManagerOuputReceiver rec) { + String command = "apt-get update"; + + if (device != null) { + try { + device.executeShellCommand(command, rec, MAX_TIMEOUT); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + public static void fixBrokenForRootstrap(String targetID, OutputStream stdoutStream, OutputStream stderrStream) { + + if (targetID == null) { + return ; + } + + String command = "apt-get -f --force-yes -y install"; + try { + sbi.actionStream("command", + String.format("-mode=emulate -cmd=\'%s\' -path=.", command ), + targetID, null, stdoutStream, stderrStream ); + } catch (SBIException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public static void fixBrokenForRealTarget(IDevice device, PackageManagerOuputReceiver rec) { + String command = "apt-get -f --force-yes -y install"; + + if (device != null) { + try { + device.executeShellCommand(command, rec, MAX_TIMEOUT); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + public static boolean verifySshConnectionForRealTarget(IDevice device, String remoteAddr, PackageManagerOuputReceiver rec) { + String command = "ssh -oStrictHostKeyChecking=no " + remoteAddr + " exit; echo $?"; + String log = ""; + + if (device != null) { + try { + device.executeShellCommand(command, rec, VERIFY_SSHCONN_TIMEOUT); + String[] logs = rec.getLog(); + log = logs[0]; + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + if (log.equals("0")) { + return true; + } else { + SBIException e = new SBIException( + String.format("Failed to connect \"%s\".", remoteAddr)); + e.showErrorDialog(); + return false; + } + } + + + public static void aptGetUpgradeForRealTarget(IDevice device, PackageManagerOuputReceiver rec) { + String command = "apt-get --force-yes -y dist-upgrade"; + + if (device != null) { + try { + device.executeShellCommand(command, rec, MAX_TIMEOUT); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + public static String getArchForDebFile(String debPath) { + String retStr = ""; + + String command = String.format("dpkg --info %s | grep \"Architecture: \"", debPath); + String result = HostUtil.returnExecute(command); + + if (!result.contains("Architecture: ")) { + return retStr; + } + + String[] splitResult = result.split(":"); + + if (splitResult.length < 2 ) { + return retStr; + } + + retStr = splitResult[1].trim(); + + return retStr; + } + + public static String getArchOfRemotePkgForRootstrap(String pkgName, String targetID) { + String retStr = ""; + if (targetID == null) { + return ""; + } + + try { + String command = String.format("apt-cache show %s | grep \"Architecture: \"", pkgName); + String result = sbi.actionStdOut("command", + String.format("-mode=emulate -cmd=\'%s\' -path=.", command ), + targetID, null ); + + if (!result.contains("Architecture: ")) { + return retStr; + } + + result = result.split("\n")[0]; + String[] splitResult = result.split(":"); + + if (splitResult.length < 2 ) { + return retStr; + } + + retStr = splitResult[1].trim(); + + } catch (SBIException e) { + // TODO Auto-generated catch block + //e.printStackTrace(); + } + + return retStr; + } + private static String getValue(String header, String key) { + int s_pos = 0; + int e_pos = 0; + String ret = null; + s_pos = header.indexOf(key); + if (s_pos == -1) + return ""; + e_pos = header.indexOf("\n",s_pos); + if (e_pos == -1) { + ret = header.substring(s_pos+key.length()); + } else { + ret = header.substring(s_pos+key.length(), e_pos).trim(); + } + return ret; + } + public static String getArchOfRemotePkgForRealTarget(String pkgName, IDevice device, PackageManagerOuputReceiver rec) { + String retStr = ""; + String archKey = "Architecture: "; + if (device != null) { + try { + String result = ""; + String command = String.format("apt-cache show %s | grep \"Architecture: \"", pkgName); + device.executeShellCommand(command, rec, MAX_TIMEOUT); + for(String line : rec.getLog()) { + result = result + line + "\n"; + } + //String result = session.run(command, null); + + retStr = getValue(result,archKey); + } catch (Exception e) { + e.printStackTrace(); + } + } + + return retStr; + } + + + public static String getPkgNameForDebFile(String debPath) { + String retStr = ""; + + String command = String.format("dpkg --info %s | grep \"Package: \"", debPath); + String result = HostUtil.returnExecute(command); + + if (!result.contains("Package: ")) { + return retStr; + } + + String[] splitResult = result.split(":"); + + if (splitResult.length < 2 ) { + return retStr; + } + + retStr = splitResult[1].trim(); + + return retStr; + } + + public static String getPkgVerForDebFile(String debPath) { + String retStr = ""; + + String command = String.format("dpkg --info %s | grep \"Version: \"", debPath); + String result = HostUtil.returnExecute(command); + + if (!result.contains("Version:")) { + return retStr; + } + + String[] splitResult = result.split(":"); + + if (splitResult.length < 2 ) { + return retStr; + } + + retStr = splitResult[1].trim(); + + return retStr; + } + + public static String getPkgNewVerForRootstrap(String pkgName, String targetID) { + String retStr = ""; + if (targetID == null) { + return ""; + } + + try { + String command = String.format("apt-cache showpkg %s | grep -A 1 \"Versions:\"", pkgName); + String result = sbi.actionStdOut("command", + String.format("-mode=emulate -cmd=\'%s\' -path=.", command ), + targetID, null ); + + if (!result.contains("Versions:")) { + return retStr; + } + + String[] splitResult = result.split("\n"); + + if (splitResult.length < 2 ) { + return retStr; + } + + //splitResult = splitResult[1].split(" ")[0].split(":"); + //retStr = splitResult[splitResult.length-1].trim(); + retStr = splitResult[1].split(" ")[0]; + } catch (SBIException e) { + e.printStackTrace(); + } + return retStr; + } + + public static String getPkgNewVerForRealTarget(String pkgName, IDevice device, PackageManagerOuputReceiver rec) { + String retStr = ""; + + if (device != null) { + try { + String result = ""; + String command = String.format("apt-cache showpkg %s | grep -A 1 \"Versions:\"", pkgName); + //String result = session.run(command, null); + device.executeShellCommand(command, rec, MAX_TIMEOUT); + + for (String line : rec.getLog()) { + result = result + line + "\n"; + } + + if (!result.contains("Versions:")) { + return retStr; + } + + String[] splitResult = result.split("\n"); + + if (splitResult.length < 2 ) { + return retStr; + } + + //splitResult = splitResult[1].split(" ")[0].split(":"); + retStr = splitResult[1].split(" ")[0]; + //retStr = splitResult[splitResult.length-1].trim(); + + } catch (Exception e1) { + e1.printStackTrace(); + } + } + + return retStr; + } + + + public static String getPkgInstalledVerForRootstrap(String pkgName, String targetID) { + String retStr = ""; + if (targetID == null) { + return ""; + } + + try { + + String command = String.format("dpkg -s %s | grep \"Version: \"", pkgName); + + String result = sbi.actionStdOut("command", + String.format("-mode=emulate -cmd=\'%s\' -path=.", command ), + targetID, null ); + + if (!result.contains("Version: ")) { + return retStr; + } + + result = result.replace("\n", " "); + String[] splitResult = result.split(" "); + if (splitResult.length < 2) { + return retStr; + } + + //splitResult = splitResult[1].split(" ")[0].split(":"); + //retStr = splitResult[splitResult.length-1].replace("\n", "").trim(); + retStr = splitResult[1].split(" ")[0]; + } catch (SBIException e) { + e.printStackTrace(); + } + + return retStr; + } + + public static String getPkgInstalledVerForRealTarget(String pkgName, IDevice device, PackageManagerOuputReceiver rec) { + String archKey = "Version: "; + String retStr = ""; + if (device != null) { + try { + String command = String.format("dpkg -s %s | grep \"Version: \"", pkgName); + String result = ""; + device.executeShellCommand(command, rec, MAX_TIMEOUT); + for (String line : rec.getLog()) { + result = result + line + "\n"; + } + //String result = session.run(command, null); + + retStr = getValue(result,archKey); + + } catch (Exception e1) { + e1.printStackTrace(); + } + } + + return retStr; + } + + public static boolean pkgInstalledSuccessfullyForRootstrap(String pkgName, String targetID) { + boolean ret = false; + + if (targetID == null) { + return ret; + } + + try { + String command = String.format("dpkg -l | grep -w \"%s \" | cut -d\" \" -f1", pkgName); + String result = sbi.actionStdOut("command", + String.format("-mode=emulate -cmd=\'%s\' -path=.", command ), + targetID, null ); + + result = result.trim(); + + if (result.equals("ii")) { + ret = true; + } + + } catch (SBIException e) { + e.printStackTrace(); + } + + return ret; + } + + public static boolean pkgInstalledSuccessfullyForRealTarget(String pkgName, IDevice device, PackageManagerOuputReceiver rec) { + boolean ret = false; + if (device != null) { + try { + String command = String.format("dpkg -l | grep -w \"%s \" | cut -d' ' -f1", pkgName); + device.executeShellCommand(command, rec, MAX_TIMEOUT); + for (String line : rec.getLog()) { + line = line.trim(); + if (line.equals("ii")) { + ret = true; + } + } + + } catch (Exception e1) { + e1.printStackTrace(); + } + } + + return ret; + } +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PackageManager.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PackageManager.java new file mode 100644 index 00000000..aa02f4dc --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PackageManager.java @@ -0,0 +1,1626 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.pkgInstall; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.util.Iterator; +import java.util.concurrent.CopyOnWriteArrayList; + +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.TableViewerColumn; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.swt.widgets.TabItem; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.console.MessageConsoleStream; + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.console.ConsoleManager; + + +import org.tizen.nativecommon.build.CheckCancelJob; +import org.tizen.nativecommon.build.CurrentEnabledProject; +import org.tizen.nativecommon.build.SmartBuildInterface; +import org.tizen.nativecommon.build.exception.SBIException; +import org.tizen.nativeplatform.Activator; +import org.tizen.nativeplatform.build.PlatformConfigurationManager; +import org.tizen.sdblib.IDevice; +import org.tizen.sdblib.SyncService; +import org.tizen.sdblib.SyncService.SyncResult; + + +public class PackageManager extends Dialog { + + private TableViewer viewerForRootstrap = null; + private TableViewer viewerForTarget = null; + private static TableViewer currentViewer; + private static String CURRENT_TAB_NAME; + + private static Table tableForRootstrap = null; + private static Table tableForTarget = null; + + private Button addButtonFromFile; + private Button addButtonFromRemote; + private Button installButton; + private Button removeButton; + private Button upgradeButton; + private Button updateButton; + private Button fixBrokenButton; + + private Text repositoryText; + private Text packageListText; + + private static String ROOTSTRAP_TAB_NAME = "Build System"; + private static String TARGET_TAB_NAME = "Device"; + private static String DEB_PATH= "/tmp"; + private static String DEB_COMMAND_INSTALL = "dpkg -i"; + private static String DEB_COMMAND_UPDATEMODE = "/bin/change-booting-mode.sh --update"; + + public Shell shell; + + public String target = null; + private String addPkgListForRemote; + private String repositoryForRemote; + private static String previousFilterPath = null; + private String selectedFileList; + private String configuration; + + private IDevice device; + private Display display = null; + private FileDialog fd; + private TabFolder tabFolder; + private CopyOnWriteArrayList<Package> pkgs = null; + + private boolean enableRootstrapTab = true; + private boolean enableTargetTab = true; + + private final int MAX_TIMEOUT = 60000; + + private SmartBuildInterface sbi = SmartBuildInterface.getInstance(); + + private int tabIndex = 0; + + private MouseListener removeListener = new MouseListener() + { + + @Override + public void mouseDoubleClick(MouseEvent e) { + } + + @Override + public void mouseDown(MouseEvent e) { + CopyOnWriteArrayList<Package> pkgList = PkgModelProvider.INSTANCE.getPkgs(); + for( Package pkg: pkgList) + { + boolean selected = false; + if (CURRENT_TAB_NAME.equals(ROOTSTRAP_TAB_NAME)) { + selected = pkg.getCheckColumn1(); + } else if (CURRENT_TAB_NAME.equals(TARGET_TAB_NAME)) { + selected = pkg.getCheckColumn2(); + } + if (selected) { + pkgList.remove(pkg); + } + } + if (viewerForRootstrap != null) { + viewerForRootstrap.refresh(); + } + if (viewerForTarget != null) { + viewerForTarget.refresh(); + } + + int recentTableIndex = currentViewer.getTable().getItemCount(); + + for (int i = 0; i < recentTableIndex; i++) { + TableItem item1 = null; + TableItem item2 = null;; + + if (viewerForRootstrap != null) { + item1 = viewerForRootstrap.getTable().getItem(i); + Package pkg = (Package)item1.getData(); + item1.setChecked(pkg.getCheckColumn1()); + } + if (viewerForTarget != null) { + item2 = viewerForTarget.getTable().getItem(i); + Package pkg = (Package)item2.getData(); + item2.setChecked(pkg.getCheckColumn2()); + } + } + } + + @Override + public void mouseUp(MouseEvent e) { + } + + }; + + + protected PackageManager(Shell parentShell, String target) { + super(parentShell); + setBlockOnOpen(false); + this.display = parentShell.getDisplay(); + this.target = target; + this.device = ConnectionPlugin.getDefault().getCurrentDevice(); + } + + protected PackageManager(Shell parentShell, String target, boolean enableRootstrap, boolean enableTarget) { + super(parentShell); + setBlockOnOpen(false); + this.enableRootstrapTab = enableRootstrap; + this.enableTargetTab = enableTarget; + this.display = parentShell.getDisplay(); + + if (enableRootstrap) { + IProject _project = CurrentEnabledProject.getCurrentProject(); + IConfiguration config = ManagedBuildManager.getBuildInfo( _project ).getDefaultConfiguration(); + this.configuration = config.getName(); + } + if (enableTarget) { + this.target = target; + this.device = ConnectionPlugin.getDefault().getCurrentDevice(); + } + } + + protected PackageManager(Shell parentShell, String target, int tabIndex) { + super(parentShell); + setBlockOnOpen(false); + this.display = parentShell.getDisplay(); + this.target = target; + this.device = ConnectionPlugin.getDefault().getCurrentDevice(); + this.tabIndex = tabIndex; + } + + protected void setShellStyle(int newShellStyle) { + int newStyle = newShellStyle & ~SWT.APPLICATION_MODAL; + newStyle |= SWT.MODELESS; + super.setShellStyle(newStyle); + } + + @Override + public boolean close() + { + PkgModelProvider.INSTANCE.getPkgs().clear(); + return super.close(); + } + + protected void createButtonsForButtonBar(Composite parent) + { + createButton(parent, IDialogConstants.OK_ID, IDialogConstants.CLOSE_LABEL, true); + } + + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText("Package Manager"); + newShell.setLocation(100, 100); + newShell.setSize(960, 600); + } + + @Override + protected Control createDialogArea(Composite parent) { + + + Composite composite = new Composite( parent, SWT.None ); + composite.setLayoutData(new GridData(GridData.FILL_BOTH)); + composite.setLayout(new GridLayout(1, false)); + + if (!enableRootstrapTab && !enableTargetTab) { + createError( composite, "- Any project is not selected and any connection is not connected,\n" + + "- or project is not \"CUSTOM DEBIAN PROJECT\"." ); + } else { + //2nd basement : Sourcelist + update button + createTopComposite( composite ); + //3rd basement : Package text + +, - button + createMiddleComposite( composite ); + //5th basement : tab (upgrade/install button + table) + createBottomComposite( composite ); + } + + return null; + } + + + private void createError( Composite parent, String message ) + { + Composite com = new Composite( parent, SWT.NONE ); + com.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); + com.setLayout(new GridLayout(1, false)); + + Label errorLabel = new Label(com, SWT.NONE); + errorLabel.setText(message); + } + + private void createTopComposite( Composite parent ) + { + Composite com = new Composite( parent, SWT.NONE ); + com.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); + com.setLayout(new GridLayout(3, false)); + + Label searchLabel = new Label( com, SWT.NONE ); + searchLabel.setText("Source List : "); + + repositoryText = new Text(com, SWT.SINGLE | SWT.BORDER | SWT.SEARCH); + + GridData gridData = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); + gridData.widthHint = 300; + repositoryText.setLayoutData(gridData); + + if (enableRootstrapTab) { + String targetID = getTargetID(); + + try { + repositoryText.setText(PackageCommander.getCurrentSourceListForRootstrap(targetID)); + } catch (SBIException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } else if (enableTargetTab) { + //repositoryText.setText(PackageCommander.getCurrentSourceListForRealTarget(getSession())); + PackageManagerOuputReceiver rec = new PackageManagerOuputReceiver(); + rec.setPrintConsole(false); + repositoryText.setText(PackageCommander.getCurrentSourceListForRealTarget(device, rec)); + } else { + repositoryText.setText(""); + } + + updateButton = new Button( com, SWT.PUSH ); + updateButton.setText("Update "); + updateButton.addMouseListener(new MouseListener(){ + + @Override + public void mouseDoubleClick(MouseEvent e) { + } + + @Override + public void mouseDown(MouseEvent e) { + repositoryForRemote = repositoryText.getText(); + + if(repositoryForRemote.isEmpty()) { + MessageDialog.openError(shell, "Error", "Repository is empty.\nPlease set repository."); + return; + } + + ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell()); + + try { + dialog.run(true, true, new IRunnableWithProgress() { + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, + InterruptedException { + monitor.beginTask("apt-get update", -1); + + CheckCancelJob cancelJob = new CheckCancelJob(monitor); + Thread checkCancelThread = new Thread(cancelJob); + checkCancelThread.start(); + + ConsoleManager cm = new ConsoleManager( "Package Installer", true); + cm.clear(); + MessageConsoleStream mcsError = cm.getMessageConsoleStream(true); + MessageConsoleStream mcs = cm.getMessageConsoleStream(false); + PackageManagerOuputReceiver rec = new PackageManagerOuputReceiver(); + rec.setMessageConsoleStream(mcs); + + try { + if (CURRENT_TAB_NAME.equals(ROOTSTRAP_TAB_NAME)) { + String targetID = getTargetID(); + monitor.subTask("changing source list..."); + PackageCommander.changeSourceListForRootstrap(targetID, repositoryForRemote); + + Thread.sleep(500); + + int s = repositoryForRemote.indexOf("ssh://"); + if (s != -1) { + String remoteAddr = repositoryForRemote.substring(s + 6); + int e = remoteAddr.indexOf("/"); + + remoteAddr = remoteAddr.substring(0, e); + monitor.subTask(String.format("verifying connection %s", remoteAddr)); + if (!PackageCommander.verifySshConnectionForRootstrap(targetID, remoteAddr)) { + return; + } + } + + monitor.subTask("apt-get update..."); + PackageCommander.aptGetUpdateForRootstrap(targetID, mcs, mcsError); + + } else if(CURRENT_TAB_NAME.equals(TARGET_TAB_NAME)) { + if (!device.isEmulator()) { + // Change to bootmode with update + String command = DEB_COMMAND_UPDATEMODE; + device.executeShellCommand(command, rec, MAX_TIMEOUT); + } + /** target change source list **/ + monitor.subTask("changing source list..."); + PackageCommander.changeSourceListForRealTarget(repositoryForRemote, device); + + Thread.sleep(500); + + if (!device.isEmulator()) { + // Change to bootmode with update + String command = DEB_COMMAND_UPDATEMODE; + device.executeShellCommand(command, rec, MAX_TIMEOUT); + } + + int s = repositoryForRemote.indexOf("ssh://"); + if (s != -1) { + String remoteAddr = repositoryForRemote.substring(s + 6); + int e = remoteAddr.indexOf("/"); + + remoteAddr = remoteAddr.substring(0, e); + + if (!PackageCommander.verifySshConnectionForRealTarget(device, remoteAddr, rec)) { + return; + } + } + + monitor.subTask("apt-get update..."); + PackageCommander.aptGetUpdateForRealTarget(device, rec); + } + monitor.subTask("updating package informations..."); + updatePkgInfoAfterAptUpdate(); + + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + checkCancelThread.interrupt(); + //monitor.worked(1); + monitor.done(); + } + }); + } catch (Exception e1) { + e1.printStackTrace(); + } + + currentViewer.refresh(); + } + + @Override + public void mouseUp(MouseEvent e) { + } + + }); + + } + private void createMiddleComposite( Composite parent ) + { + Composite com = new Composite( parent, SWT.NONE ); + com.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); + com.setLayout(new GridLayout(4, false)); + + Label targetLabel = new Label( com, SWT.NONE ); + targetLabel.setText("Package Name: "); + + Listener AddPackageEventHandler = new Listener() + { + + @Override + public void handleEvent(Event event) { + switch ( event.type ) + { + /* package is selected for 2 cases + * 1. Edit text in packageListText then input 'Enter' key + * 2. click addButtonFromRemote button + * so, addListener for 2 case for each cases + * then, event type is SWT.Traverse then 1st case + * and, event type is SWT.MouseDown then 2nd case + */ + case SWT.Traverse: + if( event.character == SWT.CR) + { + /* if input is enter key, then we don't want to other process for 'enter key' + * then event.doit variable is set to false + */ + event.doit = false; + } + else + { + /* if input is other key, for example tab or arrow key + * then we do not add package + */ + break; + } + case SWT.MouseDown: + + int oldTableIndex = currentViewer.getTable().getItemCount(); + + addPkgListForRemote = packageListText.getText(); + + if(addPkgListForRemote.isEmpty()) { + MessageDialog.openError(shell, "Error", "Package name is empty.\nPlease input package name for installing"); + return; + } else if(addPkgListForRemote.contains("\"") || addPkgListForRemote.contains("\'") || + addPkgListForRemote.contains(":") || addPkgListForRemote.contains(",") || + addPkgListForRemote.contains(";")) { + MessageDialog.openError(shell, "Error", "Invalid character is found. (\" \' , : ; . )\n" + + "Between package names, delimeter shoud be space character.\n" + + "(ex) sqlite3 sysv-rc sglib-dev perl"); + return; + } + + ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell()); + + try { + dialog.run(true, false, new IRunnableWithProgress() { + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, + InterruptedException { + monitor.beginTask("Adding packages to list", -1); + + if (addPkgListForRemote != "") { + addPkgListForRemote = addPkgListForRemote.trim(); + String[] arrPkgs = addPkgListForRemote.split(" "); + for (String pkgName : arrPkgs) { + if (pkgName.isEmpty()) { + continue; + } + monitor.subTask(String.format("Adding %s", pkgName)); + addColumn(currentViewer, pkgName, null, Package.PKGTYPE.REMOTE); + } + } + + monitor.worked(1); + monitor.done(); + } + }); + } catch (Exception e1) { + e1.printStackTrace(); + } + + packageListText.setText(""); + + //currentViewer.refresh(); + if (viewerForRootstrap != null) { + viewerForRootstrap.refresh(); + } + if (viewerForTarget != null) { + viewerForTarget.refresh(); + } + + int recentTableIndex = currentViewer.getTable().getItemCount(); + + for (int i = oldTableIndex; i < recentTableIndex; i++) { + TableItem item1 = null; + TableItem item2 = null;; + + if (viewerForRootstrap != null) { + item1 = viewerForRootstrap.getTable().getItem(i); + Package pkg = (Package)item1.getData(); + item1.setChecked(pkg.getCheckColumn1()); + } + if (viewerForTarget != null) { + item2 = viewerForTarget.getTable().getItem(i); + Package pkg = (Package)item2.getData(); + item2.setChecked(pkg.getCheckColumn2()); + } + } + break; + } + } + }; + + packageListText = new Text(com, SWT.SINGLE | SWT.BORDER | SWT.SEARCH); + packageListText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL + | GridData.HORIZONTAL_ALIGN_FILL)); + packageListText.addListener(SWT.Traverse, AddPackageEventHandler); + + addButtonFromRemote = new Button( com, SWT.PUSH ); + addButtonFromRemote.setImage(new Image(display, + Activator.getImageDescriptor("/icons/packagelist_to_table.gif").getImageData())); + addButtonFromRemote.setToolTipText("Add packages from remote repository"); + addButtonFromRemote.addListener(SWT.MouseDown, AddPackageEventHandler); + + + addButtonFromFile = new Button( com, SWT.PUSH ); + addButtonFromFile.setImage(new Image(display, + Activator.getImageDescriptor("/icons/folder_search.gif").getImageData())); + addButtonFromFile.setToolTipText("Add packages from file system"); + addButtonFromFile.addMouseListener(new MouseListener() + { + + @Override + public void mouseDoubleClick(MouseEvent e) { + } + + @Override + public void mouseDown(MouseEvent e) { + + int oldTableIndex = currentViewer.getTable().getItemCount(); + + fd = new FileDialog( getShell(), SWT.OPEN|SWT.MULTI); + fd.setText("Select deb file..."); + if (previousFilterPath == null) + fd.setFilterPath(null); + else + fd.setFilterPath(previousFilterPath); + String[] filterExt = { "*.deb" }; + fd.setFilterExtensions(filterExt); + selectedFileList = fd.open(); + + ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell()); + + try { + dialog.run(true, false, new IRunnableWithProgress() { + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, + InterruptedException { + monitor.beginTask("Adding packages to list", -1); + if( selectedFileList != null ) + { + String[] files = fd.getFileNames(); + previousFilterPath = fd.getFilterPath(); + for (int i=0, n = files.length; i<n; i++) { + monitor.subTask(String.format("Adding %s", files[i])); + StringBuffer buf = new StringBuffer(); + buf.append(fd.getFilterPath()); + if (buf.charAt(buf.length() -1) != File.separatorChar) { + buf.append(File.separatorChar); + } + buf.append(files[i]); + addColumn( currentViewer, null, buf.toString(), Package.PKGTYPE.LOCAL); + } + } + } + }); + } catch (Exception e1) { + e1.printStackTrace(); + } + + //currentViewer.refresh(); + if (viewerForRootstrap != null) { + viewerForRootstrap.refresh(); + } + if (viewerForTarget != null) { + viewerForTarget.refresh(); + } + + int recentTableIndex = currentViewer.getTable().getItemCount(); + + for (int i = oldTableIndex; i < recentTableIndex; i++) { + TableItem item1 = null; + TableItem item2 = null;; + + if (viewerForRootstrap != null) { + item1 = viewerForRootstrap.getTable().getItem(i); + Package pkg = (Package)item1.getData(); + item1.setChecked(pkg.getCheckColumn1()); + } + if (viewerForTarget != null) { + item2 = viewerForTarget.getTable().getItem(i); + Package pkg = (Package)item2.getData(); + item2.setChecked(pkg.getCheckColumn2()); + } + } + } + + @Override + public void mouseUp(MouseEvent e) { + } + + }); + + } + + private Control getRootstrapTabControl( TabFolder tabFolder ) + { + Composite composite = new Composite( tabFolder, SWT.NONE ); + composite.setLayoutData(new GridData(GridData.FILL_BOTH)); + composite.setLayout(new GridLayout(1, false)); + + Composite Com = new Composite( composite, SWT.NONE ); + Com.setLayoutData(new GridData(GridData.FILL_HORIZONTAL )); + Com.setLayout(new GridLayout(2, false)); + + Composite leftCom = new Composite( Com, SWT.NONE ); + leftCom.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING)); + leftCom.setLayout(new GridLayout(1, false)); + + Composite rightCom = new Composite( Com, SWT.NONE ); + rightCom.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_END)); + //rightCom.setLayout(new GridLayout(4, false)); + rightCom.setLayout(new GridLayout(3, false)); + + Label configurationLabel = new Label(leftCom, SWT.LEFT); + configurationLabel.setText(String.format("Configuration : %s", this.configuration)); + + upgradeButton = new Button( rightCom, SWT.PUSH ); + upgradeButton.setText("Upgrade"); + upgradeButton.addMouseListener(new MouseListener(){ + + @Override + public void mouseDoubleClick(MouseEvent e) { + } + + @Override + public void mouseDown(MouseEvent e) { + + repositoryForRemote = repositoryText.getText(); + + if(repositoryForRemote.isEmpty()) { + MessageDialog.openError(shell, "Error", "Repository is empty.\nPlease set repository."); + return; + } + + ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell()); + + try { + dialog.run(true, true, new IRunnableWithProgress() { + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, + InterruptedException { + monitor.beginTask("apt-get upgrade", -1); + + CheckCancelJob cancelJob = new CheckCancelJob(monitor); + Thread checkCancelThread = new Thread(cancelJob); + checkCancelThread.start(); + + ConsoleManager cm = new ConsoleManager( "Package Installer", true); + cm.clear(); + MessageConsoleStream mcsError = cm.getMessageConsoleStream(true); + MessageConsoleStream mcs = cm.getMessageConsoleStream(false); + MessageConsoleStream mcsError1 = cm.getMessageConsoleStream(true); + MessageConsoleStream mcs1 = cm.getMessageConsoleStream(false); + String targetID = getTargetID(); + + monitor.subTask("apt-get -f -y install"); + PackageCommander.fixBrokenForRootstrap(targetID, mcs, mcsError); + + monitor.subTask("apt-get -y dist-upgrade"); + PackageCommander.aptGetUpgradeForRootstrap(targetID, mcs1, mcsError1); + + //monitor.worked(1); + checkCancelThread.interrupt(); + monitor.done(); + } + }); + } catch (Exception e1) { + e1.printStackTrace(); + } + } + + @Override + public void mouseUp(MouseEvent e) { + } + + }); + + installButton = new Button( rightCom, SWT.PUSH ); + installButton.setText("Install"); + installButton.addMouseListener(new MouseListener(){ + + @Override + public void mouseDoubleClick(MouseEvent e) { + } + + @Override + public void mouseDown(MouseEvent e) { + pkgs = getSelectedPkg(PkgModelProvider.INSTANCE.getPkgs()); + + if(pkgs.isEmpty()) { + MessageDialog.openError(shell, "Error", "There is no selected package."); + return; + } + + ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell()); + + try { + dialog.run(true, true, new IRunnableWithProgress() { + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, + InterruptedException { + monitor.beginTask("Installing package", -1); + + CheckCancelJob cancelJob = new CheckCancelJob(monitor); + Thread checkCancelThread = new Thread(cancelJob); + checkCancelThread.start(); + + try { + String targetID = getTargetID(); + String debPathList = ""; + String debNameList = ""; + String aptPkgList = ""; + + ConsoleManager cm = new ConsoleManager( "Installing packages", true); + cm.clear(); + MessageConsoleStream mcsError = cm.getMessageConsoleStream(true); + MessageConsoleStream mcs = cm.getMessageConsoleStream(false); + MessageConsoleStream mcsError1 = cm.getMessageConsoleStream(true); + MessageConsoleStream mcs1 = cm.getMessageConsoleStream(false); + MessageConsoleStream mcsError2 = cm.getMessageConsoleStream(true); + MessageConsoleStream mcs2 = cm.getMessageConsoleStream(false); + + for (Package pkg : pkgs) { + if (pkg.getPkgType().equals(Package.PKGTYPE.LOCAL)) { + debPathList = debPathList.concat(pkg.getPath() + " "); + debNameList = debNameList.concat(pkg.getName() + " "); + } else if (pkg.getPkgType().equals(Package.PKGTYPE.REMOTE)) { + aptPkgList = aptPkgList.concat(pkg.getName() + " "); + } + } + + if(!aptPkgList.equals("")) { + monitor.subTask("apt-get -f -y install"); + PackageCommander.fixBrokenForRootstrap(targetID, mcs, mcsError); + monitor.subTask(String.format("apt-get install %s", aptPkgList)); + mcs1.write("***** apt-get install *****\n"); + PackageCommander.aptGetInstallForRootstrap(targetID, aptPkgList, mcs1, mcsError1); + } + + + if(!cancelJob.getTerminateChecker() && !debNameList.equals("")) { + monitor.subTask(String.format("dpkg -i %s", debNameList)); + mcs2.write("\n***** dpkg install *****\n"); + PackageCommander.dpkgInstallForRootstrap(targetID, debPathList, mcs2, mcsError2); + /** E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem. **/ + PackageCommander.resolveDpkgInterruptForRootstrap(targetID, mcs2, mcsError2); + } + + for (Package pkg : pkgs) { + String installedVer = PackageCommander.getPkgInstalledVerForRootstrap(pkg.getName(), targetID); + pkg.setInstalledVersion1(installedVer); + + if (installedVer.equals("")) { + pkg.setInstallInfo1(Package.INSTALLINFO.NOT_INSTALLED); + } else if (installedVer.equals(pkg.getNewVersion1())) { + if (PackageCommander.pkgInstalledSuccessfullyForRootstrap(pkg.getName(), targetID)) { + pkg.setInstallInfo1(Package.INSTALLINFO.INSTALLED); + } else { + pkg.setInstallInfo1(Package.INSTALLINFO.NOT_PROPERLY_INSTALLED); + } + } else { + pkg.setInstallInfo1(Package.INSTALLINFO.DIFFERENT_VERSION); + } + } + + } catch (IOException e) { + e.printStackTrace(); + } + + //checkCancelThread.interrupt(); + cancelJob.setFinishFlag(true); + monitor.done(); + } + }); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + currentViewer.refresh(); + //removeButtonForLocal.setEnabled(false); + //installButtonForLocal.setEnabled(false); + //localDebs.clear(); + } + + @Override + public void mouseUp(MouseEvent e) { + } + + }); + + /* + fixBrokenButton = new Button( rightCom, SWT.PUSH ); + fixBrokenButton.setText("Fix-Broken"); + fixBrokenButton.addMouseListener(new MouseListener(){ + + @Override + public void mouseDoubleClick(MouseEvent e) { + } + + @Override + public void mouseDown(MouseEvent e) { + ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell()); + + try { + dialog.run(true, false, new IRunnableWithProgress() { + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, + InterruptedException { + monitor.beginTask("Fix; attempt to correct a system with broken dependencies in place", -1); + monitor.subTask("apt-get -f -y install"); + String targetID = getTargetID(); + ConsoleManager cm = new ConsoleManager( "Fix broken dependencies", true); + cm.clear(); + MessageConsoleStream mcsError = cm.getMessageConsoleStream(true); + MessageConsoleStream mcs = cm.getMessageConsoleStream(false); + PackageCommander.fixBrokenForRootstrap(targetID, mcs, mcsError); + monitor.done(); + } + }); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + + @Override + public void mouseUp(MouseEvent e) { + } + }); + */ + + removeButton = new Button( rightCom, SWT.PUSH ); + removeButton.setToolTipText("Remove checked package from list"); + removeButton.setImage(new Image(display, + Activator.getImageDescriptor("/icons/list-delete.gif").getImageData())); + removeButton.addMouseListener(removeListener); + + bottomTableForRootstrap(composite); + + return composite; + } + + private Control getTargetTabControl( TabFolder tabFolder ) + { + Composite composite = new Composite( tabFolder, SWT.NONE ); + composite.setLayoutData(new GridData(GridData.FILL_VERTICAL)); + composite.setLayout(new GridLayout(1, false)); + + Composite com = new Composite( composite, SWT.NONE ); + com.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + com.setLayout(new GridLayout(2, false)); + + Composite leftCom = new Composite( com, SWT.NONE ); + leftCom.setLayoutData(new GridData( GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING)); + leftCom.setLayout(new GridLayout(1, false)); + + Composite rightCom = new Composite( com, SWT.NONE ); + rightCom.setLayoutData(new GridData( GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_END)); + //rightCom.setLayout(new GridLayout(4, false)); + rightCom.setLayout(new GridLayout(3, false)); + + Label configurationLabel = new Label(leftCom, SWT.LEFT); + configurationLabel.setText(String.format("Connection : %s", device.getSerialNumber())); + + upgradeButton = new Button( rightCom, SWT.PUSH ); + upgradeButton.setText("Upgrade"); + upgradeButton.addMouseListener(new MouseListener(){ + + @Override + public void mouseDoubleClick(MouseEvent e) { + } + + @Override + public void mouseDown(MouseEvent e) { + repositoryForRemote = repositoryText.getText(); + + if(repositoryForRemote.isEmpty()) { + MessageDialog.openError(shell, "Error", "Repository is empty.\nPlease set repository."); + return; + } + + ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell()); + + try { + dialog.run(true, true, new IRunnableWithProgress() { + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, + InterruptedException { + monitor.beginTask("apt-get upgrade", -1); + + ConsoleManager cm = new ConsoleManager( "Package Installer", true); + cm.clear(); + MessageConsoleStream mcs = cm.getMessageConsoleStream(false); + PackageManagerOuputReceiver rec = new PackageManagerOuputReceiver(); + rec.setMessageConsoleStream(mcs); + + monitor.subTask("apt-get -f -y install"); + PackageCommander.fixBrokenForRealTarget(device, rec); + + monitor.subTask("apt-get -y dist-upgrade"); + PackageCommander.aptGetUpgradeForRealTarget(device, rec); + + monitor.done(); + } + }); + } catch (Exception e1) { + e1.printStackTrace(); + } + } + + @Override + public void mouseUp(MouseEvent e) { + } + + }); + + installButton = new Button( rightCom, SWT.PUSH ); + installButton.setText("Install"); + installButton.addMouseListener(new MouseListener(){ + + @Override + public void mouseDoubleClick(MouseEvent e) { + } + + @Override + public void mouseDown(MouseEvent e) { + pkgs = getSelectedPkg(PkgModelProvider.INSTANCE.getPkgs()); + + if(pkgs.isEmpty()) { + MessageDialog.openError(shell, "Error", "Any package is not selected."); + return; + } + + ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell()); + + try { + dialog.run(true, true, new IRunnableWithProgress() { + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, + InterruptedException { + monitor.beginTask("Installing deb package", -1); + + try { + String newPath = null; + ConsoleManager cm = new ConsoleManager( "Package Installer", true); + cm.clear(); + MessageConsoleStream mcsError = cm.getMessageConsoleStream(true); + MessageConsoleStream mcs = cm.getMessageConsoleStream(false); + PackageManagerOuputReceiver rec = new PackageManagerOuputReceiver(); + rec.setMessageConsoleStream(mcs); + String command = null; + String localPkgList = ""; + String remotePkgList = ""; + + // Step 1: transfer pkg and make pkg list + for (Package pkg : pkgs) + { + if (pkg.getPkgType().equals(Package.PKGTYPE.LOCAL)) { + String debfile = new File(pkg.getPath()).getName(); + newPath = DEB_PATH + "/" + debfile; + monitor.subTask(String.format("transfer %s to target's %s",pkg.getPath(), newPath)); + if (monitor.isCanceled()) + throw new OperationCanceledException(); + SyncService syncService = device.getSyncService(); + SyncResult syncResult = syncService.pushFile(pkg.getPath(), newPath, SyncService.getNullProgressMonitor()); + if (syncResult.getCode() != SyncService.RESULT_OK) { + mcsError.println("Faild to move file from " + pkg.getPath() + " to " + newPath); + pkg.setInstallInfo2( Package.INSTALLINFO.NOT_INSTALLED); + //viewerForTarget.refresh(); + continue; + } + if (monitor.isCanceled()) + throw new OperationCanceledException(); + + if (localPkgList == "") { + localPkgList = newPath; + } else { + localPkgList = localPkgList + " " + newPath; + } + + } else if (pkg.getPkgType().equals(Package.PKGTYPE.REMOTE)) { + if (remotePkgList == "") { + remotePkgList = pkg.getName(); + } else { + remotePkgList = remotePkgList + " " + pkg.getName(); + } + } + } + + // Step 2: set update mode on device + if (!device.isEmulator()) { + // Change to bootmode with update + command = DEB_COMMAND_UPDATEMODE; + device.executeShellCommand(command, rec, MAX_TIMEOUT); + } + + // Step 3 : apt-get install pkg + if (remotePkgList != "") { + monitor.subTask("apt-get -y -f install"); + PackageCommander.fixBrokenForRealTarget(device, rec); + monitor.subTask(String.format("apt-get install %s", remotePkgList)); + PackageCommander.aptGetInstallForTarget(remotePkgList, device, rec); + } + + if (monitor.isCanceled()) + throw new OperationCanceledException(); + + // Step 4: install deb file + if (localPkgList != "") { + command = DEB_COMMAND_INSTALL + " " + localPkgList; + monitor.subTask(command); + device.executeShellCommand(command, rec, MAX_TIMEOUT); + } + + if (monitor.isCanceled()) + throw new OperationCanceledException(); + + for (Package pkg : pkgs) { + if (monitor.isCanceled()) + throw new OperationCanceledException(); + // update status + rec.setPrintConsole(false); + String installedVer = PackageCommander.getPkgInstalledVerForRealTarget(pkg.getName(), device, rec); + pkg.setInstalledVersion2(installedVer); + + if (installedVer.equals("")) { + pkg.setInstallInfo2(Package.INSTALLINFO.NOT_INSTALLED); + } else if (installedVer.equals(pkg.getNewVersion2())) { + if (PackageCommander.pkgInstalledSuccessfullyForRealTarget(pkg.getName(), device, rec)) { + pkg.setInstallInfo2(Package.INSTALLINFO.INSTALLED); + } else { + pkg.setInstallInfo2(Package.INSTALLINFO.NOT_PROPERLY_INSTALLED); + } + } else { + pkg.setInstallInfo2(Package.INSTALLINFO.DIFFERENT_VERSION); + } + if (monitor.isCanceled()) + throw new OperationCanceledException(); + } + + monitor.done(); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + viewerForTarget.refresh(); + } + + @Override + public void mouseUp(MouseEvent e) { + } + + }); + + /* + fixBrokenButton = new Button( rightCom, SWT.PUSH ); + fixBrokenButton.setText("Fix-Broken"); + fixBrokenButton.addMouseListener(new MouseListener(){ + + @Override + public void mouseDoubleClick(MouseEvent e) { + } + + @Override + public void mouseDown(MouseEvent e) { + ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell()); + + try { + dialog.run(true, false, new IRunnableWithProgress() { + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, + InterruptedException { + monitor.beginTask("Fix; attempt to correct a system with broken dependencies in place", -1); + monitor.subTask("apt-get -f -y install"); + ConsoleManager cm = new ConsoleManager( "Fix broken dependencies", true); + cm.clear(); + MessageConsoleStream mcs = cm.getMessageConsoleStream(false); + PackageManagerOuputReceiver rec = new PackageManagerOuputReceiver(); + rec.setMessageConsoleStream(mcs); + PackageCommander.fixBrokenForRealTarget(device, rec); + monitor.done(); + } + }); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + + @Override + public void mouseUp(MouseEvent e) { + } + }); + */ + + removeButton = new Button( rightCom, SWT.PUSH ); + removeButton.setToolTipText("Remove checked package from list"); + removeButton.setImage(new Image(display, + Activator.getImageDescriptor("/icons/list-delete.gif").getImageData())); + removeButton.addMouseListener(removeListener); + + bottomTableForTarget(composite); + + return composite; + } + + private void bottomTableForRootstrap( Composite parent ) + { + Composite bottom = new Composite( parent, SWT.NONE ); + bottom.setLayoutData(new GridData(GridData.FILL_BOTH)); + bottom.setLayout(new FillLayout()); + + viewerForRootstrap = new TableViewer( bottom, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CHECK ); + createColumns( parent, viewerForRootstrap, ROOTSTRAP_TAB_NAME ); + tableForRootstrap = viewerForRootstrap.getTable(); + tableForRootstrap.addListener( SWT.Selection, new Listener(){ + + @Override + public void handleEvent(Event event) { + if( event.detail == SWT.CHECK ) + { + Package pkg = (Package)event.item.getData(); + pkg.setCheckColumn1( !pkg.getCheckColumn1() ); + } + } + + }); + + tableForRootstrap.setHeaderVisible(true); + tableForRootstrap.setLinesVisible(true); + + viewerForRootstrap.setContentProvider(new ArrayContentProvider()); + viewerForRootstrap.setInput(PkgModelProvider.INSTANCE.getPkgs()); + + if (tabIndex == 0) { + currentViewer = viewerForRootstrap; + CURRENT_TAB_NAME = ROOTSTRAP_TAB_NAME; + } + } + + private void bottomTableForTarget( Composite parent ) + { + Composite bottom = new Composite( parent, SWT.NONE ); + bottom.setLayoutData(new GridData(GridData.FILL_BOTH)); + bottom.setLayout(new FillLayout()); + + viewerForTarget = new TableViewer( bottom, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CHECK); + createColumns( parent, viewerForTarget, TARGET_TAB_NAME ); + tableForTarget = viewerForTarget.getTable(); + tableForTarget.addListener( SWT.Selection, new Listener(){ + + @Override + public void handleEvent(Event event) { + if( event.detail == SWT.CHECK ) + { + Package pkg = (Package)event.item.getData(); + pkg.setCheckColumn2( !pkg.getCheckColumn2() ); + } + } + + }); + + + tableForTarget.setHeaderVisible(true); + tableForTarget.setLinesVisible(true); + + viewerForTarget.setContentProvider(new ArrayContentProvider()); + viewerForTarget.setInput(PkgModelProvider.INSTANCE.getPkgs()); + + if (tabIndex == 1) { + currentViewer = viewerForTarget; + CURRENT_TAB_NAME = TARGET_TAB_NAME; + } + } + + + private void createBottomComposite( Composite parent ) + { + tabFolder = new TabFolder( parent, SWT.BORDER ); + tabFolder.setLayoutData(new GridData( GridData.FILL_BOTH)); + tabFolder.setLayout(new GridLayout(1, false)); + + tabFolder.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent event) { + try { + String tabName = tabFolder.getSelection()[0].getText(); + if (tabName.equals(ROOTSTRAP_TAB_NAME)) { + CURRENT_TAB_NAME = ROOTSTRAP_TAB_NAME; + if (enableRootstrapTab) { + String targetID = getTargetID(); + currentViewer = viewerForRootstrap; + String sourcelist = ""; + if (!sbi.checkTargetID(targetID)) { + MessageDialog.openError(shell, "Error", "Target does not exist. please build project first"); + } else { + sourcelist = PackageCommander.getCurrentSourceListForRootstrap(targetID); + } + repositoryText.setText(sourcelist); + } + + } else if (tabName.equals(TARGET_TAB_NAME)) { + CURRENT_TAB_NAME = TARGET_TAB_NAME; + if (enableTargetTab) { + PackageManagerOuputReceiver rec = new PackageManagerOuputReceiver(); + rec.setPrintConsole(false); + currentViewer = viewerForTarget; + repositoryText.setText(PackageCommander.getCurrentSourceListForRealTarget(device, rec)); + } + } + if (currentViewer != null) { + currentViewer.refresh(); + } + } catch (SBIException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); + + TabItem rootstrapTab = new TabItem( tabFolder, SWT.NULL ); + rootstrapTab.setText(ROOTSTRAP_TAB_NAME); + + if (!enableRootstrapTab) { + rootstrapTab.setControl( errorTab( tabFolder , "- Any project is not selected or project is not \"CUSTOM DEBIAN PROJECT\".")); + tabIndex = 1; + } else { + rootstrapTab.setControl( getRootstrapTabControl( tabFolder )); + } + + TabItem deviceTab = new TabItem( tabFolder, SWT.NULL ); + deviceTab.setText(TARGET_TAB_NAME); + if (!enableTargetTab) { + deviceTab.setControl( errorTab( tabFolder, "- Any device is not connected or selected." )); + tabIndex = 0; + } else { + deviceTab.setControl( getTargetTabControl( tabFolder )); + } + + tabFolder.setSelection(tabIndex); + } + + private Control errorTab(TabFolder tabFolder, String msg) { + Composite composite = new Composite( tabFolder, SWT.NONE ); + composite.setLayoutData(new GridData(GridData.FILL_VERTICAL)); + composite.setLayout(new GridLayout(1, false)); + + Label errorLabel = new Label(composite, SWT.LEFT); + errorLabel.setText(msg); + + return composite; + } + + private void updatePkgInfoAfterAptUpdate() { + CopyOnWriteArrayList<Package> pkgs = PkgModelProvider.INSTANCE.getPkgs(); + + for (Package pkg : pkgs) { + if (pkg.getPkgType().equals(Package.PKGTYPE.REMOTE)) { + if (CURRENT_TAB_NAME.equals(ROOTSTRAP_TAB_NAME)) { + String targetID = getTargetID(); + String newVer = PackageCommander.getPkgNewVerForRootstrap(pkg.getName(), targetID); + if (newVer.equals("")) { + pkg.setInstallInfo1(Package.INSTALLINFO.NOT_FOUND); + pkg.setCheckColumn1(false); + } else if (pkg.getInstalledVersion1().equals("")) { + pkg.setInstallInfo1(Package.INSTALLINFO.NOT_INSTALLED); + } else if (newVer.equals(pkg.getInstalledVersion1())) { + if (PackageCommander.pkgInstalledSuccessfullyForRootstrap(pkg.getName(), targetID)) { + pkg.setInstallInfo1(Package.INSTALLINFO.INSTALLED); + } else { + pkg.setInstallInfo1(Package.INSTALLINFO.NOT_PROPERLY_INSTALLED); + } + } else { + pkg.setInstallInfo1(Package.INSTALLINFO.DIFFERENT_VERSION); + } + pkg.setNewVersion1(newVer); + } else if (CURRENT_TAB_NAME.equals(TARGET_TAB_NAME)) { + PackageManagerOuputReceiver rec = new PackageManagerOuputReceiver(); + rec.setPrintConsole(false); + String newVer = PackageCommander.getPkgNewVerForRealTarget(pkg.getName(), device, rec); + if (newVer.equals("")) { + pkg.setInstallInfo2(Package.INSTALLINFO.NOT_FOUND); + pkg.setCheckColumn2(false); + } else if (pkg.getInstalledVersion2().equals("")) { + pkg.setInstallInfo2(Package.INSTALLINFO.NOT_INSTALLED); + } else if (newVer.equals(pkg.getInstalledVersion2())) { + if (PackageCommander.pkgInstalledSuccessfullyForRealTarget(pkg.getName(), device, rec)) { + pkg.setInstallInfo2(Package.INSTALLINFO.INSTALLED); + } else { + pkg.setInstallInfo2(Package.INSTALLINFO.NOT_PROPERLY_INSTALLED); + } + } else { + pkg.setInstallInfo2(Package.INSTALLINFO.DIFFERENT_VERSION); + } + pkg.setNewVersion2(newVer); + } + } + } + } + + + private boolean addColumn( TableViewer viewer, String pkgName, String debPath, Package.PKGTYPE type ) + { +// viewer.add( debName ); + CopyOnWriteArrayList<Package> pkgs = PkgModelProvider.INSTANCE.getPkgs(); + Iterator<Package> debIter = pkgs.iterator(); + //String targetID = getTargetID(); + String targetID = null; + //ISession session = null; + //IDevice device = null; + + if (enableRootstrapTab) { + targetID = getTargetID(); + } + /* + if (enableTargetTab) { + session = getSession(); + } + */ + + Package pkg; + + if (pkgName == null && debPath != null) { + pkgName = PackageCommander.getPkgNameForDebFile(debPath); + } + + while( debIter.hasNext() ) + { + pkg = debIter.next(); + if( pkg.getName().equals(pkgName)) + return true; + } + + pkg = new Package(); + if (debPath != null) { + pkg.setName(PackageCommander.getPkgNameForDebFile(debPath)); + } else if (pkgName != null) { + pkg.setName(pkgName); + } + + pkg.setTarget( this.target ); + pkg.setPath(debPath); + + String newVerForRootstrap = ""; + String newVerForTarget = ""; + + PackageManagerOuputReceiver rec = new PackageManagerOuputReceiver(); + rec.setPrintConsole(false); + + if (type.equals(Package.PKGTYPE.LOCAL)) { + pkg.setArch1(PackageCommander.getArchForDebFile(debPath)); + pkg.setArch2(PackageCommander.getArchForDebFile(debPath)); + newVerForRootstrap = PackageCommander.getPkgVerForDebFile(debPath); + newVerForTarget = newVerForRootstrap; + pkg.setNewVersion1(newVerForRootstrap); + pkg.setNewVersion2(newVerForRootstrap); + } else { + pkg.setArch1(PackageCommander.getArchOfRemotePkgForRootstrap(pkg.getName(), targetID)); + pkg.setArch2(PackageCommander.getArchOfRemotePkgForRealTarget(pkg.getName(), device, rec)); + newVerForRootstrap = PackageCommander.getPkgNewVerForRootstrap(pkg.getName(), targetID); + rec.cleanLog(); + newVerForTarget = PackageCommander.getPkgNewVerForRealTarget(pkg.getName(), device, rec); + pkg.setNewVersion1(newVerForRootstrap); + pkg.setNewVersion2(newVerForTarget); + } + + String installedVerForRootstrap = PackageCommander.getPkgInstalledVerForRootstrap(pkg.getName(), targetID); + rec.cleanLog(); + String installedVerForRealDevice = PackageCommander.getPkgInstalledVerForRealTarget(pkg.getName(), device, rec); + + pkg.setInstalledVersion1(installedVerForRootstrap); + pkg.setInstalledVersion2(installedVerForRealDevice); + + if (newVerForRootstrap.equals("")) { + pkg.setInstallInfo1(Package.INSTALLINFO.NOT_FOUND); + pkg.setCheckColumn1(false); + } else if (!installedVerForRootstrap.equals("")) { + if (!installedVerForRootstrap.equals(newVerForRootstrap)) { + pkg.setInstallInfo1(Package.INSTALLINFO.DIFFERENT_VERSION); + } else { + if (PackageCommander.pkgInstalledSuccessfullyForRootstrap(pkg.getName(), targetID)) { + pkg.setInstallInfo1(Package.INSTALLINFO.INSTALLED); + } else { + pkg.setInstallInfo1(Package.INSTALLINFO.NOT_PROPERLY_INSTALLED); + } + } + } + + if (newVerForTarget.equals("")) { + pkg.setInstallInfo2(Package.INSTALLINFO.NOT_FOUND); + pkg.setCheckColumn2(false); + } else if (!installedVerForRealDevice.equals("")) { + if (!installedVerForRealDevice.equals(newVerForTarget)) { + pkg.setInstallInfo2(Package.INSTALLINFO.DIFFERENT_VERSION); + } else { + if (PackageCommander.pkgInstalledSuccessfullyForRealTarget(pkg.getName(), device, rec)) { + pkg.setInstallInfo2(Package.INSTALLINFO.INSTALLED); + } else { + pkg.setInstallInfo2(Package.INSTALLINFO.NOT_PROPERLY_INSTALLED); + } + } + } + + pkg.setPkgType(type); + + PkgModelProvider.INSTANCE.getPkgs().add(pkg); + + /* + if (type.equals(Package.PKGTYPE.LOCAL)) { + viewer.refresh(); + } + */ + + return true; + } + + + private void createColumns( Composite parent, final TableViewer viewer, final String type) + { + String[] titles = {"Install Type", "Package Name", "Arch", "New Version", "Installed Version", "Status"}; + int[] bounds = { 120, 180, 60, 200, 200, 160}; + + TableViewerColumn colInstallType = createTableViewerColumn( viewer, titles[0], bounds[0], SWT.NONE); + + colInstallType.setLabelProvider(new ColumnLabelProvider() { + @Override + public String getText(Object element) { + Package pkg = (Package)element; + return pkg.getPkgType().toString(); + } + }); + + TableViewerColumn colPackage = createTableViewerColumn( viewer, titles[1], bounds[1], SWT.NONE); + + colPackage.setLabelProvider(new ColumnLabelProvider() { + @Override + public String getText(Object element) { + Package pkg = (Package)element; + return pkg.getName(); + } + }); + + TableViewerColumn colArch = createTableViewerColumn( viewer, titles[2], bounds[2], SWT.NONE); + + colArch.setLabelProvider(new ColumnLabelProvider() { + @Override + public String getText(Object element) { + Package pkg = (Package)element; + String arch = ""; + if (type.equals(ROOTSTRAP_TAB_NAME)) { + arch = pkg.getArch1(); + } else if (type.equals(TARGET_TAB_NAME)) { + arch = pkg.getArch2(); + } + + return arch; + } + }); + + TableViewerColumn colNewVer = createTableViewerColumn( viewer, titles[3], bounds[3], SWT.NONE); + + colNewVer.setLabelProvider(new ColumnLabelProvider() { + @Override + public String getText(Object element) { + Package pkg = (Package)element; + String newVer = ""; + if (type.equals(ROOTSTRAP_TAB_NAME)) { + newVer = pkg.getNewVersion1(); + } else if (type.equals(TARGET_TAB_NAME)) { + newVer = pkg.getNewVersion2(); + } + + return newVer; + } + }); + + TableViewerColumn colInsVer = createTableViewerColumn( viewer, titles[4], bounds[4], SWT.NONE); + colInsVer.setLabelProvider(new ColumnLabelProvider() { + @Override + public String getText(Object element) { + Package pkg = (Package)element; + String installedVer = ""; + if (type.equals(ROOTSTRAP_TAB_NAME)) { + installedVer = pkg.getInstalledVersion1(); + } else if (type.equals(TARGET_TAB_NAME)) { + installedVer = pkg.getInstalledVersion2(); + } + + return installedVer; + } + }); + + TableViewerColumn colStatus = createTableViewerColumn( viewer, titles[5], bounds[5], SWT.NONE); + + colStatus.setLabelProvider(new ColumnLabelProvider() { + @Override + public String getText(Object element) { + Package pkg = (Package)element; + String status = ""; + if (type.equals(ROOTSTRAP_TAB_NAME)) { + status = pkg.getInstallInfo1().toString(); + } else if (type.equals(TARGET_TAB_NAME)) { + status = pkg.getInstallInfo2().toString(); + } + + return status; + } + }); + } + + private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, int Style) { + + final TableViewerColumn viewerColumn = new TableViewerColumn( viewer, Style); + final TableColumn column = viewerColumn.getColumn(); + column.setText(title); + column.setWidth(bound); + column.setResizable(true); + column.setMoveable(true); + return viewerColumn; + } + + + private String getTargetID() { + IProject project = CurrentEnabledProject.getCurrentProject(); + IConfiguration config = ManagedBuildManager.getBuildInfo( project ).getDefaultConfiguration(); + String targetID = PlatformConfigurationManager.getBuildTargetName(config); + return targetID; + } + + private CopyOnWriteArrayList<Package> getSelectedPkg(CopyOnWriteArrayList<Package> pkgs) { + CopyOnWriteArrayList<Package> _pkgs = new CopyOnWriteArrayList<Package>(); + if (CURRENT_TAB_NAME.equals(ROOTSTRAP_TAB_NAME)) { + for (Package pkg : pkgs) { + if(pkg.getCheckColumn1()) { + _pkgs.add(pkg); + } + } + } else if (CURRENT_TAB_NAME.equals(TARGET_TAB_NAME)) { + for (Package pkg : pkgs) { + if(pkg.getCheckColumn2()) { + _pkgs.add(pkg); + } + } + } + + return _pkgs; + } +}
\ No newline at end of file diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PackageManagerOuputReceiver.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PackageManagerOuputReceiver.java new file mode 100644 index 00000000..0955cd9b --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PackageManagerOuputReceiver.java @@ -0,0 +1,85 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.pkgInstall; + +import org.eclipse.ui.console.MessageConsoleStream; + +import org.tizen.sdblib.MultiLineReceiver; + +public class PackageManagerOuputReceiver extends MultiLineReceiver { + + public boolean isCancelled = false; + private boolean printConsole = true; + private String[] log = null; + private MessageConsoleStream mcs = null; + + public PackageManagerOuputReceiver() { + super(); + + setTrimLine(false); + } + + public void setMessageConsoleStream(MessageConsoleStream mcs) { + this.mcs = mcs; + } + + public void setPrintConsole(boolean b) { + printConsole = b; + } + + @Override + public void processNewLines(String[] lines) { + if (isCancelled == false) { + //processLogLines(lines); + log = lines; + if (printConsole) { + for (String line : lines) { + if (line.endsWith("\n")) { + mcs.print(line); + } else { + mcs.println(line); + } + } + } + } + } + + public String[] getLog() { + return log; + } + + public void cleanLog() { + log = null; + } + + public boolean isCancelled() { + return isCancelled; + } + +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PackageManagerRootstrapHandler.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PackageManagerRootstrapHandler.java new file mode 100644 index 00000000..a5f72a26 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PackageManagerRootstrapHandler.java @@ -0,0 +1,99 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.pkgInstall; + +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.IManagedProject; +import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IProject; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.handlers.HandlerUtil; + +import org.tizen.common.connection.ConnectionPlugin; + + +import org.tizen.nativecommon.build.CurrentEnabledProject; +import org.tizen.nativeplatform.build.PlatformConfigurationManager; +import org.tizen.sdblib.IDevice; + +/** + * Our sample handler extends AbstractHandler, an IHandler base class. + * @see org.eclipse.core.commands.IHandler + * @see org.eclipse.core.commands.AbstractHandler + */ +public class PackageManagerRootstrapHandler extends AbstractHandler { + /** + * The constructor. + */ + public PackageManagerRootstrapHandler() { + } + + /** + * the command has been executed, so extract extract the needed information + * from the application context. + */ + public Object execute(ExecutionEvent event) throws ExecutionException { + + IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); + IDevice device = ConnectionPlugin.getDefault().getCurrentDevice(); + PackageManager pkgdlg; + String target = null; + boolean enableRootstrap = true; + boolean eanbleTarget = true; + + if (device == null) { + eanbleTarget = false; + } else { + target = device.getSerialNumber(); + if (target == null) { + eanbleTarget = false; + } + } + + IProject project = CurrentEnabledProject.getCurrentProject(); + if (project == null) { + enableRootstrap = false; + } else { + IConfiguration cfg =ManagedBuildManager.getBuildInfo( project ).getDefaultConfiguration(); + IManagedProject managedProject = cfg.getManagedProject(); + String projectArtifactType = managedProject.getProjectType().getBuildArtefactType().getId(); + if (!projectArtifactType.equals(PlatformConfigurationManager.TIZEN_CUSTOM_DEBIAN_ARTIFACT_TYPE) && + !projectArtifactType.equals(PlatformConfigurationManager.OLD_SLP_CUSTOM_DEBIAN_ARTIFACT_TYPE)) { + enableRootstrap = false; + } + } + + pkgdlg = new PackageManager(window.getShell(), target, enableRootstrap, eanbleTarget); + pkgdlg.open(); + return null; + } +}
\ No newline at end of file diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PkgModelProvider.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PkgModelProvider.java new file mode 100644 index 00000000..a6f0a4b8 --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgInstall/PkgModelProvider.java @@ -0,0 +1,215 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.pkgInstall; + +import java.util.concurrent.CopyOnWriteArrayList; + +public enum PkgModelProvider { + + INSTANCE; + + private CopyOnWriteArrayList<Package> pkgs; + + private PkgModelProvider() + { + pkgs = new CopyOnWriteArrayList <Package>(); + } + + public CopyOnWriteArrayList<Package> getPkgs() + { + return pkgs; + } +} + +class Package{ + + public static enum INSTALLINFO + { +// READY, SUCCESSED, FAILED, INSTALLED, NOT_INSTALLED + INSTALLED, NOT_INSTALLED, DIFFERENT_VERSION, NOT_FOUND, NOT_PROPERLY_INSTALLED + } + + public static enum PKGTYPE + { + LOCAL, REMOTE + } + private String target = ""; + private String path = ""; + + private String name = ""; + private String arch1 = ""; + private String arch2 = ""; + private String newVersion1 = ""; + private String newVersion2 = ""; + private String installVersion1 = ""; + private String installVersion2 = ""; + private boolean checkColumn1 = true; + private boolean checkColumn2 = true; + private INSTALLINFO installInfo1 = INSTALLINFO.NOT_INSTALLED; + private INSTALLINFO installInfo2 = INSTALLINFO.NOT_INSTALLED; + private PKGTYPE pkgType = PKGTYPE.LOCAL; + +// private Button check1 = new Button( PackageManager.getTable(), SWT.CHECK ); +// private Button check2 = new Button( PackageManager.getTable(), SWT.CHECK ); + + public PKGTYPE getPkgType() + { + return pkgType; + } + + public void setPkgType( PKGTYPE pkgType ) + { + this.pkgType = pkgType; + } + + public void setArch1(String arch) + { + this.arch1 = arch; + } + + public String getArch1() + { + return arch1; + } + + public void setArch2(String arch) + { + this.arch2 = arch; + } + + public String getArch2() + { + return arch2; + } + + public INSTALLINFO getInstallInfo1() + { + return installInfo1; + } + + public void setInstallInfo1( INSTALLINFO installInfo ) + { + this.installInfo1 = installInfo; + } + + public INSTALLINFO getInstallInfo2() + { + return installInfo2; + } + + public void setInstallInfo2( INSTALLINFO installInfo ) + { + this.installInfo2 = installInfo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public void setInstalledVersion1(String ver) { + this.installVersion1 = ver; + } + public String getInstalledVersion1() { + return installVersion1; + } + + public void setInstalledVersion2(String ver) { + this.installVersion2 = ver; + } + + public String getInstalledVersion2() { + return installVersion2; + } + + public void setNewVersion1(String ver) { + this.newVersion1 = ver; + } + + public String getNewVersion1() { + return newVersion1; + } + + public void setNewVersion2(String ver) { + this.newVersion2 = ver; + } + + public String getNewVersion2() { + return newVersion2; + } + + public boolean getCheckColumn1() + { + return checkColumn1; + } + + public void setCheckColumn1( boolean check ) + { + this.checkColumn1 = check; + } + + public boolean getCheckColumn2() + { + return checkColumn2; + } + + public void setCheckColumn2( boolean check ) + { + this.checkColumn2 = check; + } + +// public Button getCheck1() +// { +// return check1; +// } +// +// public Button getCheck2() +// { +// return check2; +// } +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/wizards/TizenDebianMainWizardPage.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/wizards/TizenDebianMainWizardPage.java new file mode 100644 index 00000000..4456de3a --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/wizards/TizenDebianMainWizardPage.java @@ -0,0 +1,87 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.wizards; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.cdt.ui.wizards.CDTMainWizardPage; +import org.eclipse.cdt.ui.wizards.EntryDescriptor; + + +public class TizenDebianMainWizardPage extends CDTMainWizardPage { + + public TizenDebianMainWizardPage(String pageName) { + super(pageName); + // TODO Auto-generated constructor stub + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public List filterItems(List items) { + List<Object> result = new ArrayList<Object>(); + + for(Object item:items) { + if(item instanceof EntryDescriptor) { + EntryDescriptor e = (EntryDescriptor)item; + + // remove default empty project + if ( e.getName() != null && e.getName().equals("Empty Project") ) + continue; + + if( e.getId().equals("com.samsung.slp.nativeide.buildArtefactType.cdeb") || + (e.getParentId() != null && e.getParentId().equals("com.samsung.slp.nativeide.buildArtefactType.cdeb")) ) { + result.add(item); + } + + // Deprecated project type + //if(e.getId().equals("com.samsung.slp.buildArtefactType.custom.debian") || + // (e.getParentId() != null && e.getParentId().equals("com.samsung.slp.buildArtefactType.custom.debian") ) ) { + // result.add(item); + //} + } + + } + return result; + } + + @Override + protected boolean validatePage() { + // TODO Auto-generated method stub + boolean result = super.validatePage(); + + if(result == true && super.getMessage() != null) { + if (super.getMessage().equals("Directory with specified name already exists.")) { + super.setMessage(null); + } + } + + return result; + } +} diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/wizards/TizenDebianProjectWizard.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/wizards/TizenDebianProjectWizard.java new file mode 100644 index 00000000..4e6c6e2f --- /dev/null +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/wizards/TizenDebianProjectWizard.java @@ -0,0 +1,96 @@ +/* +* Inhouse +* +* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +* +* Contact: +* Taejun Ha <taejun.ha@samsung.com> +* Jiil Hyoun <jiil.hyoun@samsung.com> +* Donghyuk Yang <donghyuk.yang@samsung.com> +* Hoon Kang <h245.kang@samsung.com> +* DongHee Yang <donghee.yang@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.nativeplatform.wizards; + +import org.eclipse.cdt.core.CCProjectNature; +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.CProjectNature; +import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.cdt.ui.wizards.CDTCommonProjectWizard; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.SubProgressMonitor; +import org.tizen.nativeplatform.build.PlatformConfigurationManager; + + + + +public class TizenDebianProjectWizard extends CDTCommonProjectWizard{ + + public TizenDebianProjectWizard() { + super("Tizen Custom Debian Project", //$NON-NLS-1$ + "Create a Tizen Custom Debian Project project of selected type"); //$NON-NLS-1$ +// WizardConstants.isDebian = true; + } + + @Override + public String[] getNatures() { + return new String[] { CProjectNature.C_NATURE_ID, CCProjectNature.CC_NATURE_ID }; + } + + @Override + protected IProject continueCreation(IProject prj) { + if (continueCreationMonitor == null) { + continueCreationMonitor = new NullProgressMonitor(); + } + + try { + continueCreationMonitor.beginTask("Add C/C++ Project Nature", 1); + CProjectNature.addCNature(prj, new SubProgressMonitor(continueCreationMonitor, 1)); + CCProjectNature.addCCNature(prj, new SubProgressMonitor(continueCreationMonitor, 1)); + } catch (CoreException e) {} + finally {continueCreationMonitor.done();} + return prj; + } + + @Override + public void addPages() { + fMainPage= new TizenDebianMainWizardPage(CUIPlugin.getResourceString("CProjectWizard")); + fMainPage.setTitle("Tizen Custom Debian Project"); + fMainPage.setDescription("Create a Tizen Custom Debian Project project of selected type"); + addPage(fMainPage); + } + + @Override + public String[] getContentTypeIDs() { + return new String[] { CCorePlugin.CONTENT_TYPE_CXXSOURCE, CCorePlugin.CONTENT_TYPE_CXXHEADER }; + } + + @Override + public IProject getProject(boolean defaults, boolean onFinish) { + IProject prj = super.getProject(defaults, onFinish); + + // Marking project version + PlatformConfigurationManager.setProjectVersion( prj, PlatformConfigurationManager.CURRENT_SLP_PROJECT_VERSION ); + + return prj; + } + +} diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/EmptyProject/.buildproperties.xml b/org.tizen.nativeplatform/templates/CustomDebianPackages/EmptyProject/.buildproperties.xml new file mode 100644 index 00000000..2dc1f3f7 --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/EmptyProject/.buildproperties.xml @@ -0,0 +1 @@ +<BuildProperty><Project><Name>${CMAKE_TARGET}</Name></Project><Frameworks><Framework>capi-application-app_efl</Framework><Framework>capi-application-app_bundle</Framework><Framework>capi-base-i18n</Framework><Framework>elementary</Framework><Framework>ecore-x</Framework><Framework>ecore</Framework><Framework>evas</Framework><Framework>edje</Framework><Framework>dlog</Framework></Frameworks><Compiler><Type>C</Type><Flags>-Wall</Flags></Compiler><Includes><Path>${CMAKE_SOURCE_DIR}/include</Path></Includes><Linker><Libraries/><Paths/><Flags/></Linker><Symbols/><Debug><Level>g</Level></Debug><Optimization><Level>O0</Level></Optimization></BuildProperty>
\ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/EmptyProject/template.properties b/org.tizen.nativeplatform/templates/CustomDebianPackages/EmptyProject/template.properties new file mode 100644 index 00000000..7afbfe8f --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/EmptyProject/template.properties @@ -0,0 +1,19 @@ +EmptyProject.Ctemplate.label=Empty Debian Project +EmptyProject.Ctemplate.description=Empty Debian Project +EmptyProject.basics.label=Advanced Settings +EmptyProject.basics.description=Advanced properties of a project +EmptyProject.author.label=Author +EmptyProject.author.description=Name of the author +EmptyProject.author.default=Author +EmptyProject.copyright.label=Copyright +EmptyProject.copyright.description=Your copyright notice +EmptyProject.copyright.default=Your copyright notice +EmptyProject.vendor.label=Vendor +EmptyProject.vendor.default=samsung +EmptyProject.vendor.description=Enter your company or organization. +EmptyProject.description.default=Empty Project +EmptyProject.description.description=Enter a description about your application. +EmptyProject.description.label=Description +EmptyProject.e-mail.default=E-mail +EmptyProject.e-mail.description=Enter your email address +EmptyProject.e-mail.label=E-mail diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/EmptyProject/template.xml b/org.tizen.nativeplatform/templates/CustomDebianPackages/EmptyProject/template.xml new file mode 100644 index 00000000..e91a503e --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/EmptyProject/template.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Intel Corporation" + copyright="Copyright (c) 2007 Intel Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html" + id="EmptyProject" label="%EmptyProject.Ctemplate.label" description="%EmptyProject.Ctemplate.description" + help="help.html"> + <property-group id="basics" label="%EmptyProject.basics.label" description="%EmptyProject.basics.description" type="PAGES-ONLY" help="help.html"> + <property id="author" + label="%EmptyProject.author.label" + description="%EmptyProject.author.description" + type="input" + pattern=".*" + default="%EmptyProject.author.default" + hidden="false" + persist="false"/> + <property id="copyright" + label="%EmptyProject.copyright.label" + description="%EmptyProject.copyright.description" + type="input" + pattern=".*" + default="%EmptyProject.copyright.default" + hidden="false" + persist="false"/> + <property id="description" + label="%EmptyProject.description.label" + description="%EmptyProject.description.description" + type="input" + pattern=".*" + default="%EmptyProject.description.default" + hidden="false" + persist="false"/> + <property id="vendor" + label="%EmptyProject.vendor.label" + description="%EmptyProject.vendor.description" + type="input" + pattern=".*" + default="%EmptyProject.vendor.default" + hidden="false" + persist="false"/> + <property id="e-mail" + label="%EmptyProject.e-mail.label" + description="%EmptyProject.e-mail.description" + type="input" + pattern=".*" + default="%EmptyProject.e-mail.default" + hidden="false" + persist="false"/> + </property-group> + + + <process type="org.tizen.nativecommon.SetSBITarget"> + <simple name="projectName" value="$(projectName)"/> + </process> + + +</template> diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/.buildproperties.xml b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/.buildproperties.xml new file mode 100644 index 00000000..2dc1f3f7 --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/.buildproperties.xml @@ -0,0 +1 @@ +<BuildProperty><Project><Name>${CMAKE_TARGET}</Name></Project><Frameworks><Framework>capi-application-app_efl</Framework><Framework>capi-application-app_bundle</Framework><Framework>capi-base-i18n</Framework><Framework>elementary</Framework><Framework>ecore-x</Framework><Framework>ecore</Framework><Framework>evas</Framework><Framework>edje</Framework><Framework>dlog</Framework></Frameworks><Compiler><Type>C</Type><Flags>-Wall</Flags></Compiler><Includes><Path>${CMAKE_SOURCE_DIR}/include</Path></Includes><Linker><Libraries/><Paths/><Flags/></Linker><Symbols/><Debug><Level>g</Level></Debug><Optimization><Level>O0</Level></Optimization></BuildProperty>
\ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/Makefile b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/Makefile new file mode 100644 index 00000000..f1ce8207 --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/Makefile @@ -0,0 +1,30 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET(CMAKE_VERBOSE_MAKEFILE "ON") +SET(LIB_DIR "${CMAKE_SOURCE_DIR}/lib") +SET(RESOURCE_DIR "${CMAKE_SOURCE_DIR}/res") +SET(DATA_DIR "${CMAKE_SOURCE_DIR}/data") +SET(DEBIAN_DIR "${CMAKE_SOURCE_DIR}/debian") + +INCLUDE(${CDT_CONFIG_DIR}/CMakeLists.target) + +# FIND ALL SOURCE IN A SOURCE DIRECTORY + + +# INSTALL +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) +INSTALL(DIRECTORY ${RESOURCE_DIR}/images DESTINATION res) +INSTALL(DIRECTORY ${RESOURCE_DIR}/etc DESTINATION res) +INSTALL(DIRECTORY ${RESOURCE_DIR}/icons DESTINATION res) +INSTALL(DIRECTORY ${LIB_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}) +INSTALL(DIRECTORY ${DATA_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}) + +# INSTALL DESKTOP FILE +INSTALL(FILES ${DEBIAN_DIR}/desktop DESTINATION /opt/share/applications RENAME ${PACKAGE_NAME}.desktop) + +# INCLUDE FOR BUILD & INSTALL .EDC FILES +ADD_SUBDIRECTORY(res/edje) + +# INCLUDE FOR BUILD & INSTALL .PO FILES +ADD_SUBDIRECTORY(res/locale) + diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/changelog b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/changelog new file mode 100644 index 00000000..8db3a56c --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/changelog @@ -0,0 +1,5 @@ +com.samsung.hello (1.0.0) unstable; urgency=low + + * Initial Release + + -- Author <E-mail> Fri, 22 Jul 2011 17:32:27 +0900
\ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/com.samsung.hello.install b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/com.samsung.hello.install new file mode 100644 index 00000000..0b11bef6 --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/com.samsung.hello.install @@ -0,0 +1 @@ +/usr/bin
\ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/compat b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/compat new file mode 100644 index 00000000..7813681f --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/compat @@ -0,0 +1 @@ +5
\ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/control b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/control new file mode 100644 index 00000000..05ebaa0d --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/control @@ -0,0 +1,13 @@ +################################################################################# +# THIS FILE IS CREATED AUTOMATICALLY. DO NOT DELETE OR MODIFY THIS FILE. +################################################################################# + +Source: com.samsung.hello +Maintainer: Author <E-mail> +Standards-Version: 1.0.0 + +Package: com.samsung.hello +description: none +Architecture: any +XB-Permission: +XB-RequiredHardware: diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/rules b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/rules new file mode 100644 index 00000000..88e033a1 --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/debian/rules @@ -0,0 +1,74 @@ +#!/usr/bin/make -f + +CC?=gcc +CFLAGS?= +LDFLAGS?= + +PKGDIR = debian/PKG + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + touch configure-stamp + +build: build-stamp +build-stamp: configure-stamp + dh_testdir + # Add here commands to build the package. + mkdir -p bin + $(CC) $(CFLAGS) $(LDFLAGS) src/hello.c -o bin/hello + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + # Add here commands to clean up before the build process. + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + # Add here commands to install the package. + mkdir -p debian/tmp/usr/bin + cp bin/hello debian/tmp/usr/bin/ + +# Build architecture-independent files here. +binary-indep: build install + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install --sourcedir=debian/tmp +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb +# dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure
\ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/src/hello.c b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/src/hello.c new file mode 100644 index 00000000..5467927a --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/src/hello.c @@ -0,0 +1,8 @@ +#include <stdio.h> + +int main(int argc, char *argv[]) +{ + printf("Hello World!"); + return 0; +} + diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/template.properties b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/template.properties new file mode 100644 index 00000000..d47d18a1 --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/template.properties @@ -0,0 +1,19 @@ +HelloWorldProject.Ctemplate.label=Hello World Project +HelloWorldProject.Ctemplate.description=Hello World Project +HelloWorldProject.basics.label=Advanced Settings +HelloWorldProject.basics.description=Advanced properties of a project +HelloWorldProject.author.label=Author +HelloWorldProject.author.description=Name of the author +HelloWorldProject.author.default=Author +HelloWorldProject.copyright.label=Copyright +HelloWorldProject.copyright.description=Your copyright notice +HelloWorldProject.copyright.default=Your copyright notice +HelloWorldProject.vendor.label=Vendor +HelloWorldProject.vendor.default=samsung +HelloWorldProject.vendor.description=Enter your company or organization. +HelloWorldProject.description.default=Hello World Project +HelloWorldProject.description.description=Enter a description about your application. +HelloWorldProject.description.label=Description +HelloWorldProject.e-mail.default=E-mail +HelloWorldProject.e-mail.description=Enter your email address +HelloWorldProject.e-mail.label=E-mail diff --git a/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/template.xml b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/template.xml new file mode 100644 index 00000000..8e42f4ce --- /dev/null +++ b/org.tizen.nativeplatform/templates/CustomDebianPackages/HelloWorldProject/template.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Intel Corporation" + copyright="Copyright (c) 2007 Intel Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html" + id="HelloWorldProject" label="%HelloWorldProject.Ctemplate.label" description="%HelloWorldProject.Ctemplate.description" + help="help.html"> + <property-group id="basics" label="%HelloWorldProject.basics.label" description="%HelloWorldProject.basics.description" type="PAGES-ONLY" help="help.html"> + <property id="author" + label="%HelloWorldProject.author.label" + description="%HelloWorldProject.author.description" + type="input" + pattern=".*" + default="%HelloWorldProject.author.default" + hidden="false" + persist="false"/> + <property id="copyright" + label="%HelloWorldProject.copyright.label" + description="%HelloWorldProject.copyright.description" + type="input" + pattern=".*" + default="%HelloWorldProject.copyright.default" + hidden="false" + persist="false"/> + <property id="description" + label="%HelloWorldProject.description.label" + description="%HelloWorldProject.description.description" + type="input" + pattern=".*" + default="%HelloWorldProject.description.default" + hidden="false" + persist="false"/> + <property id="vendor" + label="%HelloWorldProject.vendor.label" + description="%HelloWorldProject.vendor.description" + type="input" + pattern=".*" + default="%HelloWorldProject.vendor.default" + hidden="false" + persist="false"/> + <property id="e-mail" + label="%HelloWorldProject.e-mail.label" + description="%HelloWorldProject.e-mail.description" + type="input" + pattern=".*" + default="%HelloWorldProject.e-mail.default" + hidden="false" + persist="false"/> + </property-group> + + <process type="org.tizen.nativecommon.TizenCreateSourceFolder"> + <simple name="projectName" value="$(projectName)"/> + <simple name="path" value="src"/> + </process> + + <process type="org.eclipse.cdt.core.AddFiles"> + <simple name="projectName" value="$(projectName)"/> + <complex-array name="files"> + <element> + <simple name="source" value="src/hello.c"/> + <simple name="target" value="src/hello.c"/> + <simple name="replaceable" value="true"/> + </element> + <element> + <simple name="source" value="debian/rules"/> + <simple name="target" value="debian/rules"/> + <simple name="replaceable" value="true"/> + </element> + <element> + <simple name="source" value="debian/compat"/> + <simple name="target" value="debian/compat"/> + <simple name="replaceable" value="true"/> + </element> + <element> + <simple name="source" value="debian/control"/> + <simple name="target" value="debian/control"/> + <simple name="replaceable" value="true"/> + </element> + <element> + <simple name="source" value="debian/changelog"/> + <simple name="target" value="debian/changelog"/> + <simple name="replaceable" value="true"/> + </element> + <element> + <simple name="source" value="debian/com.samsung.hello.install"/> + <simple name="target" value="debian/com.samsung.hello.install"/> + <simple name="replaceable" value="true"/> + </element> + </complex-array> + </process> + + <process type="org.tizen.nativecommon.SetSBITarget"> + <simple name="projectName" value="$(projectName)"/> + </process> + + +</template> diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/EmptyProject/.buildproperties.xml b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/EmptyProject/.buildproperties.xml new file mode 100644 index 00000000..2dc1f3f7 --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/EmptyProject/.buildproperties.xml @@ -0,0 +1 @@ +<BuildProperty><Project><Name>${CMAKE_TARGET}</Name></Project><Frameworks><Framework>capi-application-app_efl</Framework><Framework>capi-application-app_bundle</Framework><Framework>capi-base-i18n</Framework><Framework>elementary</Framework><Framework>ecore-x</Framework><Framework>ecore</Framework><Framework>evas</Framework><Framework>edje</Framework><Framework>dlog</Framework></Frameworks><Compiler><Type>C</Type><Flags>-Wall</Flags></Compiler><Includes><Path>${CMAKE_SOURCE_DIR}/include</Path></Includes><Linker><Libraries/><Paths/><Flags/></Linker><Symbols/><Debug><Level>g</Level></Debug><Optimization><Level>O0</Level></Optimization></BuildProperty>
\ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/EmptyProject/template.properties b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/EmptyProject/template.properties new file mode 100644 index 00000000..7afbfe8f --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/EmptyProject/template.properties @@ -0,0 +1,19 @@ +EmptyProject.Ctemplate.label=Empty Debian Project +EmptyProject.Ctemplate.description=Empty Debian Project +EmptyProject.basics.label=Advanced Settings +EmptyProject.basics.description=Advanced properties of a project +EmptyProject.author.label=Author +EmptyProject.author.description=Name of the author +EmptyProject.author.default=Author +EmptyProject.copyright.label=Copyright +EmptyProject.copyright.description=Your copyright notice +EmptyProject.copyright.default=Your copyright notice +EmptyProject.vendor.label=Vendor +EmptyProject.vendor.default=samsung +EmptyProject.vendor.description=Enter your company or organization. +EmptyProject.description.default=Empty Project +EmptyProject.description.description=Enter a description about your application. +EmptyProject.description.label=Description +EmptyProject.e-mail.default=E-mail +EmptyProject.e-mail.description=Enter your email address +EmptyProject.e-mail.label=E-mail diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/EmptyProject/template.xml b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/EmptyProject/template.xml new file mode 100644 index 00000000..e91a503e --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/EmptyProject/template.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Intel Corporation" + copyright="Copyright (c) 2007 Intel Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html" + id="EmptyProject" label="%EmptyProject.Ctemplate.label" description="%EmptyProject.Ctemplate.description" + help="help.html"> + <property-group id="basics" label="%EmptyProject.basics.label" description="%EmptyProject.basics.description" type="PAGES-ONLY" help="help.html"> + <property id="author" + label="%EmptyProject.author.label" + description="%EmptyProject.author.description" + type="input" + pattern=".*" + default="%EmptyProject.author.default" + hidden="false" + persist="false"/> + <property id="copyright" + label="%EmptyProject.copyright.label" + description="%EmptyProject.copyright.description" + type="input" + pattern=".*" + default="%EmptyProject.copyright.default" + hidden="false" + persist="false"/> + <property id="description" + label="%EmptyProject.description.label" + description="%EmptyProject.description.description" + type="input" + pattern=".*" + default="%EmptyProject.description.default" + hidden="false" + persist="false"/> + <property id="vendor" + label="%EmptyProject.vendor.label" + description="%EmptyProject.vendor.description" + type="input" + pattern=".*" + default="%EmptyProject.vendor.default" + hidden="false" + persist="false"/> + <property id="e-mail" + label="%EmptyProject.e-mail.label" + description="%EmptyProject.e-mail.description" + type="input" + pattern=".*" + default="%EmptyProject.e-mail.default" + hidden="false" + persist="false"/> + </property-group> + + + <process type="org.tizen.nativecommon.SetSBITarget"> + <simple name="projectName" value="$(projectName)"/> + </process> + + +</template> diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/.buildproperties.xml b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/.buildproperties.xml new file mode 100644 index 00000000..2dc1f3f7 --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/.buildproperties.xml @@ -0,0 +1 @@ +<BuildProperty><Project><Name>${CMAKE_TARGET}</Name></Project><Frameworks><Framework>capi-application-app_efl</Framework><Framework>capi-application-app_bundle</Framework><Framework>capi-base-i18n</Framework><Framework>elementary</Framework><Framework>ecore-x</Framework><Framework>ecore</Framework><Framework>evas</Framework><Framework>edje</Framework><Framework>dlog</Framework></Frameworks><Compiler><Type>C</Type><Flags>-Wall</Flags></Compiler><Includes><Path>${CMAKE_SOURCE_DIR}/include</Path></Includes><Linker><Libraries/><Paths/><Flags/></Linker><Symbols/><Debug><Level>g</Level></Debug><Optimization><Level>O0</Level></Optimization></BuildProperty>
\ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/Makefile b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/Makefile new file mode 100644 index 00000000..f1ce8207 --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/Makefile @@ -0,0 +1,30 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET(CMAKE_VERBOSE_MAKEFILE "ON") +SET(LIB_DIR "${CMAKE_SOURCE_DIR}/lib") +SET(RESOURCE_DIR "${CMAKE_SOURCE_DIR}/res") +SET(DATA_DIR "${CMAKE_SOURCE_DIR}/data") +SET(DEBIAN_DIR "${CMAKE_SOURCE_DIR}/debian") + +INCLUDE(${CDT_CONFIG_DIR}/CMakeLists.target) + +# FIND ALL SOURCE IN A SOURCE DIRECTORY + + +# INSTALL +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin) +INSTALL(DIRECTORY ${RESOURCE_DIR}/images DESTINATION res) +INSTALL(DIRECTORY ${RESOURCE_DIR}/etc DESTINATION res) +INSTALL(DIRECTORY ${RESOURCE_DIR}/icons DESTINATION res) +INSTALL(DIRECTORY ${LIB_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}) +INSTALL(DIRECTORY ${DATA_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}) + +# INSTALL DESKTOP FILE +INSTALL(FILES ${DEBIAN_DIR}/desktop DESTINATION /opt/share/applications RENAME ${PACKAGE_NAME}.desktop) + +# INCLUDE FOR BUILD & INSTALL .EDC FILES +ADD_SUBDIRECTORY(res/edje) + +# INCLUDE FOR BUILD & INSTALL .PO FILES +ADD_SUBDIRECTORY(res/locale) + diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/changelog b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/changelog new file mode 100644 index 00000000..8db3a56c --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/changelog @@ -0,0 +1,5 @@ +com.samsung.hello (1.0.0) unstable; urgency=low + + * Initial Release + + -- Author <E-mail> Fri, 22 Jul 2011 17:32:27 +0900
\ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/com.samsung.hello.install b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/com.samsung.hello.install new file mode 100644 index 00000000..0b11bef6 --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/com.samsung.hello.install @@ -0,0 +1 @@ +/usr/bin
\ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/compat b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/compat new file mode 100644 index 00000000..7813681f --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/compat @@ -0,0 +1 @@ +5
\ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/control b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/control new file mode 100644 index 00000000..05ebaa0d --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/control @@ -0,0 +1,13 @@ +################################################################################# +# THIS FILE IS CREATED AUTOMATICALLY. DO NOT DELETE OR MODIFY THIS FILE. +################################################################################# + +Source: com.samsung.hello +Maintainer: Author <E-mail> +Standards-Version: 1.0.0 + +Package: com.samsung.hello +description: none +Architecture: any +XB-Permission: +XB-RequiredHardware: diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/rules b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/rules new file mode 100644 index 00000000..88e033a1 --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/rules @@ -0,0 +1,74 @@ +#!/usr/bin/make -f + +CC?=gcc +CFLAGS?= +LDFLAGS?= + +PKGDIR = debian/PKG + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + touch configure-stamp + +build: build-stamp +build-stamp: configure-stamp + dh_testdir + # Add here commands to build the package. + mkdir -p bin + $(CC) $(CFLAGS) $(LDFLAGS) src/hello.c -o bin/hello + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + # Add here commands to clean up before the build process. + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + # Add here commands to install the package. + mkdir -p debian/tmp/usr/bin + cp bin/hello debian/tmp/usr/bin/ + +# Build architecture-independent files here. +binary-indep: build install + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install --sourcedir=debian/tmp +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb +# dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure
\ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/src/hello.c b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/src/hello.c new file mode 100644 index 00000000..5467927a --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/src/hello.c @@ -0,0 +1,8 @@ +#include <stdio.h> + +int main(int argc, char *argv[]) +{ + printf("Hello World!"); + return 0; +} + diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/template.properties b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/template.properties new file mode 100644 index 00000000..d47d18a1 --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/template.properties @@ -0,0 +1,19 @@ +HelloWorldProject.Ctemplate.label=Hello World Project +HelloWorldProject.Ctemplate.description=Hello World Project +HelloWorldProject.basics.label=Advanced Settings +HelloWorldProject.basics.description=Advanced properties of a project +HelloWorldProject.author.label=Author +HelloWorldProject.author.description=Name of the author +HelloWorldProject.author.default=Author +HelloWorldProject.copyright.label=Copyright +HelloWorldProject.copyright.description=Your copyright notice +HelloWorldProject.copyright.default=Your copyright notice +HelloWorldProject.vendor.label=Vendor +HelloWorldProject.vendor.default=samsung +HelloWorldProject.vendor.description=Enter your company or organization. +HelloWorldProject.description.default=Hello World Project +HelloWorldProject.description.description=Enter a description about your application. +HelloWorldProject.description.label=Description +HelloWorldProject.e-mail.default=E-mail +HelloWorldProject.e-mail.description=Enter your email address +HelloWorldProject.e-mail.label=E-mail diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/template.xml b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/template.xml new file mode 100644 index 00000000..8e42f4ce --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/template.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Intel Corporation" + copyright="Copyright (c) 2007 Intel Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html" + id="HelloWorldProject" label="%HelloWorldProject.Ctemplate.label" description="%HelloWorldProject.Ctemplate.description" + help="help.html"> + <property-group id="basics" label="%HelloWorldProject.basics.label" description="%HelloWorldProject.basics.description" type="PAGES-ONLY" help="help.html"> + <property id="author" + label="%HelloWorldProject.author.label" + description="%HelloWorldProject.author.description" + type="input" + pattern=".*" + default="%HelloWorldProject.author.default" + hidden="false" + persist="false"/> + <property id="copyright" + label="%HelloWorldProject.copyright.label" + description="%HelloWorldProject.copyright.description" + type="input" + pattern=".*" + default="%HelloWorldProject.copyright.default" + hidden="false" + persist="false"/> + <property id="description" + label="%HelloWorldProject.description.label" + description="%HelloWorldProject.description.description" + type="input" + pattern=".*" + default="%HelloWorldProject.description.default" + hidden="false" + persist="false"/> + <property id="vendor" + label="%HelloWorldProject.vendor.label" + description="%HelloWorldProject.vendor.description" + type="input" + pattern=".*" + default="%HelloWorldProject.vendor.default" + hidden="false" + persist="false"/> + <property id="e-mail" + label="%HelloWorldProject.e-mail.label" + description="%HelloWorldProject.e-mail.description" + type="input" + pattern=".*" + default="%HelloWorldProject.e-mail.default" + hidden="false" + persist="false"/> + </property-group> + + <process type="org.tizen.nativecommon.TizenCreateSourceFolder"> + <simple name="projectName" value="$(projectName)"/> + <simple name="path" value="src"/> + </process> + + <process type="org.eclipse.cdt.core.AddFiles"> + <simple name="projectName" value="$(projectName)"/> + <complex-array name="files"> + <element> + <simple name="source" value="src/hello.c"/> + <simple name="target" value="src/hello.c"/> + <simple name="replaceable" value="true"/> + </element> + <element> + <simple name="source" value="debian/rules"/> + <simple name="target" value="debian/rules"/> + <simple name="replaceable" value="true"/> + </element> + <element> + <simple name="source" value="debian/compat"/> + <simple name="target" value="debian/compat"/> + <simple name="replaceable" value="true"/> + </element> + <element> + <simple name="source" value="debian/control"/> + <simple name="target" value="debian/control"/> + <simple name="replaceable" value="true"/> + </element> + <element> + <simple name="source" value="debian/changelog"/> + <simple name="target" value="debian/changelog"/> + <simple name="replaceable" value="true"/> + </element> + <element> + <simple name="source" value="debian/com.samsung.hello.install"/> + <simple name="target" value="debian/com.samsung.hello.install"/> + <simple name="replaceable" value="true"/> + </element> + </complex-array> + </process> + + <process type="org.tizen.nativecommon.SetSBITarget"> + <simple name="projectName" value="$(projectName)"/> + </process> + + +</template> diff --git a/package/build.linux b/package/build.linux new file mode 100755 index 00000000..741790cc --- /dev/null +++ b/package/build.linux @@ -0,0 +1,292 @@ +#!/bin/bash -x + +build_path=${SRCDIR}/build_result + +__set_parameter() +{ + build_id=${package_name} + build_type=N + build_result_directory=${build_type}.${build_id} + build_result_path="$build_path/$build_result_directory" + architecture=x86 + ide_root_path_name=IDE + + case ${platform} in + linux) + archive_platform_name=linux + windowing=gtk + ;; + windows) + archive_platform_name=win32 + windowing=win32 + ;; + *) + echo "${platform} is not support yet." + ;; + esac + + result_archive_file=${build_id}-${archive_platform_name}.${windowing}.${architecture}.zip +} + +__set_build_parameter() +{ + case ${platform} in + linux) + reference_ide_path=${ROOTDIR}/indigo-pde/eclipse + ;; + windows) + reference_ide_path=${ROOTDIR}/indigo-winpde/eclipse + ;; + *) + echo "${platform} is not support yet." + ;; + esac +} + +__set_install_parameter() +{ + INSTALL_DIR=${SRCDIR}/package/${package_name}.package.${platform}/data +} + +__clean_build_environment() +{ + if [ -d $build_path ] + then + echo "Build result directory : [$build_path]" + else + echo "Make build result directory [$build_path]" + mkdir -p $build_path + fi + + echo "Remove legacy build files..." + if [ -d ${build_result_path}/${archive_platform_name}.${windowing}.${architecture} ] + then + rm -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture} + fi + if [ -e ${build_result_path}/${result_archive_file} ] + then + rm -rf ${build_result_path}/${result_archive_file} + fi + if [ -d ${build_path}/tmp ] + then + rm -rf ${build_path}/tmp + fi + + if [ -d ${build_path}/buildRepo ] + then + rm -rf ${build_path}/buildRepo + fi + + rm -r ${build_path}/*.xml + rm -r ${build_path}/*.properties + rm -r ${build_path}/*.clean + + + if [ -d $build_path/plugins ] + then + echo "plugins directory recreate..." + rm -rf $build_path/plugins + mkdir $build_path/plugins + else + echo "Make plugins directory..." + mkdir $build_path/plugins + fi + if [ -d $build_path/features/ ] + then + echo "features directory recreate..." + rm -rf $build_path/features + mkdir $build_path/features + else + echo "Make features directory..." + mkdir $build_path/features + fi + +} + +__copy_build_sources() +{ + echo "Copy features from $SRCDIR to $build_path/features" + cp -r $SRCDIR/*.feature $build_path/features + + echo "Copy plugins from $SRCDIR to $build_path/plugins" + cp -r $SRCDIR/* $build_path/plugins + rm -rf $build_path/plugins/*.feature +} + +__copy_dependency_plugins() +{ + dependency_plugin_path=${ROOTDIR}/${ide_root_path_name} + if [ -d ${dependency_plugin_path} ] + then + cp -rf ${dependency_plugin_path}/features/* ${build_path}/features/ + cp -rf ${dependency_plugin_path}/plugins/* ${build_path}/plugins/ + fi +} + +__make_ant_build_properties_file() +{ + builder_path="${SRCDIR}/builder" + parent_path_of_based_eclipse=${reference_ide_path}/.. + + echo "Make build.properties file..." + if [ ! -e $builder_path/build.properties.clean ] ; then + echo "ERROR : \"build.properties.clean\" file does not exist..." + exit 1 + fi + cp $builder_path/build.properties.clean $build_path + cp $builder_path/customTargets.xml $build_path + + if [ -d $reference_ide_path ] + then + sed -e "s;\(^buildDirectory=\).*;\1${build_path};g" \ + -e "s;\(^base=\).*;\1${parent_path_of_based_eclipse};g" \ + -e "s;\(^baseLocation=\).*;\1${reference_ide_path};g" \ + -e "s;\(^configs=\).*;\1${archive_platform_name},${windowing},${architecture};g" \ + -e "s;\(^buildType=\).*;\1${build_type};g" \ + -e "s;\(^buildId=\).*;\1${build_id};g" \ + -e "s;\(^archivePrefix=\).*;\1${build_id};g" \ + < $build_path/build.properties.clean > $build_path/build.properties + + else + echo "ERROR : target eclipse is not exist." + exit 1 + fi +} + +__execute_pde_build() +{ + echo "Execute Product Ant Builder..." + equinox_launcher=`echo org.eclipse.equinox.launcher_*.jar` + pde_build=`echo org.eclipse.pde.build_*` + + java -jar ${reference_ide_path}/plugins/$equinox_launcher -application org.eclipse.ant.core.antRunner -buildfile ${reference_ide_path}/plugins/$pde_build/scripts/productBuild/productBuild.xml -Dbuilder=$build_path -Dosgi.locking=none 2>&1 + + if [ $? != 0 ]; + then + echo "Build failed..." + exit 1 + fi +} + +__unzip_plugin_pack() +{ + echo "unzip to $build_result_path" + unzip -a $build_result_path/${result_archive_file} -d $build_result_path/${archive_platform_name}.${windowing}.${architecture} +} + +build_plugins() +{ + case ${platform} in + linux) + echo "build plugin for ${platform}" + ;; + windows) + echo "build plugin for ${platform}" + ;; + *) + echo "${platform} is not support yet." + exit 1 + ;; + esac + + __set_parameter + __set_build_parameter + __clean_build_environment + __copy_build_sources + __copy_dependency_plugins + __make_ant_build_properties_file + __execute_pde_build + __unzip_plugin_pack + + echo "Build SUCCESS. You will find SDK IDE in \"${build_result_path}\"." +} + +__clean_packaging_environment() +{ + + if [ -d ${INSTALL_DIR} ] + then + rm -rf ${INSTALL_DIR} + else + mkdir -p ${INSTALL_DIR} + fi +} + +__copy_necessary_binaries() +{ + echo "add necessary files." + ## ex) cp -rf ~~~~/file.file ${INSTALL_DIR}/${ide_root_path_name}/ +} + +packaging_plugins() +{ + __set_parameter + __set_install_parameter + + __clean_packaging_environment + __copy_necessary_binaries + + install_ide_path=${INSTALL_DIR}/${ide_root_path_name} + + if [ ! -d ${install_ide_path} ] + then + mkdir -p ${install_ide_path} + fi + + cp -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture}/${package_name}/* ${install_ide_path}/ +} + +# clean +clean() +{ + echo "=========================================CLEAN============================================" + make clean + rm -rf ${SRCDIR}/*.zip + rm -rf ${SRCDIR}/*.tar.gz + rm -rf ${build_path} +} + +# build +build() +{ + echo "=========================================BUILD============================================" + pkgname_and_platform_list=`awk 'BEGIN{RS="\n\n"; FS="\n"} /Package:/{for(i=1;i<NF;i++){if($i ~ /^OS:/){print $1,$i}}}' ${SRCDIR}/package/pkginfo.manifest | tr ' ' '@'` + for pkgname_and_platform in ${pkgname_and_platform_list} + do + pkgname_and_platform=`echo $pkgname_and_platform | tr '@' ' '` + package_name=`echo ${pkgname_and_platform} | cut -f1 -d " " | cut -f2 -d ":"` + platform=`echo ${pkgname_and_platform} | cut -f2 -d " " | cut -f2 -d ":"` + + if [ "x${BUILD_TARGET_OS}" = "x${platform}" ] + then + build_plugins + else + echo "" + fi + done +} + +# install +install() +{ + pkgname_and_platform_list=`awk 'BEGIN{RS="\n\n"; FS="\n"} /Package:/{for(i=1;i<NF;i++){if($i ~ /^OS:/){print $1,$i}}}' ${SRCDIR}/package/pkginfo.manifest | tr ' ' '@'` + for pkgname_and_platform in ${pkgname_and_platform_list} + do + echo "=========================================INSTALL============================================" + pkgname_and_platform=`echo $pkgname_and_platform | tr '@' ' '` + package_name=`echo ${pkgname_and_platform} | cut -f1 -d " " | cut -f2 -d ":"` + platform=`echo ${pkgname_and_platform} | cut -f2 -d " " | cut -f2 -d ":"` + + if [ "x${BUILD_TARGET_OS}" = "x${platform}" ] + then + packaging_plugins + else + echo "" + fi + done +} + +[ "$1" = "clean" ] && clean +[ "$1" = "build" ] && build +[ "$1" = "install" ] && install +exit 0 diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest new file mode 100644 index 00000000..827d43c8 --- /dev/null +++ b/package/pkginfo.manifest @@ -0,0 +1,19 @@ +Package:nativeplatform-eplugin +Version:0.20.14 +OS:linux +Build-host-os:linux +Build-dependency:indigo-pde [linux], base-ide-product [linux], common-eplugin [linux], nativecommon-eplugin [linux] +Install-dependency:base-ide-product [linux], common-eplugin [linux], nativecommon-eplugin [linux] +Source:nativeplatform-eplugin +Maintainer:Kangho Kim <kh5325.kim@samsung.com>, Yoonki Park, Taeyoung Son +Description:Nativeplatform plugin + +Package:nativeplatform-eplugin +Version:0.20.14 +OS:windows +Build-host-os:linux +Build-dependency:indigo-winpde [windows], base-ide-product [windows], common-eplugin [windows], nativecommon-eplugin [windows] +Install-dependency:base-ide-product [windows], common-eplugin [windows], nativecommon-eplugin [windows] +Source:nativeplatform-eplugin +Maintainer:Kangho Kim <kh5325.kim@samsung.com>, Yoonki Park, Taeyoung Son +Description:Nativeplatform plugin |