upm/Documentation/contributingrules.html
2018-11-07 21:32:23 +00:00

2 lines
9.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"><link href="https://fonts.googleapis.com/css?family=Roboto+Slab:100,300,400,700|Roboto:100,300,400,500,700,900" rel="stylesheet"><link rel="shortcut icon" type="image/png" href="/assets/images/favicon.png"/><link rel="stylesheet" href="/assets/css/style.css"><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/dracula.min.css"> <script src="/assets/js/library/jquery-2.2.4.min.js"></script> <script src="/assets/js/library/handlebars.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script> <script type="text/javascript">hljs.initHighlightingOnLoad();</script> <script type="text/javascript"> $(function(){ var current = location.pathname; $('.nav li a').each(function(){ var $this = $(this); /* if the current path is like this link, make it active */ if($this.attr('href').indexOf(current) !== -1){ $this.addClass('active'); } }) }); </script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-17890616-13', 'auto'); ga('send', 'pageview'); </script><body><header><nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"><div class="container"><div class="row"><div class="col-xs-12 col-sm-5"> <a class="navbar-logo pull-left" href="/"> <img src="/assets/images/logo.png" class="logo-img"> </a><div class="navbar-header pull-right" style="display: inline-block;"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button></div></div><div class="col-sm-7 col-xs-12 menu-inner"><div id="navbar" class="navbar-collapse collapse"><ul class="nav navbar-nav navbar-right nav-list"><li> <a href="/findSensor.html"><span class="icon find-sensor" ></span> <span class="">Find</span></a><li> <a href="/addSensor.html"><span class="icon add-sensor" ></span> <span class="">Join</span></a><li> <a href="/Documentation/docindex.html"><span class="icon documentation" ></span> <span class="">Documentation</span></a><li> <a href="https://github.com/intel-iot-devkit/upm" target="_blank"><span class="icon github github-mobile"></span> <span class="github-desktop">Github</span></a></ul></div></div></div></div></nav></header><main><div class="main-container inner-pages"><div class="container"><div class="row"><div class="col-sm-8 col-xs-12 "><div class="page-heading"> Contribution rules and templates</div></div></div></div><div class="section-wrapper installingMraa"><div class="container"><div class="row "><div class="col-xs-12"><div class="description"> • Each new module must have an example that builds against your UPM library.<br /> • Each commit must have a sign-off line by everyone who authored or reviewed them. • Commits must be named &lt;file/module&gt;: A good description. <br /> • You must license your module under a FOSS license. The recommended license is MIT but any permissive license is fine. Remember that people using UPM may want to write proprietary programs with your sensors so please avoid GPL. If your license is not MIT, please include a LICENSE file in src/mymodule/.<br /> • The top of each source file must contain a comment block containing the license information. Please test your module builds before contributing and make sure it works on the latest version of libmraa. If you tested on a specific board/platform please tell us what this was in your PR.<br /> • Try not to break the master in any commit.<br /> • Include API documentation as described in the the @ref documentation guide.<br /></div><div class="title">Including the MIT license</div><div class="sub-title">We prefer that you choose the MIT license for the UPM repository. Heres the comment block thats needed at the top each source file:</div><div class="description"> /* * The MIT License (MIT) <br /> *<br /> * Author: &lt;your full name&gt;<br /> * Copyright (c) &lt;year&gt; &lt;copyright holder&gt; <br /> *<br /> * Author: &lt;contributing author full name - if applicable&gt;<br /> * Copyright (c) &lt;year&gt; &lt;copyright holder&gt;<br /> *<br /> * Permission is hereby granted, free of charge, to any person obtaining a copy of<br /> * this software and associated documentation files (the "Software"), to deal in<br /> * the Software without restriction, including without limitation the rights to<br /> * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of<br /> * the Software, and to permit persons to whom the Software is furnished to do so,<br /> * subject to the following conditions:<br /> *<br /> * The above copyright notice and this permission notice shall be included in all<br /> * copies or substantial portions of the Software.<br /> *<br /> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br /> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS<br /> * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR<br /> * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER<br /> * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN<br /> * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.<br /> */<br /></div><div class="title">Code signing</div><div class="sub-title">The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify the below:</div><div class="description"> Developer's Certificate of Origin 1.1 <br /> &nbsp;&nbsp;By making a contribution to this project, I certify that: <br /> &nbsp; &nbsp;(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or <br /> &nbsp; &nbsp;(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or <br /> &nbsp; &nbsp;(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. <br /> &nbsp; &nbsp;(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. <br /> <br /> then you just add a line to each of your commits with --signoff saying using your real name (sorry, no pseudonyms or anonymous contributions.) Unsigned commits will not be accepted. <br /> &nbsp;&nbsp;Signed-off-by: Random J Developer &lt;random@developer.example.org&gt; <br /> using your real name (sorry, no pseudonyms or anonymous contributions.) Unsigned commits will not be accepted. <br /> <br /></div><div class="title">Creating a new sensor library using the sensortemplate</div><div class="sub-title">A stubbed-out sensor library is available that can be leveraged to get up-and-running quickly when writing a new sensor library. Use the shell commands below to generate collateral files for your new sensor library.</div><div class="description"> # Set SensorName to your new library name, example: 'MyNewSensor1234' <br /> export SensorName=MyNewSensor1234 <br /> # Copy/paste the below commands into a bash shell... <br /> # Get a lowercase version of the string <br /> export sensorname=${SensorName,,} <br /> # Copy sensortemplate files to ${sensorname} <br /> find docs/ examples/ src/ -name '*sensortemplate*' -exec bash -c 'cp -r $0 ${0/ <br />sensortemplate/${sensorname}}' {} \; <br /> # Copy SensorTemplate files to ${SensorName} <br /> find examples/ src/ -name '*SensorTemplate*' -exec bash -c 'cp -r $0 ${0/ <br />SensorTemplate/${SensorName}}' {} \; <br /> # Rename sernsortemplate src files <br /> rename "s/sensortemplate/${sensorname}/" src/${sensorname}/* <br /> # Search/replace the new files, replacing all instances of sensortemplate <br /> perl -p -i -e "s/SensorTemplate/${SensorName}/g" src/${sensorname}/* examples/*/*${sensorname}* <br />examples/*/*${SensorName}* <br /> perl -p -i -e "s/sensortemplate/${sensorname}/g" src/${sensorname}/* examples/*/*${sensorname}* <br />examples/*/*${SensorName}*<br /> # Add mynewmodule example target for c++<br /> perl -p -i -e "s/^((.*)sensortemplate(.*))/\1\n\2${sensorname}\3/g" examples/c++/CMakeLists.txt<br /> # Add mynewmodule example target for java<br /> perl -p -i -e "s/^((.*)SensorTemplateSample sensortemplate(.*))/\1\n\2${SensorName}Sample <br />${sensorname}\3/g" examples/java/CMakeLists.txt<br /> # Add mynewmodule example mappings for doxygen<br /> perl -p -i -e "s/^(.*SensorTemplateSample.*)$/\1\n${sensorname}.cxx\t${SensorName}Sample.java\t${se<br />nsorname}.js\t${sensorname}.py/g" doxy/samples.mapping.txt<br /></div></div></div></div></div></div><footer class="site-footer"><div class="container"><div class="row"><div class="col-xs-6"><p class="text-muted">(* Trademarks)</div><div class="col-xs-6 text-right"><p class="text-muted">&copy; 2017 UPM</div></div></div><script src="/assets/js/library/bootstrap.min.js"></script></footer></main>