Generate "readme.txt" for project "lib" directory // Resolve #273

This commit is contained in:
Ivan Kravets
2015-08-22 23:11:48 +03:00
parent 47d5783700
commit e2795716f9
3 changed files with 20 additions and 2 deletions

View File

@ -25,8 +25,10 @@ PlatformIO 2.0
* Updated ``tool-teensy`` for `Teensy <http://docs.platformio.org/en/latest/platforms/teensy.html>`__
platform
(`issue #268 <https://github.com/platformio/platformio/issues/268>`_)
* Added answer to FAQ when `Program "platformio" not found in PATH <http://docs.platformio.org/en/latest/faq.html#faq-troubleshooting-pionotfoundinpath>`_
* Added FAQ answer when `Program "platformio" not found in PATH <http://docs.platformio.org/en/latest/faq.html#faq-troubleshooting-pionotfoundinpath>`_
(`issue #272 <https://github.com/platformio/platformio/issues/272>`_)
* Generate "readme.txt" for project "lib" directory
(`issue #273 <https://github.com/platformio/platformio/issues/273>`_)
* Fixed includes list for Windows OS when generating project for `Eclipse IDE <http://docs.platformio.org/en/latest/ide/eclipse.html>`__
(`issue #270 <https://github.com/platformio/platformio/issues/270>`_)
* Fixed ``AttributeError: 'module' object has no attribute 'packages'``

View File

@ -26,6 +26,10 @@ This command will create:
* ``lib`` - a directory for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file
.. note::
The source code of each library should be placed in separate directory.
For example, ``lib/private_lib/[here are source files]``.
Options
-------
@ -70,11 +74,11 @@ allows you to disable firmware auto-uploading by default.
--env-prefix
An environment prefix which will be used with pair in board type.
For example, the default environment name for ``teensy_31`` board will
be ``[env:teensy_31]``.
Examples
--------

View File

@ -77,6 +77,18 @@ def cli(project_dir, board, ide, disable_auto_uploading, env_prefix):
if not isdir(d):
makedirs(d)
if not isfile(join(lib_dir, "readme.txt")):
with open(join(lib_dir, "readme.txt"), "w") as f:
f.write("""
Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory.
For example, "lib/private_lib/[here are source files]".
""")
if not isfile(project_file):
copyfile(join(get_source_dir(), "projectconftpl.ini"),
project_file)