This notebook assists in creating the FEMAddOns-X.Y.paclet. The creation is two step process. First the source code and other files need to be copied alongside the documentation and secondly the actual paclet is created. Previously you should have generated the documentation as outlined in the HowToBuild.md file.
Get the distribution directory by using this notebook’s directory:
In[]:=
source=NotebookDirectory[]
Out[]=
/home/ruebenko/wri_git/FEMAddOns/
Construct the target directory from this notebooks base directory:
In[]:=
target=FileNameJoin[{source,"build","FEMAddOns"}]
Out[]=
/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns
Make sure the documentation build has created the necessary directories.
In[]:=
If[!DirectoryQ[target],Print["First create the documentation as outlined in the HowToBuild.md file"]]
Copy some files from the source to the target directory:
In[]:=
CopyFile[FileNameJoin[{source,#}],FileNameJoin[{target,#}],OverwriteTargetTrue]&/@{"Contributing.md","License.md","Readme.md","FEMAddOns.m","PacletInfo.m"}
Out[]=
{/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/Contributing.md,/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/License.md,/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/Readme.md,/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/FEMAddOns.m,/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/PacletInfo.m}
Copy the Resources directory from the source to the target directory:
In[]:=
If[FileExistsQ[FileNameJoin[{target,"Resources"}]],DeleteDirectory[FileNameJoin[{target,"Resources"}],DeleteContentsTrue]];CopyDirectory[FileNameJoin[{source,"Resources"}],FileNameJoin[{target,"Resources"}]]
Out[]=
/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/Resources
Make a list of sub-packages contained in FEMAddOns:
In[]:=
subPackages={"Applications","DistMesh","DomainDecomposition","FEMUtils","ImportMesh"};
Copy files from the source to the target directories:
In[]:=
CopyFile[FileNameJoin[{source,"FEMAddOns",#,"COPYING"}],FileNameJoin[{target,#,"COPYING"}],OverwriteTargetTrue]&/@subPackages
Out[]=
{/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/Applications/COPYING,/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/DistMesh/COPYING,/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/DomainDecomposition/COPYING,/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/FEMUtils/COPYING,/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/ImportMesh/COPYING}
Delete possibly outdated the source Kernel directories:
In[]:=
If[FileExistsQ[FileNameJoin[{target,#,"Kernel"}]],DeleteDirectory[FileNameJoin[{target,#,"Kernel"}],DeleteContentsTrue]]&/@subPackages
Out[]=
{Null,Null,Null,Null,Null}
Copy the source Kernel directories:
In[]:=
CopyDirectory[FileNameJoin[{source,"FEMAddOns",#,"Kernel"}],FileNameJoin[{target,#,"Kernel"}]]&/@subPackages
Out[]=
{/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/Applications/Kernel,/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/DistMesh/Kernel,/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/DomainDecomposition/Kernel,/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/FEMUtils/Kernel,/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns/ImportMesh/Kernel}
This concludes the file and directory coping. Next, the paclet itself will be build. Load the paclet manager to create the paclet
In[]:=
Needs["PacletManager`"]
Change into the build directory:
In[]:=
SetDirectory[FileNameJoin[{source,"build"}]]
Out[]=
/home/ruebenko/wri_git/FEMAddOns/build
Check that this is the right directory; To a minimum it needs to contain the FEMAddOns directory:
In[]:=
FileNames[]
Out[]=
{FEMAddOns,FEMAddOns-1.4.5.paclet,FEMAddOns-1.4.6.paclet,FEMAddOns-1.4.7.paclet}
Create the paclet:
In[]:=
pacletPath=PackPaclet["FEMAddOns"]
Out[]=
/home/ruebenko/wri_git/FEMAddOns/build/FEMAddOns-1.4.8.paclet
Uninstall a possibly old version
In[]:=
If[PacletFind["FEMAddOns"]=!={},PacletUninstall["FEMAddOns"]]
Install the paclet
In[]:=
PacletInstall[pacletPath]
Out[]=
PacletObject
Rebuild the paclet data:
In[]:=
RebuildPacletData[]
Note to self: When drafting a release, make sure to allow in No-Script all github sites for the Paclet uploading to work. This means that after an initial try, check the allowed sites in No-Script and make sure they are allowed.