Repository: conan-io/conan

Issue:
Broken tests in Mac with apple-clang 10.0 as default [PR 4332] [BROKEN DEVELOP]
⚠️ ⚠️  PR #4332 breaks in my Mac, there is a test that fails (commit hash e2246c90):

> CMakeGeneratorTest::test_cmake_default_generator_osx

The error is the automatic detection of the clang version by CMake:

```bash
CMake Error at conanbuildinfo.cmake:300 (message):
  Incorrect 'apple-clang' version 'compiler.version=9.0' is not the one
  detected by CMake: 'Clang=10.0'
```

and the full log:

```bash

Error
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/case.py", line 615, in run
    testMethod()
  File "/Users/jgsogo/dev/conan/conan/conans/test/functional/generators/cmake_generator_test.py", line 72, in test_cmake_default_generator_osx
    self._check_build_generator("Macos", "apple-clang", "9.0", "Unix Makefiles")
  File "/Users/jgsogo/dev/conan/conan/conans/test/functional/generators/cmake_generator_test.py", line 58, in _check_build_generator
    client.run("build .")
  File "/Users/jgsogo/dev/conan/conan/conans/test/utils/tools.py", line 615, in run
    raise Exception(exc_message)
Exception: 
------------------------ Command failed (unexpectedly): ------------------------
build .
----------------------------------- Output: ------------------------------------
conanfile.py (foo/0.1@None/None): Running build()

----Running------
> cd '/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces' && cmake -G "Unix Makefiles" -DCONAN_EXPORTED="1" -DCONAN_IN_LOCAL_CACHE="OFF" -DCONAN_COMPILER="apple-clang" -DCONAN_COMPILER_VERSION="9.0" -DCONAN_LIBCXX="libstdc++" -DCMAKE_INSTALL_PREFIX="/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces/package" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -Wno-dev '/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces'
-----------------
Logging command output to file '/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces/conan_run.log'
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
CMake Error at conanbuildinfo.cmake:300 (message):
  Incorrect 'apple-clang' version 'compiler.version=9.0' is not the one
  detected by CMake: 'Clang=10.0'
Call Stack (most recent call first):
  conanbuildinfo.cmake:370 (conan_error_compiler_version)
  conanbuildinfo.cmake:441 (check_compiler_version)
  conanbuildinfo.cmake:59 (conan_check_compiler)
  CMakeLists.txt:6 (conan_basic_setup)


-- Configuring incomplete, errors occurred!
See also "/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces/CMakeFiles/CMakeOutput.log".
ERROR: conanfile.py (foo/0.1@None/None): Error in build() method, line 12
	cmake.configure()
	ConanException: Error 1 while executing cd '/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces' && cmake -G "Unix Makefiles" -DCONAN_EXPORTED="1" -DCONAN_IN_LOCAL_CACHE="OFF" -DCONAN_COMPILER="apple-clang" -DCONAN_COMPILER_VERSION="9.0" -DCONAN_LIBCXX="libstdc++" -DCMAKE_INSTALL_PREFIX="/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces/package" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -Wno-dev '/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces'

--------------------------------------------------------------------------------


E
======================================================================
ERROR: test_cmake_default_generator_osx (conan.conans.test.functional.generators.cmake_generator_test.CMakeGeneratorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jgsogo/dev/conan/conan/conans/test/functional/generators/cmake_generator_test.py", line 72, in test_cmake_default_generator_osx
    self._check_build_generator("Macos", "apple-clang", "9.0", "Unix Makefiles")
  File "/Users/jgsogo/dev/conan/conan/conans/test/functional/generators/cmake_generator_test.py", line 58, in _check_build_generator
    client.run("build .")
  File "/Users/jgsogo/dev/conan/conan/conans/test/utils/tools.py", line 615, in run
    raise Exception(exc_message)
Exception: 
------------------------ Command failed (unexpectedly): ------------------------
build .
----------------------------------- Output: ------------------------------------
conanfile.py (foo/0.1@None/None): Running build()

----Running------
> cd '/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces' && cmake -G "Unix Makefiles" -DCONAN_EXPORTED="1" -DCONAN_IN_LOCAL_CACHE="OFF" -DCONAN_COMPILER="apple-clang" -DCONAN_COMPILER_VERSION="9.0" -DCONAN_LIBCXX="libstdc++" -DCMAKE_INSTALL_PREFIX="/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces/package" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -Wno-dev '/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces'
-----------------
Logging command output to file '/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces/conan_run.log'
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
CMake Error at conanbuildinfo.cmake:300 (message):
  Incorrect 'apple-clang' version 'compiler.version=9.0' is not the one
  detected by CMake: 'Clang=10.0'
Call Stack (most recent call first):
  conanbuildinfo.cmake:370 (conan_error_compiler_version)
  conanbuildinfo.cmake:441 (check_compiler_version)
  conanbuildinfo.cmake:59 (conan_check_compiler)
  CMakeLists.txt:6 (conan_basic_setup)


-- Configuring incomplete, errors occurred!
See also "/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces/CMakeFiles/CMakeOutput.log".
ERROR: conanfile.py (foo/0.1@None/None): Error in build() method, line 12
	cmake.configure()
	ConanException: Error 1 while executing cd '/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces' && cmake -G "Unix Makefiles" -DCONAN_EXPORTED="1" -DCONAN_IN_LOCAL_CACHE="OFF" -DCONAN_COMPILER="apple-clang" -DCONAN_COMPILER_VERSION="9.0" -DCONAN_LIBCXX="libstdc++" -DCMAKE_INSTALL_PREFIX="/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces/package" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -Wno-dev '/private/var/folders/yq/14hmvxm96xd7gfgl37_tnrbh0000gn/T/tmpsmfbdzzoconans/path with spaces'

--------------------------------------------------------------------------------


----------------------------------------------------------------------
Ran 1 test in 1.141s

FAILED (errors=1)

Process finished with exit code 1

```



Discussion:
memsharded: Looks good, but in Windows the default is already VS, so that might need to be passed in command line or something,.
jgsogo: This is more or less reverting #4332, so I think that issue #4265 is not fixed yet. Or maybe I'm wrong, I haven't read it all and I'm not sure what the problem was. 

Patch:
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 3f00bc051..4a9bf5fbf 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -81,3 +81,27 @@ Please keep in mind these points:
   - Backwards compatibility and not breaking users' packages is very important and it won't be done unless there are very good reasons.
 - You should not get bothered if you feel unattended, Conan is an Open Source project, not a commercial product. Try to explain what you
   really need and we will try to help you.
+
+Code style
+----------
+
+- In general, follow [pep8](https://www.python.org/dev/peps/pep-0008/)
+- Limit all lines to a maximum of 101 characters (`Right margin` setting in PyCharm)
+- Start new files with [encoding declaration](https://www.python.org/dev/peps/pep-0263/):
+```
+# -*- coding: utf-8 -*-
+```
+- Specify imports in the following order: system, `blank line`, 3rd-party, `blank line`, own; all sorted alphabetically:
+```
+import os
+import platform
+import shutil
+
+from nose.plugins.attrib import attr
+from tqdm import tqdm
+
+from conans.client.tools import which
+from conans.errors import ConanException
+from conans.model.version import Version
+```
+- Write unit tests, if possible
diff --git a/conans/client/build/msbuild.py b/conans/client/build/msbuild.py
index fee14a3e0..980f65171 100644
--- a/conans/client/build/msbuild.py
+++ b/conans/client/build/msbuild.py
@@ -101,6 +101,7 @@ class MSBuild(object):
 
         build_type = build_type or self._settings.get_safe("build_type")
         arch = arch or self._settings.get_safe("arch")
+        toolset = toolset or tools.msvs_toolset(self._settings)
         verbosity = os.getenv("CONAN_MSBUILD_VERBOSITY") or verbosity or "minimal"
         if not build_type:
             raise ConanException("Cannot build_sln_command, build_type not defined")
diff --git a/conans/client/cmd/export.py b/conans/client/cmd/export.py
index 53ab09db3..2c68b22b3 100644
--- a/conans/client/cmd/export.py
+++ b/conans/client/cmd/export.py
@@ -12,7 +12,7 @@ from conans.model.manifest import FileTreeManifest
 from conans.model.scm import SCM, get_scm_data
 from conans.paths import CONANFILE, CONAN_MANIFEST
 from conans.search.search import search_recipes
-from conans.util.files import is_dirty, load, mkdir, rmdir, save, set_dirty
+from conans.util.files import is_dirty, load, mkdir, rmdir, save, set_dirty, remove
 from conans.util.log import logger
 
 
@@ -144,6 +144,8 @@ def _replace_scm_data_in_conanfile(conanfile_path, scm_data):
     new_text = "scm = " + ",\n          ".join(str(scm_data).split(",")) + "\n"
     content = content.replace(to_replace[0], new_text)
     content = content if not headers else ''.join(headers) + content
+
+    remove(conanfile_path)
     save(conanfile_path, content)
 
 
diff --git a/conans/client/command.py b/conans/client/command.py
index d7cf2b533..0f6f05184 100644
--- a/conans/client/command.py
+++ b/conans/client/command.py
@@ -377,7 +377,7 @@ class Command(object):
                                            remote_name=args.remote,
                                            verify=args.verify, manifests=args.manifests,
                                            manifests_interactive=args.manifests_interactive,
-                                           build=args.build, profile_name=args.profile,
+                                           build=args.build, profile_names=args.profile,
                                            update=args.update, generators=args.generator,
                                            no_imports=args.no_imports,
                                            install_folder=args.install_folder)
@@ -388,7 +388,7 @@ class Command(object):
                                                      remote_name=args.remote,
                                                      verify=args.verify, manifests=args.manifests,
                                                      manifests_interactive=args.manifests_interactive,
-                                                     build=args.build, profile_name=args.profile,
+                                                     build=args.build, profile_names=args.profile,
                                                      update=args.update,
                                                      generators=args.generator,
                                                      install_folder=args.install_folder)
@@ -504,7 +504,7 @@ class Command(object):
                                                settings=args.settings,
                                                options=args.options,
                                                env=args.env,
-                                               profile_name=args.profile,
+                                               profile_names=args.profile,
                                                remote_name=args.remote,
                                                build_order=args.build_order,
                                                check_updates=args.update,
@@ -522,7 +522,7 @@ class Command(object):
                                                        settings=args.settings,
                                                        options=args.options,
                                                        env=args.env,
-                                                       profile_name=args.profile,
+                                                       profile_names=args.profile,
                                                        remote_name=args.remote,
                                                        check_updates=args.update,
                                                        install_folder=args.install_folder)
@@ -535,7 +535,7 @@ class Command(object):
                                     settings=args.settings,
                                     options=args.options,
                                     env=args.env,
-                                    profile_name=args.profile,
+                                    profile_names=args.profile,
                                     update=args.update,
                                     install_folder=args.install_folder,
                                     build=args.dry_build)
@@ -743,7 +743,7 @@ class Command(object):
                             "will raise an error.")
         parser.add_argument("-o", "--options", nargs=1, action=Extender,
                             help='Define options values, e.g., -o pkg:with_qt=true')
-        parser.add_argument("-pr", "--profile", action=OnceArgument,
+        parser.add_argument("-pr", "--profile", action=Extender,
                             help='Profile for this package')
         parser.add_argument("-pf", "--package-folder", action=OnceArgument,
                             help="folder containing a locally created package. If a value is given,"
@@ -770,7 +770,7 @@ class Command(object):
                                           build_folder=args.build_folder,
                                           package_folder=args.package_folder,
                                           install_folder=args.install_folder,
-                                          profile_name=args.profile,
+                                          profile_names=args.profile,
                                           env=args.env,
                                           settings=args.settings,
                                           options=args.options,
@@ -1537,7 +1537,7 @@ def _add_common_install_arguments(parser, build_help):
                              '-e CXX=/usr/bin/clang++')
     parser.add_argument("-o", "--options", nargs=1, action=Extender,
                         help='Define options values, e.g., -o Pkg:with_qt=true')
-    parser.add_argument("-pr", "--profile", default=None, action=OnceArgument,
+    parser.add_argument("-pr", "--profile", default=None, action=Extender,
                         help='Apply the specified profile to the install command')
     parser.add_argument("-r", "--remote", action=OnceArgument,
                         help='Look in the specified remote server')
diff --git a/conans/client/conan_api.py b/conans/client/conan_api.py
index 85b27c290..d8b08bdb6 100644
--- a/conans/client/conan_api.py
+++ b/conans/client/conan_api.py
@@ -299,7 +299,7 @@ class ConanAPIV1(object):
         return result
 
     @api_method
-    def test(self, path, reference, profile_name=None, settings=None, options=None, env=None,
+    def test(self, path, reference, profile_names=None, settings=None, options=None, env=None,
              remote_name=None, update=False, build_modes=None, cwd=None, test_build_folder=None):
 
         settings = settings or []
@@ -308,7 +308,7 @@ class ConanAPIV1(object):
 
         conanfile_path = _get_conanfile_path(path, cwd, py=True)
         cwd = cwd or get_cwd()
-        graph_info = get_graph_info(profile_name, settings, options, env, cwd, None,
+        graph_info = get_graph_info(profile_names, settings, options, env, cwd, None,
                                     self._cache, self._user_io.out)
         ref = ConanFileReference.loads(reference)
         recorder = ActionRecorder()
@@ -320,7 +320,7 @@ class ConanAPIV1(object):
 
     @api_method
     def create(self, conanfile_path, name=None, version=None, user=None, channel=None,
-               profile_name=None, settings=None,
+               profile_names=None, settings=None,
                options=None, env=None, test_folder=None, not_export=False,
                build_modes=None,
                keep_source=False, keep_build=False, verify=None,
@@ -359,7 +359,7 @@ class ConanAPIV1(object):
 
             manifests = _parse_manifests_arguments(verify, manifests, manifests_interactive, cwd)
             manifest_folder, manifest_interactive, manifest_verify = manifests
-            graph_info = get_graph_info(profile_name, settings, options, env, cwd, None,
+            graph_info = get_graph_info(profile_names, settings, options, env, cwd, None,
                                         self._cache, self._user_io.out)
 
             manager = self._init_manager(recorder)
@@ -378,7 +378,7 @@ class ConanAPIV1(object):
 
     @api_method
     def export_pkg(self, conanfile_path, name, channel, source_folder=None, build_folder=None,
-                   package_folder=None, install_folder=None, profile_name=None, settings=None,
+                   package_folder=None, install_folder=None, profile_names=None, settings=None,
                    options=None, env=None, force=False, user=None, version=None, cwd=None):
 
         settings = settings or []
@@ -407,7 +407,7 @@ class ConanAPIV1(object):
                                            default=os.path.dirname(conanfile_path))
 
             # Checks that no both settings and info files are specified
-            graph_info = get_graph_info(profile_name, settings, options, env, cwd, install_folder,
+            graph_info = get_graph_info(profile_names, settings, options, env, cwd, install_folder,
                                         self._cache, self._user_io.out)
 
             conanfile = self._loader.load_export(conanfile_path, name, version, user, channel)
@@ -446,7 +446,7 @@ class ConanAPIV1(object):
     @api_method
     def install_reference(self, reference, settings=None, options=None, env=None,
                           remote_name=None, verify=None, manifests=None,
-                          manifests_interactive=None, build=None, profile_name=None,
+                          manifests_interactive=None, build=None, profile_names=None,
                           update=False, generators=None, install_folder=None, cwd=None):
 
         try:
@@ -457,7 +457,7 @@ class ConanAPIV1(object):
             manifests = _parse_manifests_arguments(verify, manifests, manifests_interactive, cwd)
             manifest_folder, manifest_interactive, manifest_verify = manifests
 
-            graph_info = get_graph_info(profile_name, settings, options, env, cwd, None,
+            graph_info = get_graph_info(profile_names, settings, options, env, cwd, None,
                                         self._cache, self._user_io.out)
 
             if not generators:  # We don't want the default txt
@@ -480,7 +480,7 @@ class ConanAPIV1(object):
     @api_method
     def install(self, path="", settings=None, options=None, env=None,
                 remote_name=None, verify=None, manifests=None,
-                manifests_interactive=None, build=None, profile_name=None,
+                manifests_interactive=None, build=None, profile_names=None,
                 update=False, generators=None, no_imports=False, install_folder=None, cwd=None):
 
         try:
@@ -489,7 +489,7 @@ class ConanAPIV1(object):
             manifests = _parse_manifests_arguments(verify, manifests, manifests_interactive, cwd)
             manifest_folder, manifest_interactive, manifest_verify = manifests
 
-            graph_info = get_graph_info(profile_name, settings, options, env, cwd, None,
+            graph_info = get_graph_info(profile_names, settings, options, env, cwd, None,
                                         self._cache, self._user_io.out)
 
             wspath = _make_abs_path(path, cwd)
@@ -552,7 +552,7 @@ class ConanAPIV1(object):
         return configuration_install(path_or_url, self._cache, self._user_io.out, verify_ssl,
                                      requester=self._requester, config_type=config_type, args=args)
 
-    def _info_args(self, reference_or_path, install_folder, profile_name, settings, options, env):
+    def _info_args(self, reference_or_path, install_folder, profile_names, settings, options, env):
         cwd = get_cwd()
         try:
             ref = ConanFileReference.loads(reference_or_path)
@@ -567,16 +567,16 @@ class ConanAPIV1(object):
                 if os.path.exists(os.path.join(cwd, GRAPH_INFO_FILE)):
                     install_folder = cwd
 
-        graph_info = get_graph_info(profile_name, settings, options, env, cwd, install_folder,
+        graph_info = get_graph_info(profile_names, settings, options, env, cwd, install_folder,
                                     self._cache, self._user_io.out)
 
         return ref, graph_info
 
     @api_method
     def info_build_order(self, reference, settings=None, options=None, env=None,
-                         profile_name=None, remote_name=None, build_order=None, check_updates=None,
+                         profile_names=None, remote_name=None, build_order=None, check_updates=None,
                          install_folder=None):
-        reference, graph_info = self._info_args(reference, install_folder, profile_name,
+        reference, graph_info = self._info_args(reference, install_folder, profile_names,
                                                 settings, options, env)
         recorder = ActionRecorder()
         deps_graph, _ = self._graph_manager.load_graph(reference, None, graph_info, ["missing"],
@@ -586,9 +586,9 @@ class ConanAPIV1(object):
 
     @api_method
     def info_nodes_to_build(self, reference, build_modes, settings=None, options=None, env=None,
-                            profile_name=None, remote_name=None, check_updates=None,
+                            profile_names=None, remote_name=None, check_updates=None,
                             install_folder=None):
-        reference, graph_info = self._info_args(reference, install_folder, profile_name,
+        reference, graph_info = self._info_args(reference, install_folder, profile_names,
                                                 settings, options, env)
         recorder = ActionRecorder()
         deps_graph, conanfile = self._graph_manager.load_graph(reference, None, graph_info,
@@ -600,8 +600,8 @@ class ConanAPIV1(object):
 
     @api_method
     def info(self, reference, remote_name=None, settings=None, options=None, env=None,
-             profile_name=None, update=False, install_folder=None, build=None):
-        reference, graph_info = self._info_args(reference, install_folder, profile_name,
+             profile_names=None, update=False, install_folder=None, build=None):
+        reference, graph_info = self._info_args(reference, install_folder, profile_names,
                                                 settings, options, env)
         recorder = ActionRecorder()
         deps_graph, conanfile = self._graph_manager.load_graph(reference, None, graph_info, build,
@@ -953,7 +953,7 @@ class ConanAPIV1(object):
 Conan = ConanAPIV1
 
 
-def get_graph_info(profile_name, settings, options, env, cwd, install_folder, cache, output):
+def get_graph_info(profile_names, settings, options, env, cwd, install_folder, cache, output):
     try:
         graph_info = GraphInfo.load(install_folder)
         graph_info.profile.process_settings(cache, preprocess=False)
@@ -963,7 +963,7 @@ def get_graph_info(profile_name, settings, options, env, cwd, install_folder, ca
                                  % install_folder)
         graph_info = None
 
-    if profile_name or settings or options or profile_name or env or not graph_info:
+    if profile_names or settings or options or profile_names or env or not graph_info:
         if graph_info:
             # FIXME: Convert to Exception in Conan 2.0
             output.warn("Settings, options, env or profile specified. "
@@ -971,7 +971,7 @@ def get_graph_info(profile_name, settings, options, env, cwd, install_folder, ca
                         "Don't pass settings, options or profile arguments if you want to reuse "
                         "the installed graph-info file."
                         % install_folder)
-        profile = profile_from_args(profile_name, settings, options, env, cwd, cache)
+        profile = profile_from_args(profile_names, settings, options, env, cwd, cache)
         profile.process_settings(cache)
         graph_info = GraphInfo(profile=profile)
         # Preprocess settings and convert to real settings
diff --git a/conans/client/generators/make.py b/conans/client/generators/make.py
index cad737431..c4b6713f6 100644
--- a/conans/client/generators/make.py
+++ b/conans/client/generators/make.py
@@ -47,15 +47,15 @@ class MakeGenerator(Generator):
 
         vars_info = [("ROOT", self.assignment_if_absent, [cpp_info.rootpath]),
                      ("SYSROOT", self.assignment_if_absent, [cpp_info.sysroot]),
-                     ("INCLUDE_PATHS", self.assignment_append, cpp_info.include_paths),
-                     ("LIB_PATHS", self.assignment_append, cpp_info.lib_paths),
-                     ("BIN_PATHS", self.assignment_append, cpp_info.bin_paths),
-                     ("BUILD_PATHS", self.assignment_append, cpp_info.build_paths),
-                     ("RES_PATHS", self.assignment_append, cpp_info.res_paths),
+                     ("INCLUDE_DIRS", self.assignment_append, cpp_info.include_paths),
+                     ("LIB_DIRS", self.assignment_append, cpp_info.lib_paths),
+                     ("BIN_DIRS", self.assignment_append, cpp_info.bin_paths),
+                     ("BUILD_DIRS", self.assignment_append, cpp_info.build_paths),
+                     ("RES_DIRS", self.assignment_append, cpp_info.res_paths),
                      ("LIBS", self.assignment_append, cpp_info.libs),
                      ("DEFINES", self.assignment_append, cpp_info.defines),
                      ("CFLAGS", self.assignment_append, cpp_info.cflags),
-                     ("CPPFLAGS", self.assignment_append, cpp_info.cppflags),
+                     ("CXXFLAGS", self.assignment_append, cpp_info.cppflags),
                      ("SHAREDLINKFLAGS", self.assignment_append, cpp_info.sharedlinkflags),
                      ("EXELINKFLAGS", self.assignment_append, cpp_info.exelinkflags)]
 
@@ -104,6 +104,6 @@ class MakeGenerator(Generator):
 
     @staticmethod
     def all_dep_vars():
-        return ["rootpath", "sysroot", "include_paths", "lib_paths", "bin_paths", "build_paths",
-                "res_paths", "libs", "defines", "cflags", "cppflags", "sharedlinkflags",
+        return ["rootpath", "sysroot", "include_dirs", "lib_dirs", "bin_dirs", "build_dirs",
+                "res_dirs", "libs", "defines", "cflags", "cxxflags", "sharedlinkflags",
                 "exelinkflags"]
diff --git a/conans/client/generators/premake.py b/conans/client/generators/premake.py
index d6fe018b8..c51de3d20 100644
--- a/conans/client/generators/premake.py
+++ b/conans/client/generators/premake.py
@@ -34,8 +34,8 @@ class PremakeGenerator(Generator):
                     'conan_libdirs{dep} = {{{deps.lib_paths}}}\n'
                     'conan_bindirs{dep} = {{{deps.bin_paths}}}\n'
                     'conan_libs{dep} = {{{deps.libs}}}\n'
-                    'conan_cppdefines{dep} = {{{deps.defines}}}\n'
-                    'conan_cppflags{dep} = {{{deps.cppflags}}}\n'
+                    'conan_defines{dep} = {{{deps.defines}}}\n'
+                    'conan_cxxflags{dep} = {{{deps.cppflags}}}\n'
                     'conan_cflags{dep} = {{{deps.cflags}}}\n'
                     'conan_sharedlinkflags{dep} = {{{deps.sharedlinkflags}}}\n'
                     'conan_exelinkflags{dep} = {{{deps.exelinkflags}}}\n')
@@ -65,7 +65,7 @@ class PremakeGenerator(Generator):
             "    includedirs{conan_includedirs}\n"
             "    libdirs{conan_libdirs}\n"
             "    links{conan_libs}\n"
-            "    defines{conan_cppdefines}\n"
+            "    defines{conan_defines}\n"
             "    bindirs{conan_bindirs}\n"
             "end\n")
 
diff --git a/conans/client/generators/visualstudio_multi.py b/conans/client/generators/visualstudio_multi.py
index 9d6894132..98bbfbd24 100644
--- a/conans/client/generators/visualstudio_multi.py
+++ b/conans/client/generators/visualstudio_multi.py
@@ -5,28 +5,20 @@ from conans.client.generators import VisualStudioGenerator
 from conans.errors import ConanException
 from conans.model import Generator
 from conans.util.files import load
+from conans.client.tools import msvs_toolset
 
 
 class _VSSettings(object):
     def __init__(self, settings):
-        self._props = [("Configuration", settings.get_safe("build_type")),
-                       ("Platform", {'x86': 'Win32', 'x86_64': 'x64'}.get(settings.get_safe("arch")))]
+        toolset = msvs_toolset(settings)
+        if toolset is None:
+            raise ConanException("Undefined Visual Studio version %s" %
+                                 settings.get_safe("compiler.version"))
 
-        toolset = settings.get_safe("compiler.toolset")
-        if not toolset:
-            default_toolset = {"15": "v141",
-                               "14": "v140",
-                               "12": "v120",
-                               "11": "v110",
-                               "10": "v100",
-                               "9": "v90",
-                               "8": "v80"}
-            try:
-                vs_version = settings.get_safe("compiler.version")
-                toolset = default_toolset[vs_version]
-            except KeyError:
-                raise ConanException("Undefined Visual Studio version %s" % vs_version)
-        self._props.append(("PlatformToolset", toolset))
+        self._props = [("Configuration", settings.get_safe("build_type")),
+                       ("Platform", {'x86': 'Win32',
+                                     'x86_64': 'x64'}.get(settings.get_safe("arch"))),
+                       ("PlatformToolset", toolset)]
 
     @property
     def filename(self):
diff --git a/conans/client/profile_loader.py b/conans/client/profile_loader.py
index 0f8b45afa..a2edc2e1b 100644
--- a/conans/client/profile_loader.py
+++ b/conans/client/profile_loader.py
@@ -213,16 +213,20 @@ def _apply_inner_profile(doc, base_profile):
     base_profile.env_values = current_env_values
 
 
-def profile_from_args(profile, settings, options, env, cwd, cache):
+def profile_from_args(profiles, settings, options, env, cwd, cache):
     """ Return a Profile object, as the result of merging a potentially existing Profile
     file and the args command-line arguments
     """
     default_profile = cache.default_profile  # Ensures a default profile creating
 
-    if profile is None:
+    if profiles is None:
         result = default_profile
     else:
-        result, _ = read_profile(profile, cwd, cache.profiles_path)
+        result = Profile()
+        for p in profiles:
+            tmp, _ = read_profile(p, cwd, cache.profiles_path)
+            result.update(tmp)
+
     args_profile = _profile_parse_args(settings, options, env)
 
     if result:
diff --git a/conans/client/tools/win.py b/conans/client/tools/win.py
index 7ecb7a7b1..82869bd99 100644
--- a/conans/client/tools/win.py
+++ b/conans/client/tools/win.py
@@ -93,8 +93,35 @@ def latest_vs_version_installed(output):
     return latest_visual_studio_version_installed(output=output)
 
 
+MSVS_DEFAULT_TOOLSETS = {"15": "v141",
+                         "14": "v140",
+                         "12": "v120",
+                         "11": "v110",
+                         "10": "v100",
+                         "9": "v90",
+                         "8": "v80"}
+
+# inverse version of the above MSVS_DEFAULT_TOOLSETS (keys and values are swapped)
+MSVS_DEFAULT_TOOLSETS_INVERSE = {"v141": "15",
+                                 "v140": "14",
+                                 "v120": "12",
+                                 "v110": "11",
+                                 "v100": "10",
+                                 "v90": "9",
+                                 "v80": "8"}
+
+
+def msvs_toolset(settings):
+    toolset = settings.get_safe("compiler.toolset")
+    if not toolset:
+        vs_version = settings.get_safe("compiler.version")
+        toolset = MSVS_DEFAULT_TOOLSETS.get(vs_version)
+    return toolset
+
+
 def latest_visual_studio_version_installed(output):
-    for version in reversed(["8", "9", "10", "11", "12", "14", "15"]):
+    msvc_sersions = reversed(sorted(list(MSVS_DEFAULT_TOOLSETS.keys()), key=int))
+    for version in msvc_sersions:
         vs = _visual_compiler(output, version)
         if vs:
             return vs[1]
diff --git a/conans/model/info.py b/conans/model/info.py
index 5c0db68a9..5d3434c3c 100644
--- a/conans/model/info.py
+++ b/conans/model/info.py
@@ -1,6 +1,7 @@
 import os
 
 from conans.client.build.cppstd_flags import cppstd_default
+from conans.client.tools.win import MSVS_DEFAULT_TOOLSETS_INVERSE
 from conans.errors import ConanException
 from conans.model.env_info import EnvValues
 from conans.model.options import OptionsValues
@@ -345,17 +346,8 @@ class ConanInfo(object):
         if self.full_settings.compiler != "Visual Studio":
             return
 
-        toolsets_versions = {
-            "v141": "15",
-            "v140": "14",
-            "v120": "12",
-            "v110": "11",
-            "v100": "10",
-            "v90": "9",
-            "v80": "8"}
-
         toolset = str(self.full_settings.compiler.toolset)
-        version = toolsets_versions.get(toolset)
+        version = MSVS_DEFAULT_TOOLSETS_INVERSE.get(toolset)
         if version is not None:
             self.settings.compiler.version = version
             del self.settings.compiler.toolset
diff --git a/conans/paths.py b/conans/paths.py
index 9967560c0..3671f2131 100644
--- a/conans/paths.py
+++ b/conans/paths.py
@@ -34,7 +34,7 @@ BUILD_INFO_QMAKE = 'conanbuildinfo.pri'
 BUILD_INFO_QBS = 'conanbuildinfo.qbs'
 BUILD_INFO_VISUAL_STUDIO = 'conanbuildinfo.props'
 BUILD_INFO_XCODE = 'conanbuildinfo.xcconfig'
-BUILD_INFO_PREMAKE = 'conanbuildinfo.lua'
+BUILD_INFO_PREMAKE = 'conanbuildinfo.premake.lua'
 BUILD_INFO_MAKE = 'conanbuildinfo.mak'
 CONANINFO = "conaninfo.txt"
 CONANENV = "conanenv.txt"
diff --git a/conans/paths/__init__.py b/conans/paths/__init__.py
index 19c9663f1..39ffd7898 100644
--- a/conans/paths/__init__.py
+++ b/conans/paths/__init__.py
@@ -39,7 +39,7 @@ BUILD_INFO_QMAKE = 'conanbuildinfo.pri'
 BUILD_INFO_QBS = 'conanbuildinfo.qbs'
 BUILD_INFO_VISUAL_STUDIO = 'conanbuildinfo.props'
 BUILD_INFO_XCODE = 'conanbuildinfo.xcconfig'
-BUILD_INFO_PREMAKE = 'conanbuildinfo.lua'
+BUILD_INFO_PREMAKE = 'conanbuildinfo.premake.lua'
 BUILD_INFO_MAKE = 'conanbuildinfo.mak'
 CONANINFO = "conaninfo.txt"
 CONANENV = "conanenv.txt"
diff --git a/conans/util/files.py b/conans/util/files.py
index 514a877d6..0914bb334 100644
--- a/conans/util/files.py
+++ b/conans/util/files.py
@@ -1,3 +1,4 @@
+import errno
 import hashlib
 import os
 import platform
@@ -7,8 +8,6 @@ import stat
 import sys
 import tarfile
 import tempfile
-from contextlib import contextmanager
-from errno import ENOENT
 from os.path import abspath, join as joinpath, realpath
 
 import six
@@ -207,7 +206,19 @@ def rmdir(path):
     try:
         shutil.rmtree(path, onerror=_change_permissions)
     except OSError as err:
-        if err.errno == ENOENT:
+        if err.errno == errno.ENOENT:
+            return
+        raise
+
+
+def remove(path):
+    try:
+        assert os.path.isfile(path)
+        os.remove(path)
+    except (IOError, OSError) as e:  # for py3, handle just PermissionError
+        if e.errno == errno.EPERM or e.errno == errno.EACCES:
+            os.chmod(path, stat.S_IRWXU)
+            os.remove(path)
             return
         raise
 


Test patch:
diff --git a/conans/test/functional/configuration/profile_test.py b/conans/test/functional/configuration/profile_test.py
index bce9bff21..0b0cbeb21 100644
--- a/conans/test/functional/configuration/profile_test.py
+++ b/conans/test/functional/configuration/profile_test.py
@@ -1,6 +1,7 @@
 import os
 import unittest
 from collections import OrderedDict
+from textwrap import dedent
 
 from parameterized import parameterized
 
@@ -391,3 +392,138 @@ class DefaultNameConan(ConanFile):
         self.client.run("info Hello/0.1@lasote/stable --profile scopes_env")
         self.assertIn('''Requires:
         WinRequire/0.1@lasote/stable''', self.client.user_io.out)
+
+
+class ProfileAggregationTest(unittest.TestCase):
+
+    profile1 = dedent("""
+    [settings]
+    os=Windows
+    arch=x86_64
+
+    [env]
+    ENV1=foo
+    ENV2=bar
+
+    """)
+
+    profile2 = dedent("""
+    [settings]
+    arch=x86
+    build_type=Debug
+    compiler=Visual Studio
+    compiler.version=15
+
+    [env]
+    ENV1=foo2
+    ENV3=bar2
+    """)
+
+    conanfile = dedent("""
+    from conans.model.conan_file import ConanFile
+    import os
+
+    class DefaultNameConan(ConanFile):
+        settings = "os", "compiler", "arch", "build_type"
+
+        def build(self):
+            self.output.warn("ENV1:%s" % os.getenv("ENV1"))
+            self.output.warn("ENV2:%s" % os.getenv("ENV2"))
+            self.output.warn("ENV3:%s" % os.getenv("ENV3"))
+    """)
+
+    consumer = dedent("""
+    from conans.model.conan_file import ConanFile
+    import os
+
+    class DefaultNameConan(ConanFile):
+        settings = "os", "compiler", "arch", "build_type"
+        requires = "lib/1.0@user/channel"
+    """)
+
+    def setUp(self):
+        self.client = TestClient()
+        self.client.save({CONANFILE: self.conanfile,
+                          "profile1": self.profile1, "profile2": self.profile2})
+
+    def test_create(self):
+
+        # The latest declared profile has priority
+        self.client.run("create . lib/1.0@user/channel --profile profile1 -p profile2")
+        self.assertIn(dedent("""
+        [env]
+        ENV1=foo2
+        ENV2=bar
+        ENV3=bar2
+        """), self.client.out)
+        self.client.run("search lib/1.0@user/channel")
+        self.assertIn("arch: x86", self.client.out)
+
+    def test_info(self):
+
+        # The latest declared profile has priority
+        self.client.run("create . lib/1.0@user/channel --profile profile1 -p profile2")
+
+        self.client.save({CONANFILE: self.consumer})
+        self.client.run("info . --profile profile1 --profile profile2")
+        self.assertIn("b786e9ece960c3a76378ca4d5b0d0e922f4cedc1", self.client.out)
+
+        # Build order
+        self.client.run("info . --profile profile1 --profile profile2 "
+                        "--build-order lib/1.0@user/channel")
+        self.assertIn("[lib/1.0@user/channel]", self.client.out)
+
+    def test_install(self):
+        self.client.run("export . lib/1.0@user/channel")
+        # Install ref
+        self.client.run("install lib/1.0@user/channel -p profile1 -p profile2 --build missing")
+        self.assertIn(dedent("""
+               [env]
+               ENV1=foo2
+               ENV2=bar
+               ENV3=bar2
+               """), self.client.out)
+        self.client.run("search lib/1.0@user/channel")
+        self.assertIn("arch: x86", self.client.out)
+
+        # Install project
+        self.client.save({CONANFILE: self.consumer})
+        self.client.run("install . -p profile1 -p profile2 --build")
+        self.assertIn("arch=x86", self.client.out)
+        self.assertIn(dedent("""
+                       [env]
+                       ENV1=foo2
+                       ENV2=bar
+                       ENV3=bar2
+                       """), self.client.out)
+
+    def test_export_pkg(self):
+        self.client.run("export-pkg . lib/1.0@user/channel -pr profile1 -pr profile2")
+        # ID for the expected settings applied: x86, Visual Studio 15,...
+        self.assertIn("b786e9ece960c3a76378ca4d5b0d0e922f4cedc1", self.client.out)
+
+    def profile_crazy_inheritance_test(self):
+        profile1 = dedent("""
+            [settings]
+            os=Windows
+            arch=x86_64
+            compiler=Visual Studio
+            compiler.version=15
+            """)
+
+        profile2 = dedent("""
+            include(profile1)
+            [settings]
+            os=Linux
+            """)
+
+        self.client.save({"profile1": profile1, "profile2": profile2})
+        self.client.run("create . lib/1.0@user/channel --profile profile2 -p profile1")
+        self.assertIn(dedent("""
+                             Configuration:
+                             [settings]
+                             arch=x86_64
+                             compiler=Visual Studio
+                             compiler.runtime=MD
+                             compiler.version=15
+                             os=Windows"""), self.client.out)
diff --git a/conans/test/functional/generators/cmake_generator_test.py b/conans/test/functional/generators/cmake_generator_test.py
index 3f4074b2d..80b88bd6f 100644
--- a/conans/test/functional/generators/cmake_generator_test.py
+++ b/conans/test/functional/generators/cmake_generator_test.py
@@ -1,4 +1,5 @@
 import unittest
+import os
 
 from nose.plugins.attrib import attr
 
@@ -12,7 +13,7 @@ from conans import ConanFile, CMake
 class FooConan(ConanFile):
     name = "foo"
     version = "0.1"
-    settings = "os_build", "compiler", "build_type"
+    settings = "os_build"
     generators = "cmake"
 
     def build(self):
@@ -27,45 +28,41 @@ int main() {}
 
 CMAKE_RECIPE = """
 cmake_minimum_required(VERSION 2.8.12)
-project(dummy CXX)
+project(dummy)
 
 include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
 conan_basic_setup()
-
-add_executable(dummy dummy.cpp)
 """
 
 PROFILE = """
 [settings]
+os={os_build}
 os_build={os_build}
-compiler={compiler}
-compiler.version={compiler_version}
-compiler.libcxx=libstdc++
 """
 
-
 class CMakeGeneratorTest(unittest.TestCase):
 
-    def _check_build_generator(self, os_build, compiler, compiler_version, generator):
+    def _check_build_generator(self, os_build, generator):
         client = TestClient()
         client.save({"conanfile.py": CONAN_RECIPE,
                      "CMakeLists.txt": CMAKE_RECIPE,
                      "dummy.cpp": CPP_CONTENT,
-                     "my_profile": PROFILE.format(os_build=os_build, compiler=compiler,
-                                                  compiler_version=compiler_version)})
+                     "my_profile": PROFILE.format(os_build=os_build)
+                     })
         client.run("install . -p my_profile")
         client.run("build .")
-        self.assertIn("Check for working CXX compiler", client.out)
+
         self.assertIn('cmake -G "{}"'.format(generator), client.out)
+        self.assertTrue(os.path.isfile(os.path.join(client.current_folder, "Makefile")))
 
     @unittest.skipUnless(tools.os_info.is_linux, "Compilation with real gcc needed")
     def test_cmake_default_generator_linux(self):
-        self._check_build_generator("Linux", "gcc", "5", "Unix Makefiles")
+        self._check_build_generator("Linux", "Unix Makefiles")
 
     @unittest.skipUnless(tools.os_info.is_windows, "MinGW is only supported on Windows")
     def test_cmake_default_generator_windows(self):
-        self._check_build_generator("Windows", "gcc", "7", "MinGW Makefiles")
+        self._check_build_generator("Windows", "MinGW Makefiles")
 
     @unittest.skipUnless(tools.os_info.is_macos, "Compilation with real clang is needed")
     def test_cmake_default_generator_osx(self):
-        self._check_build_generator("Macos", "apple-clang", "9.0", "Unix Makefiles")
+        self._check_build_generator("Macos", "Unix Makefiles")
diff --git a/conans/test/functional/generators/make_test.py b/conans/test/functional/generators/make_test.py
index f2757787f..34d558796 100644
--- a/conans/test/functional/generators/make_test.py
+++ b/conans/test/functional/generators/make_test.py
@@ -17,8 +17,9 @@ class MakeGeneratorTest(unittest.TestCase):
         client.run("new myhello/1.0.0 --sources")
         conanfile_path = os.path.join(client.current_folder, "conanfile.py")
         replace_in_file(conanfile_path, "{\"shared\": [True, False]}",
-                        "{\"shared\": [True, False], \"fPIC\": [True, False]}")
-        replace_in_file(conanfile_path, "\"shared=False\"", "\"shared=False\", \"fPIC=True\"")
+                        "{\"shared\": [True, False], \"fPIC\": [True, False]}", output=client.out)
+        replace_in_file(conanfile_path, "\"shared=False\"", "\"shared=False\", \"fPIC=True\"",
+                        output = client.out)
         client.run("create . danimtb/testing")
         hellowrapper_include = """
 #pragma once
@@ -41,7 +42,7 @@ include conanbuildinfo.mak
 #     Make variables for a sample App
 #----------------------------------------
 
-INCLUDE_PATHS = \
+INCLUDE_DIRS = \
 ./include
 
 CXX_SRCS = \
@@ -64,10 +65,10 @@ CXXFLAGS += \
 #----------------------------------------
 
 CFLAGS              += $(CONAN_CFLAGS)
-CXXFLAGS            += $(CONAN_CPPFLAGS)
-CPPFLAGS            += $(addprefix -I, $(INCLUDE_PATHS) $(CONAN_INCLUDE_PATHS))
+CXXFLAGS            += $(CONAN_CXXFLAGS)
+CPPFLAGS            += $(addprefix -I, $(INCLUDE_DIRS) $(CONAN_INCLUDE_DIRS))
 CPPFLAGS            += $(addprefix -D, $(CONAN_DEFINES))
-LDFLAGS             += $(addprefix -L, $(CONAN_LIB_PATHS))
+LDFLAGS             += $(addprefix -L, $(CONAN_LIB_DIRS))
 LDLIBS              += $(addprefix -l, $(CONAN_LIBS))
 SHAREDLINKFLAGS     += $(CONAN_SHAREDLINKFLAGS)
 
@@ -172,10 +173,10 @@ EXELINKFLAGS += \
 #----------------------------------------
 
 CFLAGS              += $(CONAN_CFLAGS)
-CXXFLAGS            += $(CONAN_CPPFLAGS)
-CPPFLAGS            += $(addprefix -I, $(CONAN_INCLUDE_PATHS))
+CXXFLAGS            += $(CONAN_CXXFLAGS)
+CPPFLAGS            += $(addprefix -I, $(CONAN_INCLUDE_DIRS))
 CPPFLAGS            += $(addprefix -D, $(CONAN_DEFINES))
-LDFLAGS             += $(addprefix -L, $(CONAN_LIB_PATHS))
+LDFLAGS             += $(addprefix -L, $(CONAN_LIB_DIRS))
 LDLIBS              += $(addprefix -l, $(CONAN_LIBS))
 EXELINKFLAGS        += $(CONAN_EXELINKFLAGS)
 
diff --git a/conans/test/functional/generators/premake_test.py b/conans/test/functional/generators/premake_test.py
index fe4ce47ee..6a634779a 100644
--- a/conans/test/functional/generators/premake_test.py
+++ b/conans/test/functional/generators/premake_test.py
@@ -20,7 +20,7 @@ class PremakeGeneratorTest(unittest.TestCase):
         premake
         """)
         premake = textwrap.dedent("""
-        include("conanbuildinfo.lua")
+        include("conanbuildinfo.premake.lua")
 
         workspace("example")
             conan_basic_setup()
diff --git a/conans/test/functional/scm/scm_test.py b/conans/test/functional/scm/scm_test.py
index e626047d6..2a8baa7ef 100644
--- a/conans/test/functional/scm/scm_test.py
+++ b/conans/test/functional/scm/scm_test.py
@@ -5,6 +5,7 @@ from collections import namedtuple
 
 from nose.plugins.attrib import attr
 
+from conans.client.tools.files import chdir
 from conans.client.tools.scm import Git, SVN
 from conans.client.tools.win import get_cased_path
 from conans.model.ref import ConanFileReference, PackageReference
@@ -852,3 +853,25 @@ class ConanLib(ConanFile):
         the_json = str(scm_data)
         data2 = json.loads(the_json)
         self.assertEquals(data, data2)
+
+
+@attr('svn')
+class SCMSVNWithLockedFilesTest(SVNLocalRepoTestCase):
+
+    def test_propset_own(self):
+        """ Apply svn:needs-lock property to every file in the own working-copy of the repository """
+
+        conanfile = base_svn.format(directory="None", url="auto", revision="auto")
+        project_url, _ = self.create_project(files={"conanfile.py": conanfile,})
+        project_url = project_url.replace(" ", "%20")
+
+        # Add property needs-lock to my own copy
+        client = TestClient()
+        client.runner('svn co "{url}" "{path}"'.format(url=project_url,
+                                                       path=client.current_folder))
+        with chdir(client.current_folder):
+            for item in ['conanfile.py', ]:
+                client.runner('svn propset svn:needs-lock yes {}'.format(item))
+            client.runner('svn commit -m "lock some files"')
+
+        client.run("export . user/channel")
diff --git a/conans/test/unittests/client/build/cmake_flags.py b/conans/test/unittests/client/build/cmake_flags.py
index 81acb84b8..d6ea74607 100644
--- a/conans/test/unittests/client/build/cmake_flags.py
+++ b/conans/test/unittests/client/build/cmake_flags.py
@@ -1,7 +1,8 @@
 import unittest
 
+from conans import CMake
 from conans.client.build.cmake_flags import get_generator
-from conans.test.utils.conanfile import MockSettings
+from conans.test.utils.conanfile import MockSettings, ConanFileMock
 
 
 class CMakeGeneratorTest(unittest.TestCase):
@@ -10,13 +11,24 @@ class CMakeGeneratorTest(unittest.TestCase):
         settings = MockSettings({"os_build": "Linux"})
         generator = get_generator(settings)
         self.assertEquals("Unix Makefiles", generator)
+        self._test_default_generator_cmake(settings, "Unix Makefiles")
 
     def test_cmake_default_generator_osx(self):
         settings = MockSettings({"os_build": "Macos"})
         generator = get_generator(settings)
         self.assertEquals("Unix Makefiles", generator)
+        self._test_default_generator_cmake(settings, "Unix Makefiles")
 
     def test_default_generator_windows(self):
         settings = MockSettings({"os_build": "Windows"})
         generator = get_generator(settings)
         self.assertEquals("MinGW Makefiles", generator)
+        self._test_default_generator_cmake(settings, "MinGW Makefiles")
+
+    def _test_default_generator_cmake(self, settings, generator):
+        conanfile = ConanFileMock()
+        conanfile.settings = settings
+        cmake = CMake(conanfile)
+        self.assertEquals(generator, cmake.generator)
+        self.assertIn('-G "{}"'.format(generator), cmake.command_line)
+
diff --git a/conans/test/unittests/client/build/msbuild_test.py b/conans/test/unittests/client/build/msbuild_test.py
index 126139866..76cbe7b46 100644
--- a/conans/test/unittests/client/build/msbuild_test.py
+++ b/conans/test/unittests/client/build/msbuild_test.py
@@ -1,18 +1,14 @@
-import os
 import platform
 import unittest
 
 import mock
-from nose.plugins.attrib import attr
 from parameterized import parameterized
 
-from conans.client import tools
 from conans.client.build.msbuild import MSBuild
+from conans.client import tools
 from conans.errors import ConanException
 from conans.model.version import Version
-from conans.paths import CONANFILE
 from conans.test.utils.conanfile import MockConanfile, MockSettings
-from conans.test.utils.visual_project_files import get_vs_project_files
 
 
 class MSBuildTest(unittest.TestCase):
@@ -141,11 +137,61 @@ class MSBuildTest(unittest.TestCase):
                                  "arch": "x86_64"})
         conanfile = MockConanfile(settings)
         msbuild = MSBuild(conanfile)
-        command = msbuild.get_command("projecshould_flags_testt_file.sln", properties={"MyProp1": "MyValue1",
-                                                                      "MyProp2": "MyValue2"})
+        command = msbuild.get_command("project_should_flags_test_file.sln",
+                                      properties={"MyProp1": "MyValue1", "MyProp2": "MyValue2"})
         self.assertIn('/p:MyProp1="MyValue1"', command)
         self.assertIn('/p:MyProp2="MyValue2"', command)
 
+    @parameterized.expand([("15", "v141"),
+                           ("14", "v140"),
+                           ("12", "v120"),
+                           ("11", "v110"),
+                           ("10", "v100"),
+                           ("9", "v90"),
+                           ("8", "v80")])
+    def default_toolset_test(self, compiler_version, expected_toolset):
+        settings = MockSettings({"build_type": "Debug",
+                                 "compiler": "Visual Studio",
+                                 "compiler.version": compiler_version,
+                                 "arch": "x86_64"})
+        conanfile = MockConanfile(settings)
+        msbuild = MSBuild(conanfile)
+        command = msbuild.get_command("project_should_flags_test_file.sln")
+        self.assertIn('/p:PlatformToolset="%s"' % expected_toolset, command)
+
+    @parameterized.expand([("v141",),
+                           ("v140",),
+                           ("v120",),
+                           ("v110",),
+                           ("v100",),
+                           ("v90",),
+                           ("v80",)])
+    def explicit_toolset_test(self, expected_toolset):
+        settings = MockSettings({"build_type": "Debug",
+                                 "compiler": "Visual Studio",
+                                 "compiler.version": "15",
+                                 "arch": "x86_64"})
+        conanfile = MockConanfile(settings)
+        msbuild = MSBuild(conanfile)
+        command = msbuild.get_command("project_should_flags_test_file.sln", toolset=expected_toolset)
+        self.assertIn('/p:PlatformToolset="%s"' % expected_toolset, command)
+
+    @parameterized.expand([("16", "v141_xp"),
+                           ("15", "v141_xp"),
+                           ("14", "v140_xp"),
+                           ("12", "v120_xp"),
+                           ("11", "v110_xp")])
+    def custom_toolset_test(self, compiler_version, expected_toolset):
+        settings = MockSettings({"build_type": "Debug",
+                                 "compiler": "Visual Studio",
+                                 "compiler.version": compiler_version,
+                                 "compiler.toolset": expected_toolset,
+                                 "arch": "x86_64"})
+        conanfile = MockConanfile(settings)
+        msbuild = MSBuild(conanfile)
+        command = msbuild.get_command("project_should_flags_test_file.sln")
+        self.assertIn('/p:PlatformToolset="%s"' % expected_toolset, command)
+
     def definitions_test(self):
         settings = MockSettings({"build_type": "Debug",
                                  "compiler": "Visual Studio",
diff --git a/conans/test/unittests/client/generators/make_test.py b/conans/test/unittests/client/generators/make_test.py
index 717f91dff..98d867af3 100644
--- a/conans/test/unittests/client/generators/make_test.py
+++ b/conans/test/unittests/client/generators/make_test.py
@@ -62,19 +62,19 @@ CONAN_ROOT_MYPKG1 ?=  \\
 CONAN_SYSROOT_MYPKG1 ?=  \\
 
 
-CONAN_INCLUDE_PATHS_MYPKG1 +=  \\
-{conan_include_paths_mypkg1}
+CONAN_INCLUDE_DIRS_MYPKG1 +=  \\
+{conan_include_dirs_mypkg1}
 
-CONAN_LIB_PATHS_MYPKG1 +=  \\
-{conan_lib_paths_mypkg1}
+CONAN_LIB_DIRS_MYPKG1 +=  \\
+{conan_lib_dirs_mypkg1}
 
-CONAN_BIN_PATHS_MYPKG1 +=  \\
-{conan_bin_paths_mypkg1}
+CONAN_BIN_DIRS_MYPKG1 +=  \\
+{conan_bin_dirs_mypkg1}
 
-CONAN_BUILD_PATHS_MYPKG1 +=  \\
-{conan_build_paths_mypkg1}
+CONAN_BUILD_DIRS_MYPKG1 +=  \\
+{conan_build_dirs_mypkg1}
 
-CONAN_RES_PATHS_MYPKG1 +=  \\
+CONAN_RES_DIRS_MYPKG1 +=  \\
 
 
 CONAN_LIBS_MYPKG1 +=  \\
@@ -86,7 +86,7 @@ MYDEFINE1
 CONAN_CFLAGS_MYPKG1 +=  \\
 -fgimple
 
-CONAN_CPPFLAGS_MYPKG1 +=  \\
+CONAN_CXXFLAGS_MYPKG1 +=  \\
 -fdollars-in-identifiers
 
 CONAN_SHAREDLINKFLAGS_MYPKG1 +=  \\
@@ -101,19 +101,19 @@ CONAN_ROOT_MYPKG2 ?=  \\
 CONAN_SYSROOT_MYPKG2 ?=  \\
 
 
-CONAN_INCLUDE_PATHS_MYPKG2 +=  \\
-{conan_include_paths_mypkg2}
+CONAN_INCLUDE_DIRS_MYPKG2 +=  \\
+{conan_include_dirs_mypkg2}
 
-CONAN_LIB_PATHS_MYPKG2 +=  \\
-{conan_lib_paths_mypkg2}
+CONAN_LIB_DIRS_MYPKG2 +=  \\
+{conan_lib_dirs_mypkg2}
 
-CONAN_BIN_PATHS_MYPKG2 +=  \\
-{conan_bin_paths_mypkg2}
+CONAN_BIN_DIRS_MYPKG2 +=  \\
+{conan_bin_dirs_mypkg2}
 
-CONAN_BUILD_PATHS_MYPKG2 +=  \\
-{conan_build_paths_mypkg2}
+CONAN_BUILD_DIRS_MYPKG2 +=  \\
+{conan_build_dirs_mypkg2}
 
-CONAN_RES_PATHS_MYPKG2 +=  \\
+CONAN_RES_DIRS_MYPKG2 +=  \\
 
 
 CONAN_LIBS_MYPKG2 +=  \\
@@ -125,7 +125,7 @@ MYDEFINE2
 CONAN_CFLAGS_MYPKG2 +=  \\
 -fno-asm
 
-CONAN_CPPFLAGS_MYPKG2 +=  \\
+CONAN_CXXFLAGS_MYPKG2 +=  \\
 -pthread
 
 CONAN_SHAREDLINKFLAGS_MYPKG2 +=  \\
@@ -142,25 +142,25 @@ CONAN_SYSROOT +=  \\
 $(CONAN_SYSROOT_MYPKG1) \\
 $(CONAN_SYSROOT_MYPKG2)
 
-CONAN_INCLUDE_PATHS +=  \\
-$(CONAN_INCLUDE_PATHS_MYPKG1) \\
-$(CONAN_INCLUDE_PATHS_MYPKG2)
+CONAN_INCLUDE_DIRS +=  \\
+$(CONAN_INCLUDE_DIRS_MYPKG1) \\
+$(CONAN_INCLUDE_DIRS_MYPKG2)
 
-CONAN_LIB_PATHS +=  \\
-$(CONAN_LIB_PATHS_MYPKG1) \\
-$(CONAN_LIB_PATHS_MYPKG2)
+CONAN_LIB_DIRS +=  \\
+$(CONAN_LIB_DIRS_MYPKG1) \\
+$(CONAN_LIB_DIRS_MYPKG2)
 
-CONAN_BIN_PATHS +=  \\
-$(CONAN_BIN_PATHS_MYPKG1) \\
-$(CONAN_BIN_PATHS_MYPKG2)
+CONAN_BIN_DIRS +=  \\
+$(CONAN_BIN_DIRS_MYPKG1) \\
+$(CONAN_BIN_DIRS_MYPKG2)
 
-CONAN_BUILD_PATHS +=  \\
-$(CONAN_BUILD_PATHS_MYPKG1) \\
-$(CONAN_BUILD_PATHS_MYPKG2)
+CONAN_BUILD_DIRS +=  \\
+$(CONAN_BUILD_DIRS_MYPKG1) \\
+$(CONAN_BUILD_DIRS_MYPKG2)
 
-CONAN_RES_PATHS +=  \\
-$(CONAN_RES_PATHS_MYPKG1) \\
-$(CONAN_RES_PATHS_MYPKG2)
+CONAN_RES_DIRS +=  \\
+$(CONAN_RES_DIRS_MYPKG1) \\
+$(CONAN_RES_DIRS_MYPKG2)
 
 CONAN_LIBS +=  \\
 $(CONAN_LIBS_MYPKG1) \\
@@ -174,9 +174,9 @@ CONAN_CFLAGS +=  \\
 $(CONAN_CFLAGS_MYPKG1) \\
 $(CONAN_CFLAGS_MYPKG2)
 
-CONAN_CPPFLAGS +=  \\
-$(CONAN_CPPFLAGS_MYPKG1) \\
-$(CONAN_CPPFLAGS_MYPKG2)
+CONAN_CXXFLAGS +=  \\
+$(CONAN_CXXFLAGS_MYPKG1) \\
+$(CONAN_CXXFLAGS_MYPKG2)
 
 CONAN_SHAREDLINKFLAGS +=  \\
 $(CONAN_SHAREDLINKFLAGS_MYPKG1) \\
@@ -199,13 +199,14 @@ $(CONAN_EXELINKFLAGS_MYPKG2)
         bin2 = os.path.join(tmp_folder2, 'bin2').replace('\\', '/')
 
         expected_content = content_template.format(conan_root_mypkg1=root1,
-                                                   conan_include_paths_mypkg1=inc1,
-                                                   conan_lib_paths_mypkg1=lib1,
-                                                   conan_bin_paths_mypkg1=bin1,
-                                                   conan_build_paths_mypkg1=root1 + "/",
+                                                   conan_include_dirs_mypkg1=inc1,
+                                                   conan_lib_dirs_mypkg1=lib1,
+                                                   conan_bin_dirs_mypkg1=bin1,
+                                                   conan_build_dirs_mypkg1=root1 + "/",
                                                    conan_root_mypkg2=root2,
-                                                   conan_include_paths_mypkg2=inc2,
-                                                   conan_lib_paths_mypkg2=lib2,
-                                                   conan_bin_paths_mypkg2=bin2,
-                                                   conan_build_paths_mypkg2=root2 + "/")
+                                                   conan_include_dirs_mypkg2=inc2,
+                                                   conan_lib_dirs_mypkg2=lib2,
+                                                   conan_bin_dirs_mypkg2=bin2,
+                                                   conan_build_dirs_mypkg2=root2 + "/")
+        self.maxDiff = None
         self.assertIn(expected_content, content)
diff --git a/conans/test/unittests/client/generators/premake_test.py b/conans/test/unittests/client/generators/premake_test.py
index d95870280..355a15c2b 100644
--- a/conans/test/unittests/client/generators/premake_test.py
+++ b/conans/test/unittests/client/generators/premake_test.py
@@ -26,8 +26,8 @@ class PremakeGeneratorTest(unittest.TestCase):
     conan_bindirs = {{"{bin1}",
     "{bin2}"}}
     conan_libs = {{"libfoo", "libbar"}}
-    conan_cppdefines = {{"MYDEFINE2", "MYDEFINE1"}}
-    conan_cppflags = {{"-march=native", "-fPIE"}}
+    conan_defines = {{"MYDEFINE2", "MYDEFINE1"}}
+    conan_cxxflags = {{"-march=native", "-fPIE"}}
     conan_cflags = {{"-mtune=native", "-fPIC"}}
     conan_sharedlinkflags = {{"-framework AudioFoundation", "-framework Cocoa"}}
     conan_exelinkflags = {{"-framework VideoToolbox", "-framework QuartzCore"}}
@@ -36,8 +36,8 @@ class PremakeGeneratorTest(unittest.TestCase):
     conan_libdirs_MyPkg1 = {{"{lib1}"}}
     conan_bindirs_MyPkg1 = {{"{bin1}"}}
     conan_libs_MyPkg1 = {{"libfoo"}}
-    conan_cppdefines_MyPkg1 = {{"MYDEFINE1"}}
-    conan_cppflags_MyPkg1 = {{"-fPIE"}}
+    conan_defines_MyPkg1 = {{"MYDEFINE1"}}
+    conan_cxxflags_MyPkg1 = {{"-fPIE"}}
     conan_cflags_MyPkg1 = {{"-fPIC"}}
     conan_sharedlinkflags_MyPkg1 = {{"-framework Cocoa"}}
     conan_exelinkflags_MyPkg1 = {{"-framework QuartzCore"}}
@@ -47,8 +47,8 @@ class PremakeGeneratorTest(unittest.TestCase):
     conan_libdirs_MyPkg2 = {{"{lib2}"}}
     conan_bindirs_MyPkg2 = {{"{bin2}"}}
     conan_libs_MyPkg2 = {{"libbar"}}
-    conan_cppdefines_MyPkg2 = {{"MYDEFINE2"}}
-    conan_cppflags_MyPkg2 = {{"-march=native"}}
+    conan_defines_MyPkg2 = {{"MYDEFINE2"}}
+    conan_cxxflags_MyPkg2 = {{"-march=native"}}
     conan_cflags_MyPkg2 = {{"-mtune=native"}}
     conan_sharedlinkflags_MyPkg2 = {{"-framework AudioFoundation"}}
     conan_exelinkflags_MyPkg2 = {{"-framework VideoToolbox"}}
@@ -60,7 +60,7 @@ class PremakeGeneratorTest(unittest.TestCase):
         includedirs{{conan_includedirs}}
         libdirs{{conan_libdirs}}
         links{{conan_libs}}
-        defines{{conan_cppdefines}}
+        defines{{conan_defines}}
         bindirs{{conan_bindirs}}
     end
     """)
diff --git a/conans/test/unittests/model/info/__init__.py b/conans/test/unittests/model/info/__init__.py
new file mode 100644
index 000000000..faa18be5b
--- /dev/null
+++ b/conans/test/unittests/model/info/__init__.py
@@ -0,0 +1,2 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
diff --git a/conans/test/unittests/model/info/vs_toolset_compatible_test.py b/conans/test/unittests/model/info/vs_toolset_compatible_test.py
new file mode 100644
index 000000000..fba9fdf22
--- /dev/null
+++ b/conans/test/unittests/model/info/vs_toolset_compatible_test.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import unittest
+
+from parameterized import parameterized
+
+from conans.client.conf import default_settings_yml
+from conans.model.info import ConanInfo
+from conans.model.settings import Settings
+
+
+class VSToolsetCompatibleTest(unittest.TestCase):
+    @parameterized.expand([("14", "v141", "15"),
+                           ("15", "v140", "14"),
+                           ("11", "v120", "12"),
+                           ("12", "v110", "11"),
+                           ("9", "v100", "10"),
+                           ("10", "v90", "9")])
+    def test_compatible(self, initial_version, toolset, expected_version):
+        info = ConanInfo()
+        settings = Settings.loads(default_settings_yml)
+        info.settings = settings
+        settings.compiler = "Visual Studio"
+        settings.compiler.toolset = toolset
+        settings.compiler.version = initial_version
+        info.full_settings = info.settings
+        info.vs_toolset_compatible()
+        self.assertEqual(info.settings.compiler.version, expected_version)
+        self.assertIsNone(info.settings.get_safe("compiler.toolset"))
+
+    @parameterized.expand([("14", "v141_xp"),
+                           ("15", "v140_xp"),
+                           ("11", "v120_xp"),
+                           ("12", "v110_xp"),
+                           ("9", "LLVM-vs2012_xp"),
+                           ("10", "LLVM-vs2013_xp")])
+    def test_incompatible(self, initial_version, toolset):
+        info = ConanInfo()
+        settings = Settings.loads(default_settings_yml)
+        info.settings = settings
+        settings.compiler = "Visual Studio"
+        settings.compiler.toolset = toolset
+        settings.compiler.version = initial_version
+        info.full_settings = info.settings
+        info.vs_toolset_compatible()
+        self.assertEqual(info.settings.compiler.version, initial_version)
+        self.assertEqual(info.settings.compiler.toolset, toolset)
diff --git a/conans/test/unittests/util/files/__init__.py b/conans/test/unittests/util/files/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/conans/test/unittests/util/files/test_remove.py b/conans/test/unittests/util/files/test_remove.py
new file mode 100644
index 000000000..c241ef810
--- /dev/null
+++ b/conans/test/unittests/util/files/test_remove.py
@@ -0,0 +1,34 @@
+# coding=utf-8
+
+import os
+import stat
+import unittest
+
+from conans.test.utils.test_files import temp_folder
+from conans.util.files import remove, save
+
+
+class RemoveTest(unittest.TestCase):
+
+    def setUp(self):
+        self.file = os.path.join(temp_folder(), 'file.txt')
+        save(self.file, "some content")
+
+    def test_remove(self):
+        remove(self.file)
+        self.assertFalse(os.path.exists(self.file))
+        self.assertTrue(os.path.exists(os.path.dirname(self.file)))
+
+    def test_remove_readonly(self):
+        os.chmod(self.file, stat.S_IREAD|stat.S_IRGRP|stat.S_IROTH)
+        with self.assertRaisesRegexp((IOError, OSError), "Permission denied"):
+            save(self.file, "change the content")
+        remove(self.file)
+        self.assertFalse(os.path.exists(self.file))
+        self.assertTrue(os.path.exists(os.path.dirname(self.file)))
+
+    def test_remove_folder(self):
+        dirname = os.path.dirname(self.file)
+        self.assertRaises(AssertionError, remove, dirname)
+        self.assertTrue(os.path.exists(dirname))
+
diff --git a/conans/test/unittests/util/msvs_toolset_test.py b/conans/test/unittests/util/msvs_toolset_test.py
new file mode 100644
index 000000000..50a84f74c
--- /dev/null
+++ b/conans/test/unittests/util/msvs_toolset_test.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import platform
+import unittest
+
+from nose.plugins.attrib import attr
+from parameterized import parameterized
+
+from conans.client import tools
+from conans.test.utils.conanfile import MockSettings
+
+
+@attr('visual_studio')
+@unittest.skipUnless(platform.system() == "Windows", "Requires Windows")
+class MSVCToolsetTest(unittest.TestCase):
+
+    @parameterized.expand([("15", "v141"),
+                           ("14", "v140"),
+                           ("12", "v120"),
+                           ("11", "v110"),
+                           ("10", "v100"),
+                           ("9", "v90"),
+                           ("8", "v80")])
+    def test_default(self, compiler_version, expected_toolset):
+        settings = MockSettings({"compiler": "Visual Studio",
+                                 "compiler.version": compiler_version})
+        self.assertEqual(expected_toolset, tools.msvs_toolset(settings))
+
+    @parameterized.expand([("15", "v141_xp"),
+                           ("14", "v140_xp"),
+                           ("12", "v120_xp"),
+                           ("11", "v110_xp")])
+    def test_custom(self, compiler_version, expected_toolset):
+        settings = MockSettings({"compiler": "Visual Studio",
+                                 "compiler.version": compiler_version,
+                                 "compiler.toolset": expected_toolset})
+        self.assertEqual(expected_toolset, tools.msvs_toolset(settings))
+
+    def test_negative(self):
+        self.assertIsNone(tools.msvs_toolset(MockSettings({"compiler": "Visual Studio",
+                                                           "compiler.version": "666"})))