RE: Converting Frameworks into path-like structures in ant

From: Bill Michell (bill.michel..bc.co.uk)
Date: Tue Oct 11 2005 - 10:37:02 EDT

  • Next message: gbrown: "New >WO Component == empty wo component"


    Suggestion 1)
    Ant task for WOProject to create a file that looks like this, given some <frameworks/>:
    JavaEOAccess.framework/Resources/Java/*.jar
    JavaEOControl.framework/Resources/Java/*.jar
    JavaFoundation.framework/Resources/Java/*.jar
    JavaJDBCAdaptor.framework/Resources/Java/*.jar
    JavaWebObjects.framework/Resources/Java/*.jar
    JavaWOExtensions.framework/Resources/Java/*.jar
    JavaXML.framework/Resources/Java/*.jar

    Possibly add in all the other dependencies too.

    Suggestion 2)
    Ant task for WOProject that assigns a full classpath to a property given suitable input

    Suggestion 3)
    Same WOLips code that updates PB.project also creates a file that expresses a full (or partial) classpath.

    Suggestion 4) (may not be possible)
    Allow <frameworks/> tags to be specified in something that can be referred to using a classpathref.


    Any of these allows me to pass a classpath to some optional ant task that doesn't understand the <frameworks/> tag.


    --
    Bill Michell
    Development Team Leader, Broadcast Platforms, BBC News Interactive.


    -----Original Message-----
    From: Mike Schrag [mailto:mschrag@mdimension.com]
    Sent: Tuesday, October 11, 2005 3:20 PM
    To: woproject-dev@objectstyle.org
    Subject: Re: Converting Frameworks into path-like structures in ant

    If you have a suggestion on how to make this not suck, let me know
    and we can look at adding it in to the core ...

    On Oct 11, 2005, at 10:04 AM, Bill Michell wrote:

    > No it doesn't work.
    >
    > The conflicting foundation classes are in some of the frameworks in
    > ${wo.wosystemroot}/Library/Frameworks
    >
    > Deleting all the frameworks I'm not currently using fixes the
    > problem using any of the classpath sets so far specified. However,
    > I can't do this on my production servers so for the time being,
    > I've created an includesfile that explicitly selects jars only from
    > those system frameworks that the project actually requires.
    >
    > Unfortunately, this also means that I'm specifying the dependencies
    > in two separate places.
    >
    >
    > --
    > Bill Michell
    > Development Team Leader, Broadcast Platforms, BBC News Interactive.
    >
    >
    > -----Original Message-----
    > From: Mike Schrag [mailto:mschrag@mdimension.com]
    > Sent: Tuesday, October 11, 2005 2:52 PM
    > To: woproject-dev@objectstyle.org
    > Subject: Re: Converting Frameworks into path-like structures in ant
    >
    > If you remove your include of /Library/Frameworks and /System/Library/
    > Frameworks and replace it with the filesets in my email, does it
    > still not work? I don't know how conflicting Foundation classes
    > would get into your classpath otherwise ...
    >
    > On Oct 11, 2005, at 9:28 AM, Bill Michell wrote:
    >
    >
    >> No joy - looks like that includesfile is adding stuff (perhaps no
    >> stuff) to the classpath rather than restricting it at all.
    >>
    >>
    >> --
    >> Bill Michell
    >> Development Team Leader, Broadcast Platforms, BBC News Interactive.
    >>
    >> -----Original Message-----
    >> From: Mike Schrag [mailto:mschrag@mdimension.com]
    >> Sent: Tuesday, October 11, 2005 2:18 PM
    >> To: woproject-dev@objectstyle.org
    >> Subject: Re: Converting Frameworks into path-like structures in ant
    >>
    >> Try:
    >>
    >> <fileset dir="$
    >> {wo.dir.user.home.library.frameworks}" includesfile = "woproject/
    >> ant.frameworks.user.home">
    >> <include name = "**/*.jar"/>
    >> </fileset>
    >> <fileset dir="${wo.wolocalroot}"
    >> includesfile = "woproject/ant.frameworks.wo.wolocalroot">
    >> <include name = "**/*.jar"/>
    >> </fileset>
    >> <fileset dir="${wo.wosystemroot}"
    >> includesfile = "woproject/ant.frameworks.wo.wosystemroot">
    >> <include name = "**/*.jar"/>
    >> </fileset>
    >> <fileset dir = "yourotherfolder">
    >> <include name="**/*.jar"/>
    >> </fileset>
    >>
    >> On Oct 11, 2005, at 9:12 AM, Bill Michell wrote:
    >>
    >>
    >>
    >>> I’m trying to add unit tests to my ant automated build scripts.
    >>>
    >>> The unit testing framework provides its own custom ant task, which
    >>> expects to be told the runtime classpath for the unit tests using a
    >>> path-like structure.
    >>>
    >>> Obviously, the task knows nothing about the <frameworks> element.
    >>>
    >>>
    >>> Superficially, the following seems to work:
    >>> <classpath>
    >>> <fileset dir="${wo.wosystemroot}/Library/Frameworks">
    >>> <include name="**/*.jar" />
    >>> <include name="**/*.zip" />
    >>> </fileset>
    >>> <fileset dir="${wo.wolocalroot}/Library/Frameworks">
    >>> <include name="**/*.jar" />
    >>> <include name="**/*.zip" />
    >>> </fileset>
    >>> <fileset dir="${dest.dir}">
    >>> <include name="**/*.jar" />
    >>> <include name="**/*.zip" />
    >>> </fileset>
    >>> </classpath>
    >>>
    >>> Unfortunately, I then hit a problem with the SecurityManager when
    >>> referring to certain classes in JavaFoundation.framework, notably
    >>> NSBundle.
    >>>
    >>> There also seems to be a version of NSBundle in
    >>> Foundation.framework, and incompatible signatures mean the test
    >>> simply won't execute; the java runtime aborts it with a
    >>> SecurityException.
    >>>
    >>> Obviously, traversing such large directory structures also takes
    >>> significant time.
    >>>
    >>> So my question is how best I can convert the dependencies expressed
    >>> in the woproject/ant.frameworks.wo.wosystemroot into a path-like
    >>> structure for my testing task to use.
    >>>
    >>> I notice that the wocompile task actually goes so far as to
    >>> subclass the javac task in order to add this framework classpath
    >>> expansion. Is there some simpler way for me to achieve my goal?
    >>>
    >>>
    >>>
    >>> --
    >>> Bill Michell
    >>> Development Team Leader, Broadcast Platforms, BBC News Interactive.
    >>> Work: 020 8 752 6850
    >>> Room 1468, BBC White City, Wood Lane, London. W12 7TS
    >>> mailto:Bill.Michell@bbc.co.uk (Work)
    >>> mailto:bill@mics.org.uk (Home)
    >>> mailto:billm1@orange.net (Mobile)
    >>>
    >>>
    >>>
    >>> http://www.bbc.co.uk/
    >>>
    >>> This e-mail (and any attachments) is confidential and may contain
    >>> personal views which are not the views of the BBC unless
    >>> specifically
    >>> stated.
    >>> If you have received it in error, please delete it from your system.
    >>> Do not use, copy or disclose the information in any way nor act in
    >>> reliance on it and notify the sender immediately. Please note that
    >>> the
    >>> BBC monitors e-mails sent or received.
    >>> Further communication will signify your consent to this.
    >>>
    >>>
    >>>
    >>
    >>
    >>
    >>
    >> http://www.bbc.co.uk/
    >>
    >> This e-mail (and any attachments) is confidential and may contain
    >> personal views which are not the views of the BBC unless specifically
    >> stated.
    >> If you have received it in error, please delete it from your system.
    >> Do not use, copy or disclose the information in any way nor act in
    >> reliance on it and notify the sender immediately. Please note that
    >> the
    >> BBC monitors e-mails sent or received.
    >> Further communication will signify your consent to this.
    >>
    >>
    >
    >
    >
    >
    > http://www.bbc.co.uk/
    >
    > This e-mail (and any attachments) is confidential and may contain
    > personal views which are not the views of the BBC unless specifically
    > stated.
    > If you have received it in error, please delete it from your system.
    > Do not use, copy or disclose the information in any way nor act in
    > reliance on it and notify the sender immediately. Please note that the
    > BBC monitors e-mails sent or received.
    > Further communication will signify your consent to this.
    >




    http://www.bbc.co.uk/

    This e-mail (and any attachments) is confidential and may contain
    personal views which are not the views of the BBC unless specifically
    stated.
    If you have received it in error, please delete it from your system.
    Do not use, copy or disclose the information in any way nor act in
    reliance on it and notify the sender immediately. Please note that the
    BBC monitors e-mails sent or received.
    Further communication will signify your consent to this.



    This archive was generated by hypermail 2.0.0 : Tue Oct 11 2005 - 10:37:04 EDT