You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Brett Francis <br...@mediagate.com> on 2000/08/04 04:28:40 UTC

Random Classes not being Compiled

O.K. Here's a strange one...

We've been struggling with this for a while now and have lost hope of
resolving it ourselves. When we compile using Ant with the following
target not all of the classes that should be created using the
-sourcepath option to javac are actually getting compiled.

When we do the same compilation from the command line the -sourcepath
option works fine and the appropriate classes are built.

What's even stranger is that when running the *same build.xml* file
using Ant on different machines.. different classes in the -sourcepath
are being missed.

Here's our target:
-----------------------
    <target name="accessor" depends="prepare">

        <echo message="### Building Accessors..."/>
        <!-- cleaning any old class files -->
        <deltree dir="${accessor.build}/com"/>
        <deltree dir="${accessor.build}/net"/>

        <!-- cleaning old jars -->
        <delete file="${accessor-dl.build}/accessor-dl.jar"/>
        <delete file="${accessor.build}/accessor.jar"/>
        <delete file="${accessor.build}/tools.jar"/>

        <javac srcdir="${source}"
            destdir="${accessor.build}"
            classpath="${accessor.classpath}"
            includes="com/mediagate/adapter/**,com/mediagate/tools/**"
            debug="on"/>

        <rmic stubversion="1.2"
classname="net.jini.lookup.ServiceDiscoveryManager.LookupCacheImpl.LookupListener"

            base="${accessor.build}"/>

        <!-- Build Accessor JAR file -->
        <jar jarfile="${accessor.build}/accessor.jar"
            basedir="${accessor.build}"
            includes="com/**,net/**"
            excludes="com/mediagate/tools/**"/>

        <!-- Build Tools JAR file -->
        <jar jarfile="${accessor.build}/tools.jar"
            basedir="${accessor.build}"
            includes="com/mediagate/tools/**" />

    </target>
-----------------------
...all the variables are resolving fine.

But classes that should be compiled into the "destdir" of the javac
command are not actually showing up. The target "prepare" that this
target depends upon simply creates the directories that will receive the
created classes and jars.
_________________________________________
|> Brett Francis
|> mediagate, inc.
|> mailto:brett@mediagate.com



RE: Random Classes not being Compiled

Posted by Ken Liu <kl...@auctionlogic.com>.
My motto for java is:
"If something strange is happening, then it must be something wrong with
your classpath."


> -----Original Message-----
> From: Brett Francis [mailto:brett.francis@mediagate.com]
> Sent: Monday, August 07, 2000 4:19 PM
> To: ant-user@jakarta.apache.org
> Subject: Re: Random Classes not being Compiled
>
>
> We found out our problem.
>
> In the BATCH file that we were using to launch Ant we had an erroneous
> CLASSPATH. This CLASSPATH had classes in it that were being
> discovered from
> another directory and accepted as existing when another target was being
> created.
>
> We've resolved it by removing this reference from the CLASSPATH and now
> everything works.


Re: Random Classes not being Compiled

Posted by Brett Francis <br...@mediagate.com>.
We found out our problem.

In the BATCH file that we were using to launch Ant we had an erroneous
CLASSPATH. This CLASSPATH had classes in it that were being discovered from
another directory and accepted as existing when another target was being
created.

We've resolved it by removing this reference from the CLASSPATH and now
everything works.

Peter Donald wrote:

> The only thing I noticed is that the "source" property is not set (at least
> that I can see) and so when you use it in
>
>         <javac srcdir="${source}"
>             destdir="${accessor.build}"
>             classpath="${accessor.classpath}"
>             includes="com/mediagate/adapter/**,com/mediagate/tools/**"
>             debug="on"/>
>
> you may confuse the task. Try defineing source and make sure it is a
> directory but you don't include the / at the end. If that doesn't work post
> again :P
>
> Cheers,
>
> Pete
>
> *------------------------------------------------------*
> | "Nearly all men can stand adversity, but if you want |
> | to test a man's character, give him power."          |
> |       -Abraham Lincoln                               |
> *------------------------------------------------------*

--
_________________________________________
|> Brett Francis
|> mediagate, inc.
|> mailto:brett@mediagate.com



Re: Random Classes not being Compiled

Posted by Peter Donald <do...@mad.scientist.com>.
The only thing I noticed is that the "source" property is not set (at least
that I can see) and so when you use it in 

        <javac srcdir="${source}"
            destdir="${accessor.build}"
            classpath="${accessor.classpath}"
            includes="com/mediagate/adapter/**,com/mediagate/tools/**"
            debug="on"/>

you may confuse the task. Try defineing source and make sure it is a
directory but you don't include the / at the end. If that doesn't work post
again :P

Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Re: Random Classes not being Compiled

Posted by Brett Francis <br...@mediagate.com>.
Here's the info about the properties being setup:
------------------

<project name="foo" default="main" basedir="w:/mg">
   <target name="init">
        <property name="build.dir"  value="${basedir}/build/output"/>
        <property name="quicksilver.source" value="${basedir}/src"/>

        <property name="accessor.build"    value="${build.dir}/client"/>
        <property name="accessor-dl.build" value="${build.dir}/client-dl"/>
        <property name="service.build"     value="${build.dir}/service"/>
        <property name="service-dl.build"  value="${build.dir}/service-dl"/>

        <property name="javadocs.build"
value="${basedir}/docs/javadocs"/>

        <property name="dependencies" value="${basedir}/dependencies"/>

        <!-- Classpath needed by all Accessor builds -->
        <property name="accessor.classpath"
value="${jsdk.home}/servlet.jar;${jini.home}/lib/jini-core.jar;${jini.home}/lib/jini-ext.jar;${jini.home}/lib/sun-util.jar;${xerces.home}/xerces.jar;${xalan.home}/xalan.jar;${mail.home}/mail.jar"/>


        <!-- Currently broken pieces of code that must be excluded from an
Accessor build -->
        <property name="accessor.excludes" value=""/>

        <!-- Classpath needed by all Service builds -->
        <property name="service.classpath"

value="${jsdk.home}/servlet.jar;${jini.home}/lib/jini-core.jar;${jini.home}/lib/jini-ext.jar;${jini.home}/lib/sun-util.jar;${xerces.home}/xerces.jar;${xalan.home}/xalan.jar;${mail.home}/mail.jar"/>


        <!-- Currently broken pieces of code that must be excluded from all
Service builds -->
        <property name="service.excludes" value=""/>

        <!-- Generic service-dl includes -->
        <property name="service-dl.includes"

value="net/jini/lookup/ServiceDiscoveryManager*LookupCacheImpl*LookupListener_Stub.class,com/mediagate/jini/service/BasicUnicastAdmin_Stub.class,com/mediagate/jini/service/BasicUnicastAdminRemote.class,com/mediagate/jini/service/Singleton.class,com/mediagate/jini/entry/QuicksilverEntry.class,com/mediagate/jini/entry/NetAddressEntry.class,com/mediagate/jini/entry/QuicksilverServiceType.class,com/mediagate/jini/entry/SingletonServiceEntry.class,com/mediagate/jini/util/BasicRegistrationLandlord_Stub.class,com/mediagate/jini/util/DiscoverAndDelegate.class,com/mediagate/jini/util/DiscoverAndDelegate*Delegate.class,com/mediagate/jini/util/LookupCacheAdapter.class,com/mediagate/util/StringHelper.class,com/mediagate/util/Debug.class,com/mediagate/BaseException.class,com/mediagate/data/Datum.class,com/mediagate/data/ToXML.class,com/mediagate/jini/service/configurable/RemoteConfigurable.class,com/mediagate/jini/service/datasource/RemoteDataSource.class,com/mediagate/jini/UnknownDataException.class,com/mediagate/jini/SetDataException.class,com/mediagate/jini/Configurable.class,com/mediagate/jini/DataSource.class,com/mediagate/jini/util/PerformanceRecord.class,com/mediagate/jini/util/PerformanceRecordHelper.class,com/mediagate/jini/util/SupportedURL.class,com/mediagate/jini/util/SupportedURLHelper.class,com/mediagate/jini/log/Logger.class,com/mediagate/jini/log/LogClient.class,com/mediagate/jini/log/LogServiceClient.class,com/mediagate/jini/log/LogServiceClient*SetLoggingService.class,com/mediagate/jini/probe/Probe.class,com/mediagate/jini/probe/ProbeRegistration.class,com/mediagate/jini/probe/ProbeEventListener.class,com/mediagate/jini/probe/ProbeID.class,com/mediagate/jini/probe/ProbeException.class,com/mediagate/jini/probe/ProbeHost.class,com/mediagate/jini/probe/ProbeNotFoundException.class,com/mediagate/jini/probe/ProbeRegistrationID.class"/>

    </target>
------------------
Thanks for the help.

Peter Donald wrote:

> Hi,
>
> It all looks right. Do you want to send the property definitions in your
> file - it could be something there.
>
> Cheers,
>
> Pete
>
> *------------------------------------------------------*
> | "Nearly all men can stand adversity, but if you want |
> | to test a man's character, give him power."          |
> |       -Abraham Lincoln                               |
> *------------------------------------------------------*

--
_________________________________________
|> Brett Francis
|> mediagate, inc.
|> mailto:brett@mediagate.com



Re: Random Classes not being Compiled

Posted by Peter Donald <do...@mad.scientist.com>.
Hi,

It all looks right. Do you want to send the property definitions in your
file - it could be something there.

Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*