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
|
|
|
|
(v1.0) pkg> add PkgTemplates
|
|
|
|
```
|
2017-08-16 06:12:42 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2018-09-26 20:55:24 +00:00
|
|
|
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
|
|
|
|
→ 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
|
|
|
Generating project MyPkg:
|
|
|
|
/Users/degraafc/.julia/dev/MyPkg/Project.toml
|
|
|
|
/Users/degraafc/.julia/dev/MyPkg/src/MyPkg.jl
|
|
|
|
[ Info: Initialized git repo at /Users/degraafc/.julia/dev/MyPkg
|
|
|
|
[ Info: Set remote origin to https://github.com/myusername/MyPkg.jl
|
|
|
|
Updating registry at `~/.julia/registries/General`
|
|
|
|
Updating git-repo `https://github.com/JuliaRegistries/General.git`
|
|
|
|
Resolving package versions...
|
|
|
|
Updating `~/.julia/dev/MyPkg/Project.toml`
|
|
|
|
[8dfed614] + Test
|
|
|
|
Updating `~/.julia/dev/MyPkg/Manifest.toml`
|
|
|
|
[2a0f44e3] + Base64
|
|
|
|
[8ba89e20] + Distributed
|
|
|
|
[b77e0a4c] + InteractiveUtils
|
|
|
|
[8f399da3] + Libdl
|
|
|
|
[37e2e46d] + LinearAlgebra
|
|
|
|
[56ddb016] + Logging
|
|
|
|
[d6f4376e] + Markdown
|
|
|
|
[9a3f8284] + Random
|
|
|
|
[9e88b42a] + Serialization
|
|
|
|
[6462fe0b] + Sockets
|
|
|
|
[8dfed614] + Test
|
|
|
|
[ Info: Staged and committed 8 files/directories: src/, Project.toml, Manifest.toml, test/, REQUIRE, README.md, .gitignore, LICENSE
|
|
|
|
[ Info: Finished
|
|
|
|
|
|
|
|
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"],
|
2017-08-21 19:52:50 +00:00
|
|
|
dir=joinpath(homedir(), "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(),
|
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
|
|
|
|
→ 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")
|
|
|
|
Generating project MyPkg2:
|
|
|
|
/Users/degraafc/code/MyPkg2/Project.toml
|
|
|
|
/Users/degraafc/code/MyPkg2/src/MyPkg2.jl
|
|
|
|
[ Info: Initialized git repo at /Users/degraafc/code/MyPkg2
|
|
|
|
[ Info: Set remote origin to https://github.com/myusername/MyPkg2.jl
|
|
|
|
[ Info: Created empty gh-pages branch
|
|
|
|
Resolving package versions...
|
|
|
|
Updating `~/code/MyPkg2/Project.toml`
|
|
|
|
[8dfed614] + Test
|
|
|
|
Updating `~/code/MyPkg2/Manifest.toml`
|
|
|
|
[2a0f44e3] + Base64
|
|
|
|
[8ba89e20] + Distributed
|
|
|
|
[b77e0a4c] + InteractiveUtils
|
|
|
|
[8f399da3] + Libdl
|
|
|
|
[37e2e46d] + LinearAlgebra
|
|
|
|
[56ddb016] + Logging
|
|
|
|
[d6f4376e] + Markdown
|
|
|
|
[9a3f8284] + Random
|
|
|
|
[9e88b42a] + Serialization
|
|
|
|
[6462fe0b] + Sockets
|
|
|
|
[8dfed614] + Test
|
|
|
|
[ Info: Staged and committed 11 files/directories: src/, Project.toml, Manifest.toml, test/, REQUIRE, README.md, .gitignore, LICENSE, .appveyor.yml, .travis.yml, docs/
|
|
|
|
[ Info: Finished
|
|
|
|
[ Info: Remember to push all created branches to your remote: git push --all
|
|
|
|
|
|
|
|
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
|
|
|
Manifest.toml
|
|
|
|
Project.toml
|
2017-08-18 07:08:11 +00:00
|
|
|
README.md
|
|
|
|
REQUIRE
|
|
|
|
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-23 17:50:52 +00:00
|
|
|
## Comparison to PkgDev
|
2017-08-16 21:00:15 +00:00
|
|
|
|
2017-08-23 17:50:52 +00:00
|
|
|
`PkgTemplates` is similar in functionality to
|
|
|
|
[`PkgDev`](https://github.com/JuliaLang/PkgDev.jl)'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` doesn't
|
|
|
|
include, you are encouraged to use [AttoBot](https://github.com/apps/attobot) instead.
|
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).
|