Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 20929 invoked from network); 22 Jun 2009 14:46:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jun 2009 14:46:07 -0000 Received: (qmail 28079 invoked by uid 500); 22 Jun 2009 14:46:18 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 28062 invoked by uid 500); 22 Jun 2009 14:46:18 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 28054 invoked by uid 99); 22 Jun 2009 14:46:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 14:46:18 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jeffgbutler@gmail.com designates 209.85.217.205 as permitted sender) Received: from [209.85.217.205] (HELO mail-gx0-f205.google.com) (209.85.217.205) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 14:46:08 +0000 Received: by gxk1 with SMTP id 1so4881293gxk.0 for ; Mon, 22 Jun 2009 07:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=IVlbOcHJWO5H0hO+X8G1vyBAvR8w4gEEBmtMKWD/6oo=; b=irApd+vAffn7RlcGwzWIyigvMcDNWCdGwP1ainAg1wNeFO0Z+A3jnnzfdMR/7rUh2K cFkMropDqMScQIEH2qVsmh6tJ7L1kKpyNMHCaY+h3jyiSORFZRWA8EcDaIfrDutYPos0 2ZKLjkPwulAScTaqgfQRO/kGlJ91meLUsfo28= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Mxqd02aLpzl7hvJhtFbeNZ3G91879ONaW7qEpTeUZpEe/OWioH+Bs902t81Dj5agu8 84XG2KkVonFRRBMdB9T80uoQW89DAFJHYNG+jc8fiW9yzRjx2+QsEUJAxphhqDWp3QNt 7ZrMi0wQ8AkhYXDR5cKDDadtlvKi3+iDe1BBU= MIME-Version: 1.0 Received: by 10.151.139.7 with SMTP id r7mr11461086ybn.109.1245681947867; Mon, 22 Jun 2009 07:45:47 -0700 (PDT) In-Reply-To: <2ee5b0120906212020l4d743397wb88f8054840ee986@mail.gmail.com> References: <2ee5b0120906212020l4d743397wb88f8054840ee986@mail.gmail.com> Date: Mon, 22 Jun 2009 09:45:47 -0500 Message-ID: Subject: Re: Ibator plugin use and future plans From: Jeff Butler To: user-java@ibatis.apache.org Content-Type: multipart/alternative; boundary=001e680f12bc017b51046cf0ee53 X-Virus-Checked: Checked by ClamAV on apache.org --001e680f12bc017b51046cf0ee53 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Several topics: 1. Java file merging The code for merging Java files is only in the Eclipse plugin. It uses the Eclipse AST parser and AST rewriter and cannot run outside of Eclipse. If you want to merge Java code, you must run in Eclipse. In the far future, I hope to enable Java merging outside of Eclipse. The problem is that it's just so easy in Eclipse, and so difficult elsewhere! I think the long term solution is to write a specialized Java parser for Ibator using ANTLR or the like. Parsing Java source code is a non-trivial task and I have no interest in reinventing the wheel - so probably something like ANTLR is the right answer ultimately. If anyone is interested in making an important contribution to Ibator this would be a good area to look into :) 2. Plugin Classloading You must add your plugin classes to Ibator's runtime classpath. This cannot be done with elements in the configuration. Outside eclipse, you can do this by using the -cp argument, or by adding to the Ant classpath in the normal ways. Inside Eclipse, you must use the eclipse integrated Ant task and add to the classpath with the Eclipse launch configuration. The Ibator menu option in Eclipse does not allow modifications to the runtime classpath. >From these two answers, you should deduce that the only way to use a plugin AND use Java merging is to use the Eclipse plugin provided Ant task (NOT the Ant task in the base Ibator distribution). If you want to automate this, you will have to run Ant inside Eclipse with headless Eclipse. 3. Maven I'm looking at maven for the Ibator build. If it works out, then I'll also provide a maven plugin to run Ibator. But, this plugin will not merge Java files (see #1 above). 4. The future My current focus is updates to Ibator for iBATIS3. I have some code *sort of* working now, but iBATIS3 is in Alpha stage only - so Clinton and I are working through some bugs in iBATIS3. I have done some refactoring of the Ibator code base to allow for iBATIS3 - but this is mostly internal and should not affect anyone (hopefully). Feel free to checkout the latest Ibator code from SVN and try it out. I don't think you'll see much difference. Note that the iBATIS3 support for Ibator is not in SVN yet - just the base Ibator refactorings. Hope that helps! Jeff Butler On Sun, Jun 21, 2009 at 10:20 PM, Chad McHenry wrote: > I was having trouble using my ibator plugin from eclipse, getting the error > "Cannot instantiate object of type > com.example.ibatis.ibator.plugins.ClassAnnotator" and found an old thread > [1] which references the same error. It appears it is still relevant (I > could only run my plugin via eclipse by putting my plugin classes into > $eclipse/plugins/org.apache.ibatis.ibator.core_1.2.1/ibator.jar). > > For using plugins, is the ant-task still the preferred way to use Ibator? I > use maven, and can use maven-antrun-plugin, but is it still true that any > changes made to generated files will be lost when using the ant version > since it does not merge java files? > > Are there plans, or a roadmap for Ibator? I'm spending a lot of time > getting this plugin working (and actually believe it will be worth it over > the course of multiple projects). I'm wondering if I can contribute back to > the ibator-core, but would hesitate if there is going to be a drastic > redesign for ibatis-3.0. > > ...Chad > > [1] > http://www.nabble.com/Re:-ibator-question-about--element-p19222727.html > > --001e680f12bc017b51046cf0ee53 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Several topics:

1. Java file merging

The code for merging Java files is only in the Eclipse plugin. =A0It = uses the Eclipse AST parser and AST rewriter and cannot run outside of Ecli= pse. =A0If you want to merge Java code, you must run in Eclipse.

In the far future, I hope to enable Java merging outsid= e of Eclipse. =A0The problem is that it's just so easy in Eclipse, and = so difficult elsewhere! =A0I think the long term solution is to write a spe= cialized Java parser for Ibator using ANTLR or the like. =A0Parsing Java so= urce code is a non-trivial task and I have no interest in reinventing the w= heel - so probably something like ANTLR is the right answer ultimately. =A0= If anyone is interested in making an important contribution to Ibator this = would be a good area to look into :)

2. Plugin Classloading

You mus= t add your plugin classes to Ibator's runtime classpath. =A0This cannot= be done with <classPathEntry> elements in the configuration. =A0Outs= ide eclipse, you can do this by using the -cp argument, or by adding to the= Ant classpath in the normal ways. =A0Inside Eclipse, you must use the ecli= pse integrated Ant task and add to the classpath with the Eclipse launch co= nfiguration. =A0The Ibator menu option in Eclipse does not allow modificati= ons to the runtime classpath.

From these two answers, you should deduce that the only= way to use a plugin AND use Java merging is to use the Eclipse plugin prov= ided Ant task (NOT the Ant task in the base Ibator distribution). =A0If you= want to automate this, you will have to run Ant inside Eclipse with headle= ss Eclipse.

3. Maven

I'm looking at ma= ven for the Ibator build. =A0If it works out, then I'll also provide a = maven plugin to run Ibator. =A0But, this plugin will not merge Java files (= see #1 above).

4. The future

My current focus= is updates to Ibator for iBATIS3. =A0I have some code *sort of* working no= w, but iBATIS3 is in Alpha stage only - so Clinton and I are working throug= h some bugs in iBATIS3. =A0I have done some refactoring of the Ibator code = base to allow for iBATIS3 - but this is mostly internal and should not affe= ct anyone (hopefully). =A0Feel free to checkout the latest Ibator code from= SVN and try it out. =A0I don't think you'll see much difference. = =A0Note that the iBATIS3 support for Ibator is not in SVN yet - just the ba= se Ibator refactorings.

Hope that helps!
Jeff Butler



On Sun, Jun 21, 2009 at 10:20 P= M, Chad McHenry <mchenryc@gmail.com> wrote:
I was having trouble using my ibator p= lugin from eclipse, getting the error "Cannot instantiate object of ty= pe com.example.ibatis.ibator.plugins.ClassAnnotator" and found an old = thread [1] which references the same error. It appears it is still relevant= (I could only run my plugin via eclipse by putting my plugin classes into = $eclipse/plugins/org.apache.ibatis.ibator.core_1.2.1/ibator.jar).

For using plugins, is the ant-task still the preferred = way to use Ibator? I use maven, and can use maven-antrun-plugin, but is it = still true that any changes made to generated files will be lost when using= the ant version since it does not merge java files?

Are there plans, or a roadmap for Ibator? I'm spend= ing a lot of time getting this plugin working (and actually believe it will= be worth it over the course of multiple projects). I'm wondering if I = can contribute back to the ibator-core, but would hesitate if there is goin= g to be a drastic redesign for ibatis-3.0.

...Chad



--001e680f12bc017b51046cf0ee53--