Skip to content

Commit

Permalink
changed msbuild_verbosity priority (#4327)
Browse files Browse the repository at this point in the history
  • Loading branch information
memsharded authored and lasote committed Jan 17, 2019
1 parent 6ac12b4 commit b27adca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
6 changes: 4 additions & 2 deletions conans/client/build/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def __init__(self, conanfile, generator=None, cmake_system_name=True,
self.definitions = builder.get_definitions()
self.toolset = toolset or get_toolset(self._settings)
self.build_dir = None
self.msbuild_verbosity = msbuild_verbosity or get_env("CONAN_MSBUILD_VERBOSITY", "minimal")
self.msbuild_verbosity = (os.getenv("CONAN_MSBUILD_VERBOSITY") or msbuild_verbosity or
"minimal")

@property
def build_folder(self):
Expand Down Expand Up @@ -189,7 +190,8 @@ def configure(self, args=None, defs=None, source_dir=None, build_dir=None,
pkg_env = {"PKG_CONFIG_PATH": self._conanfile.install_folder} if set_env else {}

with tools.environment_append(pkg_env):
command = "cd %s && %s %s" % (args_to_string([self.build_dir]), self._cmake_program, arg_list)
command = "cd %s && %s %s" % (args_to_string([self.build_dir]), self._cmake_program,
arg_list)
if platform.system() == "Windows" and self.generator == "MinGW Makefiles":
with tools.remove_from_path("sh"):
self._run(command)
Expand Down
14 changes: 9 additions & 5 deletions conans/client/build/msbuild.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import copy
import os
import re
import subprocess

Expand Down Expand Up @@ -79,7 +80,8 @@ def build(self, project_file, targets=None, upgrade_project=True, build_type=Non
targets=targets, upgrade_project=upgrade_project,
build_type=build_type, arch=arch, parallel=parallel,
toolset=toolset, platforms=platforms,
use_env=use_env, properties=properties, output_binary_log=output_binary_log,
use_env=use_env, properties=properties,
output_binary_log=output_binary_log,
verbosity=verbosity)
command = "%s && %s" % (vcvars, command)
return self._conanfile.run(command)
Expand All @@ -99,7 +101,7 @@ def get_command(self, project_file, props_file_path=None, targets=None, upgrade_

build_type = build_type or self._settings.get_safe("build_type")
arch = arch or self._settings.get_safe("arch")
verbosity = verbosity or get_env("CONAN_MSBUILD_VERBOSITY", "minimal")
verbosity = os.getenv("CONAN_MSBUILD_VERBOSITY") or verbosity or "minimal"
if not build_type:
raise ConanException("Cannot build_sln_command, build_type not defined")
if not arch:
Expand All @@ -125,7 +127,8 @@ def get_command(self, project_file, props_file_path=None, targets=None, upgrade_
else:
config = "%s|%s" % (build_type, msvc_arch)
if config not in "".join(lines):
self._output.warn("***** The configuration %s does not exist in this solution *****" % config)
self._output.warn("***** The configuration %s does not exist in this solution *****"
% config)
self._output.warn("Use 'platforms' argument to define your architectures")

if output_binary_log:
Expand Down Expand Up @@ -173,7 +176,8 @@ def format_macro(name, value):
runtime_library = {"MT": "MultiThreaded",
"MTd": "MultiThreadedDebug",
"MD": "MultiThreadedDLL",
"MDd": "MultiThreadedDebugDLL"}.get(self._settings.get_safe("compiler.runtime"), "")
"MDd": "MultiThreadedDebugDLL"}.get(
self._settings.get_safe("compiler.runtime"), "")

if self.build_env:
# Take the flags from the build env, the user was able to alter them if needed
Expand Down Expand Up @@ -216,7 +220,7 @@ def get_version(settings):
vcvars = vcvars_command(settings)
command = "%s && %s" % (vcvars, msbuild_cmd)
try:
out, err = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True).communicate()
out, _ = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True).communicate()
version_line = decode_text(out).split("\n")[-1]
prog = re.compile("(\d+\.){2,3}\d+")
result = prog.match(version_line).group()
Expand Down
8 changes: 3 additions & 5 deletions conans/test/unittests/client/tools/os_info/osinfo_test.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4

import unittest
import platform
import os
import unittest
from mock import mock

from conans.client.tools import OSInfo, environment_append, CYGWIN, MSYS2, MSYS, remove_from_path
from conans.errors import ConanException
from mock import mock
from nose.plugins.attrib import attr


class OSInfoTest(unittest.TestCase):
Expand Down

0 comments on commit b27adca

Please sign in to comment.