Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Dec 21, 2021
1 parent 0454237 commit 347f419
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 16 deletions.
43 changes: 28 additions & 15 deletions docs/modules/configuration/pages/name-templates.adoc
Expand Up @@ -2715,21 +2715,23 @@ The following names are related to xref:configuration:packagers/snap.adoc[]

[%header, cols="<2,<5", width="100%"]
|===
| Key | Description
| snapPackageName | the name of the Snap package. Defaults to `${distribution.name}`
| snapRepoUrl | the snap repository URL, `pass:[https://{{repoHost}}/{{repoOwner}}/{{repoName}}]`
| snapRepoCloneUrl | the snap repository clone URL, `pass:[https://{{repoHost}}/{{repoOwner}}/{{repoName}}.git]`
| snapBase | the snap base
| snapGrade | the snap grade
| snapConfinement | the snap confinement
| snapHasPlugs | a boolean, when there snap defines plugs
| snapPlugs | a list of `Plugs`
| snapHasSlots | a boolean, when the snap defines slots
| snapSlots | a list of `Slots`
| snapHasLocalPlugs | a boolean, when the snap defines plug names
| snapLocalPlugs | a list of plug names
| snapHasLocalSlots | a boolean, when the snap defines slot names
| snapLocalSlots | a list of slot names
| Key | Description
| snapPackageName | the name of the Snap package. Defaults to `${distribution.name}`
| snapRepoUrl | the snap repository URL, `pass:[https://{{repoHost}}/{{repoOwner}}/{{repoName}}]`
| snapRepoCloneUrl | the snap repository clone URL, `pass:[https://{{repoHost}}/{{repoOwner}}/{{repoName}}.git]`
| snapBase | the snap base
| snapGrade | the snap grade
| snapConfinement | the snap confinement
| snapHasPlugs | a boolean, when there snap defines plugs
| snapPlugs | a list of `Plugs`
| snapHasSlots | a boolean, when the snap defines slots
| snapSlots | a list of `Slots`
| snapHasLocalPlugs | a boolean, when the snap defines plug names
| snapLocalPlugs | a list of plug names
| snapHasLocalSlots | a boolean, when the snap defines slot names
| snapLocalSlots | a list of slot names
| snapHasArchitectures | a boolean, when the snap defines architectures
| snapArchitectures | a list of architectures
|===

A `Plug` defines the following fields
Expand All @@ -2754,6 +2756,17 @@ A `Slot` defines the following fields
| hasWrites | a boolean, when the slot defines writes
|===

An `Architecture` defines the following fields

[%header, cols="<2,<5", width="100%"]
|===
| Key | Description
| buildOn | a list of archs for build-on
| runOn | a list of archs for run-on
| hasRunOn | a boolean, when the architecture defines runOn
| IgnoreError | a boolean, when the architecture ignores build errors
|===

Additionally, every key/value from `snap.extraProperties` is mapped with `snap` as key prefix and the capitalized
key, such that

Expand Down
77 changes: 76 additions & 1 deletion docs/modules/configuration/pages/packagers/snap.adoc
Expand Up @@ -118,6 +118,18 @@ include::partial$packagers/yaml/package-name.adoc[]
write:
- $HOME/.foo
- $HOME/.foobar
# Configures build/run architectures
# More details can be found at link:https://snapcraft.io/docs/architectures[]
# Default is empty
# icon:dot-circle[]
architectures:
# icon:exclamation-triangle[]
- buildOn: [amd64]
# icon:dot-circle[]
runOn: [am64]
# icon:dot-circle[]
ignoreError: true
----
--
TOML::
Expand Down Expand Up @@ -207,6 +219,18 @@ include::partial$packagers/toml/package-name.adoc[]
some_slot_name.key = "value"
some_slot_name.read = ["$HOME/.foo"]
some_slot_name.write = ["$HOME/.foo", "$HOME/.foobar"]
# Configures build/run architectures
# More details can be found at link:https://snapcraft.io/docs/architectures[]
# Default is empty
# icon:dot-circle[]
pass:[[[packagers.snap.architectures]]]
# icon:exclamation-triangle[]
buildOn = ["amd64"]
# icon:dot-circle[]
runOn = ["am64"]
# icon:dot-circle[]
ignoreError = true
----
--
JSON::
Expand Down Expand Up @@ -314,7 +338,22 @@ include::partial$packagers/json/package-name.adoc[]
]
}
}
= ]
],
// Configures build/run architectures
// More details can be found at link:https://snapcraft.io/docs/architectures[]
// Default is empty
// icon:dot-circle[]
"architectures": [
{
// icon:exclamation-triangle[]
"buildOn": ["amd64"],
// icon:dot-circle[]
"runOn": ["am64"],
// icon:dot-circle[]
"ignoreError": true
}
]
include::partial$packagers/json/common-footer.adoc[]
----
--
Expand Down Expand Up @@ -444,6 +483,29 @@ include::partial$packagers/maven/package-name.adoc[]
</writes>
</slot>
</slots>
<!--
// Configures build/run architectures
More details can be found at link:https://snapcraft.io/docs/architectures[]
Default is empty
icon:dot-circle[]
-->
<architectures>
<architecture>
<!--
icon:exclamation-triangle[]
-->
<buildOn>amd64</buildOn>
<!--
icon:dot-circle[]
-->
<runOn>am64</runOn>
<!--
icon:dot-circle[]
-->
<ignoreError>true</ignoreError>
</architecture>
</architectures>
include::partial$packagers/maven/common-footer.adoc[]
----
--
Expand Down Expand Up @@ -541,6 +603,19 @@ include::partial$packagers/gradle/package-name.adoc[]
addWrite('$HOME/.foobar')
}
}
// Configures build/run architectures
// More details can be found at link:https://snapcraft.io/docs/architectures[]
// Default is empty
// icon:dot-circle[]
architecture {
// icon:exclamation-triangle[]
buildOn = ['amd64']
// icon:dot-circle[]
runOn = ['am64']
// icon:dot-circle[]
ignoreError = true
}
include::partial$packagers/gradle/common-footer.adoc[]
----
--
Expand Down

0 comments on commit 347f419

Please sign in to comment.