2017-08-10 17:13:01 +00:00
|
|
|
# PkgTemplates
|
2017-08-16 22:10:13 +00:00
|
|
|
|
2017-08-24 18:38:21 +00:00
|
|
|
[](https://invenia.github.io/PkgTemplates.jl/stable)
|
|
|
|
[](https://invenia.github.io/PkgTemplates.jl/latest)
|
|
|
|
[](https://travis-ci.org/invenia/PkgTemplates.jl)
|
2017-08-25 04:00:22 +00:00
|
|
|
[](https://ci.appveyor.com/project/christopher-dG/PkgTemplates-jl)
|
2017-08-24 18:38:21 +00:00
|
|
|
[](https://codecov.io/gh/invenia/PkgTemplates.jl)
|
2017-08-16 22:10:13 +00:00
|
|
|
|
|
|
|
**PkgTemplates is a Julia package for creating new Julia packages in an easy,
|
|
|
|
repeatable, and customizable way.**
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
`PkgTemplates` is registered in
|
|
|
|
[`METADATA.jl`](https://github.com/JuliaLang/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.
|
|
|
|
|
2017-08-18 07:08:11 +00:00
|
|
|
```@repl
|
|
|
|
using PkgTemplates
|
2017-10-27 14:31:34 +00:00
|
|
|
t = Template(; user="myusername");
|
2017-08-18 07:08:11 +00:00
|
|
|
generate("MyPkg", t)
|
2017-10-27 14:31:34 +00:00
|
|
|
run(`git -C $(joinpath(t.dir, "MyPkg")) ls-tree -r --name-only HEAD`)
|
2017-08-16 22:10:13 +00:00
|
|
|
```
|
2017-08-18 07:08:11 +00:00
|
|
|
|
2017-08-22 20:13:25 +00:00
|
|
|
However, we can also configure a number of keyword arguments to
|
|
|
|
[`Template`](@ref) and [`generate`](@ref):
|
2017-08-16 22:10:13 +00:00
|
|
|
|
2017-08-18 07:08:11 +00:00
|
|
|
```@repl
|
|
|
|
using PkgTemplates
|
|
|
|
t = Template(;
|
2017-08-24 18:38:21 +00:00
|
|
|
user="myusername",
|
2017-08-18 07:08:11 +00:00
|
|
|
license="MIT",
|
|
|
|
authors=["Chris de Graaf", "Invenia Technical Computing Corporation"],
|
|
|
|
years="2016-2017",
|
2017-08-21 19:52:50 +00:00
|
|
|
dir=joinpath(homedir(), "code"),
|
2017-08-18 07:08:11 +00:00
|
|
|
julia_version=v"0.5.2",
|
|
|
|
requirements=["PkgTemplates"],
|
2017-08-23 17:50:52 +00:00
|
|
|
gitconfig=Dict("diff.renames" => true),
|
2017-08-18 07:08:11 +00:00
|
|
|
plugins=[
|
|
|
|
TravisCI(),
|
2017-10-27 14:31:34 +00:00
|
|
|
CodeCov(),
|
2017-08-18 07:08:11 +00:00
|
|
|
Coveralls(),
|
|
|
|
AppVeyor(),
|
2017-08-24 20:14:27 +00:00
|
|
|
GitHubPages(),
|
2017-08-18 07:08:11 +00:00
|
|
|
],
|
2017-10-27 14:31:34 +00:00
|
|
|
);
|
2017-08-18 07:08:11 +00:00
|
|
|
generate("MyPkg", t; force=true, ssh=true)
|
2017-10-27 14:31:34 +00:00
|
|
|
run(`git -C $(joinpath(t.dir, "MyPkg")) ls-tree -r --name-only HEAD`)
|
2017-08-16 22:10:13 +00:00
|
|
|
```
|
|
|
|
|
2017-08-22 20:13:25 +00:00
|
|
|
If that looks like a lot of work, you can also create templates interactively
|
|
|
|
with [`interactive_template`](@ref):
|
2017-08-21 21:19:40 +00:00
|
|
|
|
|
|
|
[](https://asciinema.org/a/bqBwff05mI7Cl9bz7EqLPMKF8)
|
|
|
|
|
2017-08-22 20:13:25 +00:00
|
|
|
And if that's **still** too much work for you, you can call
|
|
|
|
`interactive_template` with `fast=true` to use default values for everything
|
|
|
|
but username and plugin selection.
|
|
|
|
|
2017-10-01 23:25:12 +00:00
|
|
|
You can also use [`generate_interactive`](@ref) to interactively generate a template and then
|
|
|
|
immediately use it to create a new package.
|
|
|
|
|
2017-08-16 22:10:13 +00:00
|
|
|
## Comparison to [PkgDev](https://github.com/JuliaLang/PkgDev.jl)
|
|
|
|
|
|
|
|
`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](https://github.com/apps/attobot) instead.
|