From alan-make-cafe at engrm.com Wed Oct 12 07:45:38 2005 From: alan-make-cafe at engrm.com (Alan Gutierrez) Date: Wed, 12 Oct 2005 07:45:38 -0400 Subject: [Rant] Rant Directions In-Reply-To: <200509302056.51235.langstefan@gmx.at> References: <20050930135529.GA26809@maribor.izzy.net> <200509302056.51235.langstefan@gmx.at> Message-ID: <20051012114537.GC22181@maribor.izzy.net> * Stefan Lang [2005-09-30 14:46]: > On Friday 30 September 2005 15:55, Alan Gutierrez wrote: > > Is there a Wiki or something with a project outline? > > Currently there is only the site under http://make.ruby-co.de > The section "Getting started" has two links which point to all > available documentation for Rant. > > Perhaps this isn't enough, especially if you don't already know > Ruby. Just ask on this list if you have questions. > > Also the Rant package (gem, tar.gz or zip) contains some > examples under the doc/examples directory. Try them out and > read the buildfiles to get a feeling for Rant. By directions I meant, where the project is headed. What are your plans for Rant? What tool support are you looking for? Curious. -- Alan Gutierrez - alan at engrm.com - http://engrm.com/blogometer/ From langstefan at gmx.at Wed Oct 12 16:52:57 2005 From: langstefan at gmx.at (Stefan Lang) Date: Wed, 12 Oct 2005 22:52:57 +0200 Subject: [Rant] Rant Directions In-Reply-To: <20051012114537.GC22181@maribor.izzy.net> References: <20050930135529.GA26809@maribor.izzy.net> <200509302056.51235.langstefan@gmx.at> <20051012114537.GC22181@maribor.izzy.net> Message-ID: <200510122252.57941.langstefan@gmx.at> On Wednesday 12 October 2005 13:45, Alan Gutierrez wrote: Forbear with me, English is not my native language. > By directions I meant, where the project is headed. What are > your plans for Rant? What tool support are you looking for? The first goal is to make Rant a feature rich general purpose build tool on top of which it should be easy to provide specialized support for different programming languages/environments. Perhaps after a 1.0 release development for builtin support for different languages (similar to scons) will start. (Currently there is support for C#, but that needs rework.) Languages could be C#, Java, Haskell, OCaml, D and C/C++(hardest, but all others can interface to C and for Ruby extensions). Some short term goals: * A task that creates a file by shell command(s). The file will be rebuilt if a dependency or the command changes. Syntax could be: gen Command, "a" => sys["a.c", "b.c"] do |t| " gcc #{var :CFLAGS} -o #{t.name} {t.prerequisites} " end * General install/uninstall tasks. Kind regards, Stefan From langstefan at gmx.at Fri Oct 21 10:40:17 2005 From: langstefan at gmx.at (Stefan Lang) Date: Fri, 21 Oct 2005 16:40:17 +0200 Subject: [Rant] Subversion repository for Rant Message-ID: <200510211640.17782.langstefan@gmx.at> Since I prefer Subversion over CVS, I didn't use the CVS repository on RubyForge. A few days ago I searched for other possibilities to make my private repository publicly available and I found berliOS attractive. If you want to follow Rant development closer, you can checkout with: % svn checkout svn://svn.berlios.de/rant/trunk and later: % svn update to stay up to date. To get a specific Rant release version, e.g. 0.4.6 type: % svn checkout svn://svn.berlios.de/rant/tags/rant-0.4.6 More info and Web interface: https://developer.berlios.de/svn/?group_id=5046 Have a nice weekend! -- Stefan Lang From langstefan at gmx.at Fri Oct 21 10:43:28 2005 From: langstefan at gmx.at (Stefan Lang) Date: Fri, 21 Oct 2005 16:43:28 +0200 Subject: [Rant] Subversion repository for Rant In-Reply-To: <200510211640.17782.langstefan@gmx.at> References: <200510211640.17782.langstefan@gmx.at> Message-ID: <200510211643.28170.langstefan@gmx.at> On Friday 21 October 2005 16:40, Stefan Lang wrote: > > More info and Web interface: > https://developer.berlios.de/svn/?group_id=5046 or (HTTP instead of HTTPS): http://developer.berlios.de/svn/?group_id=5046 -- Stefan Lang From lthiry at skynet.be Fri Oct 21 17:58:04 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Fri, 21 Oct 2005 23:58:04 +0200 Subject: [Rant] Subversion repository for Rant In-Reply-To: <200510211640.17782.langstefan@gmx.at> References: <200510211640.17782.langstefan@gmx.at> Message-ID: <4359646C.3090503@skynet.be> Stefan Lang a ?crit : >Since I prefer Subversion over CVS, I didn't use the CVS repository >on RubyForge. A few days ago I searched for other possibilities >to make my private repository publicly available and I found berliOS >attractive. > >If you want to follow Rant development closer, you can checkout >with: > > % svn checkout svn://svn.berlios.de/rant/trunk > >and later: > > % svn update > >to stay up to date. > >To get a specific Rant release version, e.g. 0.4.6 type: > > % svn checkout svn://svn.berlios.de/rant/tags/rant-0.4.6 > >More info and Web interface: > https://developer.berlios.de/svn/?group_id=5046 > >Have a nice weekend! > > What a good idea! :) -- Lionel Thiry Personal web site: http://users.skynet.be/lthiry/ From langstefan at gmx.at Sat Oct 22 18:55:40 2005 From: langstefan at gmx.at (Stefan Lang) Date: Sun, 23 Oct 2005 00:55:40 +0200 Subject: [Rant] rant -n In-Reply-To: <20051022084549.GA1008@bathost> References: <20051022084549.GA1008@bathost> Message-ID: <200510230055.40960.langstefan@gmx.at> Forwarded message: On Saturday 22 October 2005 10:45, Barrie Stott wrote: > A quick question for you: do you intend to add a -n option to rant > so that a dry run can be performed? It's something make has and, > when I'm struggling a bit to find what is happening, it's often > been useful. Yes, rant will have such an option, but it can't work exactly like "make -n", since a task action can contain arbitrary Ruby code. It could look something like the following: Rantfile: task :a => "foo" do puts "built programs" end file "foo" => ["foo.c", "foo.h"] do |t| sys "gcc", "-o", t.name, t.source end Running rant with "dry run" option: % rant -n Invoking "a" Invoking "foo" ("foo.c" requires update) Executing "foo" Executing "a" Assuming "foo" was built correctly: % rant -n Invoking "a" Invoking "foo" Executing "a" A first version of this feature will probably come with one of the next two releases. If you have suggestions/ideas, let me know. Kind regards, Stefan From langstefan at gmx.at Sun Oct 30 18:04:14 2005 From: langstefan at gmx.at (Stefan Lang) Date: Mon, 31 Oct 2005 00:04:14 +0100 Subject: [Rant] Command tasks, command change recognition Message-ID: <200510310004.14765.langstefan@gmx.at> My latest development efforts have gone into the creation of a task that recognizes command changes. I would like to hear your opinions about the syntax, semantics, etc. == General usage Consider the following Rantfile for rant 0.4.6: var :CFLAGS => "-g -O2" # can be overriden from commandline file "foo" => ["foo.o", "util.o"] do |t| sys "cc -o #{t.name} #{var :CFLAGS} #{t.prerequisites.join(' ')}" end gen Rule, ".o" => ".c" do |t| sys "cc -c -o #{t.name} #{var :CFLAGS} #{t.source}" end The problem with this buildfile is, that it won't recognize a change of CFLAGS, i.e. foo.o, util.o and foo should get rebuilt whenever CFLAGS changes. With Rant 0.4.7, it is possible to do the following: import "command" var :CFLAGS => "-g -O2" # can be overriden from commandline gen Command, "foo" => ["foo.o", "util.o"] do |t| # notice: we're not calling the sys method, we # are returning a string from the block "cc -o #{t.name} #{var :CFLAGS} #{t.prerequisites.join(' ')}" end # possible since 0.4.7: if the block to Rule takes two arguments, # it is expected to return a task gen Rule, ".o" => ".c" do |target, sources| gen Command, target => sources do |t| "cc -c -o #{t.name} #{var :CFLAGS} #{t.source}" end end Now, whenever the command to build foo or a *.o file changes, it will be rebuilt. There is also a more concise syntax: import "command" var :CFLAGS => "-g -O2" # first argument (string) is the task/file name, second # argument (string, array or filelist) is a list of # prerequisites (notice: no `target => prereqs' syntax!) # third argument is a command string, which will be # executed by a subshell. gen Command, "foo", ["foo.o", "util.o"], "cc -o $(>) $[CFLAGS] $(<)" gen Rule, ".o" => ".c" do |target, sources| gen Command, target, sources, "cc -c -o $(<) $[CFLAGS] $(-)" end For the last syntax: == Interpolation of variables into command strings: === Which variables are interpolated? 1. Instance variables (mostly for internal usage), e.g.: @cc = "cc" 2. "var" variables (can be set from commandline, easy synchronization with environment variables), e.g.: var :cc => "cc" 3. Special, task specific variables "name" (symbol equivalent ">") task name "prerequisites" (symbol equivalent "<") all prerequisites seperated by spaces "source" (symbol equivalent "-") first prerequisite more task specific variables might get added later === Syntax of variable interpolation Variable names must consist only of "word characters", i.e. matching \w in Ruby regexes. 1. Plain interpolation Example command: "echo $[ARGS]" The contents of variable ARGS (either @ARGS or var[:ARGS]) are converted to a string and interpolated. If the variable contains an array, ARGS.join(' ') is interpolated. 2. Escaped interpolation Example command: "echo ${ARGS}" Like plain interpolation, but spaces will be escaped (system dependent). Consider this Rantfile: import "command" @args = ["a b", "c d", "ef"] @sh_puts = "ruby -e \"puts ARGV\"" gen Command, "foo", "$[sh_puts] ${args} > $(>)" Running rant will give on Windows: ruby -e "puts ARGV" "a b" "c d" ef > foo and on other systems: ruby -e "puts ARGV" a\ b c\ d ef > foo 3. Path interpolation Example command: "echo $(ARGS)" Like escaped interpolation, but additionally, forward slashes (as used for filenames in Rantfiles) will be replaced with backslashes on Windows. === More on semantics of variable interpolation Interpolation is recursive, except for special target variables. There is a small semantic difference between the verbose special target variables (name prerequisites source) and the symbolic ones (< > -): The symbolic ones are interpolated *after* checking if the command has changed since the last build, the verbose forms are interpolated *before*. Consider this (artifical, using the Unix tool "cat") example: Rantfile (symbolic special target vars): import "command" @src = ["src1", "src2"] @src = var[:SRC].split if var[:SRC] gen Command, "foo", @src, "cat $(<) > $(>)" % echo a > src1 % echo b > src2 % echo b > src3 % rant cat src1 src2 > foo "foo" didn't exist, so it was built anyway. Now let us change the prerequisite list: % rant "SRC=src1 src3" won't cause a rebuild of foo. Dependencies of foo changed from ["src1", "src2"] to ["src1", "src3"] but since src2 and src3 have the same content and $(<) isn't expanded for command change recognition, rant considers foo up to date. Now change Rantfile to (verbose special target vars): import "command" @src = ["src1", "src2"] @src = var[:SRC].split if var[:SRC] gen Command, "foo", @src, "cat $(prerequisites) > $(name)" Starting from scratch: % echo a > src1 % echo b > src2 % echo b > src3 % rant cat src1 src2 > foo % rant "SRC=src1 src3" cat src1 src3 > foo This time, Rant expanded $(prerequisites) for command change recognition, and since the prerequsite list changed, it caused a rebuild. You can test all that by checking out the latest & greatest with: % svn checkout svn://svn.berlios.de/rant/trunk OK, thank you for reading this damm long (too long ;) post! Please let me hear your suggestions, critics, questions... Kind regards, Stefan From langstefan at gmx.at Mon Oct 31 14:35:15 2005 From: langstefan at gmx.at (Stefan Lang) Date: Mon, 31 Oct 2005 20:35:15 +0100 Subject: [Rant] Rant 0.4.8 released Message-ID: <200510312035.15488.langstefan@gmx.at> == What's new in this release? Incompatible changes: * The filenames Rantfile.rb and rantfile.rb which were deprecated since the last release aren't recognized anymore. Use Rantfile, rantfile or root.rant instead. Deprecated: * The two undocumented Array methods ary.arglist and ary.shell_pathes are deprecated. Use sys.sp(ary) in Rantfiles instead. * rant-import -v option. Use -V or --version instead. Fixes and minor improvements: * Fix output of rant -T for descriptions with more than two lines. * Filelists: Same handling of files starting with a dot with all supported ruby versions (1.8.0 - 1.9). * The sys.ruby method uses an absolute path to start the Ruby interpreter. Thus sys.ruby also works if ruby is not on the PATH. * Fix for latest ruby 1.9, which renamed +fcall+ to +funcall+. * A fix for ruby 1.8.4 preview1 regarding sys methods visibility. New features: * rant-import supports --zip (-z) option for zip-compression now. * Tasks with command change recognition. * Improved rule support. I have also written an Rant/Rake comparison. It's available under http://make.rubyforge.org/files/doc/rant_vs_rake_rdoc.html == Installing Rant You can install Rant as a RubyGem: ? ? % gem install --remote rant or download the package from RubyForge(http://rubyforge.org/frs/?group_id=615) and install with install.rb: ? ? % ruby install.rb == Example Rantfile import "command" var :CFLAGS => "-g -O2" # can be overridden from commandline gen Command, "foo", ["foo.o", "util.o"], "cc $[CFLAGS] -o $(name) $(prerequisites)" The last two lines tell Rant, that the file foo depends on the files foo.o and util.o and that foo can be built by running the command in the last line ("cc ?") in a subshell. If at least one of the following three conditions is met, foo will be rebuilt: 1. foo doesn?t exist. 2. foo.o or util.o changed since the last build of foo. 3. The command (most probably CFLAGS) changed since the last build of foo. == Resources Homepage:: visit http://make.ruby-co.de Rubyforge page:: http://rubyforge.org/projects/make/ Repository:: http://developer.berlios.de/svn/?group_id=5046 -- Stefan From lthiry at skynet.be Mon Oct 31 19:06:01 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Tue, 01 Nov 2005 01:06:01 +0100 Subject: [Rant] Rant 0.4.8 released In-Reply-To: <200510312035.15488.langstefan@gmx.at> References: <200510312035.15488.langstefan@gmx.at> Message-ID: <4366B169.30307@skynet.be> Stefan Lang a ?crit : >== What's new in this release? > >Incompatible changes: >* The filenames Rantfile.rb and rantfile.rb which > were deprecated since the last release aren't recognized anymore. > Use Rantfile, rantfile or root.rant instead. > > What is the reason for this? A Rantfile is a ruby script after all and most Editors will need the rb extension to know the correct highlight to apply. >Deprecated: >* The two undocumented Array methods ary.arglist and > ary.shell_pathes are deprecated. Use sys.sp(ary) > in Rantfiles instead. >* rant-import -v option. Use -V or --version instead. > >Fixes and minor improvements: >* Fix output of rant -T for descriptions with more than two lines. >* Filelists: Same handling of files starting with a dot with all > supported ruby versions (1.8.0 - 1.9). >* The sys.ruby method uses an absolute path to start the Ruby > interpreter. Thus sys.ruby also works if ruby is not on the > PATH. >* Fix for latest ruby 1.9, which renamed +fcall+ to +funcall+. >* A fix for ruby 1.8.4 preview1 regarding sys methods visibility. > >New features: >* rant-import supports --zip (-z) option for zip-compression now. >* Tasks with command change recognition. >* Improved rule support. > >I have also written an Rant/Rake comparison. It's available under >http://make.rubyforge.org/files/doc/rant_vs_rake_rdoc.html > >== Installing Rant > >You can install Rant as a RubyGem: > % gem install --remote rant > >or download the package from >RubyForge(http://rubyforge.org/frs/?group_id=615) >and install with install.rb: > % ruby install.rb > >== Example Rantfile > > import "command" > > var :CFLAGS => "-g -O2" # can be overridden from commandline > > gen Command, "foo", ["foo.o", "util.o"], > "cc $[CFLAGS] -o $(name) $(prerequisites)" > > >The last two lines tell Rant, that the file foo depends on the files >foo.o and util.o and that foo can be built by running the command in >the last line ("cc ?") in a subshell. If at least one of the >following three conditions is met, foo will be rebuilt: > >1. foo doesn?t exist. >2. foo.o or util.o changed since the last build of foo. >3. The command (most probably CFLAGS) changed since the last build > of foo. > >== Resources > >Homepage:: visit http://make.ruby-co.de >Rubyforge page:: http://rubyforge.org/projects/make/ >Repository:: http://developer.berlios.de/svn/?group_id=5046 > > > Your work is impressive as usual! Thanks! :) -- Lionel Thiry Personal web site: http://users.skynet.be/lthiry/