Exemplo n.º 1
0
def rules():
    return [
        *assembly.rules(),
        *build_pkg.rules(),
        *build_pkg_target.rules(),
        *check.rules(),
        *third_party_pkg.rules(),
        *golang.rules(),
        *import_analysis.rules(),
        *go_mod.rules(),
        *first_party_pkg.rules(),
        *link.rules(),
        *pkg_analyzer.rules(),
        *sdk.rules(),
        *tests_analysis.rules(),
        *tailor.rules(),
        *target_type_rules.rules(),
        *test.rules(),
        *run_binary.rules(),
        *package_binary.rules(),
        *load_go_binary.rules(),
        # Gofmt
        *gofmt_rules(),
        *gofmt_skip_field.rules(),
    ]
Exemplo n.º 2
0
def rules():
    return (
        *collect_rules(),
        UnionRule(GenerateSourcesRequest, GenerateGoFromProtobufRequest),
        UnionRule(GoCodegenBuildRequest, GoCodegenBuildProtobufRequest),
        UnionRule(InferDependenciesRequest,
                  InferGoProtobufDependenciesRequest),
        # Rules needed for this to pass src/python/pants/init/load_backends_integration_test.py:
        *assembly.rules(),
        *build_pkg.rules(),
        *build_pkg_target.rules(),
        *first_party_pkg.rules(),
        *go_mod.rules(),
        *link.rules(),
        *sdk.rules(),
        *target_type_rules.rules(),
        *third_party_pkg.rules(),
        *pex.rules(),
    )
Exemplo n.º 3
0
def rule_runner() -> RuleRunner:
    rule_runner = RuleRunner(
        rules=[
            *check.rules(),
            *sdk.rules(),
            *assembly.rules(),
            *build_pkg.rules(),
            *build_pkg_target.rules(),
            *import_analysis.rules(),
            *link.rules(),
            *go_mod.rules(),
            *first_party_pkg.rules(),
            *third_party_pkg.rules(),
            *target_type_rules.rules(),
            QueryRule(CheckResults, [GoCheckRequest]),
        ],
        target_types=[GoModTarget],
    )
    rule_runner.set_options([], env_inherit={"PATH"})
    return rule_runner
Exemplo n.º 4
0
def rule_runner() -> RuleRunner:
    rule_runner = RuleRunner(
        rules=[
            *go_tailor_rules(),
            *go_mod.rules(),
            *first_party_pkg.rules(),
            *third_party_pkg.rules(),
            *sdk.rules(),
            *target_type_rules.rules(),
            *build_pkg.rules(),
            *build_pkg_target.rules(),
            *assembly.rules(),
            *link.rules(),
            QueryRule(PutativeTargets,
                      [PutativeGoTargetsRequest, AllOwnedSources]),
        ],
        target_types=[GoModTarget, GoBinaryTarget, GoPackageTarget],
    )
    rule_runner.set_options([], env_inherit={"PATH"})
    return rule_runner
def rule_runner() -> RuleRunner:
    rule_runner = RuleRunner(
        rules=[
            *assembly.rules(),
            *import_analysis.rules(),
            *package_binary.rules(),
            *build_pkg.rules(),
            *build_pkg_target.rules(),
            *first_party_pkg.rules(),
            *go_mod.rules(),
            *link.rules(),
            *target_type_rules.rules(),
            *third_party_pkg.rules(),
            *sdk.rules(),
            QueryRule(BuiltPackage, (GoBinaryFieldSet,)),
        ],
        target_types=[GoBinaryTarget, GoModTarget],
    )
    rule_runner.set_options([], env_inherit={"PATH"})
    return rule_runner
Exemplo n.º 6
0
def rule_runner() -> RuleRunner:
    rule_runner = RuleRunner(
        rules=[
            *config_files.rules(),
            *external_tool_rules(),
            *source_files.rules(),
            *protobuf_target_types_rules(),
            *protobuf_dependency_inference.rules(),
            *stripped_source_files.rules(),
            *go_protobuf_rules(),
            *sdk.rules(),
            *target_types.rules(),
            # Rules needed to run Go unit test.
            *test.rules(),
            *assembly.rules(),
            *build_pkg.rules(),
            *build_pkg_target.rules(),
            *first_party_pkg.rules(),
            *go_mod.rules(),
            *link.rules(),
            *sdk.rules(),
            *target_type_rules.rules(),
            *tests_analysis.rules(),
            *third_party_pkg.rules(),
            QueryRule(HydratedSources, [HydrateSourcesRequest]),
            QueryRule(GeneratedSources, [GenerateGoFromProtobufRequest]),
            QueryRule(DigestContents, (Digest, )),
            QueryRule(TestResult, (GoTestFieldSet, )),
        ],
        target_types=[
            GoModTarget,
            GoPackageTarget,
            ProtobufSourceTarget,
            ProtobufSourcesGeneratorTarget,
        ],
    )
    rule_runner.set_options(
        [],
        env_inherit=PYTHON_BOOTSTRAP_ENV,
    )
    return rule_runner
Exemplo n.º 7
0
def rule_runner() -> RuleRunner:
    rule_runner = RuleRunner(
        rules=[
            *test_rules(),
            *assembly.rules(),
            *build_pkg.rules(),
            *build_pkg_target.rules(),
            *first_party_pkg.rules(),
            *go_mod.rules(),
            *link.rules(),
            *sdk.rules(),
            *target_type_rules.rules(),
            *tests_analysis.rules(),
            *third_party_pkg.rules(),
            QueryRule(TestResult, [GoTestFieldSet]),
        ],
        target_types=[GoModTarget],
    )
    rule_runner.set_options(["--go-test-args=-v -bench=."],
                            env_inherit={"PATH"})
    return rule_runner
Exemplo n.º 8
0
def rule_runner() -> RuleRunner:
    rule_runner = RuleRunner(
        rules=[
            *sdk.rules(),
            *assembly.rules(),
            *build_pkg.rules(),
            *build_pkg_target.rules(),
            *import_analysis.rules(),
            *link.rules(),
            *go_mod.rules(),
            *first_party_pkg.rules(),
            *third_party_pkg.rules(),
            *target_type_rules.rules(),
            QueryRule(BuiltGoPackage, [BuildGoPackageRequest]),
            QueryRule(FallibleBuiltGoPackage, [BuildGoPackageRequest]),
            QueryRule(BuildGoPackageRequest, [BuildGoPackageTargetRequest]),
            QueryRule(FallibleBuildGoPackageRequest, [BuildGoPackageTargetRequest]),
        ],
        target_types=[GoModTarget],
    )
    rule_runner.set_options([], env_inherit={"PATH"})
    return rule_runner