From 06399dae85785b361b520f1f3e4d6fec73409cc6 Mon Sep 17 00:00:00 2001 From: SJ Date: Thu, 21 Jul 2022 16:47:45 -0400 Subject: [PATCH] See issue #76: Scaffolding out file structure --- pants-plugins/experimental/cc/goals/BUILD | 4 ++++ pants-plugins/experimental/cc/goals/check.py | 8 +++++++ pants-plugins/experimental/cc/register.py | 21 +++++++++++++++++++ .../experimental/cc/subsystems/BUILD | 4 ++++ .../experimental/cc/subsystems/toolchain.py | 8 +++++++ .../experimental/cc/util_rules/BUILD | 4 ++++ .../experimental/cc/util_rules/compile.py | 8 +++++++ 7 files changed, 57 insertions(+) create mode 100644 pants-plugins/experimental/cc/goals/check.py create mode 100644 pants-plugins/experimental/cc/register.py create mode 100644 pants-plugins/experimental/cc/subsystems/BUILD create mode 100644 pants-plugins/experimental/cc/subsystems/toolchain.py create mode 100644 pants-plugins/experimental/cc/util_rules/BUILD create mode 100644 pants-plugins/experimental/cc/util_rules/compile.py diff --git a/pants-plugins/experimental/cc/goals/BUILD b/pants-plugins/experimental/cc/goals/BUILD index 95c6150..bb3a189 100644 --- a/pants-plugins/experimental/cc/goals/BUILD +++ b/pants-plugins/experimental/cc/goals/BUILD @@ -2,3 +2,7 @@ # Licensed under the Apache License, Version 2.0 (see LICENSE). python_sources() + +python_tests( +name="tests", +) diff --git a/pants-plugins/experimental/cc/goals/check.py b/pants-plugins/experimental/cc/goals/check.py new file mode 100644 index 0000000..f5b7dc3 --- /dev/null +++ b/pants-plugins/experimental/cc/goals/check.py @@ -0,0 +1,8 @@ +from __future__ import annotations + +from typing import Iterable +from pants.engine.rules import collect_rules, Rule, UnionRule + + +def rules() -> Iterable[Rule | UnionRule]: + return collect_rules() diff --git a/pants-plugins/experimental/cc/register.py b/pants-plugins/experimental/cc/register.py new file mode 100644 index 0000000..ba72522 --- /dev/null +++ b/pants-plugins/experimental/cc/register.py @@ -0,0 +1,21 @@ +# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). +# Licensed under the Apache License, Version 2.0 (see LICENSE). + +from __future__ import annotations + +from typing import Iterable + +from experimental.cc.goals import check +from experimental.cc.subsystems import toolchain +from experimental.cc.util_rules import compile +from pants.engine.rules import Rule +from pants.engine.unions import UnionRule + + +def rules() -> Iterable[Rule | UnionRule]: + return ( + *check.rules(), + *compile.rules(), + *toolchain.rules(), + ) + diff --git a/pants-plugins/experimental/cc/subsystems/BUILD b/pants-plugins/experimental/cc/subsystems/BUILD new file mode 100644 index 0000000..95c6150 --- /dev/null +++ b/pants-plugins/experimental/cc/subsystems/BUILD @@ -0,0 +1,4 @@ +# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). +# Licensed under the Apache License, Version 2.0 (see LICENSE). + +python_sources() diff --git a/pants-plugins/experimental/cc/subsystems/toolchain.py b/pants-plugins/experimental/cc/subsystems/toolchain.py new file mode 100644 index 0000000..f5b7dc3 --- /dev/null +++ b/pants-plugins/experimental/cc/subsystems/toolchain.py @@ -0,0 +1,8 @@ +from __future__ import annotations + +from typing import Iterable +from pants.engine.rules import collect_rules, Rule, UnionRule + + +def rules() -> Iterable[Rule | UnionRule]: + return collect_rules() diff --git a/pants-plugins/experimental/cc/util_rules/BUILD b/pants-plugins/experimental/cc/util_rules/BUILD new file mode 100644 index 0000000..95c6150 --- /dev/null +++ b/pants-plugins/experimental/cc/util_rules/BUILD @@ -0,0 +1,4 @@ +# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). +# Licensed under the Apache License, Version 2.0 (see LICENSE). + +python_sources() diff --git a/pants-plugins/experimental/cc/util_rules/compile.py b/pants-plugins/experimental/cc/util_rules/compile.py new file mode 100644 index 0000000..f5b7dc3 --- /dev/null +++ b/pants-plugins/experimental/cc/util_rules/compile.py @@ -0,0 +1,8 @@ +from __future__ import annotations + +from typing import Iterable +from pants.engine.rules import collect_rules, Rule, UnionRule + + +def rules() -> Iterable[Rule | UnionRule]: + return collect_rules()