It has been a really long time since I did that work and everything is
a bit fuzzy. I do know that part of this came down to exported
classes/libraries (in the build path) versus those that are not.
Unfortunately, it would take me some time to remember the details and
let you know for sure.
In terms of supporting multiple targets, I'm not really sure why the
current build files need to change substantially. In general, it would
seem that the current Ant targets should stay (with minor modifications
as necessary) and a new Ant target should be added. That new Ant
target would call the current Ant targets as necessary to meet the
needs of each of the target device specifications. Is there something
I'm missing?
Thanks,
Craig
Feng.Wang@xxxxxxxxxx wrote:
Hi Craig,
I am now doing some enhancement about Antenna build
files
export functionality, to make it can build for multi-target.
I have some question about the old version of the
feature.
I wonder if you still remember the detail of the implementation and can
give me some technical support.
My question is:
1. About "-mtj-initialize"
task in mtj-build.xml file. What is the purpose to make following
folder?
May I just make that folder without other consideration?
<mkdir
dir="${path.build.classes}/_no_export"/>
This seems safe. I can't remember if there were reasons that it would
not be safe.
2. Class
AntennaBuildExporter$BuildClasspathEntryVisitor
is
quite complex. Can I say that the purposes of this class are:
1, make up the <path> element in
mtj-build.xml
like this:
<path
id="classpath.Wang_Feng_Test">
<path
location="${path.build.classes}"/>
<path
location="${path.build.classes}/_no_export"/>
<path
location="${project.root.Wang_Feng_Test}/lib/svg.jar"/>
</path>
<path
id="classpath.MyMidletProject">
<path
location="${path.build.classes}"/>
<path
location="${path.build.classes}/_no_export"/>
</path>
2, make up the srcdir attribute in <wtkbuild>
task, like this:
<target
depends="-mtj-initialize"
name="-mtj-build">
<echo
message="Building
source files..."/>
<wtkbuild
destdir="${path.build.classes}"
encoding="${src.encoding}"
source="1.3"
sourcepath=""
srcdir="${project.root.Wang_Feng_Test}/res">
<classpath
refid="classpath.Wang_Feng_Test"/>
</wtkbuild>
<wtkbuild
destdir="${path.build.classes}"
encoding="${src.encoding}"
source="1.3"
sourcepath=""
srcdir="${project.root.Wang_Feng_Test}/src">
<classpath
refid="classpath.Wang_Feng_Test"/>
</wtkbuild>
</target>
I do know that the classpath entry visitor stuff is non-trivial, as it
needs to recursively search through the build/classpath to correctly
include things. In all of your examples, you have simplified things
such that prerequisite projects are no longer considered. I don't
think that is what we want.
3. BTW, I find
that if a project refer another project, the exported build files will
fail to build, end with an error say that cannot find a class. I guess
it will be hard for an exported ant build file to solve this problem,
because
the exported Ant build files may have to contain targets that build all
the projects in a certain sequence, the sequence is not easy to
determine.
While things may currently be broken in
regards to prerequisite project building, it should certainly be
possible and definitely worked at one point in the past. I think
rather than removing the support, we should figure out why it is broken
and try to get it fixed. It is a very useful function and I know that
it has been used by EclipseME users pretty heavily in the past.
Best Regards,
Feng(Marvin) Wang(王峰)
Sybase Software (China) Co., Ltd
Room 1202-1203, Building One,
Zhangjiang Semiconductor Industry Park
3000 Longdong Avenue
Pudong, Shanghai 201203
Tel: +8621-38657441 or 258-7441
email: feng.wang@xxxxxxxxxx
|