fstiewitz / build-tools-cpp

Build your projects in atom
https://atom.io/packages/build-tools
MIT License
31 stars 6 forks source link

Cannot chain dependencies #59

Closed javidcf closed 8 years ago

javidcf commented 8 years ago

I have found that it is not possible to chain dependencies (that is, indicate command A depends on command B, command B depends on command C, and run command A). This configuration file is a typical example for a CMake project (it could be directly used in any other CMake project just changing the paths):

providers: [
  {
    key: "bt"
    config:
      commands: [
        {
          project: "/home/jdehesa/Documents/project/midiendpoints"
          source: "/home/jdehesa/Documents/project/midiendpoints/.build-tools.cson"
          name: "Make"
          command: "make"
          wd: "./build"
          env: {}
          modifier:
            dependency:
              list: [
                [
                  "0"
                  "1"
                  "CMake"
                ]
              ]
              abort: true
          stdout:
            pty: false
            highlighting: "nh"
            ansi_option: "ignore"
          stderr:
            highlighting: "nh"
            ansi_option: "ignore"
          output:
            console:
              close_success: true
              queue_in_buffer: true
              stdin: false
            file:
              path: "./build/build.log"
              queue_in_file: true
          version: 1
        }
        {
          project: "/home/jdehesa/Documents/project/midiendpoints"
          source: "/home/jdehesa/Documents/project/midiendpoints/.build-tools.cson"
          name: "CMake"
          command: "cmake .."
          wd: "./build"
          env: {}
          modifier:
            dependency:
              list: [
                [
                  "0"
                  "2"
                  "Create build directory"
                ]
              ]
              abort: true
          stdout:
            pty: false
            highlighting: "nh"
            ansi_option: "ignore"
          stderr:
            highlighting: "nh"
            ansi_option: "ignore"
          output:
            console:
              close_success: true
              queue_in_buffer: true
              stdin: false
            file:
              path: "./build/build.log"
              queue_in_file: true
          version: 1
        }
        {
          project: "/home/jdehesa/Documents/project/midiendpoints"
          source: "/home/jdehesa/Documents/project/midiendpoints/.build-tools.cson"
          name: "Create build directory"
          command: "mkdir -p ./build"
          wd: "."
          env: {}
          modifier: {}
          stdout:
            pty: false
            highlighting: "nh"
            ansi_option: "ignore"
          stderr:
            highlighting: "nh"
            ansi_option: "ignore"
          output: {}
          version: 1
        }
        {
          project: "/home/jdehesa/Documents/project/midiendpoints"
          source: "/home/jdehesa/Documents/project/midiendpoints/.build-tools.cson"
          name: "Clean"
          command: "rm -rf ./build"
          wd: "."
          env: {}
          modifier: {}
          stdout:
            pty: false
            highlighting: "nh"
            ansi_option: "ignore"
          stderr:
            highlighting: "nh"
            ansi_option: "ignore"
          output: {}
          version: 1
        }
      ]
  }
]

Which are the commands:

./ $ mkdir -p ./build
./build $ cmake ..
./build $ make

And, eventually, to clean:

./ $ rm -rf build

If I try to run make directly, I get the following error message:

Error in "dependency" module: Cannot read property 'getCommandById' of undefined
fstiewitz commented 8 years ago

Thanks for reporting the bug.