Create new Julia packages, the easy way
Go to file
Chris de Graaf 26a494410a
Version bump
2019-10-05 13:45:17 +07:00
defaults Add Drone CI plugin (#94) 2019-10-05 13:44:35 +07:00
docs Mention Citation in docs/readme 2019-05-15 11:05:03 -05:00
licenses Add BSD3, rename BSD->BSD2 2019-08-07 10:51:23 -07:00
src Add Drone CI plugin (#94) 2019-10-05 13:44:35 +07:00
test Add Drone CI plugin (#94) 2019-10-05 13:44:35 +07:00
.appveyor.yml Don't rely on Git to be preconfigured in tests (close #27) 2018-10-22 15:44:31 -05:00
.codecov.yml PkgTemplates generated files 2017-08-10 12:13:01 -05:00
.gitignore Rework code, fix/add tests, fix/add docs. All the things. 2017-08-17 17:06:05 -05:00
.travis.yml Test 1.1 2019-02-14 09:36:38 -06:00
LICENSE Use METADATA-compatible UUIDs 2019-02-05 09:55:16 -06:00
Manifest.toml Make Pkg.develop optional (close #78) 2019-06-17 10:44:36 -05:00
Project.toml Version bump 2019-10-05 13:45:17 +07:00
README.md [ci skip] Add code style badge (#99) 2019-10-04 13:29:30 +07:00
REQUIRE Drop AutoHashEquals dep, use concrete types as fields 2018-12-20 13:21:17 -06:00

README.md

PkgTemplates

Stable Latest Build Status Build Status Codecov Code Style: Blue

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

Installation

pkg> add PkgTemplates

Plugins

PkgTemplates is based on plugins which handle the setup of individual package components. The available plugins are:

Usage

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:

julia> using PkgTemplates

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
   Commit Manifest.toml: No
   Plugins: None

julia> generate("MyPkg", t)

julia> run(`git -C $(joinpath(t.dir, "MyPkg")) ls-files`);
.gitignore
LICENSE
Manifest.toml
Project.toml
README.md
REQUIRE
src/MyPkg.jl
test/runtests.jl

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

julia> t = Template(;
           user="myusername",
           license="ISC",
           authors=["Chris de Graaf", "Invenia Technical Computing Corporation"],
           dir="~/code",
           julia_version=v"0.7",
           plugins=[
               TravisCI(),
               Codecov(),
               Coveralls(),
               AppVeyor(),
               GitHubPages(),
               CirrusCI(),
           ],
       )
Template:
   User: myusername
   Host: github.com
   License: ISC (Chris de Graaf, Invenia Technical Computing Corporation 2018)
   Package directory: ~/code
   Minimum Julia version: v0.7
   SSH remote: No
   Commit Manifest.toml: No
   Plugins:
     AppVeyor:
       Config file: Default
       0 gitignore entries
     Codecov:
       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`);
.appveyor.yml
.gitignore
.travis.yml
LICENSE
Project.toml
README.md
REQUIRE
docs/Manifest.toml
docs/Project.toml
docs/make.jl
docs/src/index.md
src/MyPkg2.jl
test/runtests.jl

Information on each keyword as well as plugin types can be found in the documentation.

If that looks like a lot of work, you can also create templates interactively with interactive_template:

asciicast

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.

You can also use generate_interactive to interactively generate a template and then immediately use it to create a new package.

Contributing

It's extremely easy to extend PkgTemplates with new plugins. To get started, check out the plugin development guide.