Update:
This answer is now mostly superseded by:
I am not sure about the difference between "Kernel"
and "Application"
, but I was able to gather the following information:
Adding the "Kernel"
extension to PacletInfo.m
allows the paclet to provide a package that is loadable with Needs
. (I have not tried if "Application"
works too).
In order for this to work, it seems to be necessary to set the Context
and Root
arguments, like so:
Paclet[
Name -> "MyPack",
Version -> "0.0.1",
MathematicaVersion -> "10.0+",
Description -> "My Mathematica Application",
Creator -> "John Johnson",
Extensions ->
{
{"Kernel", Root -> ".", Context -> "MyPack`"}
}
]
Effects of setting Context -> "MyPack`"
:
FindFile["MyPack`"]
will resolve to the correct location so that the package can get loaded byNeeds
orGet
.If the
"Documentation"
extension is also present, then symbol usage messages will get a little>>
sign at the end. Clicking it will open the correct documentation page.The value can also be a list of contexts.
Effects of setting Root
:
FindFile["MyPack`"]
will search in the location thatRoot
points to in the usual manner: it will resolve either toinit.m
, toKernel/init.m
, toMyPack.m
(or I assume to the other usual possibilities such as.mx
files within directories having names agreeing$SystemID
—but I haven't tried this one)The usual setting would be
Root -> "."
when the package root coincides with the paclet root, but we can also put all the package files and aninit.m
in a subdirectory and point to that instead.
Further reading
- How to distribute Mathematica packages as paclets?How to distribute Mathematica packages as paclets?