Skip to content

Commit

Permalink
Merge branch 'release/0.30.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
lasote committed Dec 14, 2017
2 parents 4fc72e3 + 9f36e16 commit 75d38d9
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 40 deletions.
2 changes: 1 addition & 1 deletion conans/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
COMPLEX_SEARCH_CAPABILITY = "complex_search"
SERVER_CAPABILITIES = [COMPLEX_SEARCH_CAPABILITY, ]

__version__ = '0.30.1'
__version__ = '0.30.2'
8 changes: 6 additions & 2 deletions conans/client/build/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,12 @@ def get_dir(folder, origin):
if self._conanfile.in_local_cache:
build_dir = cache_build_dir or build_dir

source_dir = get_dir(source_dir, self._conanfile.source_folder)
self.build_dir = get_dir(build_dir or self.build_dir, self._conanfile.build_folder)
if os.getcwd() == self._conanfile.build_folder:
source_dir = get_dir(source_dir, self._conanfile.source_folder)
self.build_dir = get_dir(build_dir or self.build_dir, self._conanfile.build_folder)
else: # Recipe build() has already changed with chdir() the directory, expect relative paths
source_dir = source_dir or self._conanfile.source_folder
self.build_dir = build_dir or self.build_dir or self._conanfile.build_folder

mkdir(self.build_dir)
arg_list = join_arguments([
Expand Down
8 changes: 6 additions & 2 deletions conans/client/build/meson.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ def get_dir(folder, origin):
else:
pc_paths = self._conanfile.install_folder

source_dir = get_dir(source_dir, self._conanfile.source_folder)
self.build_dir = get_dir(build_dir or self.build_dir, self._conanfile.build_folder)
if os.getcwd() == self._conanfile.build_folder:
source_dir = get_dir(source_dir, self._conanfile.source_folder)
self.build_dir = get_dir(build_dir or self.build_dir, self._conanfile.build_folder)
else: # Recipe build() has already changed with chdir() the directory, expect relative paths
source_dir = source_dir or self._conanfile.source_folder
self.build_dir = build_dir or self.build_dir or self._conanfile.build_folder

mkdir(self.build_dir)
build_type = ("--buildtype=%s" % self.build_type if self.build_type else "").lower()
Expand Down
1 change: 0 additions & 1 deletion conans/client/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ def source(self, *args):
except ConanException:
pass

print(args.source_folder)
return self._conan.source(args.path, args.source_folder, args.install_folder)

def build(self, *args):
Expand Down
8 changes: 1 addition & 7 deletions conans/client/generators/ycm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from conans.model import Generator
from conans.paths import BUILD_INFO_YCM


class YouCompleteMeGenerator(Generator):
Expand Down Expand Up @@ -165,7 +164,7 @@ def FlagsForFile( filename, **kwargs ):

@property
def filename(self):
return BUILD_INFO_YCM
return '.ycm_extra_conf.py'

@property
def content(self):
Expand All @@ -174,12 +173,7 @@ def prefixed(prefix, values):

flags = ['-x', 'c++']
flags.extend(self.deps_build_info.cppflags)
flags.extend(self.build_info.cppflags)

flags.extend(prefixed("-D", self.deps_build_info.defines))
flags.extend(prefixed("-D", self.build_info.defines))

flags.extend(prefixed("-I", self.build_info.include_paths))
flags.extend(prefixed("-I", self.deps_build_info.include_paths))

cxx_version = ''
Expand Down
5 changes: 0 additions & 5 deletions conans/model/conan_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class Generator(object):
def __init__(self, conanfile):
self.conanfile = conanfile
self._deps_build_info = conanfile.deps_cpp_info
self._build_info = conanfile.cpp_info
self._deps_env_info = conanfile.deps_env_info
self._env_info = conanfile.env_info
self._deps_user_info = conanfile.deps_user_info
Expand All @@ -16,10 +15,6 @@ def __init__(self, conanfile):
def deps_build_info(self):
return self._deps_build_info

@property
def build_info(self):
return self._build_info

@property
def deps_env_info(self):
return self._deps_env_info
Expand Down
1 change: 0 additions & 1 deletion conans/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def path_shortener(x, _):
BUILD_INFO_QBS = 'conanbuildinfo.qbs'
BUILD_INFO_VISUAL_STUDIO = 'conanbuildinfo.props'
BUILD_INFO_XCODE = 'conanbuildinfo.xcconfig'
BUILD_INFO_YCM = '.ycm_extra_conf.py'
CONANINFO = "conaninfo.txt"
CONANENV = "conanenv.txt"
SYSTEM_REQS = "system_reqs.txt"
Expand Down
56 changes: 35 additions & 21 deletions conans/test/generators/generator_filter_error_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,43 @@

class MultiGeneratorFilterErrorTest(unittest.TestCase):

def regression_test(self):
def test(self):
# Possible regression of: https://github.com/conan-io/conan/pull/1719#issuecomment-339137460
# https://github.com/conan-io/conan/issues/2149
client = TestClient()
client.save({"conanfile.py": """from conans import ConanFile
class Pkg(ConanFile):
llvm = '''
from conans import ConanFile
class ConanLib(ConanFile):
generators = "cmake", "visual_studio", "qmake", "ycm"
exports_sources = "*"
def package(self):
self.copy("*", dst="include")
""", "header.h": ""})
client.run("create Pkg/0.1@user/stable")
client.save({"conanfile.txt": "[requires]\nPkg/0.1@user/stable\n"
"[generators]\nycm\ncmake\ntxt\ngcc\n"}, clean_first=True)
client.run("install .")
self.copy("*")
def package_info(self):
self.cpp_info.includedirs = ["include", "include/c++/v1"]
'''

cmake = load(os.path.join(client.current_folder, "conanbuildinfo.cmake"))
txt = load(os.path.join(client.current_folder, "conanbuildinfo.txt"))
gcc = load(os.path.join(client.current_folder, "conanbuildinfo.gcc"))
ycm = load(os.path.join(client.current_folder, ".ycm_extra_conf.py"))
self.assertIn("Pkg/0.1/user/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include",
cmake)
self.assertIn("Pkg/0.1/user/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include",
txt)
self.assertIn("Pkg/0.1/user/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include",
gcc)
self.assertIn("Pkg/0.1/user/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include",
ycm.replace("\\", "/"))
client.save({"conanfile.py": llvm,
"include/file.h": "",
"include/c++/v1/file2.h": ""})
client.run("create llvm/5.0@user/channel")
test = '''
from conans import ConanFile
class ConanLib(ConanFile):
def test(self):
pass
'''
myprofile = """[build_requires]
llvm/5.0@user/channel
"""
client.save({"conanfile.py": llvm,
"include/file3.h": "",
"include/c++/v1/file4.h": "",
"test_package/conanfile.py": test,
"myprofile": myprofile}, clean_first=True)
client.run("create MyLib/0.1@user/channel -pr=myprofile")
content = load(os.path.join(client.current_folder,
"test_package/build/1ce01a69e728d0cf98d738a3dc17cee00c9010d2"
"/conanbuildinfo.txt"))
self.assertIn(".conan/data/MyLib/0.1/user/channel/package/"
"5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include",
content)

0 comments on commit 75d38d9

Please sign in to comment.