Ant versus Eclipse conflict

Project:JNode All
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Since the split of classlib, I've noticed problems with 'ant' builds following a full rebuild from Eclipse. This manifests as "bizarre" compilation errors for "./build.sh cd-x86-lite"; e.g. claiming that "java.lang.System" does not exist. The problem is cured by running "./build.sh clean".

Today I figured out what is causing this. One of the ant targets caused the classlib.jar file to be unjar'ed into "core/build/classes" if a timestamp file is out of date or missing. But when Eclipse does a full rebuild of 'core' it starts by cleaning out all old .class files.

Is there any reason why I shouldn't change the jnode build.xml files to get rid of the unjaring of classlib.jar, and put classlib.jar into the "cp" classpath?

#1

The 'unjar'-ring happens because those classes are packed up as plugins.

#2

Ok, so why cant they be packaged as plugins from the jarfile like so many other plugins are? We dont unjar ant before packing into a plugin, why do we unjar classlib?

#3

This solution didn't need any change in the deployment descitpors and most probably it's also faster than creating the plugin from the jar. I'm still thinking about how to optimize this more to reduce the build time.

#4

The main thing is the impact it has on the fs cache of the OS. Its just a lot of files to deal with.

#5

An optimization would be that instead of unpacking the jar the build system would build the related plugin. Then those plugins would be built only when the classlib is changing. The hard part of this solution is that some part of those plugins come from trunk and not classlib6 and so sould be built from source.

#6

Well for me, the unpacking of classlib into core/build/classes is an anti-optimization ... since it regularly forces me to do a "clean" build. I would really appreciate it if you could fix it.

But I'd prefer it if you committed the patch in issue #2993 first.

#7

Unpacking the classlib was necessary for building the plugins. It's not an optimization, it's one step of a process that must be optimized.

#8

No matter how you describe it, it is causing me grief. It is not optimization that is needed ... it is fixing.

Why do the classes need to be unpacked into core/build/classes? Why can't they be unpacked somewhere else?

#9

I have same problem than you. Eclipse freeze on refresh, I have try to start eclipse with -Xmx3g with out result.

You can try this temporary patch (on attached file).
Run ant clean before patch.

This patch change it :

Classlib.jar is unjar out of workspace (/jnode/classes)
After ant build, core classes are coyed to /jnode/classes

PS: Core classes need to be copied at same place than classlib for the Ant plugin AsmConstBuilder.
Perhaps AsmConstBuilder can be re write for using two classes directory (classesURL parameter)?

AttachmentSize
ant-patch.txt2.12 KB

#10

I have committed a probable fix for this problem.
You can read the details here then test it: http://www.jnode.org/node/2973

#11

To the Eclipse users!
Are there any more problems here?

#12

Status:active» fixed

I haven't seen any more issues since Levente's fix for the problem. Marking as fixed.

#14

Status:fixed» closed

Manually closed