• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Recached

pantsbuild / pants / 18517631058

15 Oct 2025 04:18AM UTC coverage: 69.207% (-11.1%) from 80.267%
18517631058

Pull #22745

github

web-flow
Merge 642a76ca1 into 99919310e
Pull Request #22745: [windows] Add windows support in the stdio crate.

53815 of 77759 relevant lines covered (69.21%)

2.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/python/pants/backend/swift/target_types.py
1
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
×
5

6
from pants.engine.target import (
×
7
    COMMON_TARGET_FIELDS,
8
    Dependencies,
9
    MultipleSourcesField,
10
    SingleSourceField,
11
    Target,
12
    TargetFilesGenerator,
13
    generate_multiple_sources_field_help_message,
14
)
15

16
SWIFT_FILE_EXTENSIONS = (".swift",)
×
17

18

19
class SwiftDependenciesField(Dependencies):
×
20
    pass
×
21

22

23
class SwiftSourceField(SingleSourceField):
×
24
    expected_file_extensions = SWIFT_FILE_EXTENSIONS
×
25

26

27
class SwiftGeneratorSourcesField(MultipleSourcesField):
×
28
    expected_file_extensions = SWIFT_FILE_EXTENSIONS
×
29

30

31
# -----------------------------------------------------------------------------------------------
32
# `swift_source` and `swift_sources` targets
33
# -----------------------------------------------------------------------------------------------
34

35

36
class SwiftSourceTarget(Target):
×
37
    alias = "swift_source"
×
38
    core_fields = (
×
39
        *COMMON_TARGET_FIELDS,
40
        SwiftDependenciesField,
41
        SwiftSourceField,
42
    )
43
    help = "A single Swift source file."
×
44

45

46
class SwiftSourcesGeneratorSourcesField(SwiftGeneratorSourcesField):
×
47
    default = tuple(f"*{ext}" for ext in SWIFT_FILE_EXTENSIONS)
×
48
    help = generate_multiple_sources_field_help_message(
×
49
        "Example: `sources=['utils.swift', 'subdir/*.swift', '!ignore_me.swift']`"
50
    )
51

52

53
class SwiftSourcesGeneratorTarget(TargetFilesGenerator):
×
54
    alias = "swift_sources"
×
55
    core_fields = (
×
56
        *COMMON_TARGET_FIELDS,
57
        SwiftSourcesGeneratorSourcesField,
58
    )
59
    generated_target_cls = SwiftSourceTarget
×
60
    copied_fields = COMMON_TARGET_FIELDS
×
61
    moved_fields = (SwiftDependenciesField,)
×
62
    help = "Generate a `swift_source` target for each file in the `sources` field."
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc