mirror of
https://github.com/wentasah/ros2nix.git
synced 2025-06-10 00:02:23 +03:00
Add --do-check
This commit is contained in:
parent
12b7379af5
commit
c4bc177658
2 changed files with 13 additions and 0 deletions
|
@ -94,12 +94,14 @@ class NixExpression:
|
||||||
propagated_native_build_inputs: Set[str] = set(),
|
propagated_native_build_inputs: Set[str] = set(),
|
||||||
src_param: Optional[str] = None,
|
src_param: Optional[str] = None,
|
||||||
source_root: Optional[str] = None,
|
source_root: Optional[str] = None,
|
||||||
|
do_check: Optional[bool] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.name = name
|
self.name = name
|
||||||
self.version = version
|
self.version = version
|
||||||
self.src_param = src_param
|
self.src_param = src_param
|
||||||
self.src_expr = src_expr
|
self.src_expr = src_expr
|
||||||
self.source_root = source_root
|
self.source_root = source_root
|
||||||
|
self.do_check = do_check
|
||||||
|
|
||||||
self.description = description
|
self.description = description
|
||||||
self.licenses = licenses
|
self.licenses = licenses
|
||||||
|
@ -170,6 +172,9 @@ class NixExpression:
|
||||||
if self.source_root:
|
if self.source_root:
|
||||||
ret += f' sourceRoot = "{self.source_root}";\n'
|
ret += f' sourceRoot = "{self.source_root}";\n'
|
||||||
|
|
||||||
|
if self.do_check is not None:
|
||||||
|
ret += f' doCheck = {"true" if self.do_check else "false"};\n'
|
||||||
|
|
||||||
if self.build_inputs:
|
if self.build_inputs:
|
||||||
ret += " buildInputs = {};\n" \
|
ret += " buildInputs = {};\n" \
|
||||||
.format(self._to_nix_list(sorted(self.build_inputs)))
|
.format(self._to_nix_list(sorted(self.build_inputs)))
|
||||||
|
|
|
@ -226,6 +226,11 @@ def ros2nix(args):
|
||||||
help="Set sourceRoot attribute value in the generated Nix expression. "
|
help="Set sourceRoot attribute value in the generated Nix expression. "
|
||||||
"Substring '{package_name}' gets replaced with the package name.",
|
"Substring '{package_name}' gets replaced with the package name.",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--do-check",
|
||||||
|
action="store_true",
|
||||||
|
help="Set doCheck attribute to true",
|
||||||
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--extra-build-inputs", type=comma_separated, metavar="DEP1,DEP2,...", default=[],
|
"--extra-build-inputs", type=comma_separated, metavar="DEP1,DEP2,...", default=[],
|
||||||
|
@ -369,6 +374,9 @@ def ros2nix(args):
|
||||||
if args.source_root:
|
if args.source_root:
|
||||||
kwargs["source_root"] = args.source_root.replace('{package_name}', pkg.name)
|
kwargs["source_root"] = args.source_root.replace('{package_name}', pkg.name)
|
||||||
|
|
||||||
|
if args.do_check:
|
||||||
|
kwargs["do_check"] = True
|
||||||
|
|
||||||
derivation = NixExpression(
|
derivation = NixExpression(
|
||||||
name=NixPackage.normalize_name(pkg.name),
|
name=NixPackage.normalize_name(pkg.name),
|
||||||
version=pkg.version,
|
version=pkg.version,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue