Use dynamic "build_dir" when checking project for structure chnages

This commit is contained in:
Ivan Kravets
2018-01-18 22:12:32 +02:00
parent 2b4b2eb571
commit dcb299e9b9

View File

@ -15,7 +15,7 @@
from datetime import datetime from datetime import datetime
from hashlib import sha1 from hashlib import sha1
from os import getcwd, makedirs, walk from os import getcwd, makedirs, walk
from os.path import getmtime, isdir, isfile, join from os.path import basename, getmtime, isdir, isfile, join
from time import time from time import time
import click import click
@ -405,12 +405,14 @@ def check_project_envs(config, environments):
def calculate_project_hash(): def calculate_project_hash():
structure = [__version__] structure = [__version__]
build_dir_name = basename(util.get_projectbuild_dir())
for d in (util.get_projectsrc_dir(), util.get_projectlib_dir()): for d in (util.get_projectsrc_dir(), util.get_projectlib_dir()):
if not isdir(d): if not isdir(d):
continue continue
for root, _, files in walk(d): for root, _, files in walk(d):
for f in files: for f in files:
path = join(root, f) path = join(root, f)
if not any(s in path for s in (".git", ".svn", ".pioenvs")): if not any(
s in path for s in (".git", ".svn", build_dir_name)):
structure.append(path) structure.append(path)
return sha1(",".join(sorted(structure))).hexdigest() if structure else "" return sha1(",".join(sorted(structure))).hexdigest() if structure else ""