Skip to content

Commit

Permalink
docs: add in Mill instructions
Browse files Browse the repository at this point in the history
I recently made a Mill plugin for Giter8 so that Mill users can also
have the benefit of being able to test the generation of their
templates. I added some small notes and instructions on how to use it
under "Testing templates locally", but let me know if there is somewhere
else that is more fitting. Also if you'd like to not include external
plugins in the official docs, then no problem, feel free to close.
  • Loading branch information
ckipp01 committed Aug 15, 2022
1 parent fbd604d commit c0db186
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/03/b.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,28 @@ project with a `.g8` extension) you can test it with the actual g8
runtime. When you're ready, add your template project to the
[the wiki][wiki] so other giter8 users can find it.

### Using Mill

There is also an external [Mill plugin][mill-plugin] that can be used to test
your templates as well. An example setup can be found below:

```scala
import $ivy.`io.chris-kipp::mill-giter8::0.2.0`

import io.kipp.mill.giter8.G8Module

object g8 extends G8Module {
override def validationTargets =
Seq("example.compile", "example.fix", "example.reformat")
}
```

This plugin only supprts [`src` layouts][src-layout], but gives you some useful
targets like `g8.validate` which will both test the generation of your template
and also ensure any targets defined with `validationTargets` can also be ran
against your generated project.

[scripted]: https://www.scala-sbt.org/1.x/docs/Testing-sbt-plugins.html
[wiki]: https://github.com/foundweekends/giter8/wiki/giter8-templates
[mill-plugin]: https://github.com/ckipp01/mill-giter8
[src-layout]: http://www.foundweekends.org/giter8/template.html#template+layout

0 comments on commit c0db186

Please sign in to comment.