Skip to content

Commit

Permalink
Merge pull request #61 from invenia/cdg/plugins
Browse files Browse the repository at this point in the history
Package overhaul
  • Loading branch information
christopher-dG authored Nov 10, 2019
2 parents 26a4944 + 90253e5 commit 055f37d
Show file tree
Hide file tree
Showing 165 changed files with 5,398 additions and 4,062 deletions.
1 change: 0 additions & 1 deletion .codecov.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* eol=lf
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.DS_Store
*.jl.cov
/docs/build/
*.jl.*.cov
*.jl.cov
*.jl.mem
/docs/build/
/docs/site/
39 changes: 27 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,40 @@
language: julia
notifications:
email: false
os:
- linux
- osx
- windows
julia:
- 1.0
- 1.1
- 1.2
- 1.3
- nightly
before_script:
- git config --global user.name Tester
- git config --global user.email te@st.er
matrix:
fast_finish: true
allow_failures:
- julia: 1.3
- julia: nightly
fast_finish: true
notifications:
email: false
after_success: julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
jobs:
include:
- arch: x86
julia: 1.0
- stage: Documentation
julia: 1.1
script: julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(path=pwd()));
Pkg.instantiate();
include("docs/make.jl");'
julia: 1.0
script:
- git config --global user.name name
- git config --global user.email email
- git config --global github.user username
- julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(; path=pwd()));
Pkg.instantiate();
include("docs/make.jl");'
after_success: skip
after_success: julia -e '
using Pkg;
Pkg.add("Coverage");
using Coverage;
Codecov.submit(process_folder());'
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
MIT License

Copyright (c) 2017-2019 Chris de Graaf, Invenia Technical Computing Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
44 changes: 27 additions & 17 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[DataAPI]]
git-tree-sha1 = "674b67f344687a88310213ddfa8a2b3c76cc4252"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.1.0"

[[DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down Expand Up @@ -39,9 +49,21 @@ uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[Mustache]]
deps = ["Printf", "Tables"]
git-tree-sha1 = "d27b8b8b99c052ea1fdd40c678bfb2dfaec4e96e"
git-tree-sha1 = "f39de3a12232eb47bd0629b3a661054287780276"
uuid = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70"
version = "0.5.12"
version = "0.5.13"

[[OrderedCollections]]
deps = ["Random", "Serialization", "Test"]
git-tree-sha1 = "c4c13474d23c60d20a67b217f1d7f22a40edf8f1"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.1.0"

[[Parameters]]
deps = ["OrderedCollections"]
git-tree-sha1 = "b62b2558efb1eef1fa44e4be5ff58a515c287e38"
uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a"
version = "0.12.0"

[[Pkg]]
deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
Expand All @@ -59,12 +81,6 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[Requires]]
deps = ["Test"]
git-tree-sha1 = "f6fbf4ba64d295e146e49e021207993b6b48c7d1"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "0.5.2"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"

Expand All @@ -81,21 +97,15 @@ uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
version = "1.0.0"

[[Tables]]
deps = ["IteratorInterfaceExtensions", "LinearAlgebra", "Requires", "TableTraits", "Test"]
git-tree-sha1 = "351a4b894122e1553c6ed05fda54086ab036adef"
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"]
git-tree-sha1 = "aaed7b3b00248ff6a794375ad6adf30f30ca5591"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "0.2.5"
version = "0.2.11"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[URIParser]]
deps = ["Test", "Unicode"]
git-tree-sha1 = "6ddf8244220dfda2f17539fa8c9de20d6c575b69"
uuid = "30578b45-9adc-5946-b283-645ec420af67"
version = "0.4.0"

[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Expand Down
16 changes: 10 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
name = "PkgTemplates"
uuid = "14b8a8f1-9102-5b29-a752-f990bacb7fe1"
authors = ["Chris de Graaf <chrisadegraaf@gmail.com>"]
version = "0.6.3"
authors = ["Chris de Graaf", "Invenia Technical Computing Corporation"]
version = "0.7.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
Mustache = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
URIParser = "30578b45-9adc-5946-b283-645ec420af67"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
Mustache = ">= 0.5.13"
julia = "1"

[extras]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ReferenceTests = "324d217c-45ce-50fc-942e-d289b448e8cf"
SimpleMock = "a896ed2c-15a5-4479-b61d-a0e88e2a1d25"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Suppressor", "Random", "ReferenceTests", "SimpleMock", "Test"]
157 changes: 33 additions & 124 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,147 +1,56 @@
# PkgTemplates

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://invenia.github.io/PkgTemplates.jl/stable)
[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/PkgTemplates.jl/latest)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://invenia.github.io/PkgTemplates.jl/dev)
[![Build Status](https://travis-ci.org/invenia/PkgTemplates.jl.svg?branch=master)](https://travis-ci.org/invenia/PkgTemplates.jl)
[![Build Status](https://ci.appveyor.com/api/projects/status/r24xamruqlm88uti/branch/master?svg=true)](https://ci.appveyor.com/project/christopher-dG/pkgtemplates-jl/branch/master)
[![Codecov](https://codecov.io/gh/invenia/PkgTemplates.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/invenia/PkgTemplates.jl)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)

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

## Installation

```julia
pkg> add PkgTemplates
```

## Plugins
Install with Pkg, just like any other registered Julia package:

`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)
* Citation
```jl
pkg> add PkgTemplates # Press ']' to enter te Pkg REPL mode.
```

## 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
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
```
Creating a `Template` is as simple as:

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

```julia
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
```jl
using PkgTemplates
t = Template()
```

Information on each keyword as well as plugin types can be found in the
[documentation](https://invenia.github.io/PkgTemplates.jl/stable).
The no-keywords constructor assumes the existence of some preexisting Git configuration (set with `git config --global`):

If that looks like a lot of work, you can also create templates interactively
with `interactive_template`:
- `user.name`: Your real name, e.g. John Smith.
- `user.email`: Your email address, eg. john.smith@acme.corp.
- `github.user`: Your GitHub username: e.g. john-smith.

[![asciicast](https://asciinema.org/a/31bZqW9u8h5RHpd7gtsemioRV.png)](https://asciinema.org/a/31bZqW9u8h5RHpd7gtsemioRV)
Once you have a `Template`, use it to generate a package:

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.
```jl
t("MyPkg")
```

You can also use `generate_interactive` to interactively generate a template and then
immediately use it to create a new package.
However, it's probably desirable to customize the template to your liking with various options and plugins:

```jl
t = Template(;
dir="~/code",
plugins=[
Git(; manifest=true, ssh=true),
Codecov(),
TravisCI(; x86=true),
Documenter{TravisCI}(),
],
)
```

## Contributing
---

It's extremely easy to extend `PkgTemplates` with new plugins. To get started,
check out the
[plugin development guide](https://invenia.github.io/PkgTemplates.jl/stable/pages/plugin_development.html).
For a much more detailled overview, please see the documentation.
3 changes: 0 additions & 3 deletions REQUIRE

This file was deleted.

29 changes: 0 additions & 29 deletions defaults/drone.yml

This file was deleted.

Loading

0 comments on commit 055f37d

Please sign in to comment.