Connor, I work with Andrew. We ended up creating our own PacletExtensionHandler
that specifically returns {}
as the list of Files for the "Path"
extension. This PacletExtensionHandler
, which is called a BuildHandler
below, also has the option to skip the documentation build, which is very useful while developing and testing the Paclet. It would be a great option to have in PacletBuild
.
Our call to PacletBuild
:
PacletTools`PacletBuild[$AlexDeveloperPath <> "/Paclet",
OverwriteTarget -> True,
PacletExtensionHandlers :> alexBuildHandler
]
Here's our BuildHandler
:
alexBuildHandler := <|
PacletTools`$PacletExtensionHandlers,
"Documentation" -> <|"DefaultRoot" -> "Documentation",
"Files" -> PacletTools`PacletExtensionFiles`Private`handleExt,
"Build" -> docBuildHandler|>,
"Path" -> <|"DefaultRoot" -> "Kernel", "Files" -> ({} &), "Build" -> ({} &)|>
|>;
The docBuildHandler
is defined with the following functions. $AlexDeveloperPath
is our developer directory. When it's done building, we save a file "LastDocBuild" which contains the results of PacletBuild``Private``handleExt
, which tracks the location of the built document files
defineDocumentHandler[aBuildDocs_] := Block[{},
ClearAll[docBuildHandler];
If[aBuildDocs,
docBuildHandler = buildAndSaveDocumentObj
, (* ELSE - return the old documentation build information *)
docBuildHandler = documentBuildObj;
]
];
documentBuildObj::nobuild = "No documentation build found in `1`. Run alexBuildHandler[\"BuildDocumentation\"->True]";
documentBuildObj = Block[{path},
If[!DirectoryQ[documentBuildPath], RenameDirectory[savedDocumentsPath, documentBuildPath]];
path = $AlexDeveloperPath <> "/Paclet/build/LastDocBuild.m";
If[!FileExistsQ[path], Message[documentBuildObj::nobuild, path]];
Get[path]
]&;
buildAndSaveDocumentObj[{"Documentation", ___}, pacletRoot_?DirectoryQ, buildPacletRoot_?DirectoryQ, _?ListQ] := Block[
{result},
result = PacletTools`PacletBuild`Private`handleExt[{"Documentation"}, pacletRoot, buildPacletRoot, {}];
Put[result, $AlexDeveloperPath <> "/Paclet/build/LastDocBuild.m"];
result
];