Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supporting multiple conan-config-install and source/target subfolders #4709

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions conans/client/cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def __init__(self, base_folder, store_folder, output):
super(ClientCache, self).__init__(self._store_folder)
self.editable_packages = EditablePackages(self.conan_folder)

@property
def config_install_file(self):
return os.path.join(self.conan_folder, "config_install.json")

def package_layout(self, ref, short_paths=None, *args, **kwargs):
assert isinstance(ref, ConanFileReference), "It is a {}".format(type(ref))
edited_ref = self.editable_packages.get(ref.copy_clear_rev())
Expand Down
11 changes: 9 additions & 2 deletions conans/client/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,14 +427,19 @@ def config(self, *args):
get_subparser.add_argument("item", nargs="?", help="Item to print")
set_subparser.add_argument("item", help="'item=value' to set")
install_subparser.add_argument("item", nargs="?",
help="Configuration file or directory to use")
help="git repository, local folder or zip file (local or "
"http) where the configuration is stored")

install_subparser.add_argument("--verify-ssl", nargs="?", default="True",
help='Verify SSL connection when downloading file')
install_subparser.add_argument("--type", "-t", choices=["git"],
help='Type of remote config')
install_subparser.add_argument("--args", "-a",
help='String with extra arguments for "git clone"')
install_subparser.add_argument("-sf", "--source-folder",
help='Install files from that path')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better: Install files from a concrete source folder in the specified origin

install_subparser.add_argument("-tf", "--target-folder",
help='Install to that path in the conan cache')

args = parser.parse_args(*args)

Expand All @@ -453,7 +458,9 @@ def config(self, *args):
return self._conan.config_rm(args.item)
elif args.subcommand == "install":
verify_ssl = get_bool_from_text(args.verify_ssl)
return self._conan.config_install(args.item, verify_ssl, args.type, args.args)
return self._conan.config_install(args.item, verify_ssl, args.type, args.args,
source_folder=args.source_folder,
target_folder=args.target_folder)

def info(self, *args):
"""Gets information about the dependency graph of a recipe.
Expand Down
7 changes: 4 additions & 3 deletions conans/client/conan_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,11 +603,12 @@ def config_rm(self, item):
self._cache.invalidate()

@api_method
def config_install(self, path_or_url, verify_ssl, config_type=None, args=None):

def config_install(self, path_or_url, verify_ssl, config_type=None, args=None,
source_folder=None, target_folder=None):
from conans.client.conf.config_installer import configuration_install
return configuration_install(path_or_url, self._cache, self._user_io.out, verify_ssl,
requester=self._requester, config_type=config_type, args=args)
requester=self._requester, config_type=config_type, args=args,
source_folder=source_folder, target_folder=target_folder)

def _info_args(self, reference_or_path, install_folder, profile_names, settings, options, env):
cwd = get_cwd()
Expand Down
Loading