Sha256: 866a3a1aae8f6560328ade3c5a0f6f1c366ae9ec565e5e503c4a3a140b56a890

Contents?: true

Size: 742 Bytes

Versions: 7

Compression:

Stored size: 742 Bytes

Contents

#!/usr/bin/env nake
# encoding: utf-8

# load "contributors.nake"

Task.new(:generate) do |task|
  task.description = "Generate lib/amq/protocol/client.rb"
  task.define do |opts, spec = nil|
    if spec.nil?
      spec = "vendor/rabbitmq-codegen/amqp-rabbitmq-0.9.1.json"
      unless File.exist?(spec)
        sh "git submodule update --init"
      end
    end
    
    targets = %w{client} # add "server" to generate server code
    targets.each do |type|
      path = "lib/amq/protocol/#{type}.rb"
      sh "./codegen.py #{type} #{spec} #{path}"
      if File.file?(path)
        sh "./post-processing.rb #{path}"
        sh "ruby -c #{path}"
      end
    end
  end
end

Task.tasks.default = Task[:generate] # FIXME: it doesn't work now

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
amq-protocol-0.7.0.alpha6 tasks.rb
amq-protocol-0.7.0.alpha5 tasks.rb
amq-protocol-0.7.0.alpha4 tasks.rb
amq-protocol-0.7.0.alpha2 tasks.rb
amq-protocol-0.7.0.alpha1 tasks.rb
amq-protocol-0.6.0.pre tasks.rb
amq-protocol-0.5.0 tasks.rb