Discussion:
Issue with exporting Antenna files from Eclipse and project dependencies
Rory Fitzpatrick
2008-07-16 16:21:17 UTC
Permalink
Sorry to dig up an old thread but I'm coming accross the same problem and
was wondering if theres been any progress in diagnosing it? I considered
looking at it myself but realised it would take forever just to know where
to look!

I have several projects depending on each other but even one with only one
dependency fails with the same error as below.

I'm running:
Eclipse 3.3.1.1
EclipseME 1.7.9
Antenna 1.1.0-beta (I think)

Is the MJT platform in a state that we can start moving accross to it?
(slightly unrelated, just thought I'd ask!)

Cheers
Rory

Scott,

I will have to look at this a bit more closely when I have more time and
brain power. You may have found a problem with the export, but my brain
is not functioning well enough at this point in the day to sort it out. :-)

Thanks,
Craig
I am trying to configure my Eclipse J2ME projects such that I can do
command line builds. I can build and run the emulator from Eclipse, but
I cannot build with the generated Antenna Build files. The issue seems
be when one project is a dependency of the other. I was able to come up
with a workaround by modifying the eclipseme-build.xml file, but I'm
looking for a better solution.
- Create a TestLib J2ME Suite
- Put a single Java class called TestClass in a package called com.foo.
It's constructor does a System.out.println() so I can tell when it's
called
- Create a TestApp J2ME Suite
- Put a single Midlet class whose startApp() also does a
System.out.println(), then creates an instance of com.foo.TestClass
- Add TestLib to the Java Build Path of TestApp, and have it checked in
the Order and Export tab.
When I run this from within Eclipse, the Emulator starts and I see both
of my print messages and everything seems happy.
Then I started trying to work on getting things working from the command
line. First I export the Antenna build files for the TestLib library
and built that. Then I export the Antenna build files for the main
===================================================
C:\Documents and Settings\swilliams\workspace\TestApp>%ANT_HOME%\bin\ant
Buildfile: build.xml
[echo] Initializing build environment...
[echo] Initializing EclipseME Antenna build environment...
[echo] Building source files...
[wtkbuild]
**************************************************************
[wtkbuild] * Antenna 0.9.15 initialized for project "TestApp"
*
[wtkbuild] * Using Sun Wireless Toolkit 2.5 (CLDC-1.1; MIDP-2.1)
*
[wtkbuild]
**************************************************************
[wtkbuild] Compiling 1 source file to C:\Documents and
Settings\swilliams\workspace\TestApp\9db49ca5.tmp\tmpclasses
[wtkbuild] C:\Documents and
Settings\swilliams\workspace\TestApp\src\TestMidlet.java:23: package
com.foo does not exist
[wtkbuild] new com.foo.TestClass();
[wtkbuild] ^
[wtkbuild] 1 error
BUILD FAILED
C:\Documents and
Settings\swilliams\workspace\TestApp\eclipseme-build.xml:25: Compile
failed; see the compiler error output for details.
===================================================
I came up with a workaround by changing three things in
I changed the locations of classpath.TestLib (they were oddly the same
<path id="classpath.TestLib">
<path location="${path.build.classes}"/>
<path location="${path.build.classes}/_no_export"/>
</path>
<path id="classpath.TestLib">
<path location="${project.root.TestLib}/build/classes"/>
<path
location="${project.root.TestLib}/build/classes/_no_export"/>
</path>
And then I changed the classpath being used in the -eclipseme-build
target to refer to classpath.TestLib instead of classpath.TestLib. I
<target depends="-eclipseme-initialize" name="-eclipseme-build">
<echo message="Building source files..."/>
<wtkbuild destdir="${path.build.classes}"
encoding="${src.encoding}" source="1.3" sourcepath=""
srcdir="${project.root.TestApp}/src">
<classpath refid="classpath.TestApp"/>
</wtkbuild>
<wtkbuild destdir="${path.build.classes}"
encoding="${src.encoding}" source="1.3" sourcepath=""
srcdir="${project.root.TestApp}/res">
<classpath refid="classpath.TestApp"/>
</wtkbuild>
</target>
<target depends="-eclipseme-initialize" name="-eclipseme-build">
<echo message="Building source files..."/>
<wtkbuild destdir="${path.build.classes}"
encoding="${src.encoding}" source="1.3" sourcepath=""
srcdir="${project.root.TestApp}/src">
<classpath refid="classpath.TestLib"/>
</wtkbuild>
<wtkbuild destdir="${path.build.classes}"
encoding="${src.encoding}" source="1.3" sourcepath=""
srcdir="${project.root.TestApp}/res">
<classpath refid="classpath.TestLib"/>
</wtkbuild>
</target>
And then in the -eclipseme-internal-package task I changed the
classpath.TestLib to be a libclasspath instead of a classpath so it
<target depends="-eclipseme-build"
name="-eclipseme-internal-package">
<copy file="${midlet.name}.jad" todir="${path.build.output}"/>
<wtkpackage autoversion="${flag.autoversion}"
jadfile="${path.build.output}/${midlet.name}.jad"
jarfile="${path.build.output}/${midlet.name}.jar" obfuscate="false"
preverify="${flag.preverify}">
<fileset dir="${path.build.classes}">
<exclude name="_no_export/"/>
</fileset>
<classpath refid="classpath.TestApp"/>
<fileset dir="${project.root.TestApp}/src">
<exclude name="**/*.java"/>
<exclude name="build/"/>
</fileset>
<fileset dir="${project.root.TestApp}/res">
<exclude name="**/*.java"/>
<exclude name="build/"/>
</fileset>
<classpath refid="classpath.TestLib"/>
</wtkpackage>
<antcall target="-eclipseme-obfuscate"/>
</target>
<target depends="-eclipseme-build"
name="-eclipseme-internal-package">
<copy file="${midlet.name}.jad" todir="${path.build.output}"/>
<wtkpackage autoversion="${flag.autoversion}"
jadfile="${path.build.output}/${midlet.name}.jad"
jarfile="${path.build.output}/${midlet.name}.jar" obfuscate="false"
preverify="${flag.preverify}">
<fileset dir="${path.build.classes}">
<exclude name="_no_export/"/>
</fileset>
<classpath refid="classpath.TestApp"/>
<fileset dir="${project.root.TestApp}/src">
<exclude name="**/*.java"/>
<exclude name="build/"/>
</fileset>
<fileset dir="${project.root.TestApp}/res">
<exclude name="**/*.java"/>
<exclude name="build/"/>
</fileset>
<libclasspath refid="classpath.TestLib"/>
</wtkpackage>
<antcall target="-eclipseme-obfuscate"/>
</target>
And then everything built, and I can run the emulator from the command
line and it printed out both messages.
So I don't really want to modify eclipseme-build.xml; so my questions
are did I figure my project(s) wrong, or did I uncover a bug in how
eclipseme-build.xml is being generated? And, if so, is there a
different/better way for me to work around the issue than to change the
eclipseme-build.xml file?
Eclipse: Version: 3.3.2 (Build id: M20080221-1800)
Antenna 1.0.0 (although it seems to report itself as 0.9.15)
Eclipse ME 1.7.7
Wireless Toolkit 2.5.2
Ant 1.7.0
Thanks.
---
Scott Williams
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Eclipseme-users mailing list
https://lists.sourceforge.net/lists/listinfo/eclipseme-users
Loading...