mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-05 21:17:25 +00:00
Adds implementation flag for swift (#7202)
* Adds implementation flag for swift Forces internal flag when using @_implementationOnly in swift Fixes access type for verifier functions & encoder functions Updates generated code * Addresses PR comments & adds a code gen dir within the swift tests * Adds test case for no-include * Fixes code gen script Removes prefix
This commit is contained in:
@@ -63,6 +63,7 @@ assert flatc_path.exists(), "Cannot find the flatc compiler " + str(flatc_path)
|
||||
|
||||
# Specify the other paths that will be referenced
|
||||
tests_path = Path(root_path, "tests")
|
||||
swift_code_gen = Path(root_path, "tests/FlatBuffers.Test.Swift/CodeGenerationTests")
|
||||
samples_path = Path(root_path, "samples")
|
||||
reflection_path = Path(root_path, "reflection")
|
||||
|
||||
@@ -138,6 +139,12 @@ RUST_SERIALIZE_OPTS = BASE_OPTS + [
|
||||
TS_OPTS = ["--ts", "--gen-name-strings"]
|
||||
LOBSTER_OPTS = ["--lobster"]
|
||||
SWIFT_OPTS = ["--swift", "--gen-json-emit", "--bfbs-filenames", str(tests_path)]
|
||||
SWIFT_OPTS_CODE_GEN = [
|
||||
"--swift",
|
||||
"--gen-json-emit",
|
||||
"--bfbs-filenames",
|
||||
swift_code_gen
|
||||
]
|
||||
JAVA_OPTS = ["--java"]
|
||||
KOTLIN_OPTS = ["--kotlin"]
|
||||
PHP_OPTS = ["--php"]
|
||||
@@ -380,6 +387,18 @@ flatc(
|
||||
prefix=swift_prefix,
|
||||
)
|
||||
|
||||
flatc(
|
||||
SWIFT_OPTS_CODE_GEN + BASE_OPTS + ["--grpc", "--swift-implementation-only"],
|
||||
schema="test_import.fbs",
|
||||
cwd=swift_code_gen
|
||||
)
|
||||
|
||||
flatc(
|
||||
SWIFT_OPTS_CODE_GEN + NO_INCL_OPTS + ["--grpc"],
|
||||
schema="test_no_include.fbs",
|
||||
cwd=swift_code_gen
|
||||
)
|
||||
|
||||
# --filename-suffix and --filename-ext tests
|
||||
flatc(
|
||||
CPP_OPTS + NO_INCL_OPTS + ["--filename-suffix", "_suffix", "--filename-ext", "hpp"],
|
||||
|
||||
Reference in New Issue
Block a user