Return-Path: X-Original-To: apmail-buildr-users-archive@www.apache.org Delivered-To: apmail-buildr-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 88EC19E7C for ; Mon, 23 Jul 2012 16:29:55 +0000 (UTC) Received: (qmail 33739 invoked by uid 500); 23 Jul 2012 16:29:55 -0000 Delivered-To: apmail-buildr-users-archive@buildr.apache.org Received: (qmail 33667 invoked by uid 500); 23 Jul 2012 16:29:54 -0000 Mailing-List: contact users-help@buildr.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@buildr.apache.org Delivered-To: mailing list users@buildr.apache.org Received: (qmail 33652 invoked by uid 99); 23 Jul 2012 16:29:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jul 2012 16:29:54 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of alex.boisvert@gmail.com designates 209.85.220.172 as permitted sender) Received: from [209.85.220.172] (HELO mail-vc0-f172.google.com) (209.85.220.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jul 2012 16:29:48 +0000 Received: by vcbfo14 with SMTP id fo14so6560102vcb.17 for ; Mon, 23 Jul 2012 09:29:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=dqrJy8lpIqt27lGCbT6INUmYWEHEGhgt6a/J1pZgnyg=; b=N6L030g0pcqkgZSxQI2MqE0SyizvHz6I2K3H9eQ63FZhPEpuF9XYDVdU6Y1SWIABHO 38IjJN0GkHRrDby9s+fPofuJvowuh7VpfkqkVO5PoaiMXACjEUBhFWu/P3UNTsFEADTG 2A+oloebXANSWXPcv0+asDnUxd2T14awtRm2bA6b90V+5DdTDqu2SkGRIXGz5FzIz4JR 6/yW2n/gePkwZsdr8tHhvI87WvG6DkuSOtFo4g66Ki1sRNKvQXIbxNDvwdUYt3ThWOl0 PJx5Gy/BUeC3r+/99gJksxOiMlQ7WOc1BqFqZlRJL7q29EO9OBrxb0Bqff4UkxSK1VBr WOCg== MIME-Version: 1.0 Received: by 10.52.23.136 with SMTP id m8mr11395131vdf.28.1343060967450; Mon, 23 Jul 2012 09:29:27 -0700 (PDT) Received: by 10.58.65.8 with HTTP; Mon, 23 Jul 2012 09:29:27 -0700 (PDT) In-Reply-To: <201207220110.20969.niklaus.giger@member.fsf.org> References: <201207220110.20969.niklaus.giger@member.fsf.org> Date: Mon, 23 Jul 2012 09:29:27 -0700 Message-ID: Subject: Re: RFC: Generate buildfile from Eclipse workspace From: Alex Boisvert To: users@buildr.apache.org Content-Type: multipart/alternative; boundary=20cf307ac81fe06a1504c581bfce --20cf307ac81fe06a1504c581bfce Content-Type: text/plain; charset=ISO-8859-1 On Sat, Jul 21, 2012 at 4:10 PM, Niklaus Giger wrote: > The attached patch adds a new menu choice for "buildr generate" to > generate a > buildfile from the eclipse projects present in the workspace. > > Contrary to the existing Eclipse extension it considers the existing > Eclipse > files to be master and trying to create a buildfile based on the extracted > values. > > It needs some polishing before a final submission, but is already capable > of > - detecting eclipse project (which may be anywhere in a subdir) > - project-names from eclipse .project-files override directory names > - uses default eclipse values ('src','bin') for layout[:source,:target] > - get the project version from MANIFEST.MF > - adds dependencies between project > - adds hints for all plugin > - skips fragments (would need buildr4osgi to handle them correctly) > Sweet! You may also consider using the Eclipse compiler (ECJ) by default by adding require 'buildr/java/ecj' to the top of the generated buildfile for consistency between buildr/eclipse builds. There are quite a few specs (including some pendings, which reflect the > task I > would like to accomplish in the next few months). > > I would be happy if you could review the patch. I will try to improve it > based > on your suggestions. > I haven't really looked at the details so just some quick superficial/cosmetic comments... 1) Try to be consistent with method naming following Ruby conventions (e.g. isEclipseProjet -> is_eclipse_project?), 2) Try to use functional/non-mutating methods where possible (e.g. string = string.gsub(/.../) in lieu of string.sub!(/.../); especially try not to modify any arguments passed into a method). 3) Other miscelaneous Ruby idioms: use "unless" instead of "if !condition", use "find" instead of "each" and returning inside the block, etc. But don't worry too much about these... we can help you clean up the code once you have working code + specs! > For me it is a first step for a to provide a simple, yet powerful way which > should convince 'hardcore' Eclipse GUI developers that for continuos > integration buildr.apache.org provides a simple, powerful way for > headless, > aka command line based builds. > > Attached is a generated buildfile (generated in the subdirectory src of a > git > clone https://github.com/zdavatz/elexis). > > Please let me know about necessary changes to get my patch accepted. > As Peter said. And if you intend to iterate quickly in the coming weeks, it may be simpler to open a pull request on github (with a tracking branch) and attach the resulting work to Jira only after you're done with development and we're done with the reviewing. But either approaches work fine. alex --20cf307ac81fe06a1504c581bfce--