forked from platformio/platformio-core
Allow to disable library archiving ("*.ar") // Resolve #719
This commit is contained in:
39
HISTORY.rst
39
HISTORY.rst
@ -13,28 +13,33 @@ PlatformIO 3.0
|
|||||||
(`issue #479 <https://github.com/platformio/platformio/issues/479>`_)
|
(`issue #479 <https://github.com/platformio/platformio/issues/479>`_)
|
||||||
* Unit Testing for Embedded (`docs <http://docs.platformio.org/en/latest/platforms/unit_testing.html>`__)
|
* Unit Testing for Embedded (`docs <http://docs.platformio.org/en/latest/platforms/unit_testing.html>`__)
|
||||||
(`issue #408 <https://github.com/platformio/platformio/issues/408>`_)
|
(`issue #408 <https://github.com/platformio/platformio/issues/408>`_)
|
||||||
* New Library Build System: intelligent dependency finder that interprets
|
* New Intelligent Library Build System
|
||||||
C Preprocessor conditional macros,
|
|
||||||
`library deep search <http://docs.platformio.org/en/latest/projectconf.html#lib-deep-search>`__,
|
+ `Library Dependency Finder <http://docs.platformio.org/en/latest/faq.html#how-works-library-dependency-finder-ldf>`__
|
||||||
`library compatibility level <http://docs.platformio.org/en/latest/projectconf.html#lib-compat-level>`__,
|
that interprets C Preprocessor conditional macros and nested includes/chain
|
||||||
support for the 3rd party manifests (Arduino IDE ``library.properties``,
|
+ Check library compatibility with project environment before building
|
||||||
ARM mbed ``module.json``)
|
(`issue #415 <https://github.com/platformio/platformio/issues/415>`_)
|
||||||
(`issue #432 <https://github.com/platformio/platformio/issues/432>`_)
|
+ Control Library Dependency Finder for compatibility using
|
||||||
* New `lib_extra_dirs <http://docs.platformio.org/en/latest/projectconf.html#lib-extra-dirs>`__ option for project environment.
|
`lib_compat_level <http://docs.platformio.org/en/latest/projectconf.html#lib-compat-level>`__
|
||||||
Multiple custom library locations!
|
option
|
||||||
(`issue #537 <https://github.com/platformio/platformio/issues/537>`_)
|
+ Custom library storages/directories with
|
||||||
* Handle extra build flags and build script from
|
`lib_extra_dirs <http://docs.platformio.org/en/latest/projectconf.html#lib-extra-dirs>`__ option
|
||||||
`library.json <http://docs.platformio.org/en/latest/librarymanager/config.html>`__
|
(`issue #537 <https://github.com/platformio/platformio/issues/537>`_)
|
||||||
(`issue #289 <https://github.com/platformio/platformio/issues/289>`_)
|
+ Handle extra build flags, source filters and build script from
|
||||||
* Check library compatibility with project environment before building
|
`library.json <http://docs.platformio.org/en/latest/librarymanager/config.html>`__
|
||||||
(`issue #415 <https://github.com/platformio/platformio/issues/415>`_)
|
(`issue #289 <https://github.com/platformio/platformio/issues/289>`_)
|
||||||
|
+ Allowed to disable library archiving (``*.ar``)
|
||||||
|
(`issue #719 <https://github.com/platformio/platformio/issues/719>`_)
|
||||||
|
+ Show detailed build information about dependent libraries
|
||||||
|
(`issue #617 <https://github.com/platformio/platformio/issues/617>`_)
|
||||||
|
+ Support for the 3rd party manifests (Arduino IDE "library.properties"
|
||||||
|
and ARM mbed "module.json")
|
||||||
|
|
||||||
* Print human-readable information when processing environments without
|
* Print human-readable information when processing environments without
|
||||||
``-v, --verbose`` option
|
``-v, --verbose`` option
|
||||||
(`issue #721 <https://github.com/platformio/platformio/issues/721>`_)
|
(`issue #721 <https://github.com/platformio/platformio/issues/721>`_)
|
||||||
* Added ``license`` field to `library.json <http://docs.platformio.org/en/latest/librarymanager/config.html>`__
|
* Added ``license`` field to `library.json <http://docs.platformio.org/en/latest/librarymanager/config.html>`__
|
||||||
(`issue #522 <https://github.com/platformio/platformio/issues/522>`_)
|
(`issue #522 <https://github.com/platformio/platformio/issues/522>`_)
|
||||||
* Show detailed build information about dependent libraries
|
|
||||||
(`issue #617 <https://github.com/platformio/platformio/issues/617>`_)
|
|
||||||
* Embedded Board compatibility with more than one development platform
|
* Embedded Board compatibility with more than one development platform
|
||||||
(`issue #456 <https://github.com/platformio/platformio/issues/456>`_)
|
(`issue #456 <https://github.com/platformio/platformio/issues/456>`_)
|
||||||
|
|
||||||
|
@ -461,6 +461,10 @@ options:
|
|||||||
- ``String``
|
- ``String``
|
||||||
- Launch extra script before build process.
|
- Launch extra script before build process.
|
||||||
More details :ref:`projectconf_extra_script`
|
More details :ref:`projectconf_extra_script`
|
||||||
|
* - ``libArchive``
|
||||||
|
- ``Boolean``
|
||||||
|
- Archive object files to Static Library. This is default behavior of
|
||||||
|
PlatformIO Build System (``"libArchive": true``).
|
||||||
|
|
||||||
**Examples**
|
**Examples**
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
VERSION = (3, 0, "0.dev10")
|
VERSION = (3, 0, "0.dev11")
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
|
@ -121,6 +121,10 @@ class LibBuilderBase(object):
|
|||||||
def extra_script(self):
|
def extra_script(self):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def lib_archive(self):
|
||||||
|
return True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_built(self):
|
def is_built(self):
|
||||||
return self._is_built
|
return self._is_built
|
||||||
@ -162,7 +166,12 @@ class LibBuilderBase(object):
|
|||||||
for key in ("CPPPATH", "LIBPATH", "LIBS", "LINKFLAGS"):
|
for key in ("CPPPATH", "LIBPATH", "LIBS", "LINKFLAGS"):
|
||||||
self.env.AppendUnique(**{key: env.get(key)})
|
self.env.AppendUnique(**{key: env.get(key)})
|
||||||
|
|
||||||
return env.BuildLibrary(self.build_dir, self.src_dir, self.src_filter)
|
if self.lib_archive:
|
||||||
|
return env.BuildLibrary(
|
||||||
|
self.build_dir, self.src_dir, self.src_filter)
|
||||||
|
else:
|
||||||
|
return env.BuildSources(
|
||||||
|
self.build_dir, self.src_dir, self.src_filter)
|
||||||
|
|
||||||
|
|
||||||
class UnknownLibBuilder(LibBuilderBase):
|
class UnknownLibBuilder(LibBuilderBase):
|
||||||
@ -260,6 +269,12 @@ class PlatformIOLibBuilder(LibBuilderBase):
|
|||||||
return self._manifest.get("build").get("extra_script")
|
return self._manifest.get("build").get("extra_script")
|
||||||
return LibBuilderBase.extra_script.fget(self)
|
return LibBuilderBase.extra_script.fget(self)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def lib_archive(self):
|
||||||
|
if "libArchive" in self._manifest.get("build", {}):
|
||||||
|
return self._manifest.get("build").get("libArchive")
|
||||||
|
return LibBuilderBase.lib_archive.fget(self)
|
||||||
|
|
||||||
def is_platform_compatible(self, platform):
|
def is_platform_compatible(self, platform):
|
||||||
items = self._manifest.get("platforms")
|
items = self._manifest.get("platforms")
|
||||||
if not items:
|
if not items:
|
||||||
@ -315,7 +330,9 @@ def find_and_build_deps(env, lib_builders, scanner,
|
|||||||
lb.append_to_cpppath()
|
lb.append_to_cpppath()
|
||||||
# start builder
|
# start builder
|
||||||
for lb in target_lbs:
|
for lb in target_lbs:
|
||||||
libs.append(lb.build())
|
lib_node = lb.build()
|
||||||
|
if lib_node:
|
||||||
|
libs.append(lib_node)
|
||||||
|
|
||||||
if env.get("LIB_DEEP_SEARCH", "").lower() == "true":
|
if env.get("LIB_DEEP_SEARCH", "").lower() == "true":
|
||||||
for lb in target_lbs:
|
for lb in target_lbs:
|
||||||
@ -377,7 +394,9 @@ def BuildDependentLibraries(env, src_dir):
|
|||||||
libs.extend(find_and_build_deps(
|
libs.extend(find_and_build_deps(
|
||||||
env, lib_builders, scanner, lb.src_dir, lb.src_filter))
|
env, lib_builders, scanner, lb.src_dir, lb.src_filter))
|
||||||
if not lb.is_built:
|
if not lb.is_built:
|
||||||
libs.append(lb.build())
|
lib_node = lb.build()
|
||||||
|
if lib_node:
|
||||||
|
libs.append(lib_node)
|
||||||
|
|
||||||
# process project source code
|
# process project source code
|
||||||
libs.extend(find_and_build_deps(
|
libs.extend(find_and_build_deps(
|
||||||
|
@ -85,24 +85,24 @@ def BuildProgram(env):
|
|||||||
env.Append(
|
env.Append(
|
||||||
CPPPATH=["$PROJECTSRC_DIR"],
|
CPPPATH=["$PROJECTSRC_DIR"],
|
||||||
LIBS=deplibs,
|
LIBS=deplibs,
|
||||||
LIBPATH=["$BUILD_DIR"]
|
LIBPATH=["$BUILD_DIR"],
|
||||||
)
|
PIOBUILDFILES=env.CollectBuildFiles(
|
||||||
|
"$BUILDSRC_DIR",
|
||||||
sources = env.CollectBuildFiles(
|
"$PROJECTSRC_DIR",
|
||||||
"$BUILDSRC_DIR", "$PROJECTSRC_DIR",
|
src_filter=env.get("SRC_FILTER"),
|
||||||
src_filter=env.get("SRC_FILTER"), duplicate=False)
|
duplicate=False))
|
||||||
|
|
||||||
if "test" in COMMAND_LINE_TARGETS:
|
if "test" in COMMAND_LINE_TARGETS:
|
||||||
sources.extend(env.ProcessTest())
|
env.Append(PIOBUILDFILES=env.ProcessTest())
|
||||||
|
|
||||||
if not sources and not COMMAND_LINE_TARGETS:
|
if not env['PIOBUILDFILES'] and not COMMAND_LINE_TARGETS:
|
||||||
env.Exit(
|
env.Exit(
|
||||||
"Error: Nothing to build. Please put your source code files "
|
"Error: Nothing to build. Please put your source code files "
|
||||||
"to '%s' folder" % env.subst("$PROJECTSRC_DIR"))
|
"to '%s' folder" % env.subst("$PROJECTSRC_DIR"))
|
||||||
|
|
||||||
program = env.Program(
|
program = env.Program(
|
||||||
join("$BUILD_DIR", env.subst("$PROGNAME")),
|
join("$BUILD_DIR", env.subst("$PROGNAME")),
|
||||||
sources
|
env['PIOBUILDFILES']
|
||||||
)
|
)
|
||||||
|
|
||||||
if set(["upload", "uploadlazy", "program"]) & set(COMMAND_LINE_TARGETS):
|
if set(["upload", "uploadlazy", "program"]) & set(COMMAND_LINE_TARGETS):
|
||||||
@ -262,11 +262,15 @@ def BuildFrameworks(env, frameworks):
|
|||||||
|
|
||||||
def BuildLibrary(env, variant_dir, src_dir, src_filter=None):
|
def BuildLibrary(env, variant_dir, src_dir, src_filter=None):
|
||||||
lib = env.Clone()
|
lib = env.Clone()
|
||||||
return lib.Library(
|
return lib.StaticLibrary(
|
||||||
lib.subst(variant_dir),
|
lib.subst(variant_dir),
|
||||||
lib.CollectBuildFiles(
|
lib.CollectBuildFiles(
|
||||||
variant_dir, src_dir, src_filter=src_filter)
|
variant_dir, src_dir, src_filter=src_filter))
|
||||||
)
|
|
||||||
|
|
||||||
|
def BuildSources(env, variant_dir, src_dir, src_filter=None):
|
||||||
|
DefaultEnvironment().Append(PIOBUILDFILES=env.Clone().CollectBuildFiles(
|
||||||
|
variant_dir, src_dir, src_filter=src_filter))
|
||||||
|
|
||||||
|
|
||||||
def exists(_):
|
def exists(_):
|
||||||
@ -283,4 +287,5 @@ def generate(env):
|
|||||||
env.AddMethod(CollectBuildFiles)
|
env.AddMethod(CollectBuildFiles)
|
||||||
env.AddMethod(BuildFrameworks)
|
env.AddMethod(BuildFrameworks)
|
||||||
env.AddMethod(BuildLibrary)
|
env.AddMethod(BuildLibrary)
|
||||||
|
env.AddMethod(BuildSources)
|
||||||
return env
|
return env
|
||||||
|
Reference in New Issue
Block a user