Conan: [feature] JSON output for `conan profile list`

Created on 18 Oct 2019  Â·  7Comments  Â·  Source: conan-io/conan

Right now the command conan profile list does not have a --json option. We parse the output by manually. This is error prone and could easily change in the future. This issue is about adding a --json option like all the other commands have. It should simply output the installed profiles into a JSON file.

Hacktoberfest low ux medium feature

Most helpful comment

Merged! Will be released in Conan 1.20

All 7 comments

Hi @monsdar,
Thanks for the feature request, we'll have a look at it

May I work on this issue?

I think it's almost done; but I prefer to check json schema with you, before send any PR!
The result of conan profile show mynewprofile command is as below:

Configuration for profile mynewprofile:

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=8
compiler.libcxx=libstdc++11
[options]
MyLib:shared=True
[build_requires]
*: Tool1/0.1@user/channel, Tool2/0.1@user/channel, Tool3/0.1@user/channel, Tool4/0.1@user/channel
[env]
zlib:CC=/usr/bin/clang
zlib:CXX=/usr/bin/clang++

And created file with conan profile list --json pro.json command is like this:

{
  "mynewprofile": {
    "settings": {
      "os": "Linux",
      "os_build": "Linux",
      "arch": "x86_64",
      "arch_build": "x86_64",
      "compiler": "gcc",
      "compiler.version": "8",
      "compiler.libcxx": "libstdc++11"
    },
    "options": {
      "MyLib:shared": "True"
    },
    "build_requires": [
      {
        "*": [
          "Tool1/0.1@user/channel",
          "Tool2/0.1@user/channel",
          "Tool3/0.1@user/channel",
          "Tool4/0.1@user/channel"
        ]
      }
    ],
    "env": {
      "zlib:CC": "/usr/bin/clang",
      "zlib:CXX": "/usr/bin/clang++"
    }
  }
}

Is it acceptable?

Hi @mrunderline

Thanks very much for willing to contribute! I have assigned the issue to you then.

I think that @monsdar request is to get the actual list of profiles in a json format, not the contents. Like the list of names of the profiles file names. Is that correct @monsdar ?

Correct, just a simple JSON array with the profile names would be enough
for me. It does not need to be more than what the commands prints to stdout.

James notifications@github.com schrieb am Sa., 19. Okt. 2019, 18:43:

Hi @mrunderline https://github.com/mrunderline

Thanks very much for willing to contribute! I have assigned the issue to
you then.

I think that @monsdar https://github.com/monsdar request is to get the
actual list of profiles in a json format, not the contents. Like the list
of names of the profiles file names. Is that correct @monsdar
https://github.com/monsdar ?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/conan-io/conan/issues/5937?email_source=notifications&email_token=ABAFTAEPZKNUD7LM2GMJBNLQPM2K7A5CNFSM4JCD346KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBXWDWQ#issuecomment-544170458,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABAFTABFIXY3EKMANQPYI7TQPM2K7ANCNFSM4JCD346A
.

Hi, It's done and PR sent!
Also I'll create a new PR to let people save profile detail as a json file.

Merged! Will be released in Conan 1.20

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rconde01 picture rconde01  Â·  3Comments

uilianries picture uilianries  Â·  3Comments

tonka3000 picture tonka3000  Â·  3Comments

niosHD picture niosHD  Â·  3Comments

niosHD picture niosHD  Â·  3Comments