mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-01 13:07:49 +02:00
First implementation of plist field
This commit is contained in:
parent
177aea9817
commit
846a822bb2
@ -274,6 +274,11 @@ brew:
|
||||
conflicts:
|
||||
- svn
|
||||
- bash
|
||||
|
||||
# Packages that run as a service
|
||||
plist:
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
...
|
||||
```
|
||||
|
||||
By defining the `brew` section, GoReleaser will take care of publishing the Homebrew tap.
|
||||
|
@ -11,6 +11,7 @@ type Homebrew struct {
|
||||
Repo string
|
||||
Folder string
|
||||
Caveats string
|
||||
Plist string
|
||||
Dependencies []string
|
||||
Conflicts []string
|
||||
}
|
||||
|
@ -47,6 +47,14 @@ const formula = `class {{ .Name }} < Formula
|
||||
"{{ .Caveats }}"
|
||||
end
|
||||
{{- end }}
|
||||
|
||||
{{- if .Plist }}
|
||||
|
||||
def plist; <<-EOS.undent
|
||||
{{ .Plist }}
|
||||
EOS
|
||||
end
|
||||
{{- end }}
|
||||
end
|
||||
`
|
||||
|
||||
@ -62,6 +70,7 @@ type templateData struct {
|
||||
File string
|
||||
Format string
|
||||
SHA256 string
|
||||
Plist string
|
||||
Dependencies []string
|
||||
Conflicts []string
|
||||
}
|
||||
@ -172,6 +181,7 @@ func dataFor(ctx *context.Context, client *github.Client) (result templateData,
|
||||
SHA256: sum,
|
||||
Dependencies: ctx.Config.Brew.Dependencies,
|
||||
Conflicts: ctx.Config.Brew.Conflicts,
|
||||
Plist: ctx.Config.Brew.Plist,
|
||||
}, err
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ var defaultTemplateData = templateData{
|
||||
File: "test_Darwin_x86_64",
|
||||
SHA256: "1633f61598ab0791e213135923624eb342196b3494909c91899bcd0560f84c68",
|
||||
Format: "tar.gz",
|
||||
Plist: "it works",
|
||||
}
|
||||
|
||||
func assertDefaultTemplateData(t *testing.T, formulae string) {
|
||||
@ -56,6 +57,7 @@ func TestFullFormulae(t *testing.T) {
|
||||
assert.Contains(formulae, "depends_on \"gtk\"")
|
||||
assert.Contains(formulae, "depends_on \"git\"")
|
||||
assert.Contains(formulae, "conflicts_with \"conflicting_dep\"")
|
||||
assert.Contains(formulae, "def plist;")
|
||||
}
|
||||
|
||||
func TestFormulaeSimple(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user