jar.mn, global extensions: let's improve the documentation

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

jar.mn, global extensions: let's improve the documentation

Fritz Schneider-2
So I'm integrating a global extension into Firefox and run up against
issues creating my jar.mn file. In particular I ran into or discovered
the following things that aren't covered on the MDC page:

- %-directives _must_not_ be indented

- files to include in the jar _must_be_ indented

- you cannot have blank lines in your list of files for the jar

- if you don't want to build with a jar you can add ac_add_options
--enable-chrome-format=flat to your mozconfig

- i have some files i want copied over into the extension but that
aren't accessible at chrome:// urls and are not part of the jar. for
example i have a bunch of js files that i want to have live in a lib/
directory and be loaded by the subscript loader. i can't actually
figure out how to do this, perhaps someone can help?

Also, it's not clear to me why or how the magic that implicitly copies
things from src/ to components/ and the like. It seems like this stuff
should all be explicit (either in a config file or explicitly stated
that this will happen in build docs) instead of happening due to
magic.

I'm happy to file bugs or update the wiki page, just let me know.
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds
Reply | Threaded
Open this post in threaded view
|

Re: jar.mn, global extensions: let's improve the documentation

Fritz Schneider-2
> Also, it's not clear to me why or how the magic that implicitly copies
> things from src/ to components/ and the like.

Scratch that comment :)
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds
Reply | Threaded
Open this post in threaded view
|

Re: jar.mn, global extensions: let's improve the documentation

Benjamin Smedberg
In reply to this post by Fritz Schneider-2
Fritz Schneider wrote:
> So I'm integrating a global extension into Firefox and run up against
> issues creating my jar.mn file. In particular I ran into or discovered
> the following things that aren't covered on the MDC page:
>
> - %-directives _must_not_ be indented

That's a function of the "XUL" preprocessor, not the jar.mn parser, but sure.

> - files to include in the jar _must_be_ indented

Correct, otherwise the jar.mn parser doesn't know what you mean.

> - you cannot have blank lines in your list of files for the jar

Correct.

> - if you don't want to build with a jar you can add ac_add_options
> --enable-chrome-format=flat to your mozconfig

Correct, though JARs are highly recommended for releases, since they reduce
the I/O burden of reading a bunch of separate files and make it easier for
the fastload system to cache timestamps.

It's also possible to override this behavior for a particular directory by
setting MOZ_CHROME_FILE_FORMAT=flat *after you include autoconf.mk but
before you include config.mk or rules.mk*.

> - i have some files i want copied over into the extension but that
> aren't accessible at chrome:// urls and are not part of the jar. for
> example i have a bunch of js files that i want to have live in a lib/
> directory and be loaded by the subscript loader. i can't actually
> figure out how to do this, perhaps someone can help?

Are you building your extension using XPI_NAME (so that your extension is
staged to dist/xpi-stag/<foo> instead of dist/bin)? If you do, it's pretty
simple to add rules at the end of your Makefile.in *after you have included
rules.mk*:

LIB_FILES = \
   mylib1.js \
   mylib2.js \
   $(NULL)

libs:: $(addprefix $(srcdir)/,$(LIB_FILES))
<tab>$(INSTALL) $^ $(FINAL_TARGET)/lib

--BDS
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds
Reply | Threaded
Open this post in threaded view
|

Re: jar.mn, global extensions: let's improve the documentation

Fritz Schneider-2
> Are you building your extension using XPI_NAME (so that your extension is
> staged to dist/xpi-stag/<foo> instead of dist/bin)? If you do, it's pretty
> simple to add rules at the end of your Makefile.in *after you have included
> rules.mk*: ...

Great, thanks, that's really helpful.

Shall I update the wiki with this info or would you like to?
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds
Reply | Threaded
Open this post in threaded view
|

Re: jar.mn, global extensions: let's improve the documentation

Benjamin Smedberg
In reply to this post by Benjamin Smedberg
Fritz Schneider wrote:
>> Are you building your extension using XPI_NAME (so that your extension is
>> staged to dist/xpi-stag/<foo> instead of dist/bin)? If you do, it's pretty
>> simple to add rules at the end of your Makefile.in *after you have included
>> rules.mk*: ...
>
> Great, thanks, that's really helpful.
>
> Shall I update the wiki with this info or would you like to?

If you can I'd much appreciate it. I'm not sure where/whether XPI_NAME is
currently documented, so you might need to start new pages. I've been
meaning to update and write a guide to the build system and glossary of
makefile variables but it's a big task and I haven't gotten around to it.

--BDS
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds
Reply | Threaded
Open this post in threaded view
|

Re: jar.mn, global extensions: let's improve the documentation

Fritz Schneider-2
What magic should I add to Makefile.in to ensure that it is only
actually made if the application is Firefox?
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds
Reply | Threaded
Open this post in threaded view
|

Re: jar.mn, global extensions: let's improve the documentation

Axel Hecht-2
In reply to this post by Benjamin Smedberg
Fritz Schneider wrote:
> What magic should I add to Makefile.in to ensure that it is only
> actually made if the application is Firefox?

Add it to the browser dir? Not sure what we're talking about here.

Axel
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds
Reply | Threaded
Open this post in threaded view
|

Re: jar.mn, global extensions: let's improve the documentation

Benjamin Smedberg
In reply to this post by Benjamin Smedberg
Fritz Schneider wrote:
> What magic should I add to Makefile.in to ensure that it is only
> actually made if the application is Firefox?

That depends on the circumstances... if you're putting something new in
extensions/* then it really shouldn't be necessary, people just shouldn't
build that extension for non-Firefox. If you're putting it somewhere else,
you probably want to add an ifdef to the makefile that builds your makefile.

--BDS
_______________________________________________
dev-builds mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-builds