-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.wls
executable file
·52 lines (39 loc) · 1.27 KB
/
build.wls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
PacletUninstall["WebTools"];
(* copy source files to build directory *)
sourceDirectory = FileNameJoin[{Directory[],"WebTools"}];
Print["Using sourceDirectory: ", sourceDirectory];
buildDirectory = FileNameJoin[ { Directory[], "build", "WebTools" } ];
Print["Using buildDirectory: ", buildDirectory];
DeleteDirectory[ buildDirectory, DeleteContents->True ];
(*
CreateDirectory[ buildDirectory ];
*)
CopyDirectory[sourceDirectory, buildDirectory];
(* build documentation *)
Get["DocumentationBuild`"];
files = FileNames["*.nb", FileNameJoin[{buildDirectory, "Documentation"}], Infinity];
Print["files: ", files];
Scan[
Function[{file},
Module[{source},
source = RenameFile[file, file <> "-source"];
MakeNotebook[source, "RasterizeOutput" -> False, "outfile" -> file];
DeleteFile[source];
]],
files]
(* create index *)
Get["DocumentationSearch`"];
index = FileNameJoin[{buildDirectory, "Documentation", "English", "SearchIndex", "2"}];
Print["index: ", index];
CreateDirectory[index];
DocumentationSearch`CreateDocumentationIndex[
files,
FileNameDrop[index, -1],
"2",
OverwriteTarget -> True
]
ReinstallJava[]
(* create paclet *)
Print["Building new paclet"];
paclet = PackPaclet[ buildDirectory, ParentDirectory @ buildDirectory ];
Print["New paclet: ", paclet];