[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dsdp-mtj-dev] PackageBuilder ignoring generated classes


  Thanks David, I will take a look on these classes.

  Cheers

  Thiago Moreira

On Mon, Nov 9, 2009 at 7:40 AM, David Marques <dpsmarques@xxxxxxxxx> wrote:
Hi Thiago,

    Take a look at the following classes:
  • org.eclipse.mtj.internal.core.l10n.L10nApi
  • org.eclipse.mtj.internal.jmunit.core.api.AbstractTestWriter (and it's subclasses)
They should help you on this task :)

Cheers,

 
David Marques
Mobile Software Platforms Researcher
=============================================================

Eclipse Mobile Industry Working Group - http://www.eclipse.org/pulsar/
Eclipse Mobile Tools for the Java Platform - http://www.eclipse.org/dsdp/mtj/
=============================================================



From: Thiago Moreira (timba) <tmoreira2020@xxxxxxxxx>
To: Mobile Tools for The Java Platform mailing list <dsdp-mtj-dev@xxxxxxxxxxx>
Sent: Sun, November 8, 2009 10:41:13 AM

Subject: Re: [dsdp-mtj-dev] PackageBuilder ignoring generated classes


  Hey David,

  Yep! I think that this is the only solution.

  Can you provide me a snippet of code that create a stub from a IJavaProject object. I tried to find something in google but I think I'm doing the wrong question, every result is related to RMI stubs :-\.

  Thanks

  Thiago Moreira

On Sun, Nov 8, 2009 at 9:46 AM, David Marques <dpsmarques@xxxxxxxxx> wrote:
Hi Thiago,

    The only solution i could find was to add stubs to the source code. The thing is that MTJ needs to find the source for every class in order to match the source file with the entries on the build.properties file.


Best Regards,
 
David Marques
Mobile Software Platforms Researcher
=============================================================

Eclipse Mobile Industry Working Group - http://www.eclipse.org/pulsar/
Eclipse Mobile Tools for the Java Platform - http://www.eclipse.org/dsdp/mtj/
=============================================================



From: Thiago Moreira (timba) <tmoreira2020@xxxxxxxxx>
To: Mobile Tools for The Java Platform mailing list <dsdp-mtj-dev@xxxxxxxxxxx>
Sent: Sat, November 7, 2009 12:50:18 PM

Subject: Re: [dsdp-mtj-dev] PackageBuilder ignoring generated classes


  Hey David and all,

  I double checked my problem and verified that the method PackageBuilderVisitor.findResourceOriginalPath will always return a EMPTY path for the classes that Floggy will embedded (net/sourceforge/floggy/persistence/impl).
  The only way that I think that is possible to fix it without changing MTJ is hacking the IJavaProject object. Stubs does something similar? The invocation that needs to return a not null object is this

IJavaElement jElement = jProject.findElement(sourcePath);

  Makes sense?

  Cheers

  Thiago Moreira 

On Fri, Nov 6, 2009 at 12:48 AM, Thiago Moreira (timba) <tmoreira2020@xxxxxxxxx> wrote:

  Hey David and all,

  Is there another way to embedded *.class files in the final package in the Pulsar bundles? The thing is the classes stored in net/sourceforge/floggy/persistence/impl must not be visible to the developer. Thoughts?

  Cheers

  Thiago Moreira



On Thu, Nov 5, 2009 at 12:20 AM, Thiago Moreira (timba) <tmoreira2020@xxxxxxxxx> wrote:

  Hey David,

  I tried what you suggested and it didn't work. Floggy weaver works exactly the way that you described, copying the classes before the package builder run.

  Attached you will find our .project file that ensure the builders execution sequence.

  Best

  Thiago Moreira


On Wed, Nov 4, 2009 at 8:50 AM, David Marques <dpsmarques@xxxxxxxxx> wrote:
Hi Thiago,

    I will try to set up my eclipse environment this week in order to try to help you on this. Have you tried creating an empty package (for example src/my/test) on your project and added it to the <configuration>.includes entry in your build.properties. Yor classes should be copied to the bin/my/test during the build process sometime before the package builder is run.


Best Regards,
 
David Marques
Mobile Software Platforms Researcher
=============================================================

Eclipse Mobile Industry Working Group - http://www.eclipse.org/pulsar/
Eclipse Mobile Tools for the Java Platform - http://www.eclipse.org/dsdp/mtj/
=============================================================



From: Thiago Moreira (timba) <tmoreira2020@xxxxxxxxx>

To: Mobile Tools for The Java Platform mailing list <dsdp-mtj-dev@xxxxxxxxxxx>
Sent: Tue, November 3, 2009 11:44:23 PM

Subject: Re: [dsdp-mtj-dev] PackageBuilder ignoring generated classes


  Hi David,

  Regarding the build.properties I made a test with eclipse-pulsar-galileo-SR1-linux-gtk-x86_64 and once I add the classes that I want to embedded in final jar and save, my changes are wiped out from the build.properties!
  I also made the same test with another Pulsar bundle, don't remember the name/version, and got a NullPointerException at PackageBuilderVisitor.isOnBuildProperties.

  Thanks in advance.

  Thiago Moreira 

On Fri, Oct 30, 2009 at 8:57 AM, David Marques <dpsmarques@xxxxxxxxx> wrote:
Hi Dan,

    You haven't said anything about the build properties, so i assume you added the entries required for the package builder to include your generated class files into the app JAR right !? Follows some answers:


1) I'm assuming this extra build before launching is intended... is this right ?
    - Well, is it being invoked explicitly by MTJ code !? Auto builds are quite hard to presume, it sometimes runs for weird reasons :(


2) Is there something about the build I could detect, or hints on how to know if I need to re-build ?
    - Well besides the resource deltas i think you should take a look at the build hooks extension point.

3) Any other advice :)
    - Let me know if it does not work still... I will try to find some time to help you on this on the weekend :)


Best Regards,
 
David Marques
Mobile Software Platforms Researcher
=============================================================

Eclipse Mobile Industry Working Group - http://www.eclipse.org/pulsar/
Eclipse Mobile Tools for the Java Platform - http://www.eclipse.org/dsdp/mtj/
=============================================================



From: Dan Murphy <dgemurphy@xxxxxxxxx>
To: Mobile Tools for The Java Platform mailing list <dsdp-mtj-dev@xxxxxxxxxxx>
Sent: Fri, October 30, 2009 7:04:20 AM

Subject: Re: [dsdp-mtj-dev] PackageBuilder ignoring generated classes

Hi David & co,

I had a little luck last night and figured out what was going wrong, but would appreciate to know if this is expected behavior....

A little background... With Eclipse 3.4, MTJ 0.9 & Floggy we had a number of reports of infinite build loops when build automatically was enabled. To get around this we put in a check to only do byte code weaving if a change was detected in a source folder.

What I'm now seeing is that just before a midlet is launched a build is initiated... The Java builder compile the code, but since the build delta doesn't contain a source code change floggy's builder doesn't do anything. The preverification builder and package builder then pickup the new class file (that doesn't contain the floggy woven code) and launches... end result is that the class doesn't contain the additional bytecode needed to work.

To test this I removed the condition in the floggy builder and hey-presto it all worked. I didn't get an infinite build loop, however it didn't always happen in the past, so am a little concerned about leaving this out. I could change the conditional build, say to only build if a change to the output is detected but am thinking that things other than class files may be here also... I guess I could change to build only if a class file changes in the bin directory, since the preverfication builder outputs to the .mtj temp directory I should be safe from java->floggy->preverify->floggy loops (?)

So, a couple of Qs...
1) I'm assuming this extra build before launching is intended... is this right ?
2) Is there something about the build I could detect, or hints on how to know if I need to re-build ?
3) Any other advice :)

Thanks in advance,
Dan

2009/10/29 Dan Murphy <dgemurphy@xxxxxxxxx>
Hi David, thanks for the info. I'll have another try with the build.properties. When I tried manually changing this file it didn't seem to work. However that was with the 1.0 release so things may have changed since then.

All the best,
Dan

----- Sent on the hoof from my phone ! -----

On 29 Oct 2009, at 12:53, David Marques <dpsmarques@xxxxxxxxx> wrote:

Hello All,

    The last builder for an MTJ project is the PackageBuilder. This builder is responsible to filter the content on the bin/ directory and package only the files/folders that match any 'include' entry within the build.properties. As soon as the generated classes are copied into the bin/ folder before the package builder is run and an entry like net/sourceforge/floggy/ is in the include part of the build.properties it should work :)

Best Regards,
 
David Marques
Mobile Software Platforms Researcher
=============================================================

Eclipse Mobile Industry Working Group - http://www.eclipse.org/pulsar/
Eclipse Mobile Tools for the Java Platform - http://www.eclipse.org/dsdp/mtj/
=============================================================



From: Dan Murphy <dgemurphy@xxxxxxxxx>
To: Mobile Tools for The Java Platform mailing list <dsdp-mtj-dev@xxxxxxxxxxx>
Sent: Thu, October 29, 2009 5:22:57 AM
Subject: Re: [dsdp-mtj-dev] PackageBuilder ignoring generated classes

Hi Thiago,
The reason I went for the jar approach was that creating stubs seemed likey to result in the stubs being stored in the users scm system, which I thought was best avoided.

With the latest trunk, the weaver customised impl classes are being jar'd and copied. The problem is that the weaver persistable classes are not being copied from the floggy temp directory back into the project bin directory... Either that or the bin directory needs a refresh.. Whatever the cause, the woven data classes are not apppearing in the jar used by the emulator.

I'll continue to have a look over lunch today

Cheers,
Dan

----- Sent on the hoof from my phone ! -----

On 29 Oct 2009, at 01:54, "Thiago Moreira (timba)" <tmoreira2020@xxxxxxxxx> wrote:


  Hi all,

  I would like bring this thread back to live: http://dev.eclipse.org/mhonarc/lists/dsdp-mtj-dev/msg01298.html. We still didn't fix it so I'm here to ask more questions.

  David, how can I build stubs like you said in your last comment? I made a search and found the below reference of stubs and pde, it is related to what you meant ?

  http://www.techq.com/source/java/Eclipse-PDE/3.4.2/org/eclipse/pde/api/tools/internal/provisional/stubs/Converter.html

  Let me explain a little more how Floggy works, so maybe you guys can give us a better feedback

  1º compiler finish its process
  2º Floggy weaver start to analyze the bytecodes
  3º Floggy weaver will for each class that implements Persistable add methods and fields in the class.
  4º Floggy weaver will drop off predefined classes into bin folder to the package net.sourceforge.floggy.persistence.impl. These classes doesn't have a java file pair.

  Until the third step everything works fine since we have a correlated .java file for each .class file.

  The problem is MTJ does not embedded the classes from the fourth step!

  Any help is appreciated. Thanks in advance.

  Thiago Moreira

 

 
_______________________________________________
dsdp-mtj-dev mailing list
dsdp-mtj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-mtj-dev

_______________________________________________
dsdp-mtj-dev mailing list
dsdp-mtj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-mtj-dev



_______________________________________________
dsdp-mtj-dev mailing list
dsdp-mtj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-mtj-dev




_______________________________________________
dsdp-mtj-dev mailing list
dsdp-mtj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-mtj-dev






_______________________________________________
dsdp-mtj-dev mailing list
dsdp-mtj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-mtj-dev




_______________________________________________
dsdp-mtj-dev mailing list
dsdp-mtj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-mtj-dev