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