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

Can I configure my own artifactory repository instead of always defaulting to conan center? #224

Open
sandybhat16 opened this issue Mar 22, 2024 · 3 comments
Assignees
Labels

Comments

@sandybhat16
Copy link

I have started using this extension but what I have observed is that it always points to the ConanCenter to fetch the packages. Is there a way I can configure my own artifactory repository or have more than one just like how Nuget supports?

@czoido czoido self-assigned this Mar 22, 2024
@czoido
Copy link
Contributor

czoido commented Mar 22, 2024

Hi @sandybhat16,

Thanks a lot for testing the VS extension.

Right now, the list of Conan packages comes from a hardcoded json that's updated daily to reflect the updates in Conan Center (if you click the 🔄 button it will be updated) but there's no option to show the contents of a custom repo.
You can edit the conandata.yml that the extension generates (dont forget to remove the comments, otherwise the extension overwrites the contents) and there you can specify your own packages, that will be fetched by order of preference that you have configured in the same way that any regular conan install works.
Is this helping?

@sandybhat16
Copy link
Author

@czoido Thank you for your response.
Is there a way that we can have a custom JSON locally that I can configure to use with the VS Extension?
If not then, the step you mentioned to edit the conandata.yml. Is there a way to define source as well? So that all the packages under requirements uses the same source. In this way I can achieve all the packages to be fetched from my custom repository.

@czoido
Copy link
Contributor

czoido commented Mar 22, 2024

@czoido Thank you for your response. Is there a way that we can have a custom JSON locally that I can configure to use with the VS Extension? If not then, the step you mentioned to edit the conandata.yml. Is there a way to define source as well? So that all the packages under requirements uses the same source. In this way I can achieve all the packages to be fetched from my custom repository.

I would not recommend you to edit the json where the packages are stored, it can lead to extension crashes as the format is not stable and will probably change in the future.
I think the easiest way of making sure that you fetch the requirements from your custom repository putting your remote first in the list of remotes (you can do that with conan remote update if you already have the remote configured) or even removing or disabling all remotes but the one you want.
Another option is modifying the arguments for the pre-build event (image attached) that the extension injects to the project addind the -r <yourremote> argument but I think the other option would be better.

image

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants