PkgTemplates.jl/docs/src/index.md
2017-08-18 16:08:48 -05:00

2.4 KiB

PkgTemplates

Stable Latest Build Status Build Status CodeCov

PkgTemplates is a Julia package for creating new Julia packages in an easy, repeatable, and customizable way.

Installation

PkgTemplates is registered in METADATA.jl, so run Pkg.add("PkgTemplates") for the latest release, or Pkg.clone("PkgTemplates") for the development version.

Usage

The simplest template only requires your GitHub username.

using PkgTemplates
t = Template(; user="christopher-dG")
generate("MyPkg", t)
cd(joinpath(t.dir, "MyPkg")); run(`git ls-tree -r --name-only HEAD`)

However, we can also configure a number of keyword arguments to Template and generate:

using PkgTemplates
t = Template(;
    user="christopher-dG",
    license="MIT",
    authors=["Chris de Graaf", "Invenia Technical Computing Corporation"],
    years="2016-2017",
    dir=joinpath(ENV["HOME"], "code"),
    julia_version=v"0.5.2",
    requirements=["PkgTemplates"],
    git_config=Dict("diff.renames" => true),
    plugins=[
        TravisCI(),
        CodeCov(; config_file=nothing),
        Coveralls(),
        AppVeyor(),
        GitHubPages(; assets=[joinpath(ENV["HOME"], "invenia.css")]),
    ],
)
generate("MyPkg", t; force=true, ssh=true)
cd(joinpath(t.dir, "MyPkg")); run(`git ls-tree -r --name-only HEAD`)

Comparison to PkgDev

PkgTemplates is similar in functionality to PkgDev's generate function. However, PkgTemplates offers more customizability in templates and more extensibility via plugins. For the package registration and release management features that PkgTemplates lacks, you are encouraged to use AttoBot instead.