Skip to content

Commit

Permalink
Merge branch 'release/0.19.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
lasote committed Oct 15, 2018
2 parents 195c2d1 + 6e8bcf4 commit ccb2b0c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cpt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

__version__ = '0.19.4'
__version__ = '0.19.5'
46 changes: 29 additions & 17 deletions cpt/builds_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ def __init__(self, reference, os_name, gcc_versions, apple_clang_versions, clang

# If there are some GCC versions declared then we don't default the clang
# versions
if not self._clang_versions and not self._gcc_versions:
self._clang_versions = default_clang_versions
if self._clang_versions is None:
if not self._gcc_versions:
self._clang_versions = default_clang_versions
else:
self._clang_versions = []

# If there are some CLANG versions declared then we don't default the gcc
# versions
if not self._gcc_versions and self._clang_versions == default_clang_versions:
self._gcc_versions = default_gcc_versions
if self._gcc_versions is None:
if self._clang_versions == default_clang_versions:
self._gcc_versions = default_gcc_versions
else:
self._gcc_versions = []

if self._gcc_versions and not self._allow_gcc_minors:
for a_version in self._gcc_versions:
Expand All @@ -79,29 +85,35 @@ def __init__(self, reference, os_name, gcc_versions, apple_clang_versions, clang
""")

if visual_versions is not None:
self._visual_versions = visual_versions
else:
self._visual_versions = split_colon_env("CONAN_VISUAL_VERSIONS")
if not self._visual_versions and not mingw_configurations and not get_mingw_config_from_env():
self._visual_versions = visual_versions or split_colon_env("CONAN_VISUAL_VERSIONS")
if self._visual_versions is None:
if not mingw_configurations and not get_mingw_config_from_env():
self._visual_versions = default_visual_versions
elif mingw_configurations or get_mingw_config_from_env():
else:
self._visual_versions = []
elif mingw_configurations or get_mingw_config_from_env():
self._visual_versions = []

self._visual_runtimes = visual_runtimes or split_colon_env("CONAN_VISUAL_RUNTIMES")
if self._visual_runtimes is None:
self._visual_runtimes = default_visual_runtimes

self._visual_runtimes = (visual_runtimes or split_colon_env("CONAN_VISUAL_RUNTIMES") or
default_visual_runtimes)
self._apple_clang_versions = apple_clang_versions or split_colon_env("CONAN_APPLE_CLANG_VERSIONS")

self._apple_clang_versions = (apple_clang_versions or
split_colon_env("CONAN_APPLE_CLANG_VERSIONS") or
default_apple_clang_versions)
if self._apple_clang_versions is None:
self._apple_clang_versions = default_apple_clang_versions

self._mingw_configurations = mingw_configurations or get_mingw_config_from_env()

_default_archs = ["x86_64"] if self._os_name == "Darwin" else default_archs

self._archs = archs or split_colon_env("CONAN_ARCHS") or _default_archs
self._archs = archs or split_colon_env("CONAN_ARCHS")
if self._archs is None:
self._archs = _default_archs

self._build_types = build_types or split_colon_env("CONAN_BUILD_TYPES") or default_build_types
self._build_types = build_types or split_colon_env("CONAN_BUILD_TYPES")
if self._build_types is None:
self._build_types = default_build_types

def get_builds(self, pure_c, shared_option_name, dll_with_static_runtime, reference=None):

Expand Down
4 changes: 2 additions & 2 deletions cpt/test/unit/packager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@


def platform_mock_for(so):
class PlatformInfoMock(object):
class PlatformInfoMock(object):
def system(self):
return so
return PlatformInfoMock()
return PlatformInfoMock()


class AppTest(unittest.TestCase):
Expand Down
2 changes: 2 additions & 0 deletions cpt/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ def get_bool_from_env(var_name):


def split_colon_env(varname):
if os.getenv(varname) is None:
return None
return [a.strip() for a in list(filter(None, os.getenv(varname, "").split(",")))]

0 comments on commit ccb2b0c

Please sign in to comment.