-
-
Notifications
You must be signed in to change notification settings - Fork 608
/
subsystem.py
33 lines (28 loc) · 1.38 KB
/
subsystem.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from pants.engine.addresses import UnparsedAddressInputs
from pants.option.custom_types import target_option
from pants.option.subsystem import Subsystem
class ScroogeAndroidSubsystem(Subsystem):
options_scope = "scrooge-android"
help = "Android-specific options for the Scrooge Thrift IDL compiler (https://twitter.github.io/scrooge/)."
@classmethod
def register_options(cls, register):
super().register_options(register)
register(
"--runtime-dependencies",
type=list,
member_type=target_option,
help=(
"A list of addresses to `jvm_artifact` targets for the runtime "
"dependencies needed for generated Java code to work. For example, "
"`['3rdparty/jvm:libthrift']`. These dependencies will "
"be automatically added to every `thrift_source` target. At the very least, "
"this option must be set to a `jvm_artifact` for the "
"`org.apache.thrift:libthrift` runtime library."
),
)
@property
def runtime_dependencies(self) -> UnparsedAddressInputs:
return UnparsedAddressInputs(self.options.runtime_dependencies, owning_address=None)