Skip to content

Commit

Permalink
feat: add includes module to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdaclan committed Jul 30, 2024
1 parent 55fe41f commit 27e09fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion core/recipe.cue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ stages: [...#Stage] & list.MinItems(1)
"go" |
"make" |
"meson" |
"shell"
"shell" |
"includes"

#Source: {
type!: "tar" | "file" | "git"
Expand All @@ -108,6 +109,7 @@ stages: [...#Stage] & list.MinItems(1)

#InstFile: #string & =~".+.inst"
#DebFile: #string & =~".+.deb"
#ModFile: #string & =~"^modules\/.+.yml"

#AptModuleOpts: close({
"noRecommends"?: bool
Expand Down Expand Up @@ -178,6 +180,10 @@ stages: [...#Stage] & list.MinItems(1)
workdir?: #string
})

#IncludesModule: close({
includes!: [... #ModFile] & list.MinItems(1)
})

#Module: close({
name!: #string
type!: #ModuleTypes
Expand All @@ -191,6 +197,7 @@ stages: [...#Stage] & list.MinItems(1)
if type == "make" {#MakeModule}
if type == "meson" {#MesonModule}
if type == "shell" {#ShellModule}
if type == "includes" {#IncludesModule}
}
})

Expand Down
9 changes: 8 additions & 1 deletion example/play.cue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ stages: [...#Stage] & list.MinItems(1)
"go" |
"make" |
"meson" |
"shell"
"shell" |
"includes"

#Source: {
type!: "tar" | "file" | "git"
Expand All @@ -108,6 +109,7 @@ stages: [...#Stage] & list.MinItems(1)

#InstFile: #string & =~".+.inst"
#DebFile: #string & =~".+.deb"
#ModFile: #string & =~"^modules\/.+.yml"

#AptModuleOpts: close({
"noRecommends"?: bool
Expand Down Expand Up @@ -178,6 +180,10 @@ stages: [...#Stage] & list.MinItems(1)
workdir?: #string
})

#IncludesModule: close({
includes!: [... #ModFile] & list.MinItems(1)
})

#Module: close({
name!: #string
type!: #ModuleTypes
Expand All @@ -191,6 +197,7 @@ stages: [...#Stage] & list.MinItems(1)
if type == "make" {#MakeModule}
if type == "meson" {#MesonModule}
if type == "shell" {#ShellModule}
if type == "includes" {#IncludesModule}
}
})

Expand Down

0 comments on commit 27e09fa

Please sign in to comment.