Re: <cgen> Ant task and makepairs attribute

From: Erik Hatcher (eri..hatchersolutions.com)
Date: Wed Apr 27 2005 - 11:20:10 EDT

  • Next message: Mike Kienenberger: "Re: <cgen> Ant task and makepairs attribute"

    On Apr 27, 2005, at 9:52 AM, Cris Daniluk wrote:

    >> For now I'm dealing with this by doing this after
    >> <cgen>:
    >>
    >> <delete>
    >> <fileset dir="${build.dir}/gen" excludes="**/_*.java"/>
    >> </delete>
    >>
    >> I'm curious what others using <cgen> do when the subclasses need to be
    >> modified, and whether modifying <cgen> to be friendlier to this type
    >> of
    >> situation is of interest or if there is a better way to do what I'm
    >> doing.
    >>
    >
    > Cayenne will not overwrite modified wrapper subclasses. However, we
    > place all of our generated code in a separate source folder (seems
    > you're doing the same).

    Yes, I keep the superclasses and subclasses in separate packages.

    > Since the subclasses were meant to be
    > modified, we store them along side the non-generated source code,
    > meaning we have to delete the generated subclasses each time we build
    > - in fact my ant task looks almost identical to what you described.
    >
    > There's really nothing wrong with adding the generated code directly
    > to your main source tree, which eliminates the need for the delete
    > task. The reason I separate the generated code (aside from
    > discouraging modification) is to make it clear that the code does not
    > belong in version control.

    Right, and I'm being a purist here as well and not wanting to put any
    generated code into version control, or even under a directory that is
    in version control.

    The <delete> technique works fine for me, and I'm glad to hear I'm not
    doing something unusual.

            Erik



    This archive was generated by hypermail 2.0.0 : Wed Apr 27 2005 - 11:20:45 EDT