summaryrefslogtreecommitdiff
path: root/cpp/rubygen/generate
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-08-01 16:50:33 +0000
committerAlan Conway <aconway@apache.org>2007-08-01 16:50:33 +0000
commit28b22a308cb6cf0232067636fb6676a4c96d82f7 (patch)
tree1f5b4cd32c425ffda3a7295dd47f0aaba3c0ce25 /cpp/rubygen/generate
parent9235b5d09b3273c7c495ff266e18781fad363a9b (diff)
downloadqpid-python-28b22a308cb6cf0232067636fb6676a4c96d82f7.tar.gz
* src/generate.sh: Moved requirements test to configure.ac
* rubygen: Cleanup and improvements, template for cluster work. * configure.ac: - support for ruby code generator + cleanup. - moved "can generate" tests to configure.ac - removed redundant APR stuff. * bootstrap: Remove codegen from bootstrap, all in config/make. * src/Makefile.am (libqpidcommon_la_LIBADD): - Ruby code generator. - Improvements to existing generator rules. - Removed APR stuff. * configure.ac (CPPUNIT_CXXFLAGS): Removed APR stuff. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@561869 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/rubygen/generate')
-rwxr-xr-xcpp/rubygen/generate23
1 files changed, 23 insertions, 0 deletions
diff --git a/cpp/rubygen/generate b/cpp/rubygen/generate
new file mode 100755
index 0000000000..09b27211af
--- /dev/null
+++ b/cpp/rubygen/generate
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+require 'amqpgen'
+
+#
+# Run a set of code generation templates.
+#
+
+if ARGV.size < 3
+ puts <<EOS
+Usage: #{ARGV[0]} OUTDIR SPEC.xml [ ... ] TEMPLATE.rb [ ... ]
+Parse all SPEC.xml files to create an AMQP model, run each TEMPLATE
+putting the resulting files under OUTDIR. Prints a list of files
+generated to standard output.
+
+If OUTDIR is '-' then just prints file list without generating files.
+EOS
+ exit 1
+end
+outdir=ARGV[0]
+specs=ARGV.grep(/\.xml$/)
+templates=ARGV.grep(/\.rb$/)
+Amqp=AmqpRoot.new(*specs)
+templates.each { |t| require t }