Julia package for creating new packages quickly. This is the successor of skeleton.jl.
This is a clone of registered package PkgSkeleton.jl. In order to install this specific variant (and the template which goes with it), please run
pkg> add https://github.com/triscale-innov/PkgSkeleton.jl
Here is a list of the few modifications that this version brings, which are not (yet?) in the official, registered package:
- fix a small issue with test cases (see PR#10)
- automatically instantiate the
docs/
sub-project during project generation (see PR#11) - interactive way to validate and provide package parameters in case default
ones (coming from
git config
) are missing (see PR#12) - default template sets Retest up
- default template contains a script to locally generate HTML coverage reports
using
genhtml
import PkgSkeleton
PkgSkeleton.generate("destination/directory") # uses default template
Then
-
files in template will be copied recursively, with various substitutions (as described below).
-
A git repo is initialized.
If the destination directory exists, the script aborts.
After this, you probably want to pkg> dev destination/directory
in Julia, and add your Github repository as a remote.
See ?PkgSkeleton.generate
for details.
Best practices and recommended setups change with time. The recommended workflow for updating existing packages using templates from this package is the following.
-
Make sure that this package is of the latest version, eg with
pkg> up
. -
Make sure that everything is committed in version control. This is very important: when files are overwritten, work may be lost.
-
Run either
PkgSkeleton.generate("/path/to/pkg"; skip_existing_dir = false)
or
PkgSkeleton.generate("/path/to/pkg"; skip_existing_dir = false, skip_existing_files = true)
Only the second one will update existing files.
-
Use your favorite git interface for reviewing the change. Pick and commit what you like, reset the rest.
For the default template, you need to set the git
configuration variables user.name
, user.email
, and github.user
.
Design follows KISS: do nothing more than substitute strings into templates. For me, this covers 99% of the use cases; the rest I edit manually.
Templates replace the following in files and filenames:
string | replacement |
---|---|
{PKGNAME} |
name of the package |
{UUID} |
an UUID (METADATA-compatible or random) |
{GHUSER} |
git config --get github.user |
{USERNAME} |
git config --get user.name |
{USEREMAIL} |
git config --get user.email |
{YEAR} |
the current year |