2017-08-10 17:13:01 +00:00
# PkgTemplates
2017-08-15 14:19:37 +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-12-05 20:07:30 +00:00
[](https://ci.appveyor.com/project/christopher-dG/pkgtemplates-jl/branch/master)
2018-11-05 22:05:30 +00:00
[](https://codecov.io/gh/invenia/PkgTemplates.jl)
2017-08-16 06:12:42 +00:00
**PkgTemplates is a Julia package for creating new Julia packages in an easy,
repeatable, and customizable way.**
## Installation
2018-09-26 20:55:24 +00:00
```julia
2018-12-14 21:37:18 +00:00
pkg> add PkgTemplates
2018-09-26 20:55:24 +00:00
```
2017-08-16 06:12:42 +00:00
2019-01-03 17:47:57 +00:00
## Plugins
`PkgTemplates` is based on plugins which handle the setup of individual package components.
The available plugins are:
* Continuous Integration (CI)
* [Travis CI ](https://travis-ci.com ) (Linux, MacOS)
* [AppVeyor ](https://appveyor.com ) (Windows)
* [GitLabCI ](https://gitlab.com ) (Linux)
* [CirrusCI ](https://cirrus-ci.org ) (FreeBSD)
* Code Coverage
* [Codecov ](https://codecov.io )
* [Coveralls ](https://coveralls.io )
* Documentation
* [GitHubPages ](https://pages.github.com )
2019-05-15 16:05:03 +00:00
* Citation
2019-01-03 17:47:57 +00:00
2017-08-16 06:12:42 +00:00
## Usage
2019-02-14 08:31:00 +00:00
Assuming you have the relatively standard Git options `user.name` , `user.email` and `github.user` set up globally with `git config --global` , the simplest template requires no arguments:
2017-08-16 06:12:42 +00:00
```julia
julia> using PkgTemplates
2018-09-26 20:55:24 +00:00
julia> t = Template()
Template:
→ User: christopher-dG
→ Host: github.com
→ License: MIT (Chris de Graaf 2018)
→ Package directory: ~/.julia/dev
→ Minimum Julia version: v1.0
→ SSH remote: No
2018-12-14 21:37:18 +00:00
→ Commit Manifest.toml: No
2018-09-26 20:55:24 +00:00
→ Plugins: None
2017-08-16 06:12:42 +00:00
2017-08-16 23:11:20 +00:00
julia> generate("MyPkg", t)
2018-09-26 20:55:24 +00:00
julia> run(`git -C $(joinpath(t.dir, "MyPkg")) ls-files`);
2017-08-18 07:08:11 +00:00
.gitignore
2017-10-27 14:31:34 +00:00
LICENSE
2018-09-26 20:55:24 +00:00
Manifest.toml
Project.toml
2017-08-18 07:08:11 +00:00
README.md
REQUIRE
src/MyPkg.jl
test/runtests.jl
2017-08-16 06:12:42 +00:00
```
2018-09-26 20:55:24 +00:00
However, we can also configure a number of keyword arguments to `Template` :
2017-08-16 06:12:42 +00:00
```julia
julia> t = Template(;
2017-08-24 18:38:21 +00:00
user="myusername",
2017-10-27 14:31:34 +00:00
license="ISC",
2017-08-16 06:12:42 +00:00
authors=["Chris de Graaf", "Invenia Technical Computing Corporation"],
2018-12-14 21:37:18 +00:00
dir="~/code",
2018-09-28 18:08:06 +00:00
julia_version=v"0.7",
2017-08-16 06:12:42 +00:00
plugins=[
TravisCI(),
2018-11-05 22:05:30 +00:00
Codecov(),
2017-08-18 07:08:11 +00:00
Coveralls(),
2017-08-16 06:12:42 +00:00
AppVeyor(),
2017-08-25 13:59:50 +00:00
GitHubPages(),
2019-01-03 17:47:57 +00:00
CirrusCI(),
2017-08-16 06:12:42 +00:00
],
2018-09-26 20:55:24 +00:00
)
Template:
→ User: myusername
→ Host: github.com
→ License: ISC (Chris de Graaf, Invenia Technical Computing Corporation 2018)
→ Package directory: ~/code
2018-09-28 18:08:06 +00:00
→ Minimum Julia version: v0.7
2018-09-26 20:55:24 +00:00
→ SSH remote: No
2018-12-14 21:37:18 +00:00
→ Commit Manifest.toml: No
2018-09-26 20:55:24 +00:00
→ Plugins:
• AppVeyor:
→ Config file: Default
→ 0 gitignore entries
2018-11-05 22:05:30 +00:00
• Codecov:
2018-09-26 20:55:24 +00:00
→ Config file: None
→ 3 gitignore entries: "*.jl.cov", "*.jl.*.cov", "*.jl.mem"
• Coveralls:
→ Config file: None
→ 3 gitignore entries: "*.jl.cov", "*.jl.*.cov", "*.jl.mem"
• GitHubPages:
→ 0 asset files
→ 2 gitignore entries: "/docs/build/", "/docs/site/"
• TravisCI:
→ Config file: Default
→ 0 gitignore entries
julia> generate(t, "MyPkg2")
julia> run(`git -C $(joinpath(t.dir, "MyPkg2")) ls-files`);
2017-08-25 04:00:22 +00:00
.appveyor.yml
2017-08-18 07:08:11 +00:00
.gitignore
.travis.yml
LICENSE
2018-09-26 20:55:24 +00:00
Project.toml
2017-08-18 07:08:11 +00:00
README.md
REQUIRE
2018-12-14 21:37:18 +00:00
docs/Manifest.toml
docs/Project.toml
2017-08-18 07:08:11 +00:00
docs/make.jl
docs/src/index.md
2018-09-26 20:55:24 +00:00
src/MyPkg2.jl
2017-08-18 07:08:11 +00:00
test/runtests.jl
2017-08-16 06:12:42 +00:00
```
Information on each keyword as well as plugin types can be found in the
2017-08-24 18:38:21 +00:00
[documentation ](https://invenia.github.io/PkgTemplates.jl/stable ).
2017-08-16 21:00:15 +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` :
2017-08-21 21:19:40 +00:00
2018-10-10 19:56:03 +00:00
[](https://asciinema.org/a/31bZqW9u8h5RHpd7gtsemioRV)
2017-08-21 21:19:40 +00:00
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` to interactively generate a template and then
immediately use it to create a new package.
2017-08-17 22:06:05 +00:00
## Contributing
It's extremely easy to extend `PkgTemplates` with new plugins. To get started,
check out the
2017-08-25 13:59:50 +00:00
[plugin development guide ](https://invenia.github.io/PkgTemplates.jl/stable/pages/plugin_development.html ).