mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 1637845 - Add 'file-updates' to the moz.yaml schema r=glob
This section is for expressing actions that occur after extracting the files, before vendoring is completed. While we support running scripts (or at least, we will...) this section can be used for simple actions that don't need scripts. Also, add the dav1d excluded files. Differential Revision: https://phabricator.services.mozilla.com/D75696 Depends on D75695
This commit is contained in:
parent
7c4c1b39f3
commit
4d9b87747c
@ -38,3 +38,17 @@ vendoring:
|
|||||||
url: https://code.videolan.org/videolan/dav1d.git
|
url: https://code.videolan.org/videolan/dav1d.git
|
||||||
source-hosting: gitlab
|
source-hosting: gitlab
|
||||||
vendor-directory: third_party/dav1d
|
vendor-directory: third_party/dav1d
|
||||||
|
|
||||||
|
exclude:
|
||||||
|
- build/.gitattributes
|
||||||
|
- build/.gitignore
|
||||||
|
|
||||||
|
file-updates:
|
||||||
|
- action: replace-in-file
|
||||||
|
pattern: '@VCS_TAG@'
|
||||||
|
with: '{revision}'
|
||||||
|
file: include/vcs_version.h.in
|
||||||
|
- action: replace-in-file
|
||||||
|
pattern: '@VCS_TAG@'
|
||||||
|
with: '{revision}'
|
||||||
|
file: '{yaml_dir}/vcs_version.h'
|
||||||
|
35
python/mozbuild/mozbuild/vendor/moz_yaml.py
vendored
35
python/mozbuild/mozbuild/vendor/moz_yaml.py
vendored
@ -161,6 +161,28 @@ vendoring:
|
|||||||
run_after:
|
run_after:
|
||||||
- script
|
- script
|
||||||
- another script
|
- another script
|
||||||
|
|
||||||
|
# Strings to replace in various files after vendoring.
|
||||||
|
# All subfields are required
|
||||||
|
# Action must be 'replace-in-file'
|
||||||
|
# Pattern is what in the file to search for. It is an exact strng match
|
||||||
|
# With is the string to replace it with. Accepts the special keyword
|
||||||
|
# '{revision}' for the commit we are updating to.
|
||||||
|
# File is the file to replace it in. It is relative to the vendor-directory.
|
||||||
|
# If the vendor-directory is different from the directory of the yaml file,
|
||||||
|
# the keyword '{yaml_dir}' may be used to make the path relative to that
|
||||||
|
# directory
|
||||||
|
# optional
|
||||||
|
file-updates:
|
||||||
|
- action: replace-in-file
|
||||||
|
pattern: '@VCS_TAG@'
|
||||||
|
with: '{revision}'
|
||||||
|
file: include/vcs_version.h.in
|
||||||
|
|
||||||
|
- action: replace-in-file
|
||||||
|
pattern: '@VCS_TAG@'
|
||||||
|
with: '{revision}'
|
||||||
|
file: '{yaml_dir}/vcs_version.h'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RE_SECTION = re.compile(r"^(\S[^:]*):").search
|
RE_SECTION = re.compile(r"^(\S[^:]*):").search
|
||||||
@ -278,6 +300,19 @@ def _schema_1():
|
|||||||
"exclude": Unique([str]),
|
"exclude": Unique([str]),
|
||||||
"include": Unique([str]),
|
"include": Unique([str]),
|
||||||
"run_after": Unique([str]),
|
"run_after": Unique([str]),
|
||||||
|
"file-updates": [
|
||||||
|
{
|
||||||
|
Required("action"): All(
|
||||||
|
In(
|
||||||
|
["replace-in-file"],
|
||||||
|
msg="Invalid action specified in file-updates",
|
||||||
|
)
|
||||||
|
),
|
||||||
|
Required("pattern"): All(str, Length(min=1)),
|
||||||
|
Required("with"): All(str, Length(min=1)),
|
||||||
|
Required("file"): All(str, Length(min=1)),
|
||||||
|
}
|
||||||
|
],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user