Status

Core Graveyard
Java to XPCOM Bridge
RESOLVED FIXED
11 years ago
3 years ago

People

(Reporter: jhp (no longer active), Assigned: jhp (no longer active))

Tracking

(Depends on: 1 bug, {fixed1.8.1.4})

Trunk
fixed1.8.1.4
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 3 obsolete attachments)

(Assignee)

Description

11 years ago
 
(Assignee)

Comment 1

11 years ago
Created attachment 236251 [details] [diff] [review]
patch

This is an attempt at a browser based JavaXPCOM unit test.  This patch creates a Java component (using Java Component Loader code from bug 299263).  The tests are run by loading the web page and clicking on the 'Run' button.

Updated

11 years ago
Blocks: 347708
(Assignee)

Updated

11 years ago
Depends on: 299263
(Assignee)

Updated

11 years ago
Depends on: 351871
(Assignee)

Comment 2

11 years ago
Created attachment 252381 [details] [diff] [review]
patch v2 - make check

Different approach.  This patch cleans up the existing tests and adds some new ones, which can all be run from the command line when calling 'make check'.

As before, I am using the interfaces from the XPConnect tests.  However, since the C++ component of the XPConnect tests isn't built when building XULRunner (see bug 315090), I rolled my own version in Javascript (xpctests.js).

There is one issue remaining.  The Java tests are all built against MozillaInterfaces.jar, which isn't built until the end of 'libs' step (after the Java tests have supposedly been built).  So I need to find a clever way to build the Java tests after MozillaInterfaces.jar has been built.
Attachment #236251 - Attachment is obsolete: true
(Assignee)

Updated

11 years ago
Depends on: 367792
(Assignee)

Updated

11 years ago
No longer depends on: 299263
(Assignee)

Updated

11 years ago
Depends on: 367793
(Assignee)

Comment 3

11 years ago
Created attachment 253345 [details] [diff] [review]
patch v2.1 - make check

This patch rearranges how JavaXPCOM is built.  Currently, the main make call to JavaXPCOM happens in tier_toolkit.  This results in building the JNI code (which gets linked in to libXUL) and the glue code.  Later, there is a special call to extensions/java/xpcom/interfaces in tier_app (for XULRunner) to build MozillaInterfaces.jar.  This setup isn't very good since it requires special rules in order to build any other Java code that depends on MozillaInterfaces.jar.

This patch moves the main make call to JavaXPCOM to the tier_app XULRunner group.  Since this is the last tier, MozillaInterfaces.jar can be built during the 'libs' stage in order to pick up all of the interfaces.  Then any Java code depending on MozillaInterfaces.jar is built during the same 'libs' stage.

The only special case that needs to be handled is the JNI code.  Since it is linked into libXUL, it needs to be built before the call to build libXUL.  So there is a line in tier_toolkit to make in extensions/java/xpcom/src.

Benjamin, can you review the Makefile changes?
Attachment #252381 - Attachment is obsolete: true
Attachment #253345 - Flags: review?(benjamin)
(Assignee)

Comment 4

11 years ago
Created attachment 254381 [details] [diff] [review]
patch v2.2 - make check

Properly handle "install" make target.
Attachment #253345 - Attachment is obsolete: true
Attachment #254381 - Flags: review?(benjamin)
Attachment #253345 - Flags: review?(benjamin)
(Assignee)

Updated

11 years ago
Duplicate of this bug: 369397

Comment 6

11 years ago
Comment on attachment 254381 [details] [diff] [review]
patch v2.2 - make check

>Index: extensions/java/xpcom/Makefile.in

>+# Build the implementation Java classes
>+libs::
>+	make -C src jar-libs
>+install::
>+	make -C src jar-install

Please add a line of whitespace between rules.
Attachment #254381 - Flags: review?(benjamin) → review+
(Assignee)

Comment 7

11 years ago
Since I am making a change to nsIXPCTestIn interface (fixing a method declaration), do I need to change the IID?

Comment 8

11 years ago
In general, yes.
(Assignee)

Comment 9

11 years ago
Checked in to trunk.  -> FIXED
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
(Assignee)

Comment 10

11 years ago
Created attachment 257077 [details] [diff] [review]
1.8.1 patch - makefile changes

This is the 1.8.1 branch version of the makefile reorg changes from the trunk patch.  XULRunner only.
Attachment #257077 - Flags: approval1.8.1.3?

Comment 11

11 years ago
This caused a build failure on the FF+XR tinderbox (the only one with --enable-tests):
d:/builds/tinderbox/Fx-XR/WINNT_5.2_Depend/mozilla/extensions/java/xpcom/tests/testparams/TestParams.java:64: warning: unmappable character for encoding Cp1252
	   "Non-Ascii 1 byte chars: Ž‰ŠˆŒ?, 2 byte chars: \u1234 \u1235 \u1236";

See http://tinderbox.mozilla.org/showlog.cgi?log=MozillaExperimental/1173081480.1173084330.23199.gz&fulltext=1
(Assignee)

Comment 12

11 years ago
Actually, there error is that it cannot find LocationProvider.java.  Seems that this bit of the command is failing:

-sourcepath ".;/cygdrive/d/builds/tinderbox/Fx-XR/WINNT_5.2_Depend/mozilla/extensions/java/xpcom/tests/testparams;/cygdrive/d/builds/tinderbox/Fx-XR/WINNT_5.2_Depend/mozilla/extensions/java/xpcom/tests/testparams/.."

I know that 'javac' is sensitive to windows build paths.  The command is called using 'cygwin-wrapper', so I assume that is replacing the 'cygdrive' instances.  Plus, why is this failing for this build, but not for the standalone XULRunner?

I don't have cygwin installed any more, but I did try to reproduce using Benjamin's new Windows tools (MSYS).  This build failed in mozilla/extensions/java/xpcom/interfaces, for what seems to be a similar issue.  The '-sourcepath' flag arguments have MSYS style paths (i.e. "/e/builds/trunk/...").  When I manually edited this to start with "e:/builds/...", then 'javac' completed just fine.

Really not sure what is going on.

Comment 13

11 years ago
(In reply to comment #12)
> Actually, there error is that it cannot find LocationProvider.java.  Seems that
> this bit of the command is failing:
> 
> -sourcepath
> ".;/cygdrive/d/builds/tinderbox/Fx-XR/WINNT_5.2_Depend/mozilla/extensions/java/xpcom/tests/testparams;/cygdrive/d/builds/tinderbox/Fx-XR/WINNT_5.2_Depend/mozilla/extensions/java/xpcom/tests/testparams/.."

The problem is that both the cygwin wrapper and the msys magic /c/path know how to convert standalone arguments, but they don't know how to convert an argument with semicolons.

>  Plus, why is this failing for this build, but not for the standalone
> XULRunner?

The main build has --disable-tests
(Assignee)

Comment 14

11 years ago
Moving Cygwin/MSYS build break discussion to already existing bug 363485.
Comment on attachment 257077 [details] [diff] [review]
1.8.1 patch - makefile changes

approved for 1.8.1.4, a=dveditz for release-drivers
Attachment #257077 - Flags: approval1.8.1.4? → approval1.8.1.4+
(Assignee)

Comment 16

11 years ago
Makefile changes checked in to MOZILLA_1_8_BRANCH.
Keywords: fixed1.8.1.4
Comment on attachment 257077 [details] [diff] [review]
1.8.1 patch - makefile changes

>+jar-install:: $(JARFILE)
>+	$(SYSINSTALL) $(IFLAGS2) $(JARFILE) $(DESTDIR)$(mozappdir)

This should be IFLAGS1, not IFLAGS2.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.