From xavier.shay at advatel.com.au Tue Sep 5 01:49:06 2006 From: xavier.shay at advatel.com.au (Xavier Shay) Date: Tue, 5 Sep 2006 15:49:06 +1000 Subject: [Rant] Non-deprecated C# compiling Message-ID: > The C# plugin is marked as deprecated. > http://make.rubyforge.org/files/doc/csharp_rdoc.html > > Is there are non-deprecated way of compiling with c#, and if > so is there any documentation for it? I can't seem to locate > any thing. Forgive the bump, but I suspect someone does have an answer to this. It was marked deprecated by someone... Even a yes/no response would suffice > Why I'm asking: I've added some changes to the C Sharp plugin > to support some 2.0 things (like the /keyfile parameter). Is > it worth reworking it into separate 1.1/2.0 compiler support > and putting these into a patch? > > Xavier From langstefan at gmx.at Tue Sep 5 17:07:58 2006 From: langstefan at gmx.at (Stefan Lang) Date: Tue, 5 Sep 2006 23:07:58 +0200 Subject: [Rant] Non-deprecated C# compiling In-Reply-To: References: Message-ID: <200609052307.58987.langstefan@gmx.at> On Tuesday 05 September 2006 07:49, Xavier Shay wrote: > > The C# plugin is marked as deprecated. > > http://make.rubyforge.org/files/doc/csharp_rdoc.html > > > > Is there are non-deprecated way of compiling with c#, and if > > so is there any documentation for it? I can't seem to locate > > any thing. > > Forgive the bump, but I suspect someone does have an answer to > this. It was marked deprecated by someone... > Even a yes/no response would suffice There is no other way. But I won't remove support for it until there is a replacement. > > Why I'm asking: I've added some changes to the C Sharp plugin > > to support some 2.0 things (like the /keyfile parameter). Is > > it worth reworking it into separate 1.1/2.0 compiler support > > and putting these into a patch? If you provide a patch, I'll incorporate it. -- Stefan From xavier.shay at advatel.com.au Tue Sep 5 18:26:03 2006 From: xavier.shay at advatel.com.au (Xavier Shay) Date: Wed, 6 Sep 2006 08:26:03 +1000 Subject: [Rant] Non-deprecated C# compiling Message-ID: > > > The C# plugin is marked as deprecated. > > > http://make.rubyforge.org/files/doc/csharp_rdoc.html > > > > > > Is there are non-deprecated way of compiling with c#, and > if so is > > > there any documentation for it? I can't seem to locate any thing. > > > > Forgive the bump, but I suspect someone does have an answer > to this. > > It was marked deprecated by someone... > > Even a yes/no response would suffice > > There is no other way. But I won't remove support for it > until there is a replacement. Is the architecture in place to build a "proper" solution and it just hasn't been done? If not what would we like to be done. Throw me some bones, I might be able to have a chew. Xavier From russel at russel.org.uk Sat Sep 9 12:37:27 2006 From: russel at russel.org.uk (Russel Winder) Date: Sat, 09 Sep 2006 17:37:27 +0100 Subject: [Rant] Building C++ code Message-ID: <1157819847.10354.42.camel@balin.russel.org.uk> I am trying to create a Rant build system for a standard Autotools C++ project of mine (using GTK+/GTKmm/etc.) Am I missing something obvious or is it really the case that I have to specify Make-style suffix rules to handle the compilation? I would have thought one of the primary benefits of using a programming language as a base was to be able to use builders and get away of the whole Make-style thing. SCons certainly goes this route with build specifications looking like: environment.Program ( 'gfontbrowser' , glob.glob ( '*.cpp' ) ) OK so all the Autotools stuff adds lots of complexity above this but this one line is the core specification. Using Rake, it looks like I am looking to synthesize a whole collection of file dependencies -- way too low-level, especially for portability across build platforms. I had been hoping Rant was going to give me more that Rake but I am now worried it is giving me less. The emphasis appears to be on suffix rules rather than rule synthesis and anyway I was hoping that there would be builders to separate out the actual command line so as the engender portability in some Ruby-like way that SCons has done in a Python-like way. Hopefully, I have got the wrong impression from the Rant documentation and someone out there doing things with Rant and C++ can put me on the right track. Thanks. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060909/081eea51/attachment.bin From langstefan at gmx.at Sat Sep 9 15:56:22 2006 From: langstefan at gmx.at (Stefan Lang) Date: Sat, 9 Sep 2006 21:56:22 +0200 Subject: [Rant] Building C++ code In-Reply-To: <1157819847.10354.42.camel@balin.russel.org.uk> References: <1157819847.10354.42.camel@balin.russel.org.uk> Message-ID: <200609092156.22228.langstefan@gmx.at> On Saturday 09 September 2006 18:37, Russel Winder wrote: [...] > I had been hoping Rant was going to give me more that Rake but I am > now worried it is giving me less. The emphasis appears to be on > suffix rules rather than rule synthesis and anyway I was hoping > that there would be builders to separate out the actual command > line so as the engender portability in some Ruby-like way that > SCons has done in a Python-like way. SCons provides highler level constructs for C/C++ builds than Rant. Since I don't know how complex your builds are, I can't give a definite answer, but the Command and C::Dependencies generators probably provide most of what you need. It shouldn't be hard to define a method, say "program , " that calls "gen Command" once for the overall target and once for each object file to generate (unless a task for the object file already exists). -- Stefan From langstefan at gmx.at Sat Sep 9 16:27:42 2006 From: langstefan at gmx.at (Stefan Lang) Date: Sat, 9 Sep 2006 22:27:42 +0200 Subject: [Rant] Non-deprecated C# compiling In-Reply-To: References: Message-ID: <200609092227.42603.langstefan@gmx.at> On Wednesday 06 September 2006 00:26, Xavier Shay wrote: [...] > > > It was marked deprecated by someone... > > > Even a yes/no response would suffice > > > > There is no other way. But I won't remove support for it > > until there is a replacement. > > Is the architecture in place to build a "proper" solution and it > just hasn't been done? > If not what would we like to be done. Throw me some bones, I might > be able to have a chew. Unfortunately, the orignial architecture was basically Rake without global state (a very simple architecture). The C# support grew in this setting. Then Rant's core evolved but the C# support didn't change. One result of this is that when you do "import 'md5'", all rebuilds are calculated based on md5 checksums instead of timestamps, *except* for the C# related tasks (which are implemented too low level). Sometime last winter I decided to rewrite Rant's core which was intended to result in a better design with a supported extension API and generally a more modular API. Sadly, this effort drifted off for lack of time and motivation :( Also read http://rubyforge.org/pipermail/make-cafe/2006-August/000086.html To answer your question: You can build better C# support by means of defining new generators. Reading http://rubyforge.org/pipermail/make-cafe/2005-December/000051.html and the existing C# support code (lib/rant/plugin/csharp.rb and lib/rant/cs_compiler.rb) might help you to get started. If you are interested we can transfer the svn repository to RubyForge and I add you as developer on the RubyForge project. -- Stefan From russel at russel.org.uk Sun Sep 10 02:56:36 2006 From: russel at russel.org.uk (Russel Winder) Date: Sun, 10 Sep 2006 07:56:36 +0100 Subject: [Rant] Building C++ code In-Reply-To: <200609092156.22228.langstefan@gmx.at> References: <1157819847.10354.42.camel@balin.russel.org.uk> <200609092156.22228.langstefan@gmx.at> Message-ID: <1157871396.10354.89.camel@balin.russel.org.uk> On Sat, 2006-09-09 at 21:56 +0200, Stefan Lang wrote: > SCons provides highler level constructs for C/C++ builds than > Rant. Since I don't know how complex your builds are, I can't > give a definite answer, but the Command and C::Dependencies > generators probably provide most of what you need. > > It shouldn't be hard to define a method, say > "program , " that calls "gen Command" once > for the overall target and once for each object file to > generate (unless a task for the object file already exists). For me this raises many questions, I hope you don't mind me raising a few of them here. SCons has not really tackled the `Autotools replacement' problem properly and so remains a `Make replacement'. I believe a number of people have tried to extend / replace the current Autotools-like bits of SCons but the developers of SCons have always rejected the material. Hence Waf and various bits of good stuff scattered around the Web that are not in SCons. I think though that Ruby is an even better language than Python for describing the sorts of things. Rake is a breath of fresh air compared to Make but it is just a `Make replacement'. The only tools in Rake are Ruby system development tools and there is no community associated with it that is separate from the core inner-sanctum Ruby community. It struck me initially that Rant (this one not the other one) could aim to be an `Autotools replacement' rather than just another `Make replacement' -- after all what is the point of having both Rake and Rant if they are fundamentally the same in terms of functionality to the user. Waf has many good ideas, as does SCons that could be used to create a superb Ruby based build tool. The core question is whether the Rant project (this one not the other one, which seems to be a `dead project') wants to remain a relatively obscure `toy' project or whether it wants to turn into a serious multi-person project with fame and glory as the goal. Both of these are equally valid, there is no right or wrong here. For me, SCons and Rake are the current Python and Ruby main offerings in the build system arena, both have good and bad sides to them. Rant (this one not the other one) and Waf can/should try to be different. Waf is certainly trying this and is creating a separate identity. The problem for both Waf and Rant at the moment seems to be that they are single person projects that are very early in their evolution. (Waf also has some unfortunate political baggage which is not helping it, sadly.) Currently I am using SCons, Rake, Waf and CMake for various projects to do a personal compare and contrast and have chipped in on the various email lists. Is it worth me doing the same for Rant? Is there sufficient difference between Rant and Rake to make it worthwhile having two (three currently) projects at all? Whatever happened to the other Rant project? Does it have anything useful or was it just a cyber-squat. If the former is there a route where the two Rant projects can merge and gain energy and momentum? If the latter then the Rubyforge management should declare it a dead project and reassign the label to this Rant so that it can realign all the naming to Rant and avoid the term Make. I have asked some of these questions before in previous emails but then everything went quiet. Hence this way of responding as I think `Rant the Project' really has to have a definitive statement of its goals and future process. Thanks. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060910/69bb7b0f/attachment.bin From xavier.shay at advatel.com.au Mon Sep 11 00:11:15 2006 From: xavier.shay at advatel.com.au (Xavier Shay) Date: Mon, 11 Sep 2006 14:11:15 +1000 Subject: [Rant] Non-deprecated C# compiling Message-ID: > Reading > http://rubyforge.org/pipermail/make-cafe/2005-December/000051.html Thanks heaps. If you have a chance, could you run your eyes over the following snippet to make sure I'm on the right track. Obviously there's no error checking or anything like that, I'm more curious about the Generator architecture: #START # import/csharp.rb module Rant class Rant::Generators::CSharp def self.rant_gen(rant, ch, args, &block) target = args.shift cs_args = args.shift rant.file target => cs_args[:sources] do |t| cmd = "csc /nologo" cmd += " #{cs_args[:sources].arglist}" cmd += " /keyfile:#{cs_args[:keyfile]}" if cs_args[:keyfile] rant.context.sys.sh cmd end end End # Rantfile import 'csharp' gen CSharp, "app.exe", :sources => sys["**/*.cs"] #END Questions: 1) Is it possible to capture the output of sys.sh (so it isn't displayed on screen)? 2) Can I add a normal task dependency to a file task, rather than a file dependency? 3) For selecting a compiler, rather than a config solution, would it be an idea to allow the user to set an environment variable? > If you are interested we can transfer the svn repository to > RubyForge and I add you as developer on the RubyForge project. Not sure how much progress I'll make, but sounds like a good idea Cheers, Xavier From langstefan at gmx.at Tue Sep 19 17:38:34 2006 From: langstefan at gmx.at (Stefan Lang) Date: Tue, 19 Sep 2006 23:38:34 +0200 Subject: [Rant] Subversion repository on RubyForge now Message-ID: <200609192338.35032.langstefan@gmx.at> Hi all! The subversion repository is hosted on RubyForge now. Look here: http://rubyforge.org/scm/?group_id=615 The repository at BerliOS still exists, but won't be updated anymore. I'll remove the BerliOS project soon. -- Stefan From xavier.shay at advatel.com.au Tue Sep 19 19:43:49 2006 From: xavier.shay at advatel.com.au (Xavier Shay) Date: Wed, 20 Sep 2006 09:43:49 +1000 Subject: [Rant] Lazy parameter evaluation in Generators Message-ID: Given the following hypothetical generator: sources = ["source1.cs"] gen CompileTask, "build", :sources => sources sources << "source2.cs" What should an execution of "rant build" do? 1) Build just source1.cs 2) Build source1.cs and source2.cs 3) Something different ... ? There is no right answer, I'm just curious as to what the intuitive behaviour is for people. #2 is the most flexible, but could it allow you to shoot yourself in the foot? Xavier From russel at russel.org.uk Wed Sep 20 02:22:48 2006 From: russel at russel.org.uk (Russel Winder) Date: Wed, 20 Sep 2006 07:22:48 +0100 Subject: [Rant] Subversion repository on RubyForge now In-Reply-To: <200609192338.35032.langstefan@gmx.at> References: <200609192338.35032.langstefan@gmx.at> Message-ID: <1158733369.7663.110.camel@balin.russel.org.uk> On Tue, 2006-09-19 at 23:38 +0200, Stefan Lang wrote: > Hi all! > > The subversion repository is hosted on RubyForge now. > Look here: http://rubyforge.org/scm/?group_id=615 I am intending to work with Subversion HEAD as I am going to create a LaTeX compile generator and a C++ compile/link generator, including various bits of Autotools-like bits and pieces -- Waf has all these things already and SCons has most of them (I am ignoring Rake as no-one associated with Rake development will answer any of my emails). I think the Rant installation instructions need to be expanded a little. I don't use RubyGems as I want all code installed in /usr/bin to be under Ubuntu package management. I had assume that I could do something like: ruby install.rb --prefix=$HOME/build to put the rant installation in my `from Subversion HEAD' area, but I don't think that is going to work. I checked the code and the Rantfile seems to have code to direct setup.rb correctly. It seems though that the install.rb doesn't allow for this. On spec I thought I would try: rant -n -v install on the grounds I have 0.5.6 installed via the Debian package and this is what install.rb appears to do, but that just says: rant: source /home/share/Software/Checkouts/rant/trunk/Rantfile Executing "install" - Ruby Proc at Rantfile:201 So clearly I am missing something very simple. Any help greatly appreciated. Thanks. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060920/4f1a29a6/attachment.bin From xavier-list at noreality.net Wed Sep 20 05:11:57 2006 From: xavier-list at noreality.net (Xavier Shay) Date: Wed, 20 Sep 2006 19:11:57 +1000 Subject: [Rant] Subversion repository on RubyForge now In-Reply-To: <1158733369.7663.110.camel@balin.russel.org.uk> References: <200609192338.35032.langstefan@gmx.at> <1158733369.7663.110.camel@balin.russel.org.uk> Message-ID: <451105DD.6080608@noreality.net> Hi Russel, I agree the installation could be improved a little. In the mean time, you can run svn rant without having to install it. Have a look at the "run_rant" script in the root directory of trunk. Cheers, Xavier Russel Winder wrote: > On Tue, 2006-09-19 at 23:38 +0200, Stefan Lang wrote: >> Hi all! >> >> The subversion repository is hosted on RubyForge now. >> Look here: http://rubyforge.org/scm/?group_id=615 > > I am intending to work with Subversion HEAD as I am going to create a > LaTeX compile generator and a C++ compile/link generator, including > various bits of Autotools-like bits and pieces -- Waf has all these > things already and SCons has most of them (I am ignoring Rake as no-one > associated with Rake development will answer any of my emails). > > I think the Rant installation instructions need to be expanded a little. > I don't use RubyGems as I want all code installed in /usr/bin to be > under Ubuntu package management. I had assume that I could do something > like: > > ruby install.rb --prefix=$HOME/build > > to put the rant installation in my `from Subversion HEAD' area, but I > don't think that is going to work. I checked the code and the Rantfile > seems to have code to direct setup.rb correctly. It seems though that > the install.rb doesn't allow for this. On spec I thought I would try: > > rant -n -v install > > on the grounds I have 0.5.6 installed via the Debian package and this is > what install.rb appears to do, but that just says: > > rant: source /home/share/Software/Checkouts/rant/trunk/Rantfile > Executing "install" > - Ruby Proc at Rantfile:201 > > So clearly I am missing something very simple. > > Any help greatly appreciated. Thanks. > > > ------------------------------------------------------------------------ > > _______________________________________________ > make-cafe mailing list > make-cafe at rubyforge.org > http://rubyforge.org/mailman/listinfo/make-cafe From russel at russel.org.uk Wed Sep 20 06:59:43 2006 From: russel at russel.org.uk (Russel Winder) Date: Wed, 20 Sep 2006 11:59:43 +0100 Subject: [Rant] Subversion repository on RubyForge now In-Reply-To: <451105DD.6080608@noreality.net> References: <200609192338.35032.langstefan@gmx.at> <1158733369.7663.110.camel@balin.russel.org.uk> <451105DD.6080608@noreality.net> Message-ID: <1158749984.7663.248.camel@balin.russel.org.uk> Xavier, On Wed, 2006-09-20 at 19:11 +1000, Xavier Shay wrote: > Hi Russel, > I agree the installation could be improved a little. In the mean time, > you can run svn rant without having to install it. Have a look at the > "run_rant" script in the root directory of trunk. Thanks for this hint -- though I should have worked it out for myself from the name and content ;-) Is it guaranteed that the require search path is set up so that the versions in the subversion checkout are used even if there is another Rant installed? Making an alias of rant to $INSTALL/run_rant actually neatly solves all the problems and no install required :-) -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060920/59e8c748/attachment.bin From russel at russel.org.uk Wed Sep 20 07:02:27 2006 From: russel at russel.org.uk (Russel Winder) Date: Wed, 20 Sep 2006 12:02:27 +0100 Subject: [Rant] Subversion repository on RubyForge now In-Reply-To: <1158749984.7663.248.camel@balin.russel.org.uk> References: <200609192338.35032.langstefan@gmx.at> <1158733369.7663.110.camel@balin.russel.org.uk> <451105DD.6080608@noreality.net> <1158749984.7663.248.camel@balin.russel.org.uk> Message-ID: <1158750147.7663.251.camel@balin.russel.org.uk> It would help portability if the #! line in all the scripts was: #! /usr/bin/env ruby Since not everyone installs things in the same place. Index: run_rant =================================================================== --- run_rant (revision 258) +++ run_rant (working copy) @@ -1,4 +1,4 @@ -#!/usr/local/bin/ruby +#!/usr/bin/env ruby # Run rant in current development directory. $:.unshift File.expand_path(File.join(File.dirname(__FILE__), "lib")) 517 balin:~/Checkouts/rant/trunk -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060920/78946845/attachment.bin From russel at russel.org.uk Wed Sep 20 07:10:31 2006 From: russel at russel.org.uk (Russel Winder) Date: Wed, 20 Sep 2006 12:10:31 +0100 Subject: [Rant] Subversion repository on RubyForge now In-Reply-To: <1158749984.7663.248.camel@balin.russel.org.uk> References: <200609192338.35032.langstefan@gmx.at> <1158733369.7663.110.camel@balin.russel.org.uk> <451105DD.6080608@noreality.net> <1158749984.7663.248.camel@balin.russel.org.uk> Message-ID: <1158750631.7663.254.camel@balin.russel.org.uk> On Wed, 2006-09-20 at 11:59 +0100, Russel Winder wrote: > Is it guaranteed that the require search path is set up so that the > versions in the subversion checkout are used even if there is another > Rant installed? > > Making an alias of rant to $INSTALL/run_rant actually neatly solves all > the problems and no install required :-) Note for the unwary: Creating a symbolic link from ~/bin/rant to the subversion checkout of run_rant does not work if there is an installation of Rant. It really does have to be an alias. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060920/b51e763b/attachment.bin From russel at russel.org.uk Wed Sep 20 10:57:05 2006 From: russel at russel.org.uk (Russel Winder) Date: Wed, 20 Sep 2006 15:57:05 +0100 Subject: [Rant] Guide to writing generators? Message-ID: <1158764225.7663.295.camel@balin.russel.org.uk> Does anyone have any material / advice on writing generators. I have a module that provides the methods needed to do LaTeX compilation but I suspect the Rant idiom is to make this into a generator. Also, I now need to add something like the C/C++ #include dependency generation to handle file inclusion in LaTeX source. Is it really necessary to write a file and include it to do dependency construction? Thanks. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060920/993a6b37/attachment.bin From xavier.shay at advatel.com.au Wed Sep 20 18:28:47 2006 From: xavier.shay at advatel.com.au (Xavier Shay) Date: Thu, 21 Sep 2006 08:28:47 +1000 Subject: [Rant] Guide to writing generators? Message-ID: > Does anyone have any material / advice on writing generators. I found the following post quite helpful: http://rubyforge.org/pipermail/make-cafe/2005-December/000051.html Also, I will be commiting some csharp generators in the next view days once I've tested them properly, so keep an eye out for those. Here's a crippled example (needs other files to work) for now, should give you an idea... class Rant::Generators::CSharp def self.rant_gen(rant, ch, args, &block) target = args.shift cs_args = args.shift # Massage argument hash dependencies = cs_args[:sources] dependencies += cs_args[:resources] if cs_args[:resources] dependencies += cs_args[:libs] if cs_args[:libs] # Create a file target to the output file, # depend on all source files, resources, # and libs rant.file target => dependencies do |t| if cs_args[:compiler] compiler = cs_args[:compiler] cs_args.delete(:compiler) else compiler = Compiler.new end cmd = compiler.cmd(target, cs_args) rant.context.sys.sh cmd end end end # Usage import "csharp" gen Csharp, "outfile.exe", :sources = sys["**/*.cs"] > I have a module that provides the methods needed to do LaTeX > compilation but I suspect the Rant idiom is to make this into > a generator. I believe so too Also, I now need to add something like the > C/C++ #include dependency generation to handle file inclusion > in LaTeX source. Is it really necessary to write a file and > include it to do dependency construction? Can't help you there, hopefully Stefan can shed some light. Xavier From xavier.shay at advatel.com.au Thu Sep 21 18:39:50 2006 From: xavier.shay at advatel.com.au (Xavier Shay) Date: Fri, 22 Sep 2006 08:39:50 +1000 Subject: [Rant] C# Generators now in trunk Message-ID: Proper doco coming soon! For now, peruse the following example: # Start gen Resgen, :namespace => "Example", :build_dir => "build" gen CSharp, 'build/example.dll', :sources => sys["**/*.cs"], :keyfile => 'ExampleKeyFile.snk', :warnaserror => true, :resources => ["build/Example.ResourceA.resources", "build/Example.ResourceB.resources"], :libs => ["lib/depa.dll", "lib/depb.dll"] # End The resgen generator creates appropriate rules to build "build/Example.ResourceA.resources" from "ResourceA.resx". Also works correctly with resources in subdirs. Csharp should be fairly self-explanatory, uses what ever compiler is in your path (csc, msc, gmcs). You can specify your own compiler: var :csc11_compiler => ::Rant::CSharp::CscCompiler.new('csc11 /nologo') gen CSharp, outfile, :sources => sys["**/*.cs"], :compiler => var[:csc11_compiler] Russel, if you check the source (lib/rant/import/csharp.rb) you'll get a fairly good example of how to write generators which is hopefully of use to you with your LaTex stuff. Xavier From russel at russel.org.uk Fri Sep 22 08:12:53 2006 From: russel at russel.org.uk (Russel Winder) Date: Fri, 22 Sep 2006 13:12:53 +0100 Subject: [Rant] Guide to writing generators? In-Reply-To: References: Message-ID: <1158927173.32708.71.camel@balin.russel.org.uk> Using the 'walk before run' idiom, I create a Generator for doing install and uninstall rules for use in a project. usage like: gen Install , PixmapsDirectory , Name + '.png' gen Install , PkgDataDirectory , [ Name + '.glade' , 'about_logo.png' ] (yes it is a C++/GTKmm application.) Is there a way of contributing these sorts of thing into a review / commit process? -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060922/6f06896e/attachment-0001.bin From russel at russel.org.uk Fri Sep 22 13:19:05 2006 From: russel at russel.org.uk (Russel Winder) Date: Fri, 22 Sep 2006 18:19:05 +0100 Subject: [Rant] Dir[...] vs. sys[...] Message-ID: <1158945545.32708.118.camel@balin.russel.org.uk> Does anyone have a quick answer to the trade-offs of using: Bits = sys[ 'bibliographies/*.bib' ] + sys[ 'sections/*.ltx' ] rather than: Bits = Dir[ 'bibliographies/*.bib' ] + Dir[ 'sections/*.ltx' ] in Rantfiles? Thanks. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060922/6d4ada07/attachment.bin From russel at russel.org.uk Fri Sep 22 13:21:49 2006 From: russel at russel.org.uk (Russel Winder) Date: Fri, 22 Sep 2006 18:21:49 +0100 Subject: [Rant] Import vs Require Message-ID: <1158945710.32708.121.camel@balin.russel.org.uk> Is there a set of guidelines for when bits of Rant should be in $RUBYLIB/rant and required vs in $RUBYLIB/rant/import and imported? Thanks. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060922/ffd5a228/attachment.bin From langstefan at gmx.at Fri Sep 22 17:17:33 2006 From: langstefan at gmx.at (Stefan Lang) Date: Fri, 22 Sep 2006 23:17:33 +0200 Subject: [Rant] Dir[...] vs. sys[...] In-Reply-To: <1158945545.32708.118.camel@balin.russel.org.uk> References: <1158945545.32708.118.camel@balin.russel.org.uk> Message-ID: <200609222317.33791.langstefan@gmx.at> On Friday 22 September 2006 19:19, Russel Winder wrote: > Does anyone have a quick answer to the trade-offs of using: > > Bits = sys[ 'bibliographies/*.bib' ] + sys[ 'sections/*.ltx' ] sys[] creates a FileList, the patterns are expanded on demand. You can shorten the above code to: Bits = sys['bibliographies/*.bib', 'sections/*.ltx'] > rather than: > > Bits = Dir[ 'bibliographies/*.bib' ] + Dir[ 'sections/*.ltx' ] Dir[] expands the patterns immediately and returns an array. When you "declare" many (especially big) filelists, using sys[]/FileList instead of Dir[] pays off in load time of the Rantfiles. E.g. consider the pattern "**/*.c" for a project with many directories/source files. With this pattern, Dir[] immediately reads all directories of the project. Declaring a FileList (with sys[], FileList.new, etc.) costs nothing if it is never accessed. FileList docs are here: http://make.rubyforge.org/files/doc/filelist_rdoc.html and here: http://make.rubyforge.org/files/doc/sys_filelist_rdoc.html -- Stefan From kevin.burge at systemware.com Fri Sep 22 17:19:35 2006 From: kevin.burge at systemware.com (Kevin Burge) Date: Fri, 22 Sep 2006 16:19:35 -0500 Subject: [Rant] Dir[...] vs. sys[...] In-Reply-To: <1158945545.32708.118.camel@balin.russel.org.uk> References: <1158945545.32708.118.camel@balin.russel.org.uk> Message-ID: <45145367.10603@systemware.com> sys[] returns a file list object, which delays resolution until the file names are actually retrieved from the file list. Dir[] is executed and resolved immediately. Russel Winder wrote: > Does anyone have a quick answer to the trade-offs of using: > > Bits = sys[ 'bibliographies/*.bib' ] + sys[ 'sections/*.ltx' ] > > rather than: > > Bits = Dir[ 'bibliographies/*.bib' ] + Dir[ 'sections/*.ltx' ] > > in Rantfiles? > > Thanks. > > > ------------------------------------------------------------------------ > > _______________________________________________ > make-cafe mailing list > make-cafe at rubyforge.org > http://rubyforge.org/mailman/listinfo/make-cafe http://www.systemware.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/make-cafe/attachments/20060922/56f64b71/attachment.html From langstefan at gmx.at Fri Sep 22 17:32:57 2006 From: langstefan at gmx.at (Stefan Lang) Date: Fri, 22 Sep 2006 23:32:57 +0200 Subject: [Rant] Import vs Require In-Reply-To: <1158945710.32708.121.camel@balin.russel.org.uk> References: <1158945710.32708.121.camel@balin.russel.org.uk> Message-ID: <200609222332.57291.langstefan@gmx.at> On Friday 22 September 2006 19:21, Russel Winder wrote: > Is there a set of guidelines for when bits of Rant should be in > $RUBYLIB/rant and required vs in $RUBYLIB/rant/import and imported? Only the core of Rant and helper code for generators that are distributed with Rant should be in $RUBYLIB/rant. If an Rantfile needs to "require" something from $RUBYLIB/rant or one of its subdirectories (including "import/") then something is wrong. "import" should be used for libraries that extend Rant, especially new generators. "import" gives library code a chance to run per project initialization code. When a project's Rantfiles contain no "require" or "require" only scripts from Ruby's standard library, then a script generated via "rant-import --auto" is guaranteed to work as a replacement for an Rant installation. (In the future, I intend "import" to be configurable that it searches in other directories, too.) -- Stefan From kevin.burge at systemware.com Fri Sep 22 17:32:15 2006 From: kevin.burge at systemware.com (Kevin Burge) Date: Fri, 22 Sep 2006 16:32:15 -0500 Subject: [Rant] Import vs Require In-Reply-To: <1158945710.32708.121.camel@balin.russel.org.uk> References: <1158945710.32708.121.camel@balin.russel.org.uk> Message-ID: <4514565F.3060701@systemware.com> The import command has the advantage of calling an initialization method for the imported ruby file with the current rant compiler/application context, which is handy when needed. (Like when setting default var values when loaded). Require can be used any modules that don't use an "init_import_...." method, but generally, that appears to be reserved for rant internals files. Kevin Russel Winder wrote: > Is there a set of guidelines for when bits of Rant should be in > $RUBYLIB/rant and required vs in $RUBYLIB/rant/import and imported? > > Thanks. > > > ------------------------------------------------------------------------ > > _______________________________________________ > make-cafe mailing list > make-cafe at rubyforge.org > http://rubyforge.org/mailman/listinfo/make-cafe http://www.systemware.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/make-cafe/attachments/20060922/7ac1271b/attachment.html From xavier-list at noreality.net Fri Sep 22 21:45:17 2006 From: xavier-list at noreality.net (Xavier Shay) Date: Sat, 23 Sep 2006 11:45:17 +1000 Subject: [Rant] Guide to writing generators? In-Reply-To: <1158927173.32708.71.camel@balin.russel.org.uk> References: <1158927173.32708.71.camel@balin.russel.org.uk> Message-ID: <451491AD.6050007@noreality.net> Russel Winder wrote: > Using the 'walk before run' idiom, I create a Generator for doing > install and uninstall rules for use in a project. usage like: > > gen Install , PixmapsDirectory , Name + '.png' > gen Install , PkgDataDirectory , [ Name + '.glade' , 'about_logo.png' ] > > Is there a way of contributing these sorts of thing into a review / > commit process? Post your code, tests and any required diffs to this list, short description, usage, why it should be in rant, etc. I will look it over (Stefan too hopefully, but I think he's fair busy) and hopefully commit it. Xavier From xavier-list at noreality.net Fri Sep 22 21:49:21 2006 From: xavier-list at noreality.net (Xavier Shay) Date: Sat, 23 Sep 2006 11:49:21 +1000 Subject: [Rant] Import vs Require In-Reply-To: <1158945710.32708.121.camel@balin.russel.org.uk> References: <1158945710.32708.121.camel@balin.russel.org.uk> Message-ID: <451492A1.6030305@noreality.net> Russel Winder wrote: > Is there a set of guidelines for when bits of Rant should be in > $RUBYLIB/rant and required vs in $RUBYLIB/rant/import and imported? I believe rant is for core rant files and import is for any addins. Which means that require should not be used in rant scripts to include anything from the rant dir - if it was in the rant dir it should have already been required already by rant. Xavier From russel at russel.org.uk Sat Sep 23 04:06:12 2006 From: russel at russel.org.uk (Russel Winder) Date: Sat, 23 Sep 2006 09:06:12 +0100 Subject: [Rant] Import vs Require In-Reply-To: <200609222332.57291.langstefan@gmx.at> References: <1158945710.32708.121.camel@balin.russel.org.uk> <200609222332.57291.langstefan@gmx.at> Message-ID: <1158998772.32708.145.camel@balin.russel.org.uk> Thanks to Stefan, Kevin and Xavier for replies on this. Just to summarize the guideline: I have a ~/lib/Ruby/rant directory I am using for trialing things, this should be structured in the same way as the Rant distribution. This means that ~/lib/Ruby/rant should have only directories providing support for generators in ~/lib/Ruby/rant/import (e.g. csharp) and that all files to be included in a Rantfile must be in ~/lib/Ruby/rant/import and included by import and not require. I guess I need to look a bit more in the import directory to see how people have structured things -- the tgz capabilities look to be a good example (there is so much of it :-) It seems that documentation is not in the import files themselves but always help separately in rdoc format files. I guess this means the best bet is to have a personal Rant directory in teh Rant distribution structure and then symbolic link from $RUBYLIB/rant/import. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060923/7debd615/attachment.bin From russel at russel.org.uk Sat Sep 23 04:27:26 2006 From: russel at russel.org.uk (Russel Winder) Date: Sat, 23 Sep 2006 09:27:26 +0100 Subject: [Rant] Bash completion script Message-ID: <1159000046.32708.156.camel@balin.russel.org.uk> For anyone using Bash, I wrote a bash completion script for Rant -- see http://www.russel.org.uk/rantBashCompletion.html. I submitted it to the maintainer of the Debian Rant package (Ralph Amissah) and he included it in a revision of the package in rant_0.5.6-2.deb which is now in Debian Testing. I have promised to keep it maintained for him. So any bugs to me, please. I see that that rant_0.5.6-2 is also now in Ubuntu Edgy Eft. Are there other distributions, etc. That I should put this forward to? -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060923/e873c146/attachment.bin From russel at russel.org.uk Sat Sep 23 05:12:38 2006 From: russel at russel.org.uk (Russel Winder) Date: Sat, 23 Sep 2006 10:12:38 +0100 Subject: [Rant] Making documentation and tests Message-ID: <1159002758.32708.164.camel@balin.russel.org.uk> I am looking at writing documentation files for my install.rb and latex.rb Rant import files. What is the command that is used to generate the HTML files from the rdoc files in the Rant doc directory? Are there any guidelines for writing tests for new generators etc. Whilst I am a fan of test-driven development, writing test programs for testing code that runs latex etc. seems a bit tough. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060923/e4000970/attachment-0001.bin From langstefan at gmx.at Sat Sep 23 09:28:19 2006 From: langstefan at gmx.at (Stefan Lang) Date: Sat, 23 Sep 2006 15:28:19 +0200 Subject: [Rant] Making documentation and tests In-Reply-To: <1159002758.32708.164.camel@balin.russel.org.uk> References: <1159002758.32708.164.camel@balin.russel.org.uk> Message-ID: <200609231528.19305.langstefan@gmx.at> On Saturday 23 September 2006 11:12, Russel Winder wrote: > I am looking at writing documentation files for my install.rb and > latex.rb Rant import files. What is the command that is used to > generate the HTML files from the rdoc files in the Rant doc > directory? "rant doc" does the job. The generated html is under doc/html. > Are there any guidelines for writing tests for new generators etc. > Whilst I am a fan of test-driven development, writing test programs > for testing code that runs latex etc. seems a bit tough. It was always very important for me to have at least a rough test coverage of all the documented features. Ideally, there is a test for each documented option, behaviour, etc. This frees one to change the implementation later. If the tests still pass, one can be fairly sure that it's backwards compatible. On the practical side: Some tests currently run only if specific tools, e.g. a C# compiler, are installed. Perhaps you can check if the necessary tools are installed (Rant::Env.find_bin might be of help) and define the tests methods only in this case. You can also include a small latex document in the test tree. Or you find a way to create "real" unit tests that check only if the tasks when run produce the right commandline etc. Just make sure that future development can't completely break the library without a failing test case showing up. -- Stefan From xavier-list at noreality.net Sat Sep 23 21:34:05 2006 From: xavier-list at noreality.net (Xavier Shay) Date: Sun, 24 Sep 2006 11:34:05 +1000 Subject: [Rant] Making documentation and tests In-Reply-To: <200609231528.19305.langstefan@gmx.at> References: <1159002758.32708.164.camel@balin.russel.org.uk> <200609231528.19305.langstefan@gmx.at> Message-ID: <4515E08D.3030607@noreality.net> >> Are there any guidelines for writing tests for new generators etc. >> Whilst I am a fan of test-driven development, writing test programs >> for testing code that runs latex etc. seems a bit tough. > Or you find a way to create "real" unit tests that check only > if the tasks when run produce the right commandline etc. Check the tests I just committed for csharp (test/units) - they are of this variety and I imagine you could reuse a lot of it (it's a latex generator, right?). I created a separate units folder to separate the true unit tests (don't touch anything) from the functional/integration (that hit the command-line or whatever). Benefit being I can run all the unit tests sub 0.1 second, or every time I save a change, and then the slower not as regularly. Xavier From xavier.shay at advatel.com.au Sun Sep 24 18:54:37 2006 From: xavier.shay at advatel.com.au (Xavier Shay) Date: Mon, 25 Sep 2006 08:54:37 +1000 Subject: [Rant] Rant support in Cerberus (Continuous Integration) Message-ID: The latest version of cerberus (http://rubyforge.org/projects/cerberus) contains support for rant files. If you find any problems with it let me know and I'll get them fixed. Cerberus is a continuous integration tool for ruby. It can be run on any machine and configured to monitor a repository, checkout/test/build any changes and notify you (email/rss/irc/etc) if anything screws up. Xavier From xavier.shay at advatel.com.au Sun Sep 24 23:11:12 2006 From: xavier.shay at advatel.com.au (Xavier Shay) Date: Mon, 25 Sep 2006 13:11:12 +1000 Subject: [Rant] File tasks in sub.rant Message-ID: This is pretty much me thinking out loud... Consider: # Rantfile subdirs "subprj" # subprj/sub.rant file "../afile" do |t| touch "../afile" end This creates a task called "subprj/../afile". I think it would be handy (and intuitive) to also create an identical task "afile", i.e. the expanded path. In particular, if I have multiple sub-projects building into a common directory. Things would work correctly if you had a task in your Rantfile depending on "afile". A potential problem is that you could define two conflicting file tasks in different sub.rants, but I can't think of a situation where this would be valid. Thoughts? From xavier.shay at advatel.com.au Sun Sep 24 23:40:16 2006 From: xavier.shay at advatel.com.au (Xavier Shay) Date: Mon, 25 Sep 2006 13:40:16 +1000 Subject: [Rant] New Rant Core / Parallel Execution Message-ID: Stephan, What is the state of the new core (branches/ncore-r1)? Is it close to what you were trying to achieve? What changes have been made so far? What needs to happen? In particular, what changes were you making towards allowing parallel execution of tasks (hinted at in previous list postings)? One of the apparent problems is the use of Dir.chdir to get to the root of sub.rant files. I'm thinking perhaps this could be "faked" by making sys things like FileList context aware (i.e., auto-prefixing of current dir to globs). In short, if I was to be trying something like this out - should I be starting with trunk or branches/ncore-r1? Cheers, Xavier From russel at russel.org.uk Thu Sep 28 14:36:26 2006 From: russel at russel.org.uk (Russel Winder) Date: Thu, 28 Sep 2006 19:36:26 +0100 Subject: [Rant] Subdirs Message-ID: <1159468586.12045.598.camel@balin.russel.org.uk> This may just be a RTFM but... When using subdirs, it is generally very useful for the sub.rant file to know the name of the subdirectory it is in relative to the root.rant file. Is there a way of accessing this information? Thanks. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060928/c4fd4bb8/attachment.bin From russel at russel.org.uk Thu Sep 28 14:54:01 2006 From: russel at russel.org.uk (Russel Winder) Date: Thu, 28 Sep 2006 19:54:01 +0100 Subject: [Rant] Another subdirs issue Message-ID: <1159469641.12045.602.camel@balin.russel.org.uk> I would like to be able to put dependencies on tasks from sub.rant in the rules in root.rant but I want to do it programatically. This implies being able to ask the question "Is task X/Y defined". This must be doable but I guess my knowledge of the Rant infrastructure isn't as much as I need to answer this question. Either than or I failed to RTFM :-) Any help on this appreciated. Thanks. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060928/1f678841/attachment.bin From russel at russel.org.uk Thu Sep 28 16:00:55 2006 From: russel at russel.org.uk (Russel Winder) Date: Thu, 28 Sep 2006 21:00:55 +0100 Subject: [Rant] subdirs stuff again... Message-ID: <1159473656.12045.623.camel@balin.russel.org.uk> If you have the same constant defined in multiple sub.rant files that are all included by a root.rant then you don't get redefined constant error is just silently does the wrong thing. I guess subdirs needs to be more careful about creating name spaces? -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060928/d30cd1df/attachment.bin From langstefan at gmx.at Thu Sep 28 16:17:16 2006 From: langstefan at gmx.at (Stefan Lang) Date: Thu, 28 Sep 2006 22:17:16 +0200 Subject: [Rant] Subdirs In-Reply-To: <1159468586.12045.598.camel@balin.russel.org.uk> References: <1159468586.12045.598.camel@balin.russel.org.uk> Message-ID: <200609282217.16643.langstefan@gmx.at> On Thursday 28 September 2006 20:36, Russel Winder wrote: > This may just be a RTFM but... > > When using subdirs, it is generally very useful for the sub.rant > file to know the name of the subdirectory it is in relative to the > root.rant file. Is there a way of accessing this information? From an Rantfile (also sub.rant) you can always use: rant.current_subdir which returns a path relative to the project's root directory. -- Stefan From langstefan at gmx.at Thu Sep 28 16:27:03 2006 From: langstefan at gmx.at (Stefan Lang) Date: Thu, 28 Sep 2006 22:27:03 +0200 Subject: [Rant] Another subdirs issue In-Reply-To: <1159469641.12045.602.camel@balin.russel.org.uk> References: <1159469641.12045.602.camel@balin.russel.org.uk> Message-ID: <200609282227.03129.langstefan@gmx.at> On Thursday 28 September 2006 20:54, Russel Winder wrote: > I would like to be able to put dependencies on tasks from sub.rant > in the rules in root.rant but I want to do it programatically. > This implies being able to ask the question "Is task X/Y defined". > This must be doable but I guess my knowledge of the Rant > infrastructure isn't as much as I need to answer this question. > Either than or I failed to RTFM :-) No failure on your part. It's not documented. From an Rantfile: rant.resolve("subdir/some-task") # => array of tasks The returned array is empty when no task with the given name is defined. -- Stefan From langstefan at gmx.at Thu Sep 28 17:01:46 2006 From: langstefan at gmx.at (Stefan Lang) Date: Thu, 28 Sep 2006 23:01:46 +0200 Subject: [Rant] File tasks in sub.rant In-Reply-To: References: Message-ID: <200609282301.46580.langstefan@gmx.at> On Monday 25 September 2006 05:11, Xavier Shay wrote: > This is pretty much me thinking out loud... > > Consider: > > # Rantfile > subdirs "subprj" > > # subprj/sub.rant > file "../afile" do |t| > touch "../afile" > end > > This creates a task called "subprj/../afile". I think it would be > handy (and intuitive) to also create an identical task "afile", > i.e. the expanded path. In particular, if I have multiple > sub-projects building into a common directory. Things would work > correctly if you had a task in your Rantfile depending on "afile". Currently it is possible (perhaps you have figured it out already :) to reference dependencies relative to the project's root directory by preceding the name with an "@". I.e. in some/sub/dir/sub.rant: file "foo" => "@bar/baz" bar/baz is resolved relative to the project's root directory. We could introduce: file "@foo" and "foo" would be defined in the root directory. The reason why I did not use ".." to mean "go one directory up" was because people might think it is handled exactly as file names and start feeding task names like "./some/../random//garbage" and expect to get a task named "random/garbage". For this to work, we'd have to normalize every task and dependency name. I think this is overkill. Iff ".." is ever handled special, then only at the beginning of a task/dependency name. So far, the "@" approach was enough for me. What do you think? Do you need ".."? Some related background: I've taken great care in the past to keep Rant fast. As a result, for certain things (e.g. checking many dependencies) Rant is much faster than similar tools like SCons and Ant. On the other hand this attitude led to some premature optimizations and not to the best design. I use Rant for small/mid-sized projects and sometimes for small scripts instead of plain Ruby. Perhaps it's time to shift the focus a bit from performance to user convinience. Comments welcome. -- Stefan From xavier.shay at advatel.com.au Thu Sep 28 20:06:37 2006 From: xavier.shay at advatel.com.au (Xavier Shay) Date: Fri, 29 Sep 2006 10:06:37 +1000 Subject: [Rant] File tasks in sub.rant Message-ID: > Currently it is possible (perhaps you have figured it out > already :) Nope, thanks for the pointer :) > The reason why I did not use ".." to mean "go one directory up" > was because people might think it is handled exactly as file > names and start feeding task names like > "./some/../random//garbage" and expect to get a task named > "random/garbage". For this to work, we'd have to normalize > every task and dependency name. I think this is overkill. > Iff ".." is ever handled special, then only at the beginning > of a task/dependency name. It would only need to happen for file tasks, and then because "../outfile" is a perfectly legitimate output file name. In my view, one of the biggest advantages of file tasks is the automatic dependency fulfilment - if I depend on "../outfile" or "outfile" from the root directory, from the user's perspective this is the same file. I don't think we should be expecting the user to have to specify whereever they want to resolve a filename, since in 99% of cases this behaviour will be correct. > So far, the "@" approach was enough for me. What do you think? > Do you need ".."? In summary, yes we need .. Because it is intuitive, @ has no analog elsewhere outside of rant. Take the example of specifying library files that your generator depends on gen CSharp, :outfile => 'whatever', :libs => sys["../build/*.dll"] It would be cool if any .dlls that needed to be built were done so by calling their file task... > Some related background: I've taken great care in the past to > keep Rant fast. I haven't checked the code yet, so I'm not sure what affect this would have. How costly is File.expand_path? I will keep it in mind. > Perhaps it's time to shift the > focus a bit from performance to user convinience. In this instance, user convenience is to be preferred. Am going away from the weekend and still have to write the doc for the c# stuff first, so probably won't have a chance to look into it further for a week or two. Xavier From russel at russel.org.uk Fri Sep 29 02:12:02 2006 From: russel at russel.org.uk (Russel Winder) Date: Fri, 29 Sep 2006 07:12:02 +0100 Subject: [Rant] Subdirs In-Reply-To: <200609282217.16643.langstefan@gmx.at> References: <1159468586.12045.598.camel@balin.russel.org.uk> <200609282217.16643.langstefan@gmx.at> Message-ID: <1159510322.12045.656.camel@balin.russel.org.uk> On Thu, 2006-09-28 at 22:17 +0200, Stefan Lang wrote: > On Thursday 28 September 2006 20:36, Russel Winder wrote: > > This may just be a RTFM but... > > > > When using subdirs, it is generally very useful for the sub.rant > > file to know the name of the subdirectory it is in relative to the > > root.rant file. Is there a way of accessing this information? > > >From an Rantfile (also sub.rant) you can always use: > > rant.current_subdir Thanks for confirming what I had found -- it's good to know I got the right answer. I delved into rantlib.rb and on the assumption that there was a an object rant available (I am still unsure as to why it isn't $rant but...) and that it was of type Rant::RantApp, I assumed all the read only properties were accessible. I guess it would be good to extend the documentation with all this sort of stuff -- start a wiki? -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060929/3072bd8b/attachment.bin From russel at russel.org.uk Fri Sep 29 02:22:35 2006 From: russel at russel.org.uk (Russel Winder) Date: Fri, 29 Sep 2006 07:22:35 +0100 Subject: [Rant] File tasks in sub.rant In-Reply-To: <200609282301.46580.langstefan@gmx.at> References: <200609282301.46580.langstefan@gmx.at> Message-ID: <1159510955.12045.666.camel@balin.russel.org.uk> On Thu, 2006-09-28 at 23:01 +0200, Stefan Lang wrote: > Currently it is possible (perhaps you have figured it out already :) > to reference dependencies relative to the project's root directory > by preceding the name with an "@". > > I.e. in some/sub/dir/sub.rant: > > file "foo" => "@bar/baz" > > bar/baz is resolved relative to the project's root directory. > We could introduce: > > file "@foo" > > and "foo" would be defined in the root directory. > > The reason why I did not use ".." to mean "go one directory up" > was because people might think it is handled exactly as > file names and start feeding task names like > "./some/../random//garbage" and expect to get a task named > "random/garbage". For this to work, we'd have to normalize > every task and dependency name. I think this is overkill. > Iff ".." is ever handled special, then only at the beginning > of a task/dependency name. > > So far, the "@" approach was enough for me. What do you think? > Do you need ".."? This is exactly the route SCons has gone I believe (not sure about Waf just now) and almost certainly for the same reasons. > Some related background: I've taken great care in the past to > keep Rant fast. As a result, for certain things (e.g. checking > many dependencies) Rant is much faster than similar tools like > SCons and Ant. On the other hand this attitude led to some > premature optimizations and not to the best design. I use Rant > for small/mid-sized projects and sometimes for small scripts > instead of plain Ruby. Perhaps it's time to shift the focus a > bit from performance to user convinience. Comments welcome. Always keep Rant fast, it is one of its prime attributes -- Rant and Waf are blindingly fast compared to SCons and I hope it always stays that way. SCons is good but it's speed is a serious negative point for certain classes of use (which turn out to be all of mine!). I now use Waf for all my (ex-)Autotools projects and Rant for all other builds not in a Java context. Currently Rant is too low-level for use as an Autotools replacement but it would be good if it really could compete with Waf. Ant and Maven are the primary build systems in the Java arena and SCons, Waf, Rant, etc. will not make inroads. This is the reason for Gant (yes, I am its author) which is a way of scripting Ant (and soon Ivy) tasks using Groovy -- a large number of people producing Java systems hate XML and so having a Groovy way of scripting builds is increasingly popular. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060929/447cf736/attachment.bin From russel at russel.org.uk Fri Sep 29 02:26:26 2006 From: russel at russel.org.uk (Russel Winder) Date: Fri, 29 Sep 2006 07:26:26 +0100 Subject: [Rant] File tasks in sub.rant In-Reply-To: References: Message-ID: <1159511187.12045.671.camel@balin.russel.org.uk> On Fri, 2006-09-29 at 10:06 +1000, Xavier Shay wrote: > It would only need to happen for file tasks, and then because > "../outfile" is a perfectly legitimate output file name. In my view, one > of the biggest advantages of file tasks is the automatic dependency > fulfilment - if I depend on "../outfile" or "outfile" from the root > directory, from the user's perspective this is the same file. I don't > think we should be expecting the user to have to specify whereever they > want to resolve a filename, since in 99% of cases this behaviour will be > correct. Can't this just happen anyway? > In summary, yes we need .. Because it is intuitive, @ has no analog > elsewhere outside of rant. SCons has #. I wonder if the two are not competitors but are, in fact, complementary. They actually serve two different use stories. I can see myself using both ideas in different contexts. > Am going away from the weekend and still have to write the doc for the > c# stuff first, so probably won't have a chance to look into it further > for a week or two. Have a good time :-) -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060929/9b39ed19/attachment.bin From russel at russel.org.uk Fri Sep 29 02:26:45 2006 From: russel at russel.org.uk (Russel Winder) Date: Fri, 29 Sep 2006 07:26:45 +0100 Subject: [Rant] Another subdirs issue In-Reply-To: <200609282227.03129.langstefan@gmx.at> References: <1159469641.12045.602.camel@balin.russel.org.uk> <200609282227.03129.langstefan@gmx.at> Message-ID: <1159511205.12045.673.camel@balin.russel.org.uk> Stefan, On Thu, 2006-09-28 at 22:27 +0200, Stefan Lang wrote: > On Thursday 28 September 2006 20:54, Russel Winder wrote: > > I would like to be able to put dependencies on tasks from sub.rant > > in the rules in root.rant but I want to do it programatically. > > This implies being able to ask the question "Is task X/Y defined". > > This must be doable but I guess my knowledge of the Rant > > infrastructure isn't as much as I need to answer this question. > > Either than or I failed to RTFM :-) > > No failure on your part. It's not documented. Phew, I am not going insane then ;-) > >From an Rantfile: > > rant.resolve("subdir/some-task") # => array of tasks > > The returned array is empty when no task with the given > name is defined. I ended up finding rant.tasks['subdir/sometask'] which gave me a representation of nil when there was no such task and something usable when there was. I guess the issue is which of these ways of expressing things is the best idiom. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060929/fa7c457d/attachment.bin From russel at russel.org.uk Fri Sep 29 02:51:06 2006 From: russel at russel.org.uk (Russel Winder) Date: Fri, 29 Sep 2006 07:51:06 +0100 Subject: [Rant] Is Rant a stalled project? In-Reply-To: <18edb2ad0608160851w45e6f8bdq92786c3eb7b8f869@mail.gmail.com> References: <1155711765.11000.488.camel@balin.russel.org.uk> <18edb2ad0608160851w45e6f8bdq92786c3eb7b8f869@mail.gmail.com> Message-ID: <1159512666.12045.699.camel@balin.russel.org.uk> On Wed, 2006-08-16 at 11:51 -0400, Chandler Carruth wrote: > I am similarly concerned. However there are several projects I am > working on that are desparate for a build system, and I am strongly > considering trying to pick up the pieces of Rant, and move from there. > So while the list and the project as it stands may be stalled, there > is still some interest out there in a Ruby-based build system. Having in effect done a survey of Autotools, SCons, Waf, Rant, Rake and CMake over the last few weeks, I can say that all of them bar Rake are good -- or some cases, at least potentially. Usage depends on context and use story. For generalized builds, I am using Rant. It is fast and allows me to express builds in a way I find comfortable. As yet though it cannot really compete with Autotools and Waf for distributable open-source projects as it doesn't have the tool infrastructure yet. Autotools have improved but are still a right pain in the .... Waf is a very promising replacement for Autotools. SCons is more generalized, like Rant, and like Rant is lacking in some infrastructure to be an Autotools replacement. SCons is slow which for many is a problem. CMake is trying to be an Autotools replacement and could succeed but is also lacking in some significant infrastructure elements -- it;s biggest problem for me is that like Autotools, it uses full upper case which makes it unreadable. Why do I dislike Rake -- compared to Rant, it is lacking. Nice one Stefan. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060929/474f77c9/attachment.bin From russel at russel.org.uk Fri Sep 29 12:32:37 2006 From: russel at russel.org.uk (Russel Winder) Date: Fri, 29 Sep 2006 17:32:37 +0100 Subject: [Rant] Constructing dependency chains. Message-ID: <1159547557.25434.6.camel@balin.russel.org.uk> In SCons, you can build a dependency chain and on execution SCons ensures that the dependencies are build in the correct order to so intermediate generated files always exist when they are needed. The building of the dependency tree happens completely before the dependencies are analysed so dependency tree building has no ordering property. In Rant, it appears that the ordering of the: file X => d1 file X => d2 etc. lines is crucial, i.e. actions are enacted in the order of the file lines independent of any dependency chain. This was a complete surprise to me, I would have thought that the transitive dependencies would have been taken into account as they are in SCons. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060929/59d98747/attachment.bin From russel at russel.org.uk Sat Sep 30 03:42:27 2006 From: russel at russel.org.uk (Russel Winder) Date: Sat, 30 Sep 2006 08:42:27 +0100 Subject: [Rant] Import hierarchy structure Message-ID: <1159602147.25434.33.camel@balin.russel.org.uk> The archive.rb import file is noted as being not an importable file (use archive.tgz.rb, etc. instead). the csharp.rb file on the other had has all it's non-importable material in ../csharp. The structuring ideas here seem a bit contradictory. Is there a structuring rule here I am missing? Thanks. -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060930/fdb185e1/attachment.bin From russel at russel.org.uk Sat Sep 30 03:59:19 2006 From: russel at russel.org.uk (Russel Winder) Date: Sat, 30 Sep 2006 08:59:19 +0100 Subject: [Rant] A question of approach Message-ID: <1159603159.25434.40.camel@balin.russel.org.uk> The LaTeX tool chain has some serious oddities and many possibilities for achieving any transformation from source to target. SCons and Waf handle this by having "builders" that are parameterized but in a way that is open to change by the user. Are any of the current Rant generators structured like this that I can use as paradigms for the LaTeX "builder" for Rant? (Currently, I have a number of functions in a module with no parameterization -- just the commands I need -- but this doesn't seem very Rant-like.) -- Russel. ==================================================== Dr Russel Winder +44 20 7585 2200 41 Buckmaster Road +44 7770 465 077 London SW11 1EN, UK russel at russel.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/make-cafe/attachments/20060930/60af63e9/attachment.bin