forked from platformio/platformio-core
Fixed an issue when configuration file options partly ignored when `--project-conf` // Resolve #3034 (#3055)
* Fixed an issue when configuration file options partly ignored when using custom ``--project-conf`` // Resolve #3034 * Py2 compatible makedirs * Fix circle dependency * Fix broken import in test examples * Fix history * Remove YAPF markers * PyLint fix * Fix invalid project conf path * Move PIO Core to the root on Windows, issue with long CPPPATHs * Respect global PLATFORMIO_BUILD_CACHE_DIR env var * Fix Appveyor paths * Minor changes
This commit is contained in:
1 parent
94f8afec38
commit
d2abac9b18
40 files changed
+411
-378
No files matched your search
@@ -54,7 +54,7 @@ def _dump_includes(env, projenv):
|
||||
if unity_dir:
|
||||
includes.append(unity_dir)
|
||||
|
||||
includes.extend([env.subst("$PROJECTINCLUDE_DIR"), env.subst("$PROJECTSRC_DIR")])
|
||||
includes.extend([env.subst("$PROJECT_INCLUDE_DIR"), env.subst("$PROJECT_SRC_DIR")])
|
||||
|
||||
# remove duplicates
|
||||
result = []
|
||||
|
||||
@@ -601,8 +601,7 @@ class MbedLibBuilder(LibBuilderBase):
|
||||
mbed_config_path = join(self.env.subst(p), "mbed_config.h")
|
||||
if isfile(mbed_config_path):
|
||||
break
|
||||
else:
|
||||
mbed_config_path = None
|
||||
mbed_config_path = None
|
||||
if not mbed_config_path:
|
||||
return None
|
||||
|
||||
@@ -821,16 +820,16 @@ class ProjectAsLibBuilder(LibBuilderBase):
|
||||
|
||||
@property
|
||||
def include_dir(self):
|
||||
include_dir = self.env.subst("$PROJECTINCLUDE_DIR")
|
||||
include_dir = self.env.subst("$PROJECT_INCLUDE_DIR")
|
||||
return include_dir if isdir(include_dir) else None
|
||||
|
||||
@property
|
||||
def src_dir(self):
|
||||
return self.env.subst("$PROJECTSRC_DIR")
|
||||
return self.env.subst("$PROJECT_SRC_DIR")
|
||||
|
||||
def get_include_dirs(self):
|
||||
include_dirs = []
|
||||
project_include_dir = self.env.subst("$PROJECTINCLUDE_DIR")
|
||||
project_include_dir = self.env.subst("$PROJECT_INCLUDE_DIR")
|
||||
if isdir(project_include_dir):
|
||||
include_dirs.append(project_include_dir)
|
||||
for include_dir in LibBuilderBase.get_include_dirs(self):
|
||||
@@ -845,9 +844,9 @@ class ProjectAsLibBuilder(LibBuilderBase):
|
||||
if "__test" in COMMAND_LINE_TARGETS:
|
||||
items.extend(
|
||||
[
|
||||
join("$PROJECTTEST_DIR", item)
|
||||
join("$PROJECT_TEST_DIR", item)
|
||||
for item in self.env.MatchSourceFiles(
|
||||
"$PROJECTTEST_DIR", "$PIOTEST_SRC_FILTER"
|
||||
"$PROJECT_TEST_DIR", "$PIOTEST_SRC_FILTER"
|
||||
)
|
||||
]
|
||||
)
|
||||
@@ -896,7 +895,7 @@ class ProjectAsLibBuilder(LibBuilderBase):
|
||||
not_found_uri.append(uri)
|
||||
|
||||
did_install = False
|
||||
lm = LibraryManager(self.env.subst(join("$PROJECTLIBDEPS_DIR", "$PIOENV")))
|
||||
lm = LibraryManager(self.env.subst(join("$PROJECT_LIBDEPS_DIR", "$PIOENV")))
|
||||
for uri in not_found_uri:
|
||||
try:
|
||||
lm.install(uri)
|
||||
|
||||
@@ -117,7 +117,7 @@ class InoToCPPConverter(object):
|
||||
stropen = True
|
||||
newlines.append(line[:-1])
|
||||
continue
|
||||
elif stropen:
|
||||
if stropen:
|
||||
newlines[len(newlines) - 1] += line[:-1]
|
||||
continue
|
||||
elif stropen and line.endswith(('",', '";')):
|
||||
@@ -199,7 +199,7 @@ class InoToCPPConverter(object):
|
||||
|
||||
|
||||
def ConvertInoToCpp(env):
|
||||
src_dir = glob_escape(env.subst("$PROJECTSRC_DIR"))
|
||||
src_dir = glob_escape(env.subst("$PROJECT_SRC_DIR"))
|
||||
ino_nodes = env.Glob(join(src_dir, "*.ino")) + env.Glob(join(src_dir, "*.pde"))
|
||||
if not ino_nodes:
|
||||
return
|
||||
@@ -256,7 +256,7 @@ def GetActualLDScript(env):
|
||||
if f == "-T":
|
||||
script_in_next = True
|
||||
continue
|
||||
elif script_in_next:
|
||||
if script_in_next:
|
||||
script_in_next = False
|
||||
raw_script = f
|
||||
elif f.startswith("-Wl,-T"):
|
||||
@@ -309,7 +309,7 @@ def PioClean(env, clean_dir):
|
||||
env.Exit(0)
|
||||
|
||||
|
||||
def ProcessDebug(env):
|
||||
def ConfigureDebugTarget(env):
|
||||
if not env.subst("$PIODEBUGFLAGS"):
|
||||
env.Replace(PIODEBUGFLAGS=["-Og", "-g3", "-ggdb3"])
|
||||
env.Append(
|
||||
@@ -322,7 +322,7 @@ def ProcessDebug(env):
|
||||
env.Append(BUILD_UNFLAGS=unflags)
|
||||
|
||||
|
||||
def ProcessTest(env):
|
||||
def ConfigureTestTarget(env):
|
||||
env.Append(
|
||||
CPPDEFINES=["UNIT_TEST", "UNITY_INCLUDE_CONFIG_H"],
|
||||
CPPPATH=[join("$BUILD_DIR", "UnityTestLib")],
|
||||
@@ -361,7 +361,7 @@ def generate(env):
|
||||
env.AddMethod(GetActualLDScript)
|
||||
env.AddMethod(VerboseAction)
|
||||
env.AddMethod(PioClean)
|
||||
env.AddMethod(ProcessDebug)
|
||||
env.AddMethod(ProcessTest)
|
||||
env.AddMethod(ConfigureDebugTarget)
|
||||
env.AddMethod(ConfigureTestTarget)
|
||||
env.AddMethod(GetExtraScripts)
|
||||
return env
|
||||
@@ -67,15 +67,17 @@ def _build_project_deps(env):
|
||||
is_test = "__test" in COMMAND_LINE_TARGETS
|
||||
if is_test:
|
||||
projenv.BuildSources(
|
||||
"$BUILDTEST_DIR", "$PROJECTTEST_DIR", "$PIOTEST_SRC_FILTER"
|
||||
"$BUILD_TEST_DIR", "$PROJECT_TEST_DIR", "$PIOTEST_SRC_FILTER"
|
||||
)
|
||||
if not is_test or env.GetProjectOption("test_build_project_src", False):
|
||||
projenv.BuildSources("$BUILDSRC_DIR", "$PROJECTSRC_DIR", env.get("SRC_FILTER"))
|
||||
projenv.BuildSources(
|
||||
"$BUILD_SRC_DIR", "$PROJECT_SRC_DIR", env.get("SRC_FILTER")
|
||||
)
|
||||
|
||||
if not env.get("PIOBUILDFILES") and not COMMAND_LINE_TARGETS:
|
||||
sys.stderr.write(
|
||||
"Error: Nothing to build. Please put your source code files "
|
||||
"to '%s' folder\n" % env.subst("$PROJECTSRC_DIR")
|
||||
"to '%s' folder\n" % env.subst("$PROJECT_SRC_DIR")
|
||||
)
|
||||
env.Exit(1)
|
||||
|
||||
@@ -102,7 +104,7 @@ def BuildProgram(env):
|
||||
env.Replace(AS="$CC", ASCOM="$ASPPCOM")
|
||||
|
||||
if "debug" in COMMAND_LINE_TARGETS or env.GetProjectOption("build_type") == "debug":
|
||||
env.ProcessDebug()
|
||||
env.ConfigureDebugTarget()
|
||||
|
||||
# process extra flags from board
|
||||
if "BOARD" in env and "build.extra_flags" in env.BoardConfig():
|
||||
@@ -121,7 +123,7 @@ def BuildProgram(env):
|
||||
env.ProcessUnFlags(env.get("BUILD_UNFLAGS"))
|
||||
|
||||
if "__test" in COMMAND_LINE_TARGETS:
|
||||
env.ProcessTest()
|
||||
env.ConfigureTestTarget()
|
||||
|
||||
# build project with dependencies
|
||||
_build_project_deps(env)
|
||||
|
||||
Reference in new issue
Block a user