craftr-build / craftr-build-4.x

Frontend for the Craftr build framework.
https://craftr-build.github.io/craftr/
Other
60 stars 14 forks source link

Add command to list up available options for a module #166

Closed NiklasRosenstein closed 7 years ago

NiklasRosenstein commented 7 years ago

It's cumbersome to look into a module's manifest.json just for the options. One of the advantages of actally having a manifest is that we don't need to execute the module to obtain things like its name, version, dependencies and options.

NiklasRosenstein commented 7 years ago

Current state:

$ craftr options -m craftr.lib.sdl2 -d

craftr.lib.sdl2 (v1.0.0)
------------------------

Options:

  build_tests                                          (False) bool, inheritable

    Enable to build test programs. Can only be used when source code is
    available with the "directory" or "url" options.

  directory                                               ('') path, inheritable

    Directory pointing to the SDL2 source code. Takes preference over the
    "url" and "version" options.

  enable_audio                                          (True) bool, inheritable

  enable_filesystem                                     (True) bool, inheritable

  enable_haptic                                         (True) bool, inheritable

  enable_joystick                                       (True) bool, inheritable

  enable_loadso                                         (True) bool, inheritable

  enable_power                                          (True) bool, inheritable

  enable_thread                                         (True) bool, inheritable

  enable_timers                                         (True) bool, inheritable

  enable_video                                          (True) bool, inheritable

  no_stdio_redirect                                     (True) bool, inheritable

  static                                                (True) bool, inheritable

    Build a static version of the library or obtain flags for static
    linking from pkg-config.

  url                                                        string, inheritable
    ('https://www.libsdl.org/release/SDL2-${VERSION}.tar.gz')

    URL to obtain the source code from.

  version                                          ('2.0.5') string, inheritable

    Version of the source code to obtain.

  video_opengl                                          (True) bool, inheritable

  video_opengles                                       (False) bool, inheritable
NiklasRosenstein commented 7 years ago

The -d option gives additional details. The -r can be used to list options recursively (thus also showing options of dependencies).

$ craftr options -m craftr.lib.sdl2 -r

craftr.lib.sdl2 (v1.0.0)
  build_tests                                          (False) bool, inheritable
  directory                                               ('') path, inheritable
  enable_audio                                          (True) bool, inheritable
  enable_filesystem                                     (True) bool, inheritable
  enable_haptic                                         (True) bool, inheritable
  enable_joystick                                       (True) bool, inheritable
  enable_loadso                                         (True) bool, inheritable
  enable_power                                          (True) bool, inheritable
  enable_thread                                         (True) bool, inheritable
  enable_timers                                         (True) bool, inheritable
  enable_video                                          (True) bool, inheritable
  no_stdio_redirect                                     (True) bool, inheritable
  static                                                (True) bool, inheritable
  url                                                        string, inheritable
    ('https://www.libsdl.org/release/SDL2-${VERSION}.tar.gz')
  version                                          ('2.0.5') string, inheritable
  video_opengl                                          (True) bool, inheritable
  video_opengles                                       (False) bool, inheritable

craftr.lang.cxx (v1.0.0)
  toolkit                                               ('') string, inheritable

craftr.lang.cxx.msvc (v1.0.0)
  debug                                                (False) bool, inheritable
  embedd_debug_symbols                                  (True) bool, inheritable
  rtti                                                  (True) bool, inheritable
  target                                                ('') string, inheritable
  toolkit                                               ('') string, inheritable

craftr.lang.cxx.common (v1.0.0)
  ar                                                    ('') string, inheritable
  as                                                    ('') string, inheritable
  c                                                     ('') string, inheritable
  cpp                                                   ('') string, inheritable
  cpp_stdlib                                            ('') string, inheritable
  crossfile                                             ('') string, inheritable
  debug                                                (False) bool, inheritable
  rtti                                                  (True) bool, inheritable
  toolkit                                               ('') string, inheritable
NiklasRosenstein commented 7 years ago

While I'm working on it, I'll also add a deptree command.

niklas@DESKTOP-RQTQ13S MINGW64 ~/repos/craftr/examples/examples.c (development)
$ craftr deptree

examples.c (v1.0.0)
  craftr.lang.cxx (v1.0.0)
    craftr.lang.cxx.common (v1.0.0)
    craftr.lang.cxx.msvc (v1.0.0)
winksaville commented 7 years ago

Nice!

On Sun, Dec 18, 2016, 10:45 AM Niklas Rosenstein notifications@github.com wrote:

While I'm working on it, I'll also add a deptree command.

niklas@DESKTOP-RQTQ13S MINGW64 ~/repos/craftr/examples/examples.c (development) $ craftr deptree

examples.c (v1.0.0) craftr.lang.cxx (v1.0.0) craftr.lang.cxx.common (v1.0.0) craftr.lang.cxx.msvc (v1.0.0)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/craftr-build/craftr/issues/166#issuecomment-267838421, or mute the thread https://github.com/notifications/unsubscribe-auth/AA-hHEVoFJjFSwAs4KUg8dyug85F-LxPks5rJX9UgaJpZM4LQMsY .