diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 7f8bdd42269..1dcf09d23ee 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -31,6 +31,7 @@ platforms: test_targets: - "//..." macos: + xcode_version: "14.3" build_targets: - "//..." test_targets: diff --git a/.bazelignore b/.bazelignore index 3c3629e647f..accce227baa 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1 +1 @@ -node_modules +ts/node_modules diff --git a/.bazelrc b/.bazelrc index f9f47a74237..813fce99ff2 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,4 +1,12 @@ # We cannot use "common" here because the "version" command doesn't support # --deleted_packages. We need to specify it for both build and query instead. -build --deleted_packages=tests/ts/bazel_repository_test_dir -query --deleted_packages=tests/ts/bazel_repository_test_dir +build --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir +query --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir +# Point tools such as coursier (used in rules_jvm_external) to Bazel's internal JDK +# suggested in https://github.com/bazelbuild/rules_jvm_external/issues/445 +common --repo_env=JAVA_HOME=../bazel_tools/jdk +common --action_env=JAVA_HOME=../bazel_tools/jdk +# Workaround "Error: need --enable_runfiles on Windows for to support rules_js" +common:windows --enable_runfiles +# Swift is not required on Windows +common:windows --deleted_packages=swift \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed5c7eb586e..b501bdfc98e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,9 @@ on: pull_request: branches: - master + schedule: + # Run daily at 4:45 A.M. to catch dependencies that break us. + - cron: '45 4 * * *' jobs: build-linux: @@ -21,10 +24,10 @@ jobs: digests-gcc: ${{ steps.hash-gcc.outputs.hashes }} digests-clang: ${{ steps.hash-clang.outputs.hashes }} name: Build Linux - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 strategy: matrix: - cxx: [g++-13, clang++-15] + cxx: [g++-13, clang++-18] fail-fast: false steps: - uses: actions/checkout@v3 @@ -53,7 +56,7 @@ jobs: with: files: Linux.flatc.binary.${{ matrix.cxx }}.zip - name: Generate SLSA subjects - clang - if: matrix.cxx == 'clang++-15' && startsWith(github.ref, 'refs/tags/') + if: matrix.cxx == 'clang++-18' && startsWith(github.ref, 'refs/tags/') id: hash-clang run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT - name: Generate SLSA subjects - gcc @@ -63,11 +66,11 @@ jobs: build-linux-no-file-tests: name: Build Linux with -DFLATBUFFERS_NO_FILE_TESTS - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: cmake - run: CXX=clang++-15 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CXX_FLAGS="-DFLATBUFFERS_NO_FILE_TESTS" . + run: CXX=clang++-18 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CXX_FLAGS="-DFLATBUFFERS_NO_FILE_TESTS" . - name: build run: make -j - name: test @@ -75,7 +78,7 @@ jobs: build-linux-out-of-source: name: Build Linux with out-of-source build location - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: make build directory @@ -83,7 +86,7 @@ jobs: - name: cmake working-directory: build run: > - CXX=clang++-15 cmake .. -G "Unix Makefiles" -DFLATBUFFERS_STRICT_MODE=ON + CXX=clang++-18 cmake .. -G "Unix Makefiles" -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_CPP_STD=17 - name: build working-directory: build @@ -97,15 +100,15 @@ jobs: build-linux-cpp-std: name: Build Linux C++ - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: std: [11, 14, 17, 20, 23] - cxx: [g++-13, clang++-15] + cxx: [g++-13, clang++-18] exclude: # Clang++15 10.3.0 stdlibc++ doesn't fully support std 23 - - cxx: clang++-15 + - cxx: clang++-18 std: 23 steps: @@ -220,11 +223,11 @@ jobs: outputs: digests: ${{ steps.hash.outputs.hashes }} name: Build Mac (for Intel) - runs-on: macos-latest + runs-on: macos-latest-large steps: - uses: actions/checkout@v3 - name: cmake - run: cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . + run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . - name: build run: xcodebuild -toolchain clang -configuration Release -target flattests - name: check that the binary is x86_64 @@ -302,7 +305,7 @@ jobs: build-android: name: Build Android (on Linux) - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: set up Java @@ -321,10 +324,10 @@ jobs: build-generator: name: Check Generated Code - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 strategy: matrix: - cxx: [g++-13, clang++-15] + cxx: [g++-13, clang++-18] steps: - uses: actions/checkout@v3 - name: cmake @@ -352,7 +355,7 @@ jobs: build-benchmarks: name: Build Benchmarks (on Linux) - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 strategy: matrix: cxx: [g++-13] @@ -370,7 +373,7 @@ jobs: build-java: name: Build Java - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: test @@ -383,6 +386,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + # Force Xcode 14.3 since Xcode 15 doesnt support older versions of + # kotlin. For Xcode 15, kotlin should be bumpped to 1.9.10 + # https://stackoverflow.com/a/77150623 + - name: Set up Xcode version + run: sudo xcode-select -s /Applications/Xcode_14.3.app/Contents/Developer - uses: gradle/wrapper-validation-action@v1.0.5 - uses: actions/setup-java@v3 with: @@ -399,7 +407,7 @@ jobs: build-kotlin-linux: name: Build Kotlin Linux - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -422,7 +430,7 @@ jobs: build-rust-linux: name: Build Rust Linux - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: test @@ -440,7 +448,7 @@ jobs: build-python: name: Build Python - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: flatc @@ -452,7 +460,7 @@ jobs: build-go: name: Build Go - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: flatc @@ -464,7 +472,7 @@ jobs: build-php: name: Build PHP - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: flatc @@ -478,7 +486,8 @@ jobs: build-swift: name: Build Swift - runs-on: ubuntu-22.04-64core + # Only 22.04 has swift at the moment https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md?plain=1#L30 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: test @@ -489,7 +498,7 @@ jobs: build-swift-wasm: name: Build Swift Wasm - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 container: image: ghcr.io/swiftwasm/carton:0.15.3 steps: @@ -502,7 +511,7 @@ jobs: build-ts: name: Build TS - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: flatc @@ -520,7 +529,7 @@ jobs: build-dart: name: Build Dart - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - uses: dart-lang/setup-dart@v1 @@ -535,7 +544,7 @@ jobs: build-nim: name: Build Nim - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: flatc @@ -554,7 +563,7 @@ jobs: needs: [build-linux, build-windows, build-mac-intel, build-mac-universal] outputs: digests: ${{ steps.hash.outputs.digests }} - runs-on: ubuntu-22.04-64core + runs-on: ubuntu-24.04 steps: - name: Merge results id: hash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1554d824f7e..24f857b37aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: # For manual tests. workflow_dispatch: release: - types: [created] + types: [published] jobs: publish-npm: @@ -100,6 +100,53 @@ jobs: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + + publish-maven-kotlin: + name: Publish Maven - Kotlin + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./kotlin + steps: + - uses: actions/checkout@v3 + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + cache: 'maven' + server-id: ossrh + server-username: OSSRH_USERNAME + server-password: OSSRH_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE # this needs to be an env var + - name: Publish Kotlin Library on Maven + run: ./gradlew publishAllPublicationsToSonatypeRepository + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + publish-crates: + name: Publish crates.io + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Publish Flatbuffers + uses: katyo/publish-crates@v2 + with: + path: ./rust/flatbuffers + registry-token: ${{ secrets.CARGO_TOKEN }} + + - name: Publish Flexbuffers + uses: katyo/publish-crates@v2 + with: + path: ./rust/flexbuffers + registry-token: ${{ secrets.CARGO_TOKEN }} diff --git a/BUILD.bazel b/BUILD.bazel index b4f015a0e29..933e24ac854 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,5 +1,3 @@ -load("@aspect_rules_js//npm:defs.bzl", "npm_link_package") -load("@npm//:defs.bzl", "npm_link_all_packages") load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") licenses(["notice"]) @@ -8,13 +6,6 @@ package( default_visibility = ["//visibility:public"], ) -npm_link_all_packages(name = "node_modules") - -npm_link_package( - name = "node_modules/flatbuffers", - src = "//ts:flatbuffers", -) - exports_files([ "LICENSE", "tsconfig.json", @@ -37,9 +28,13 @@ config_setting( filegroup( name = "distribution", srcs = [ + ".bazelignore", + ".npmrc", "BUILD.bazel", "WORKSPACE", "build_defs.bzl", + "package.json", + "pnpm-lock.yaml", "typescript.bzl", "//grpc/src/compiler:distribution", "//reflection:distribution", diff --git a/CHANGELOG.md b/CHANGELOG.md index 145c62b1099..2b0380df6c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ All major or breaking changes will be documented in this file, as well as any new features that should be highlighted. Minor fixes or improvements are not necessarily listed. +## [24.3.25] (March 25 2024)(https://github.com/google/flatbuffers/releases/tag/v24.3.25) + +* Fixed license metadata parsing (#8253) +* [C++] Allow string_view in `LookUpByKey` in addition to null-terminated c-style strings (#8203) + +## [24.3.7] (March 7 2024)(https://github.com/google/flatbuffers/releases/tag/v24.3.7) + +* Just to fix some of the CI build issues from the 24.3.6 release. + +## [24.3.6] (March 6 2024)(https://github.com/google/flatbuffers/releases/tag/v24.3.6) + +* Fix typescript object API to allow 0 values for null-default scalars (#7864) + ## [23.5.26 (May 26 2023)](https://github.com/google/flatbuffers/releases/tag/v23.5.26) * Mostly bug fixing for 64-bit support diff --git a/CMake/Version.cmake b/CMake/Version.cmake index c94240a9a33..df18fe47a08 100644 --- a/CMake/Version.cmake +++ b/CMake/Version.cmake @@ -1,6 +1,6 @@ -set(VERSION_MAJOR 23) -set(VERSION_MINOR 5) -set(VERSION_PATCH 26) +set(VERSION_MAJOR 24) +set(VERSION_MINOR 3) +set(VERSION_PATCH 25) set(VERSION_COMMIT 0) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") diff --git a/FlatBuffers.podspec b/FlatBuffers.podspec index cecb1137e34..2aa69e2a027 100644 --- a/FlatBuffers.podspec +++ b/FlatBuffers.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FlatBuffers' - s.version = '23.5.26' + s.version = '24.3.25' s.summary = 'FlatBuffers: Memory Efficient Serialization Library' s.description = "FlatBuffers is a cross platform serialization library architected for diff --git a/WORKSPACE b/WORKSPACE index e56d4ce364b..772dc018e4f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -11,6 +11,21 @@ http_archive( ], ) +# Import our own version of skylib before other rule sets (e.g. rules_swift) +# has a chance to import an old version. +http_archive( + name = "bazel_skylib", + sha256 = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz", + ], +) + +load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") + +bazel_skylib_workspace() + http_archive( name = "build_bazel_rules_apple", sha256 = "34c41bfb59cdaea29ac2df5a2fa79e5add609c71bb303b2ebb10985f93fa20e7", @@ -68,6 +83,28 @@ http_archive( ], ) +#### Building boring ssl +# Fetching boringssl within the flatbuffers repository, to patch the issue +# of not being able to upgrade to Xcode 14.3 due to buildkite throwing errors +# which was patched in the following below. +# https://github.com/google/flatbuffers/commit/67eb95de9281087ccbba9aafd6e8ab1958d12045 +# The patch was copied from the following comment on the same issue within tensorflow +# and fixed to adapt the already existing patch for boringssl. +# https://github.com/tensorflow/tensorflow/issues/60191#issuecomment-1496073147 +http_archive( + name = "boringssl", + patch_args = ["-p1"], + patches = ["//grpc:boringssl.patch"], + # Use github mirror instead of https://boringssl.googlesource.com/boringssl + # to obtain a boringssl archive with consistent sha256 + sha256 = "534fa658bd845fd974b50b10f444d392dfd0d93768c4a51b61263fd37d851c40", + strip_prefix = "boringssl-b9232f9e27e5668bc0414879dcdedb2a59ea75f2", + urls = [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/b9232f9e27e5668bc0414879dcdedb2a59ea75f2.tar.gz", + "https://github.com/google/boringssl/archive/b9232f9e27e5668bc0414879dcdedb2a59ea75f2.tar.gz", + ], +) + ##### GRPC _GRPC_VERSION = "1.49.0" # https://github.com/grpc/grpc/releases/tag/v1.48.0 @@ -101,7 +138,7 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") rules_js_dependencies() -load("@aspect_rules_js//npm:npm_import.bzl", "npm_translate_lock", "pnpm_repository") +load("@aspect_rules_js//npm:npm_import.bzl", "pnpm_repository") pnpm_repository(name = "pnpm") @@ -129,17 +166,13 @@ nodejs_register_toolchains( node_version = DEFAULT_NODE_VERSION, ) -npm_translate_lock( - name = "npm", - npmrc = "//:.npmrc", - pnpm_lock = "//:pnpm-lock.yaml", - # Set this to True when the lock file needs to be updated, commit the - # changes, then set to False again. - update_pnpm_lock = False, - verify_node_modules_ignored = "//:.bazelignore", +load("@com_github_google_flatbuffers//ts:repositories.bzl", "flatbuffers_npm") + +flatbuffers_npm( + name = "flatbuffers_npm", ) -load("@npm//:repositories.bzl", "npm_repositories") +load("@flatbuffers_npm//:repositories.bzl", "npm_repositories") npm_repositories() diff --git a/android/app/src/main/java/generated/com/fbs/app/Animal.kt b/android/app/src/main/java/generated/com/fbs/app/Animal.kt index 5564e03961e..1730eb4f168 100644 --- a/android/app/src/main/java/generated/com/fbs/app/Animal.kt +++ b/android/app/src/main/java/generated/com/fbs/app/Animal.kt @@ -57,7 +57,7 @@ class Animal : Table() { return if(o != 0) bb.getShort(o + bb_pos).toUShort() else 0u } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsAnimal(_bb: ByteBuffer): Animal = getRootAsAnimal(_bb, Animal()) fun getRootAsAnimal(_bb: ByteBuffer, obj: Animal): Animal { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/dart/lib/flat_buffers.dart b/dart/lib/flat_buffers.dart index 6f307872e10..2395992ae28 100644 --- a/dart/lib/flat_buffers.dart +++ b/dart/lib/flat_buffers.dart @@ -386,7 +386,7 @@ class Builder { /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putFloat64(double value) { _prepare(_sizeofFloat64, 1); - _setFloat32AtTail(_tail, value); + _setFloat64AtTail(_tail, value); } /// Writes a Float32 to the tail of the buffer after preparing space for it. diff --git a/dart/pubspec.yaml b/dart/pubspec.yaml index f2830de290e..8108a2b4752 100644 --- a/dart/pubspec.yaml +++ b/dart/pubspec.yaml @@ -1,5 +1,5 @@ name: flat_buffers -version: 23.5.26 +version: 24.3.25 description: FlatBuffers reading and writing library for Dart. Based on original work by Konstantin Scheglov and Paul Berry of the Dart SDK team. homepage: https://github.com/google/flatbuffers documentation: https://google.github.io/flatbuffers/index.html diff --git a/dart/test/flat_buffers_test.dart b/dart/test/flat_buffers_test.dart index caf2fc79a9e..83a6e2b3f1e 100644 --- a/dart/test/flat_buffers_test.dart +++ b/dart/test/flat_buffers_test.dart @@ -215,6 +215,10 @@ class BuilderTest { ..addTestarrayofstringOffset(testArrayOfString); final mon = monBuilder.finish(); fbBuilder.finish(mon); + + final mon3 = example.Monster(fbBuilder.buffer); + expect(mon3.name, 'MyMonster'); + expect(mon3.pos!.test1, 3.0); } void test_error_addInt32_withoutStartTable([Builder? builder]) { diff --git a/goldens/cpp/basic_generated.h b/goldens/cpp/basic_generated.h index 22a28e1f1b4..67f2902c9a8 100644 --- a/goldens/cpp/basic_generated.h +++ b/goldens/cpp/basic_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace flatbuffers { diff --git a/goldens/csharp/flatbuffers/goldens/Galaxy.cs b/goldens/csharp/flatbuffers/goldens/Galaxy.cs index 26d311da9bc..85c1c006eaf 100644 --- a/goldens/csharp/flatbuffers/goldens/Galaxy.cs +++ b/goldens/csharp/flatbuffers/goldens/Galaxy.cs @@ -13,7 +13,7 @@ public struct Galaxy : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static Galaxy GetRootAsGalaxy(ByteBuffer _bb) { return GetRootAsGalaxy(_bb, new Galaxy()); } public static Galaxy GetRootAsGalaxy(ByteBuffer _bb, Galaxy obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/goldens/csharp/flatbuffers/goldens/Universe.cs b/goldens/csharp/flatbuffers/goldens/Universe.cs index 134fbb06899..ab9413426da 100644 --- a/goldens/csharp/flatbuffers/goldens/Universe.cs +++ b/goldens/csharp/flatbuffers/goldens/Universe.cs @@ -13,7 +13,7 @@ public struct Universe : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static Universe GetRootAsUniverse(ByteBuffer _bb) { return GetRootAsUniverse(_bb, new Universe()); } public static Universe GetRootAsUniverse(ByteBuffer _bb, Universe obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static bool VerifyUniverse(ByteBuffer _bb) {Google.FlatBuffers.Verifier verifier = new Google.FlatBuffers.Verifier(_bb); return verifier.VerifyBuffer("", false, UniverseVerify.Verify); } diff --git a/goldens/java/flatbuffers/goldens/Galaxy.java b/goldens/java/flatbuffers/goldens/Galaxy.java index 22b2a4e38c3..260d5be7e05 100644 --- a/goldens/java/flatbuffers/goldens/Galaxy.java +++ b/goldens/java/flatbuffers/goldens/Galaxy.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class Galaxy extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Galaxy getRootAsGalaxy(ByteBuffer _bb) { return getRootAsGalaxy(_bb, new Galaxy()); } public static Galaxy getRootAsGalaxy(ByteBuffer _bb, Galaxy obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/goldens/java/flatbuffers/goldens/Universe.java b/goldens/java/flatbuffers/goldens/Universe.java index 4850e6782f5..73be26ce1e1 100644 --- a/goldens/java/flatbuffers/goldens/Universe.java +++ b/goldens/java/flatbuffers/goldens/Universe.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class Universe extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Universe getRootAsUniverse(ByteBuffer _bb) { return getRootAsUniverse(_bb, new Universe()); } public static Universe getRootAsUniverse(ByteBuffer _bb, Universe obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/goldens/kotlin/flatbuffers/goldens/Galaxy.kt b/goldens/kotlin/flatbuffers/goldens/Galaxy.kt index 04a27d00627..e74d068ca79 100644 --- a/goldens/kotlin/flatbuffers/goldens/Galaxy.kt +++ b/goldens/kotlin/flatbuffers/goldens/Galaxy.kt @@ -34,7 +34,7 @@ class Galaxy : Table() { return if(o != 0) bb.getLong(o + bb_pos) else 0L } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsGalaxy(_bb: ByteBuffer): Galaxy = getRootAsGalaxy(_bb, Galaxy()) fun getRootAsGalaxy(_bb: ByteBuffer, obj: Galaxy): Galaxy { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/goldens/kotlin/flatbuffers/goldens/Universe.kt b/goldens/kotlin/flatbuffers/goldens/Universe.kt index 140e35ea4cc..8c572eff520 100644 --- a/goldens/kotlin/flatbuffers/goldens/Universe.kt +++ b/goldens/kotlin/flatbuffers/goldens/Universe.kt @@ -47,7 +47,7 @@ class Universe : Table() { val o = __offset(6); return if (o != 0) __vector_len(o) else 0 } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsUniverse(_bb: ByteBuffer): Universe = getRootAsUniverse(_bb, Universe()) fun getRootAsUniverse(_bb: ByteBuffer, obj: Universe): Universe { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/goldens/py/flatbuffers/goldens/Universe.py b/goldens/py/flatbuffers/goldens/Universe.py index fea20102a9f..feec6d96c06 100644 --- a/goldens/py/flatbuffers/goldens/Universe.py +++ b/goldens/py/flatbuffers/goldens/Universe.py @@ -77,7 +77,7 @@ def AddGalaxies(builder, galaxies): def UniverseStartGalaxiesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartGalaxiesVector(builder, numElems: int) -> int: +def StartGalaxiesVector(builder, numElems): return UniverseStartGalaxiesVector(builder, numElems) def UniverseEnd(builder): diff --git a/goldens/swift/__init__.py b/goldens/swift/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/goldens/swift/basic_generated.swift b/goldens/swift/basic_generated.swift index 3943c37ab8b..9b0e6a93f3c 100644 --- a/goldens/swift/basic_generated.swift +++ b/goldens/swift/basic_generated.swift @@ -6,7 +6,7 @@ import FlatBuffers public struct flatbuffers_goldens_Galaxy: FlatBufferObject, Verifiable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -41,7 +41,7 @@ public struct flatbuffers_goldens_Galaxy: FlatBufferObject, Verifiable { public struct flatbuffers_goldens_Universe: FlatBufferObject, Verifiable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/grpc/boringssl.patch b/grpc/boringssl.patch index 632499e2804..a8768927ac1 100644 --- a/grpc/boringssl.patch +++ b/grpc/boringssl.patch @@ -11,3 +11,31 @@ index 1645a264a..12f8ca999 100644 add_executable( bssl +diff --git a/src/crypto/x509/t_x509.c b/src/crypto/x509/t_x509.c +index 7c32a8798..6e50d040e 100644 +--- a/src/crypto/x509/t_x509.c ++++ b/src/crypto/x509/t_x509.c +@@ -318,9 +318,7 @@ int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, + int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase) + { + char *s, *c, *b; +- int ret = 0, l, i; +- +- l = 80 - 2 - obase; ++ int ret = 0, i; + + b = X509_NAME_oneline(name, NULL, 0); + if (!b) +@@ -347,12 +345,10 @@ int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase) + if (BIO_write(bp, ", ", 2) != 2) + goto err; + } +- l--; + } + if (*s == '\0') + break; + s++; +- l--; + } + + ret = 1; diff --git a/grpc/build_grpc_with_cxx14.patch b/grpc/build_grpc_with_cxx14.patch index 38cdfe9931b..b5900af5b34 100644 --- a/grpc/build_grpc_with_cxx14.patch +++ b/grpc/build_grpc_with_cxx14.patch @@ -2,9 +2,12 @@ diff --git a/bazel/copts.bzl b/bazel/copts.bzl index 10be944f25..879518b92f 100644 --- a/bazel/copts.bzl +++ b/bazel/copts.bzl -@@ -59,4 +59,4 @@ GRPC_LLVM_WARNING_FLAGS = [ +@@ -59,4 +59,7 @@ GRPC_LLVM_WARNING_FLAGS = [ GRPC_DEFAULT_COPTS = select({ "//:use_strict_warning": GRPC_LLVM_WARNING_FLAGS + ["-DUSE_STRICT_WARNING=1"], "//conditions:default": [], -}) -+}) + ["-std=c++14"] ++}) + select({ ++ "@bazel_tools//src/conditions:windows": ["/std:c++14"], ++ "//conditions:default": ["-std=c++14"], ++}) diff --git a/grpc/examples/swift/Greeter/Sources/Model/greeter_generated.swift b/grpc/examples/swift/Greeter/Sources/Model/greeter_generated.swift index 26d4c65bbcf..81ffe48f857 100644 --- a/grpc/examples/swift/Greeter/Sources/Model/greeter_generated.swift +++ b/grpc/examples/swift/Greeter/Sources/Model/greeter_generated.swift @@ -6,7 +6,7 @@ import FlatBuffers public struct models_HelloReply: FlatBufferObject, Verifiable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -53,7 +53,7 @@ extension models_HelloReply: Encodable { public struct models_HelloRequest: FlatBufferObject, Verifiable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/grpc/src/compiler/cpp_generator.cc b/grpc/src/compiler/cpp_generator.cc index fd635f2fa5e..21a94acf545 100644 --- a/grpc/src/compiler/cpp_generator.cc +++ b/grpc/src/compiler/cpp_generator.cc @@ -8,8 +8,6 @@ namespace grpc_cpp_generator { namespace { -static grpc::string service_header_ext() { return ".grpc.fb.h"; } - template static grpc::string as_string(T x) { std::ostringstream out; @@ -1137,7 +1135,7 @@ grpc::string GetSourcePrologue(grpc_generator::File *file, vars["filename"] = file->filename(); vars["filename_base"] = file->filename_without_ext(); vars["message_header_ext"] = params.message_header_extension; - vars["service_header_ext"] = service_header_ext(); + vars["service_header_ext"] = params.service_header_extension; printer->Print(vars, "// Generated by the gRPC C++ plugin.\n"); printer->Print(vars, @@ -1557,7 +1555,7 @@ grpc::string GetMockPrologue(grpc_generator::File *file, vars["filename"] = file->filename(); vars["filename_base"] = file->filename_without_ext(); vars["message_header_ext"] = params.message_header_extension; - vars["service_header_ext"] = service_header_ext(); + vars["service_header_ext"] = params.service_header_extension; printer->Print(vars, "// Generated by the gRPC C++ plugin.\n"); printer->Print(vars, diff --git a/grpc/src/compiler/cpp_generator.h b/grpc/src/compiler/cpp_generator.h index a9af1a6794f..98e37df97ad 100644 --- a/grpc/src/compiler/cpp_generator.h +++ b/grpc/src/compiler/cpp_generator.h @@ -35,6 +35,8 @@ struct Parameters { bool generate_mock_code; // By default, use "_generated.h" std::string message_header_extension; + // Default: ".grpc.fb.h" + std::string service_header_extension; }; // Return the prologue of the generated header file. diff --git a/include/flatbuffers/base.h b/include/flatbuffers/base.h index a7524328e63..1a2e1208e48 100644 --- a/include/flatbuffers/base.h +++ b/include/flatbuffers/base.h @@ -139,9 +139,9 @@ #endif #endif // !defined(FLATBUFFERS_LITTLEENDIAN) -#define FLATBUFFERS_VERSION_MAJOR 23 -#define FLATBUFFERS_VERSION_MINOR 5 -#define FLATBUFFERS_VERSION_REVISION 26 +#define FLATBUFFERS_VERSION_MAJOR 24 +#define FLATBUFFERS_VERSION_MINOR 3 +#define FLATBUFFERS_VERSION_REVISION 25 #define FLATBUFFERS_STRING_EXPAND(X) #X #define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X) namespace flatbuffers { @@ -459,10 +459,17 @@ inline size_t PaddingBytes(size_t buf_size, size_t scalar_size) { return ((~buf_size) + 1) & (scalar_size - 1); } +#if !defined(_MSC_VER) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wfloat-equal" +#endif // Generic 'operator==' with conditional specialisations. // T e - new value of a scalar field. // T def - default of scalar (is known at compile-time). template inline bool IsTheSameAs(T e, T def) { return e == def; } +#if !defined(_MSC_VER) + #pragma GCC diagnostic pop +#endif #if defined(FLATBUFFERS_NAN_DEFAULTS) && \ defined(FLATBUFFERS_HAS_NEW_STRTOD) && (FLATBUFFERS_HAS_NEW_STRTOD > 0) diff --git a/include/flatbuffers/flatbuffer_builder.h b/include/flatbuffers/flatbuffer_builder.h index 9a2d62541bd..9ceca8207b6 100644 --- a/include/flatbuffers/flatbuffer_builder.h +++ b/include/flatbuffers/flatbuffer_builder.h @@ -47,7 +47,8 @@ inline voffset_t FieldIndexToOffset(voffset_t field_id) { 2 * sizeof(voffset_t); // Vtable size and Object Size. size_t offset = fixed_fields + field_id * sizeof(voffset_t); FLATBUFFERS_ASSERT(offset < std::numeric_limits::max()); - return static_cast(offset);} + return static_cast(offset); +} template> const T *data(const std::vector &v) { @@ -241,7 +242,7 @@ template class FlatBufferBuilderImpl { /// called. uint8_t *ReleaseRaw(size_t &size, size_t &offset) { Finished(); - uint8_t* raw = buf_.release_raw(size, offset); + uint8_t *raw = buf_.release_raw(size, offset); Clear(); return raw; } @@ -561,7 +562,7 @@ template class FlatBufferBuilderImpl { return CreateString(str.c_str(), str.length()); } -// clang-format off + // clang-format off #ifdef FLATBUFFERS_HAS_STRING_VIEW /// @brief Store a string in the buffer, which can contain any binary data. /// @param[in] str A const string_view to copy in to the buffer. @@ -743,7 +744,7 @@ template class FlatBufferBuilderImpl { AssertScalarT(); StartVector(len); if (len > 0) { -// clang-format off + // clang-format off #if FLATBUFFERS_LITTLEENDIAN PushBytes(reinterpret_cast(v), len * sizeof(T)); #else @@ -1470,7 +1471,8 @@ T *GetMutableTemporaryPointer(FlatBufferBuilder &fbb, Offset offset) { template const T *GetTemporaryPointer(const FlatBufferBuilder &fbb, Offset offset) { - return GetMutableTemporaryPointer(fbb, offset); + return reinterpret_cast(fbb.GetCurrentBufferPointer() + + fbb.GetSize() - offset.o); } } // namespace flatbuffers diff --git a/include/flatbuffers/idl.h b/include/flatbuffers/idl.h index a08db9bb658..cb3b2123c43 100644 --- a/include/flatbuffers/idl.h +++ b/include/flatbuffers/idl.h @@ -22,6 +22,7 @@ #include #include #include +#include #include "flatbuffers/base.h" #include "flatbuffers/flatbuffers.h" @@ -759,6 +760,12 @@ struct IDLOptions { // make the flatbuffer more compact. bool set_empty_vectors_to_null; + /*********************************** gRPC ***********************************/ + std::string grpc_filename_suffix; + bool grpc_use_system_headers; + std::string grpc_search_path; + std::vector grpc_additional_headers; + IDLOptions() : gen_jvmstatic(false), use_flexbuffers(false), @@ -829,7 +836,9 @@ struct IDLOptions { rust_module_root_file(false), lang_to_generate(0), set_empty_strings_to_null(true), - set_empty_vectors_to_null(true) {} + set_empty_vectors_to_null(true), + grpc_filename_suffix(".fb"), + grpc_use_system_headers(true) {} }; // This encapsulates where the parser is in the current source file. diff --git a/include/flatbuffers/reflection_generated.h b/include/flatbuffers/reflection_generated.h index 96e9315acd6..3e865ec15bc 100644 --- a/include/flatbuffers/reflection_generated.h +++ b/include/flatbuffers/reflection_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace reflection { @@ -274,6 +274,12 @@ struct KeyValue FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_key) const { return strcmp(key()->c_str(), _key); } + template + int KeyCompareWithValue(const StringType& _key) const { + if (key()->c_str() < _key) return -1; + if (_key < key()->c_str()) return 1; + return 0; + } const ::flatbuffers::String *value() const { return GetPointer(VT_VALUE); } @@ -464,6 +470,12 @@ struct Enum FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_name) const { return strcmp(name()->c_str(), _name); } + template + int KeyCompareWithValue(const StringType& _name) const { + if (name()->c_str() < _name) return -1; + if (_name < name()->c_str()) return 1; + return 0; + } const ::flatbuffers::Vector<::flatbuffers::Offset> *values() const { return GetPointer> *>(VT_VALUES); } @@ -616,6 +628,12 @@ struct Field FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_name) const { return strcmp(name()->c_str(), _name); } + template + int KeyCompareWithValue(const StringType& _name) const { + if (name()->c_str() < _name) return -1; + if (_name < name()->c_str()) return 1; + return 0; + } const reflection::Type *type() const { return GetPointer(VT_TYPE); } @@ -834,6 +852,12 @@ struct Object FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_name) const { return strcmp(name()->c_str(), _name); } + template + int KeyCompareWithValue(const StringType& _name) const { + if (name()->c_str() < _name) return -1; + if (_name < name()->c_str()) return 1; + return 0; + } const ::flatbuffers::Vector<::flatbuffers::Offset> *fields() const { return GetPointer> *>(VT_FIELDS); } @@ -986,6 +1010,12 @@ struct RPCCall FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_name) const { return strcmp(name()->c_str(), _name); } + template + int KeyCompareWithValue(const StringType& _name) const { + if (name()->c_str() < _name) return -1; + if (_name < name()->c_str()) return 1; + return 0; + } const reflection::Object *request() const { return GetPointer(VT_REQUEST); } @@ -1102,6 +1132,12 @@ struct Service FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_name) const { return strcmp(name()->c_str(), _name); } + template + int KeyCompareWithValue(const StringType& _name) const { + if (name()->c_str() < _name) return -1; + if (_name < name()->c_str()) return 1; + return 0; + } const ::flatbuffers::Vector<::flatbuffers::Offset> *calls() const { return GetPointer> *>(VT_CALLS); } @@ -1221,6 +1257,12 @@ struct SchemaFile FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_filename) const { return strcmp(filename()->c_str(), _filename); } + template + int KeyCompareWithValue(const StringType& _filename) const { + if (filename()->c_str() < _filename) return -1; + if (_filename < filename()->c_str()) return 1; + return 0; + } /// Names of included files, relative to project root. const ::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>> *included_filenames() const { return GetPointer> *>(VT_INCLUDED_FILENAMES); diff --git a/include/flatbuffers/stl_emulation.h b/include/flatbuffers/stl_emulation.h index 5f19eaf8d41..67c6768cbf2 100644 --- a/include/flatbuffers/stl_emulation.h +++ b/include/flatbuffers/stl_emulation.h @@ -273,7 +273,7 @@ template FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const Optional& lhs, const Optional& rhs) FLATBUFFERS_NOEXCEPT { return static_cast(lhs) != static_cast(rhs) ? false - : !static_cast(lhs) ? false : (*lhs == *rhs); + : !static_cast(lhs) ? true : (*lhs == *rhs); } #endif // FLATBUFFERS_USE_STD_OPTIONAL diff --git a/include/flatbuffers/vector.h b/include/flatbuffers/vector.h index ae52b9382c2..cd4858bb8ca 100644 --- a/include/flatbuffers/vector.h +++ b/include/flatbuffers/vector.h @@ -56,12 +56,24 @@ struct VectorIterator { return data_ == other.data_; } + bool operator!=(const VectorIterator &other) const { + return data_ != other.data_; + } + bool operator<(const VectorIterator &other) const { return data_ < other.data_; } - bool operator!=(const VectorIterator &other) const { - return data_ != other.data_; + bool operator>(const VectorIterator &other) const { + return data_ > other.data_; + } + + bool operator<=(const VectorIterator &other) const { + return !(data_ > other.data_); + } + + bool operator>=(const VectorIterator &other) const { + return !(data_ < other.data_); } difference_type operator-(const VectorIterator &other) const { diff --git a/include/flatbuffers/verifier.h b/include/flatbuffers/verifier.h index de1146be92e..6df923be45c 100644 --- a/include/flatbuffers/verifier.h +++ b/include/flatbuffers/verifier.h @@ -23,7 +23,8 @@ namespace flatbuffers { // Helper class to verify the integrity of a FlatBuffer -class Verifier FLATBUFFERS_FINAL_CLASS { +template +class VerifierTemplate FLATBUFFERS_FINAL_CLASS { public: struct Options { // The maximum nesting of tables and vectors before we call it invalid. @@ -40,17 +41,18 @@ class Verifier FLATBUFFERS_FINAL_CLASS { bool assert = false; }; - explicit Verifier(const uint8_t *const buf, const size_t buf_len, - const Options &opts) + explicit VerifierTemplate(const uint8_t *const buf, const size_t buf_len, + const Options &opts) : buf_(buf), size_(buf_len), opts_(opts) { FLATBUFFERS_ASSERT(size_ < opts.max_size); } - // Deprecated API, please construct with Verifier::Options. - Verifier(const uint8_t *const buf, const size_t buf_len, - const uoffset_t max_depth = 64, const uoffset_t max_tables = 1000000, - const bool check_alignment = true) - : Verifier(buf, buf_len, [&] { + // Deprecated API, please construct with VerifierTemplate::Options. + VerifierTemplate(const uint8_t *const buf, const size_t buf_len, + const uoffset_t max_depth = 64, + const uoffset_t max_tables = 1000000, + const bool check_alignment = true) + : VerifierTemplate(buf, buf_len, [&] { Options opts; opts.max_depth = max_depth; opts.max_tables = max_tables; @@ -62,25 +64,25 @@ class Verifier FLATBUFFERS_FINAL_CLASS { bool Check(const bool ok) const { // clang-format off #ifdef FLATBUFFERS_DEBUG_VERIFICATION_FAILURE - if (opts_.assert) { FLATBUFFERS_ASSERT(ok); } - #endif - #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE - if (!ok) - upper_bound_ = 0; + if (opts_.assert) { FLATBUFFERS_ASSERT(ok); } #endif // clang-format on + if (TrackVerifierBufferSize) { + if (!ok) { + upper_bound_ = 0; + } + } return ok; } // Verify any range within the buffer. bool Verify(const size_t elem, const size_t elem_len) const { - // clang-format off - #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE + if (TrackVerifierBufferSize) { auto upper_bound = elem + elem_len; - if (upper_bound_ < upper_bound) + if (upper_bound_ < upper_bound) { upper_bound_ = upper_bound; - #endif - // clang-format on + } + } return Check(elem_len < size_ && elem <= size_ - elem_len); } @@ -210,14 +212,14 @@ class Verifier FLATBUFFERS_FINAL_CLASS { // Call T::Verify, which must be in the generated code for this type. const auto o = VerifyOffset(start); - return Check(o != 0) && - reinterpret_cast(buf_ + start + o)->Verify(*this) - // clang-format off - #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE - && GetComputedSize() - #endif - ; - // clang-format on + if (!Check(o != 0)) return false; + if (!(reinterpret_cast(buf_ + start + o)->Verify(*this))) { + return false; + } + if (TrackVerifierBufferSize) { + if (GetComputedSize() == 0) return false; + } + return true; } template @@ -232,7 +234,8 @@ class Verifier FLATBUFFERS_FINAL_CLASS { // If there is a nested buffer, it must be greater than the min size. if (!Check(buf->size() >= FLATBUFFERS_MIN_BUFFER_SIZE)) return false; - Verifier nested_verifier(buf->data(), buf->size(), opts_); + VerifierTemplate nested_verifier( + buf->data(), buf->size(), opts_); return nested_verifier.VerifyBuffer(identifier); } @@ -286,21 +289,27 @@ class Verifier FLATBUFFERS_FINAL_CLASS { return true; } - // Returns the message size in bytes + // Returns the message size in bytes. + // + // This should only be called after first calling VerifyBuffer or + // VerifySizePrefixedBuffer. + // + // This method should only be called for VerifierTemplate instances + // where the TrackVerifierBufferSize template parameter is true, + // i.e. for SizeVerifier. For instances where TrackVerifierBufferSize + // is false, this fails at runtime or returns zero. size_t GetComputedSize() const { - // clang-format off - #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE + if (TrackVerifierBufferSize) { uintptr_t size = upper_bound_; // Align the size to uoffset_t size = (size - 1 + sizeof(uoffset_t)) & ~(sizeof(uoffset_t) - 1); return (size > size_) ? 0 : size; - #else - // Must turn on FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE for this to work. - (void)upper_bound_; - FLATBUFFERS_ASSERT(false); - return 0; - #endif - // clang-format on + } + // Must use SizeVerifier, or (deprecated) turn on + // FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE, for this to work. + (void)upper_bound_; + FLATBUFFERS_ASSERT(false); + return 0; } std::vector *GetFlexReuseTracker() { return flex_reuse_tracker_; } @@ -323,10 +332,33 @@ class Verifier FLATBUFFERS_FINAL_CLASS { // Specialization for 64-bit offsets. template<> -inline size_t Verifier::VerifyOffset(const size_t start) const { +template<> +inline size_t VerifierTemplate::VerifyOffset( + const size_t start) const { + return VerifyOffset(start); +} +template<> +template<> +inline size_t VerifierTemplate::VerifyOffset( + const size_t start) const { return VerifyOffset(start); } +// Instance of VerifierTemplate that supports GetComputedSize(). +using SizeVerifier = VerifierTemplate; + +// The FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE build configuration macro is +// deprecated, and should not be defined, since it is easy to misuse in ways +// that result in ODR violations. Rather than using Verifier and defining +// FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE, please use SizeVerifier instead. +#ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE // Deprecated, see above. +using Verifier = SizeVerifier; +#else +// Instance of VerifierTemplate that is slightly faster, but does not +// support GetComputedSize(). +using Verifier = VerifierTemplate; +#endif + } // namespace flatbuffers #endif // FLATBUFFERS_VERIFIER_H_ diff --git a/java/pom.xml b/java/pom.xml index eea7d2dc28c..1e7dbbc1f7c 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.flatbuffers flatbuffers-java - 23.5.26 + 24.3.25 bundle FlatBuffers Java API diff --git a/java/src/main/java/com/google/flatbuffers/Constants.java b/java/src/main/java/com/google/flatbuffers/Constants.java index 2374575c268..c7bae316b3f 100644 --- a/java/src/main/java/com/google/flatbuffers/Constants.java +++ b/java/src/main/java/com/google/flatbuffers/Constants.java @@ -46,7 +46,7 @@ public class Constants { Changes to the Java implementation need to be sure to change the version here and in the code generator on every possible incompatible change */ - public static void FLATBUFFERS_23_5_26() {} + public static void FLATBUFFERS_24_3_25() {} } /// @endcond diff --git a/java/src/main/java/com/google/flatbuffers/reflection/Enum.java b/java/src/main/java/com/google/flatbuffers/reflection/Enum.java index 953090e236c..6c8a4186664 100644 --- a/java/src/main/java/com/google/flatbuffers/reflection/Enum.java +++ b/java/src/main/java/com/google/flatbuffers/reflection/Enum.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class Enum extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Enum getRootAsEnum(ByteBuffer _bb) { return getRootAsEnum(_bb, new Enum()); } public static Enum getRootAsEnum(ByteBuffer _bb, Enum obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/java/src/main/java/com/google/flatbuffers/reflection/EnumVal.java b/java/src/main/java/com/google/flatbuffers/reflection/EnumVal.java index d65711e13f5..732371714c4 100644 --- a/java/src/main/java/com/google/flatbuffers/reflection/EnumVal.java +++ b/java/src/main/java/com/google/flatbuffers/reflection/EnumVal.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class EnumVal extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static EnumVal getRootAsEnumVal(ByteBuffer _bb) { return getRootAsEnumVal(_bb, new EnumVal()); } public static EnumVal getRootAsEnumVal(ByteBuffer _bb, EnumVal obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/java/src/main/java/com/google/flatbuffers/reflection/Field.java b/java/src/main/java/com/google/flatbuffers/reflection/Field.java index 45be68e7b4f..d5c1c13a5a9 100644 --- a/java/src/main/java/com/google/flatbuffers/reflection/Field.java +++ b/java/src/main/java/com/google/flatbuffers/reflection/Field.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class Field extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Field getRootAsField(ByteBuffer _bb) { return getRootAsField(_bb, new Field()); } public static Field getRootAsField(ByteBuffer _bb, Field obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/java/src/main/java/com/google/flatbuffers/reflection/KeyValue.java b/java/src/main/java/com/google/flatbuffers/reflection/KeyValue.java index 8b22030711d..546404bc25b 100644 --- a/java/src/main/java/com/google/flatbuffers/reflection/KeyValue.java +++ b/java/src/main/java/com/google/flatbuffers/reflection/KeyValue.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class KeyValue extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static KeyValue getRootAsKeyValue(ByteBuffer _bb) { return getRootAsKeyValue(_bb, new KeyValue()); } public static KeyValue getRootAsKeyValue(ByteBuffer _bb, KeyValue obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/java/src/main/java/com/google/flatbuffers/reflection/Object.java b/java/src/main/java/com/google/flatbuffers/reflection/Object.java index 382532c824c..70d73263a26 100644 --- a/java/src/main/java/com/google/flatbuffers/reflection/Object.java +++ b/java/src/main/java/com/google/flatbuffers/reflection/Object.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class Object extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Object getRootAsObject(ByteBuffer _bb) { return getRootAsObject(_bb, new Object()); } public static Object getRootAsObject(ByteBuffer _bb, Object obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/java/src/main/java/com/google/flatbuffers/reflection/RPCCall.java b/java/src/main/java/com/google/flatbuffers/reflection/RPCCall.java index d517bb06c54..f970d6ecbc3 100644 --- a/java/src/main/java/com/google/flatbuffers/reflection/RPCCall.java +++ b/java/src/main/java/com/google/flatbuffers/reflection/RPCCall.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class RPCCall extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static RPCCall getRootAsRPCCall(ByteBuffer _bb) { return getRootAsRPCCall(_bb, new RPCCall()); } public static RPCCall getRootAsRPCCall(ByteBuffer _bb, RPCCall obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/java/src/main/java/com/google/flatbuffers/reflection/Schema.java b/java/src/main/java/com/google/flatbuffers/reflection/Schema.java index 98d05fbf780..1cbe7b3b622 100644 --- a/java/src/main/java/com/google/flatbuffers/reflection/Schema.java +++ b/java/src/main/java/com/google/flatbuffers/reflection/Schema.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class Schema extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Schema getRootAsSchema(ByteBuffer _bb) { return getRootAsSchema(_bb, new Schema()); } public static Schema getRootAsSchema(ByteBuffer _bb, Schema obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static boolean SchemaBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "BFBS"); } diff --git a/java/src/main/java/com/google/flatbuffers/reflection/SchemaFile.java b/java/src/main/java/com/google/flatbuffers/reflection/SchemaFile.java index d009dc78fa2..a9a7630c72f 100644 --- a/java/src/main/java/com/google/flatbuffers/reflection/SchemaFile.java +++ b/java/src/main/java/com/google/flatbuffers/reflection/SchemaFile.java @@ -26,7 +26,7 @@ */ @SuppressWarnings("unused") public final class SchemaFile extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static SchemaFile getRootAsSchemaFile(ByteBuffer _bb) { return getRootAsSchemaFile(_bb, new SchemaFile()); } public static SchemaFile getRootAsSchemaFile(ByteBuffer _bb, SchemaFile obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/java/src/main/java/com/google/flatbuffers/reflection/Service.java b/java/src/main/java/com/google/flatbuffers/reflection/Service.java index 42eebc10a80..d33a6e9557e 100644 --- a/java/src/main/java/com/google/flatbuffers/reflection/Service.java +++ b/java/src/main/java/com/google/flatbuffers/reflection/Service.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class Service extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Service getRootAsService(ByteBuffer _bb) { return getRootAsService(_bb, new Service()); } public static Service getRootAsService(ByteBuffer _bb, Service obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/java/src/main/java/com/google/flatbuffers/reflection/Type.java b/java/src/main/java/com/google/flatbuffers/reflection/Type.java index 107a0fde535..ca0e18ac662 100644 --- a/java/src/main/java/com/google/flatbuffers/reflection/Type.java +++ b/java/src/main/java/com/google/flatbuffers/reflection/Type.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class Type extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Type getRootAsType(ByteBuffer _bb) { return getRootAsType(_bb, new Type()); } public static Type getRootAsType(ByteBuffer _bb, Type obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/kotlin/benchmark/build.gradle.kts b/kotlin/benchmark/build.gradle.kts index 1e801660d64..df4af2b25f4 100644 --- a/kotlin/benchmark/build.gradle.kts +++ b/kotlin/benchmark/build.gradle.kts @@ -69,13 +69,13 @@ kotlin { implementation(kotlin("stdlib-common")) implementation(project(":flatbuffers-kotlin")) implementation(libs.kotlinx.benchmark.runtime) - implementation("com.google.flatbuffers:flatbuffers-java:${readJavaFlatBufferVersion()}") // json serializers implementation(libs.moshi.kotlin) implementation(libs.gson) } kotlin.srcDir("src/jvmMain/generated/kotlin/") kotlin.srcDir("src/jvmMain/generated/java/") + kotlin.srcDir("../../java/src/main/java") } } } diff --git a/kotlin/convention-plugins/build.gradle.kts b/kotlin/convention-plugins/build.gradle.kts new file mode 100644 index 00000000000..52b9cc0a8c6 --- /dev/null +++ b/kotlin/convention-plugins/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + `kotlin-dsl` +} + +repositories { + gradlePluginPortal() +} diff --git a/kotlin/convention-plugins/src/main/kotlin/convention.publication.gradle.kts b/kotlin/convention-plugins/src/main/kotlin/convention.publication.gradle.kts new file mode 100644 index 00000000000..e526279654b --- /dev/null +++ b/kotlin/convention-plugins/src/main/kotlin/convention.publication.gradle.kts @@ -0,0 +1,95 @@ +import org.gradle.api.publish.maven.MavenPublication +import org.gradle.api.tasks.bundling.Jar +import org.gradle.kotlin.dsl.`maven-publish` +import org.gradle.kotlin.dsl.signing +import java.util.* + +plugins { + `maven-publish` + signing +} + +// Stub secrets to let the project sync and build without the publication values set up +ext["signing.keyId"] = null +ext["signing.password"] = null +ext["signing.secretKeyRingFile"] = null +ext["ossrhUsername"] = null +ext["ossrhPassword"] = null + +// Grabbing secrets from local.properties file or from environment variables, which could be used on CI +val secretPropsFile = project.rootProject.file("local.properties") +if (secretPropsFile.exists()) { + secretPropsFile.reader().use { + Properties().apply { + load(it) + } + }.onEach { (name, value) -> + ext[name.toString()] = value + } +} else { + ext["signing.keyId"] = System.getenv("OSSRH_USERNAME") + ext["signing.password"] = System.getenv("OSSRH_PASSWORD") + ext["signing.secretKeyRingFile"] = System.getenv("INPUT_GPG_PRIVATE_KEY") + ext["ossrhUsername"] = System.getenv("OSSRH_USERNAME") + ext["ossrhPassword"] = System.getenv("OSSRH_PASSWORD") +} + +val javadocJar by tasks.registering(Jar::class) { + archiveClassifier.set("javadoc") +} + +fun getExtraString(name: String) = ext[name]?.toString() + +publishing { + // Configure maven central repository + repositories { + maven { + name = "sonatype" + setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = getExtraString("ossrhUsername") + password = getExtraString("ossrhPassword") + } + } + } + + // Configure all publications + publications.withType { + // Stub javadoc.jar artifact + artifact(javadocJar.get()) + + // Provide artifacts information requited by Maven Central + pom { + name.set("Flatbuffers Kotlin") + description.set("Memory Efficient Serialization Library") + url.set("https://github.com/google/flatbuffers") + + licenses { + license { + name.set("Apache License V2.0") + url.set("https://raw.githubusercontent.com/google/flatbuffers/master/LICENSE") + } + } + developers { + developer { + id.set("https://github.com/paulovap") + name.set("Paulo Pinheiro") + email.set("paulovictor.pinheiro@gmail.com") + } + developer { + id.set("https://github.com/dbaileychess") + name.set("Derek Bailey") + email.set("dbaileychess@gmail.com") + } + } + scm { + url.set("https://github.com/google/flatbuffers") + } + } + } +} + +// Signing artifacts. Signing.* extra properties values will be used +signing { + sign(publishing.publications) +} diff --git a/kotlin/flatbuffers-kotlin/build.gradle.kts b/kotlin/flatbuffers-kotlin/build.gradle.kts index d4086537217..1b8d2242dbd 100644 --- a/kotlin/flatbuffers-kotlin/build.gradle.kts +++ b/kotlin/flatbuffers-kotlin/build.gradle.kts @@ -7,6 +7,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFrameworkConfig plugins { kotlin("multiplatform") + id("convention.publication") } diff --git a/kotlin/gradle/libs.versions.toml b/kotlin/gradle/libs.versions.toml index 5e792364905..71783e9ca34 100644 --- a/kotlin/gradle/libs.versions.toml +++ b/kotlin/gradle/libs.versions.toml @@ -1,5 +1,7 @@ [versions] -kotlin = "1.8.21" +# Version 1.9.10 fix +# https://youtrack.jetbrains.com/issue/KT-60230/Native-unknown-options-iossimulatorversionmin-sdkversion-with-Xcode-15-beta-3 +kotlin = "1.9.10" plugin-kotlin = "1.6.10" plugin-gver = "0.42.0" kotlinx-benchmark = "0.4.8" diff --git a/kotlin/settings.gradle.kts b/kotlin/settings.gradle.kts index 0fd19c4d22d..9b6981eebe0 100644 --- a/kotlin/settings.gradle.kts +++ b/kotlin/settings.gradle.kts @@ -1,3 +1,4 @@ rootProject.name = "flatbuffers-kotlin" +includeBuild("convention-plugins") include("flatbuffers-kotlin") include("benchmark") diff --git a/net/FlatBuffers/FlatBufferConstants.cs b/net/FlatBuffers/FlatBufferConstants.cs index 51a5d6e8821..d7fee534895 100644 --- a/net/FlatBuffers/FlatBufferConstants.cs +++ b/net/FlatBuffers/FlatBufferConstants.cs @@ -32,6 +32,6 @@ the runtime and generated code are modified in sync. Changes to the C# implementation need to be sure to change the version here and in the code generator on every possible incompatible change */ - public static void FLATBUFFERS_23_5_26() {} + public static void FLATBUFFERS_24_3_25() {} } } diff --git a/net/FlatBuffers/Google.FlatBuffers.csproj b/net/FlatBuffers/Google.FlatBuffers.csproj index 1978cc11db0..acbd01d2f9a 100644 --- a/net/FlatBuffers/Google.FlatBuffers.csproj +++ b/net/FlatBuffers/Google.FlatBuffers.csproj @@ -1,9 +1,9 @@  - netstandard2.1;net6.0;net8.0 + netstandard2.0;netstandard2.1;net6.0;net8.0 A cross-platform memory efficient serialization library - 23.5.26 + 24.3.25 Google LLC https://github.com/google/flatbuffers https://github.com/google/flatbuffers diff --git a/package.json b/package.json index ef3458be4d2..da95fd56365 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flatbuffers", - "version": "23.5.26", + "version": "24.3.25", "description": "Memory Efficient Serialization Library", "files": [ "js/**/*.js", @@ -29,7 +29,7 @@ "flatbuffers" ], "author": "The FlatBuffers project", - "license": "SEE LICENSE IN LICENSE", + "license": "Apache-2.0", "bugs": { "url": "https://github.com/google/flatbuffers/issues" }, diff --git a/python/flatbuffers/_version.py b/python/flatbuffers/_version.py index 3993733224a..f785181c785 100644 --- a/python/flatbuffers/_version.py +++ b/python/flatbuffers/_version.py @@ -14,4 +14,4 @@ # Placeholder, to be updated during the release process # by the setup.py -__version__ = u"23.5.26" +__version__ = u"24.3.25" diff --git a/python/setup.py b/python/setup.py index 9f14512397d..065b27545b9 100644 --- a/python/setup.py +++ b/python/setup.py @@ -16,7 +16,7 @@ setup( name='flatbuffers', - version='23.5.26', + version='24.3.25', license='Apache 2.0', license_files='../LICENSE', author='Derek Bailey', diff --git a/rust/flatbuffers/Cargo.toml b/rust/flatbuffers/Cargo.toml index d56292ee3e0..306e6c4ce4f 100644 --- a/rust/flatbuffers/Cargo.toml +++ b/rust/flatbuffers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flatbuffers" -version = "23.5.26" +version = "24.3.25" edition = "2018" authors = ["Robert Winslow ", "FlatBuffers Maintainers"] license = "Apache-2.0" diff --git a/rust/flexbuffers/Cargo.toml b/rust/flexbuffers/Cargo.toml index e4fa6fa54ae..b3544676be0 100644 --- a/rust/flexbuffers/Cargo.toml +++ b/rust/flexbuffers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flexbuffers" -version = "2.0.0" +version = "24.3.25" authors = ["Casper Neo ", "FlatBuffers Maintainers"] edition = "2018" license = "Apache-2.0" diff --git a/samples/monster_generated.h b/samples/monster_generated.h index b1ea1c4f1f2..96795af5282 100644 --- a/samples/monster_generated.h +++ b/samples/monster_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace MyGame { diff --git a/samples/monster_generated.swift b/samples/monster_generated.swift index 1790dde5ac6..b536d1f4f5e 100644 --- a/samples/monster_generated.swift +++ b/samples/monster_generated.swift @@ -36,7 +36,7 @@ public enum MyGame_Sample_Equipment: UInt8, UnionEnum { public struct MyGame_Sample_Vec3: NativeStruct, Verifiable, FlatbuffersInitializable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _x: Float32 private var _y: Float32 @@ -72,7 +72,7 @@ public struct MyGame_Sample_Vec3: NativeStruct, Verifiable, FlatbuffersInitializ public struct MyGame_Sample_Vec3_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -88,7 +88,7 @@ public struct MyGame_Sample_Vec3_Mutable: FlatBufferObject { public struct MyGame_Sample_Monster: FlatBufferObject, Verifiable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -200,7 +200,7 @@ public struct MyGame_Sample_Monster: FlatBufferObject, Verifiable { public struct MyGame_Sample_Weapon: FlatBufferObject, Verifiable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/scripts/release.sh b/scripts/release.sh index b97a98ba4a0..4beac49e0a0 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,8 +1,7 @@ #!/usr/bin/bash -printf -v year '%(%y)T' -1 -printf -v month '%(%-m)T' -1 -printf -v day '%(%-d)T' -1 +# Read the date as in the Pacific TZ, with no leading padding +read year month day <<<$(date --date="TZ=\"US/Pacific\"" +'%-y %-m %-d') version="$year.$month.$day" version_underscore="$year\_$month\_$day" @@ -69,6 +68,11 @@ sed -i \ "s/^version = \".*\"$/version = \"$version\"/g" \ rust/flatbuffers/Cargo.toml +echo "Updating rust/flexbuffers/Cargo.toml..." +sed -i \ + "s/^version = \".*\"$/version = \"$version\"/g" \ + rust/flexbuffers/Cargo.toml + echo "Updating FlatBuffers.podspec..." sed -i \ -e "s/\(s.version\s*= \).*/\1'$version'/" \ diff --git a/src/flatc.cpp b/src/flatc.cpp index f29d1092646..398fc77976b 100644 --- a/src/flatc.cpp +++ b/src/flatc.cpp @@ -258,6 +258,13 @@ const static FlatCOption flatc_options[] = { "Omit emission of namespace entrypoint file" }, { "", "file-names-only", "", "Print out generated file names without writing to the files" }, + { "", "grpc-filename-suffix", "SUFFIX", + "The suffix for the generated file names (Default is '.fb')." }, + { "", "grpc-additional-header", "", + "Additional headers to prepend to the generated files." }, + { "", "grpc-use-system-headers", "", + "Use <> for headers included from the generated code." }, + { "", "grpc-search-path", "PATH", "Prefix to any gRPC includes." }, }; auto cmp = [](FlatCOption a, FlatCOption b) { return a.long_opt < b.long_opt; }; @@ -674,6 +681,30 @@ FlatCOptions FlatCompiler::ParseFromCommandLineArguments(int argc, } else if (arg == "--file-names-only") { // TODO (khhn): Provide 2 implementation options.file_names_only = true; + } else if (arg == "--grpc-filename-suffix") { + if (++argi >= argc) Error("missing gRPC filename suffix: " + arg, true); + opts.grpc_filename_suffix = argv[argi]; + } else if (arg.rfind("--grpc-filename-suffix=", 0) == 0) { + opts.grpc_filename_suffix = + arg.substr(std::string("--grpc-filename-suffix=").size()); + } else if (arg == "--grpc-additional-header") { + if (++argi >= argc) Error("missing include following: " + arg, true); + opts.grpc_additional_headers.push_back(argv[argi]); + } else if (arg.rfind("--grpc-additional-header=", 0) == 0) { + opts.grpc_additional_headers.push_back( + arg.substr(std::string("--grpc-additional-header=").size())); + } else if (arg == "--grpc-search-path") { + if (++argi >= argc) Error("missing gRPC search path: " + arg, true); + opts.grpc_search_path = argv[argi]; + } else if (arg.rfind("--grpc-search-path=", 0) == 0) { + opts.grpc_search_path = + arg.substr(std::string("--grpc-search-path=").size()); + } else if (arg == "--grpc-use-system-headers" || + arg == "--grpc-use-system-headers=true") { + opts.grpc_use_system_headers = true; + } else if (arg == "--no-grpc-use-system-headers" || + arg == "--grpc-use-system-headers=false") { + opts.grpc_use_system_headers = false; } else { if (arg == "--proto") { opts.proto_mode = true; } diff --git a/src/idl_gen_cpp.cpp b/src/idl_gen_cpp.cpp index 621ea191af9..ce03a5eeca5 100644 --- a/src/idl_gen_cpp.cpp +++ b/src/idl_gen_cpp.cpp @@ -467,6 +467,20 @@ class CppGenerator : public BaseGenerator { } if (opts_.generate_object_based_api) { auto nativeName = NativeName(Name(*struct_def), struct_def, opts_); + + // Check that nativeName doesn't collide the name of another struct. + for (const auto &other_struct_def : parser_.structs_.vec) { + if (other_struct_def == struct_def) { continue; } + + auto other_name = Name(*other_struct_def); + if (nativeName == other_name) { + LogCompilerError("Generated Object API type for " + + Name(*struct_def) + " collides with " + + other_name); + FLATBUFFERS_ASSERT(true); + } + } + if (!struct_def->fixed) { code_ += "struct " + nativeName + ";"; } } code_ += ""; @@ -2417,8 +2431,20 @@ class CppGenerator : public BaseGenerator { // Generate KeyCompareWithValue function if (is_string) { + // Compares key against a null-terminated char array. code_ += " int KeyCompareWithValue(const char *_{{FIELD_NAME}}) const {"; code_ += " return strcmp({{FIELD_NAME}}()->c_str(), _{{FIELD_NAME}});"; + code_ += " }"; + // Compares key against any string-like object (e.g. std::string_view or + // std::string) that implements operator< comparison with const char*. + code_ += " template"; + code_ += + " int KeyCompareWithValue(const StringType& _{{FIELD_NAME}}) const " + "{"; + code_ += + " if ({{FIELD_NAME}}()->c_str() < _{{FIELD_NAME}}) return -1;"; + code_ += " if (_{{FIELD_NAME}} < {{FIELD_NAME}}()->c_str()) return 1;"; + code_ += " return 0;"; } else if (is_array) { const auto &elem_type = field.value.type.VectorType(); std::string input_type = "::flatbuffers::Array<" + diff --git a/src/idl_gen_csharp.cpp b/src/idl_gen_csharp.cpp index 4e1c87459c9..9a4936ca20d 100644 --- a/src/idl_gen_csharp.cpp +++ b/src/idl_gen_csharp.cpp @@ -850,7 +850,7 @@ class CSharpGenerator : public BaseGenerator { // Force compile time error if not using the same version runtime. code += " public static void ValidateVersion() {"; code += " FlatBufferConstants."; - code += "FLATBUFFERS_23_5_26(); "; + code += "FLATBUFFERS_24_3_25(); "; code += "}\n"; // Generate a special accessor for the table that when used as the root diff --git a/src/idl_gen_grpc.cpp b/src/idl_gen_grpc.cpp index 2be24e71a27..e7c3753effc 100644 --- a/src/idl_gen_grpc.cpp +++ b/src/idl_gen_grpc.cpp @@ -16,6 +16,8 @@ // independent from idl_parser, since this code is not needed for most clients +#include + #include "flatbuffers/code_generators.h" #include "flatbuffers/flatbuffers.h" #include "flatbuffers/idl.h" @@ -253,6 +255,15 @@ class FlatBufFile : public grpc_generator::File { std::string additional_headers() const { switch (language_) { case kLanguageCpp: { + if (!parser_.opts.grpc_additional_headers.empty()) { + std::string result = ""; + for (const std::string &header : + parser_.opts.grpc_additional_headers) { + if (!result.empty()) result += "\n"; + result += "#include \"" + header + "\""; + } + return result; + } return "#include \"flatbuffers/grpc.h\"\n"; } case kLanguageGo: { @@ -356,10 +367,16 @@ bool GenerateCppGRPC(const Parser &parser, const std::string &path, grpc_cpp_generator::Parameters generator_parameters; // TODO(wvo): make the other parameters in this struct configurable. - generator_parameters.use_system_headers = true; + generator_parameters.use_system_headers = opts.grpc_use_system_headers; generator_parameters.message_header_extension = suffix; - - FlatBufFile fbfile(parser, file_name, FlatBufFile::kLanguageCpp); + generator_parameters.service_header_extension = + ".grpc" + opts.grpc_filename_suffix + ".h"; + generator_parameters.grpc_search_path = opts.grpc_search_path; + std::string filename = flatbuffers::StripExtension(parser.file_being_parsed_); + if (!opts.keep_prefix) { + filename = flatbuffers::StripPath(filename); + } + FlatBufFile fbfile(parser, filename, FlatBufFile::kLanguageCpp); std::string header_code = grpc_cpp_generator::GetHeaderPrologue(&fbfile, generator_parameters) + @@ -373,10 +390,14 @@ bool GenerateCppGRPC(const Parser &parser, const std::string &path, grpc_cpp_generator::GetSourceServices(&fbfile, generator_parameters) + grpc_cpp_generator::GetSourceEpilogue(&fbfile, generator_parameters); - return flatbuffers::SaveFile((path + file_name + ".grpc.fb.h").c_str(), - header_code, false) && - flatbuffers::SaveFile((path + file_name + ".grpc.fb.cc").c_str(), - source_code, false); + return flatbuffers::SaveFile( + (path + file_name + ".grpc" + opts.grpc_filename_suffix + ".h") + .c_str(), + header_code, false) && + flatbuffers::SaveFile( + (path + file_name + ".grpc" + opts.grpc_filename_suffix + ".cc") + .c_str(), + source_code, false); } class JavaGRPCGenerator : public flatbuffers::BaseGenerator { diff --git a/src/idl_gen_java.cpp b/src/idl_gen_java.cpp index 252c60f6d9e..c1ec1d6c262 100644 --- a/src/idl_gen_java.cpp +++ b/src/idl_gen_java.cpp @@ -701,7 +701,7 @@ class JavaGenerator : public BaseGenerator { // Force compile time error if not using the same version runtime. code += " public static void ValidateVersion() {"; code += " Constants."; - code += "FLATBUFFERS_23_5_26(); "; + code += "FLATBUFFERS_24_3_25(); "; code += "}\n"; // Generate a special accessor for the table that when used as the root diff --git a/src/idl_gen_kotlin.cpp b/src/idl_gen_kotlin.cpp index ecea21edc9b..675a15c36a4 100644 --- a/src/idl_gen_kotlin.cpp +++ b/src/idl_gen_kotlin.cpp @@ -524,7 +524,7 @@ class KotlinGenerator : public BaseGenerator { // runtime. GenerateFunOneLine( writer, "validateVersion", "", "", - [&]() { writer += "Constants.FLATBUFFERS_23_5_26()"; }, + [&]() { writer += "Constants.FLATBUFFERS_24_3_25()"; }, options.gen_jvmstatic); GenerateGetRootAsAccessors(namer_.Type(struct_def), writer, options); diff --git a/src/idl_gen_lobster.cpp b/src/idl_gen_lobster.cpp index c89e7bb4614..de4e1526408 100644 --- a/src/idl_gen_lobster.cpp +++ b/src/idl_gen_lobster.cpp @@ -145,11 +145,17 @@ class LobsterGenerator : public BaseGenerator { code += def + "() -> " + name + ":\n "; code += "return " + name + "{ buf_, pos_ + " + offsets + " }\n"; } else { - code += def + "() -> " + name + "?:\n "; + code += def + "() -> " + name; + if (!field.IsRequired()) code += "?"; + code += ":\n "; code += std::string("let o = flatbuffers.field_") + (field.value.type.struct_def->fixed ? "struct" : "table") + - "(buf_, pos_, " + offsets + ")\n return if o: " + name + - " { buf_, o } else: nil\n"; + "(buf_, pos_, " + offsets + ")\n return "; + if (field.IsRequired()) { + code += name + " { buf_, assert o }\n"; + } else { + code += "if o: " + name + " { buf_, o } else: nil\n"; + } } break; } diff --git a/src/idl_gen_python.cpp b/src/idl_gen_python.cpp index 9e1627592e4..a6bc0f51e8a 100644 --- a/src/idl_gen_python.cpp +++ b/src/idl_gen_python.cpp @@ -18,7 +18,9 @@ #include "idl_gen_python.h" +#include #include +#include #include #include #include @@ -56,7 +58,7 @@ static Namer::Config PythonDefaultConfig() { /*variable=*/Case::kLowerCamel, /*variants=*/Case::kKeep, /*enum_variant_seperator=*/".", - /*escape_keywords=*/Namer::Config::Escape::BeforeConvertingCase, + /*escape_keywords=*/Namer::Config::Escape::AfterConvertingCase, /*namespaces=*/Case::kKeep, // Packages in python. /*namespace_seperator=*/".", /*object_prefix=*/"", @@ -424,16 +426,29 @@ class PythonGenerator : public BaseGenerator { code += Indent + Indent + "return None\n\n"; } + template + std::string ModuleFor(const T *def) const { + if (!parser_.opts.one_file) { + return namer_.NamespacedType(*def); + } + + std::string filename = + StripExtension(def->file) + parser_.opts.filename_suffix; + if (parser_.file_being_parsed_ == def->file) { + return "." + StripPath(filename); // make it a "local" import + } + + std::string module = parser_.opts.include_prefix + filename; + std::replace(module.begin(), module.end(), '/', '.'); + return module; + } + // Generate the package reference when importing a struct or enum from its // module. std::string GenPackageReference(const Type &type) const { - if (type.struct_def) { - return namer_.NamespacedType(*type.struct_def); - } else if (type.enum_def) { - return namer_.NamespacedType(*type.enum_def); - } else { - return "." + GenTypeGet(type); - } + if (type.struct_def) return ModuleFor(type.struct_def); + if (type.enum_def) return ModuleFor(type.enum_def); + return "." + GenTypeGet(type); } // Get the value of a vector's struct member. @@ -2021,7 +2036,7 @@ class PythonGenerator : public BaseGenerator { if (!generateStructs(&one_file_code, one_file_imports)) return false; if (parser_.opts.one_file) { - const std::string mod = file_name_ + "_generated"; + const std::string mod = file_name_ + parser_.opts.filename_suffix; // Legacy file format uses keep casing. return SaveType(mod + ".py", *parser_.current_namespace_, one_file_code, @@ -2122,11 +2137,13 @@ class PythonGenerator : public BaseGenerator { bool SaveType(const std::string &defname, const Namespace &ns, const std::string &classcode, const ImportMap &imports, const std::string &mod, bool needs_imports) const { - if (!classcode.length()) return true; - std::string code = ""; - BeginFile(LastNamespacePart(ns), needs_imports, &code, mod, imports); - code += classcode; + if (classcode.empty()) { + BeginFile(LastNamespacePart(ns), false, &code, "", {}); + } else { + BeginFile(LastNamespacePart(ns), needs_imports, &code, mod, imports); + code += classcode; + } const std::string directories = parser_.opts.one_file ? path_ : namer_.Directories(ns.components); diff --git a/src/idl_gen_swift.cpp b/src/idl_gen_swift.cpp index 17f3bf5fa49..6ac487c5573 100644 --- a/src/idl_gen_swift.cpp +++ b/src/idl_gen_swift.cpp @@ -1845,7 +1845,7 @@ class SwiftGenerator : public BaseGenerator { } std::string ValidateFunc() { - return "static func validateVersion() { FlatBuffersVersion_23_5_26() }"; + return "static func validateVersion() { FlatBuffersVersion_24_3_25() }"; } std::string GenType(const Type &type, diff --git a/swift/Sources/FlatBuffers/Constants.swift b/swift/Sources/FlatBuffers/Constants.swift index 272c572e4a1..03a9b9f5c3d 100644 --- a/swift/Sources/FlatBuffers/Constants.swift +++ b/swift/Sources/FlatBuffers/Constants.swift @@ -119,4 +119,4 @@ extension UInt64: Scalar, Verifiable { public typealias NumericValue = UInt64 } -public func FlatBuffersVersion_23_5_26() {} +public func FlatBuffersVersion_24_3_25() {} diff --git a/tests/64bit/evolution/v1_generated.h b/tests/64bit/evolution/v1_generated.h index 2fc923f3f70..82276d48e08 100644 --- a/tests/64bit/evolution/v1_generated.h +++ b/tests/64bit/evolution/v1_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace v1 { diff --git a/tests/64bit/evolution/v2_generated.h b/tests/64bit/evolution/v2_generated.h index 0b6a302fe7b..3633f0b7b39 100644 --- a/tests/64bit/evolution/v2_generated.h +++ b/tests/64bit/evolution/v2_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace v2 { diff --git a/tests/64bit/test_64bit_generated.h b/tests/64bit/test_64bit_generated.h index bbee5428d03..506143316d9 100644 --- a/tests/64bit/test_64bit_generated.h +++ b/tests/64bit/test_64bit_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); // For access to the binary schema that produced this file. diff --git a/tests/Abc.nim b/tests/Abc.nim index dbfa1aed454..2cd5138d0e8 100644 --- a/tests/Abc.nim +++ b/tests/Abc.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : ]# diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index f306f7ec82f..6313ed1b0a4 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -1,9 +1,14 @@ load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin") load("@rules_cc//cc:defs.bzl", "cc_test") load("//:build_defs.bzl", "DEFAULT_FLATC_ARGS", "flatbuffer_cc_library") +load(":defs.bzl", "flatbuffers_as_external_repo_test") package(default_visibility = ["//visibility:private"]) +exports_files([ + "bazel_repository_test_template.sh", +]) + # rules_js works around various JS tooling limitations by copying everything # into the output directory. Make the test data available to the tests this way. copy_to_bin( @@ -264,3 +269,8 @@ flatbuffer_cc_library( name = "alignment_test_cc_fbs", srcs = ["alignment_test.fbs"], ) + +flatbuffers_as_external_repo_test( + name = "bazel_repository_test", + directory = "bazel_repository_test_dir", +) diff --git a/tests/DictionaryLookup/LongFloatEntry.java b/tests/DictionaryLookup/LongFloatEntry.java index 10b18f673fd..bb5cd5dcc9e 100644 --- a/tests/DictionaryLookup/LongFloatEntry.java +++ b/tests/DictionaryLookup/LongFloatEntry.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class LongFloatEntry extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static LongFloatEntry getRootAsLongFloatEntry(ByteBuffer _bb) { return getRootAsLongFloatEntry(_bb, new LongFloatEntry()); } public static LongFloatEntry getRootAsLongFloatEntry(ByteBuffer _bb, LongFloatEntry obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/DictionaryLookup/LongFloatEntry.kt b/tests/DictionaryLookup/LongFloatEntry.kt index adc802f3329..835b57dba88 100644 --- a/tests/DictionaryLookup/LongFloatEntry.kt +++ b/tests/DictionaryLookup/LongFloatEntry.kt @@ -44,7 +44,7 @@ class LongFloatEntry : Table() { return (val_1 - val_2).sign } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsLongFloatEntry(_bb: ByteBuffer): LongFloatEntry = getRootAsLongFloatEntry(_bb, LongFloatEntry()) fun getRootAsLongFloatEntry(_bb: ByteBuffer, obj: LongFloatEntry): LongFloatEntry { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/DictionaryLookup/LongFloatMap.java b/tests/DictionaryLookup/LongFloatMap.java index 280acdd3d3e..5b9644b96dd 100644 --- a/tests/DictionaryLookup/LongFloatMap.java +++ b/tests/DictionaryLookup/LongFloatMap.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class LongFloatMap extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static LongFloatMap getRootAsLongFloatMap(ByteBuffer _bb) { return getRootAsLongFloatMap(_bb, new LongFloatMap()); } public static LongFloatMap getRootAsLongFloatMap(ByteBuffer _bb, LongFloatMap obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/DictionaryLookup/LongFloatMap.kt b/tests/DictionaryLookup/LongFloatMap.kt index 690504b1081..6de2dd47d18 100644 --- a/tests/DictionaryLookup/LongFloatMap.kt +++ b/tests/DictionaryLookup/LongFloatMap.kt @@ -58,7 +58,7 @@ class LongFloatMap : Table() { } } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsLongFloatMap(_bb: ByteBuffer): LongFloatMap = getRootAsLongFloatMap(_bb, LongFloatMap()) fun getRootAsLongFloatMap(_bb: ByteBuffer, obj: LongFloatMap): LongFloatMap { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/FromInclude.py b/tests/FromInclude.py new file mode 100644 index 00000000000..047601700df --- /dev/null +++ b/tests/FromInclude.py @@ -0,0 +1,4 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: OtherNameSpace + diff --git a/tests/KeywordTest/KeywordsInTable.cs b/tests/KeywordTest/KeywordsInTable.cs index 42e3287548f..2508391bfc6 100644 --- a/tests/KeywordTest/KeywordsInTable.cs +++ b/tests/KeywordTest/KeywordsInTable.cs @@ -13,7 +13,7 @@ public struct KeywordsInTable : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static KeywordsInTable GetRootAsKeywordsInTable(ByteBuffer _bb) { return GetRootAsKeywordsInTable(_bb, new KeywordsInTable()); } public static KeywordsInTable GetRootAsKeywordsInTable(ByteBuffer _bb, KeywordsInTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/KeywordTest/Table2.cs b/tests/KeywordTest/Table2.cs index 8561f9a2f9a..e07cfeffe96 100644 --- a/tests/KeywordTest/Table2.cs +++ b/tests/KeywordTest/Table2.cs @@ -13,7 +13,7 @@ public struct Table2 : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static Table2 GetRootAsTable2(ByteBuffer _bb) { return GetRootAsTable2(_bb, new Table2()); } public static Table2 GetRootAsTable2(ByteBuffer _bb, Table2 obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/MoreDefaults.nim b/tests/MoreDefaults.nim index 0bd309c272e..2294a541703 100644 --- a/tests/MoreDefaults.nim +++ b/tests/MoreDefaults.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : ]# diff --git a/tests/MyGame/Example/Ability.lua b/tests/MyGame/Example/Ability.lua index d7fc542f1ac..df99048ad1c 100644 --- a/tests/MyGame/Example/Ability.lua +++ b/tests/MyGame/Example/Ability.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/Ability.nim b/tests/MyGame/Example/Ability.nim index 1eebaa879c9..1c4a9a9b5e2 100644 --- a/tests/MyGame/Example/Ability.nim +++ b/tests/MyGame/Example/Ability.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/Any.lua b/tests/MyGame/Example/Any.lua index ce4a9299888..c82d405601f 100644 --- a/tests/MyGame/Example/Any.lua +++ b/tests/MyGame/Example/Any.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/Any.nim b/tests/MyGame/Example/Any.nim index c4c0b8d3d4f..fa7bfcadbe9 100644 --- a/tests/MyGame/Example/Any.nim +++ b/tests/MyGame/Example/Any.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/AnyAmbiguousAliases.lua b/tests/MyGame/Example/AnyAmbiguousAliases.lua index 1aa588c7631..02eae9afc59 100644 --- a/tests/MyGame/Example/AnyAmbiguousAliases.lua +++ b/tests/MyGame/Example/AnyAmbiguousAliases.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/AnyAmbiguousAliases.nim b/tests/MyGame/Example/AnyAmbiguousAliases.nim index 8de0ebdcd1f..485bda89458 100644 --- a/tests/MyGame/Example/AnyAmbiguousAliases.nim +++ b/tests/MyGame/Example/AnyAmbiguousAliases.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/AnyUniqueAliases.lua b/tests/MyGame/Example/AnyUniqueAliases.lua index 21b7d63e8aa..4c0e617444c 100644 --- a/tests/MyGame/Example/AnyUniqueAliases.lua +++ b/tests/MyGame/Example/AnyUniqueAliases.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/AnyUniqueAliases.nim b/tests/MyGame/Example/AnyUniqueAliases.nim index d18c80b7c89..693c8c1798a 100644 --- a/tests/MyGame/Example/AnyUniqueAliases.nim +++ b/tests/MyGame/Example/AnyUniqueAliases.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/ArrayTable.cs b/tests/MyGame/Example/ArrayTable.cs index d688e401e1c..c31254cb13f 100644 --- a/tests/MyGame/Example/ArrayTable.cs +++ b/tests/MyGame/Example/ArrayTable.cs @@ -13,7 +13,7 @@ public struct ArrayTable : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static ArrayTable GetRootAsArrayTable(ByteBuffer _bb) { return GetRootAsArrayTable(_bb, new ArrayTable()); } public static ArrayTable GetRootAsArrayTable(ByteBuffer _bb, ArrayTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static bool ArrayTableBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "ARRT"); } diff --git a/tests/MyGame/Example/ArrayTable.java b/tests/MyGame/Example/ArrayTable.java index 5185db12e5b..a9e0cb9d4b6 100644 --- a/tests/MyGame/Example/ArrayTable.java +++ b/tests/MyGame/Example/ArrayTable.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class ArrayTable extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static ArrayTable getRootAsArrayTable(ByteBuffer _bb) { return getRootAsArrayTable(_bb, new ArrayTable()); } public static ArrayTable getRootAsArrayTable(ByteBuffer _bb, ArrayTable obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static boolean ArrayTableBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "ARRT"); } diff --git a/tests/MyGame/Example/Color.lua b/tests/MyGame/Example/Color.lua index d4d59e01ed0..995d1f5b6d6 100644 --- a/tests/MyGame/Example/Color.lua +++ b/tests/MyGame/Example/Color.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/Color.nim b/tests/MyGame/Example/Color.nim index 90956ca178f..4e0a41f6989 100644 --- a/tests/MyGame/Example/Color.nim +++ b/tests/MyGame/Example/Color.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/LongEnum.lua b/tests/MyGame/Example/LongEnum.lua index 3864c706431..2cc04fb43c7 100644 --- a/tests/MyGame/Example/LongEnum.lua +++ b/tests/MyGame/Example/LongEnum.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/LongEnum.nim b/tests/MyGame/Example/LongEnum.nim index 5a63921ed31..db966247b58 100644 --- a/tests/MyGame/Example/LongEnum.nim +++ b/tests/MyGame/Example/LongEnum.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/Monster.cs b/tests/MyGame/Example/Monster.cs index fb4c9e744a7..b175bc4cdb9 100644 --- a/tests/MyGame/Example/Monster.cs +++ b/tests/MyGame/Example/Monster.cs @@ -14,7 +14,7 @@ public struct Monster : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static Monster GetRootAsMonster(ByteBuffer _bb) { return GetRootAsMonster(_bb, new Monster()); } public static Monster GetRootAsMonster(ByteBuffer _bb, Monster obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static bool MonsterBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "MONS"); } diff --git a/tests/MyGame/Example/Monster.java b/tests/MyGame/Example/Monster.java index f049dea83b2..c5d53275b72 100644 --- a/tests/MyGame/Example/Monster.java +++ b/tests/MyGame/Example/Monster.java @@ -24,7 +24,7 @@ */ @SuppressWarnings("unused") public final class Monster extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Monster getRootAsMonster(ByteBuffer _bb) { return getRootAsMonster(_bb, new Monster()); } public static Monster getRootAsMonster(ByteBuffer _bb, Monster obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static boolean MonsterBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "MONS"); } diff --git a/tests/MyGame/Example/Monster.kt b/tests/MyGame/Example/Monster.kt index dec2848d46c..240bb2e2f3e 100644 --- a/tests/MyGame/Example/Monster.kt +++ b/tests/MyGame/Example/Monster.kt @@ -1002,7 +1002,7 @@ class Monster : Table() { return compareStrings(__offset(10, o1, _bb), __offset(10, o2, _bb), _bb) } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsMonster(_bb: ByteBuffer): Monster = getRootAsMonster(_bb, Monster()) fun getRootAsMonster(_bb: ByteBuffer, obj: Monster): Monster { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/MyGame/Example/Monster.lua b/tests/MyGame/Example/Monster.lua index 774adac6a8e..d5dabb57aea 100644 --- a/tests/MyGame/Example/Monster.lua +++ b/tests/MyGame/Example/Monster.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/Monster.nim b/tests/MyGame/Example/Monster.nim index 04f043cbd1c..4df43ea6377 100644 --- a/tests/MyGame/Example/Monster.nim +++ b/tests/MyGame/Example/Monster.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/Race.lua b/tests/MyGame/Example/Race.lua index 798b2792582..cf53d06fdc9 100644 --- a/tests/MyGame/Example/Race.lua +++ b/tests/MyGame/Example/Race.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/Race.nim b/tests/MyGame/Example/Race.nim index 3ff5ae5de49..e07c9da9a4c 100644 --- a/tests/MyGame/Example/Race.nim +++ b/tests/MyGame/Example/Race.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/Referrable.cs b/tests/MyGame/Example/Referrable.cs index 0749f9cd009..14561b3d2da 100644 --- a/tests/MyGame/Example/Referrable.cs +++ b/tests/MyGame/Example/Referrable.cs @@ -13,7 +13,7 @@ public struct Referrable : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static Referrable GetRootAsReferrable(ByteBuffer _bb) { return GetRootAsReferrable(_bb, new Referrable()); } public static Referrable GetRootAsReferrable(ByteBuffer _bb, Referrable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/MyGame/Example/Referrable.java b/tests/MyGame/Example/Referrable.java index db614f93f8d..4ee23e7ff37 100644 --- a/tests/MyGame/Example/Referrable.java +++ b/tests/MyGame/Example/Referrable.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class Referrable extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Referrable getRootAsReferrable(ByteBuffer _bb) { return getRootAsReferrable(_bb, new Referrable()); } public static Referrable getRootAsReferrable(ByteBuffer _bb, Referrable obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/MyGame/Example/Referrable.kt b/tests/MyGame/Example/Referrable.kt index 59d53a5e7c1..07906c078e5 100644 --- a/tests/MyGame/Example/Referrable.kt +++ b/tests/MyGame/Example/Referrable.kt @@ -48,7 +48,7 @@ class Referrable : Table() { return (val_1 - val_2).sign } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsReferrable(_bb: ByteBuffer): Referrable = getRootAsReferrable(_bb, Referrable()) fun getRootAsReferrable(_bb: ByteBuffer, obj: Referrable): Referrable { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/MyGame/Example/Referrable.lua b/tests/MyGame/Example/Referrable.lua index be8fa90fe96..c979c36d36d 100644 --- a/tests/MyGame/Example/Referrable.lua +++ b/tests/MyGame/Example/Referrable.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/Referrable.nim b/tests/MyGame/Example/Referrable.nim index 3c5d82046d7..7c68b2a5574 100644 --- a/tests/MyGame/Example/Referrable.nim +++ b/tests/MyGame/Example/Referrable.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/Stat.cs b/tests/MyGame/Example/Stat.cs index 8c04f1469e9..218bf752f32 100644 --- a/tests/MyGame/Example/Stat.cs +++ b/tests/MyGame/Example/Stat.cs @@ -13,7 +13,7 @@ public struct Stat : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static Stat GetRootAsStat(ByteBuffer _bb) { return GetRootAsStat(_bb, new Stat()); } public static Stat GetRootAsStat(ByteBuffer _bb, Stat obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/MyGame/Example/Stat.java b/tests/MyGame/Example/Stat.java index 6472e83b36f..022090d158f 100644 --- a/tests/MyGame/Example/Stat.java +++ b/tests/MyGame/Example/Stat.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class Stat extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Stat getRootAsStat(ByteBuffer _bb) { return getRootAsStat(_bb, new Stat()); } public static Stat getRootAsStat(ByteBuffer _bb, Stat obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/MyGame/Example/Stat.kt b/tests/MyGame/Example/Stat.kt index 756220c831c..00e65c79bab 100644 --- a/tests/MyGame/Example/Stat.kt +++ b/tests/MyGame/Example/Stat.kt @@ -73,7 +73,7 @@ class Stat : Table() { return (val_1 - val_2).sign } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsStat(_bb: ByteBuffer): Stat = getRootAsStat(_bb, Stat()) fun getRootAsStat(_bb: ByteBuffer, obj: Stat): Stat { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/MyGame/Example/Stat.lua b/tests/MyGame/Example/Stat.lua index 23475223fc1..0245d915ba0 100644 --- a/tests/MyGame/Example/Stat.lua +++ b/tests/MyGame/Example/Stat.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/Stat.nim b/tests/MyGame/Example/Stat.nim index e52699c84b2..a8fd4730c3a 100644 --- a/tests/MyGame/Example/Stat.nim +++ b/tests/MyGame/Example/Stat.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/StructOfStructs.lua b/tests/MyGame/Example/StructOfStructs.lua index f34d651693e..f773374d8b6 100644 --- a/tests/MyGame/Example/StructOfStructs.lua +++ b/tests/MyGame/Example/StructOfStructs.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/StructOfStructs.nim b/tests/MyGame/Example/StructOfStructs.nim index a2a6071f1e2..59a0c8dae6b 100644 --- a/tests/MyGame/Example/StructOfStructs.nim +++ b/tests/MyGame/Example/StructOfStructs.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/StructOfStructsOfStructs.lua b/tests/MyGame/Example/StructOfStructsOfStructs.lua index ea72dcc2f46..8f8a05ff2e2 100644 --- a/tests/MyGame/Example/StructOfStructsOfStructs.lua +++ b/tests/MyGame/Example/StructOfStructsOfStructs.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/StructOfStructsOfStructs.nim b/tests/MyGame/Example/StructOfStructsOfStructs.nim index e091411f3c5..2e5028c83ab 100644 --- a/tests/MyGame/Example/StructOfStructsOfStructs.nim +++ b/tests/MyGame/Example/StructOfStructsOfStructs.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/Test.lua b/tests/MyGame/Example/Test.lua index 1786a1b3609..d03d41637d7 100644 --- a/tests/MyGame/Example/Test.lua +++ b/tests/MyGame/Example/Test.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/Test.nim b/tests/MyGame/Example/Test.nim index 8f100457cb5..97d632e3a7f 100644 --- a/tests/MyGame/Example/Test.nim +++ b/tests/MyGame/Example/Test.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/TestSimpleTableWithEnum.cs b/tests/MyGame/Example/TestSimpleTableWithEnum.cs index c7bc4d983f0..cb290d23186 100644 --- a/tests/MyGame/Example/TestSimpleTableWithEnum.cs +++ b/tests/MyGame/Example/TestSimpleTableWithEnum.cs @@ -13,7 +13,7 @@ internal partial struct TestSimpleTableWithEnum : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb) { return GetRootAsTestSimpleTableWithEnum(_bb, new TestSimpleTableWithEnum()); } public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/MyGame/Example/TestSimpleTableWithEnum.java b/tests/MyGame/Example/TestSimpleTableWithEnum.java index 1ad3c7c336e..c5130da2bfa 100644 --- a/tests/MyGame/Example/TestSimpleTableWithEnum.java +++ b/tests/MyGame/Example/TestSimpleTableWithEnum.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") final class TestSimpleTableWithEnum extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static TestSimpleTableWithEnum getRootAsTestSimpleTableWithEnum(ByteBuffer _bb) { return getRootAsTestSimpleTableWithEnum(_bb, new TestSimpleTableWithEnum()); } public static TestSimpleTableWithEnum getRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/MyGame/Example/TestSimpleTableWithEnum.kt b/tests/MyGame/Example/TestSimpleTableWithEnum.kt index a21a46051b0..7b7a6bd55f9 100644 --- a/tests/MyGame/Example/TestSimpleTableWithEnum.kt +++ b/tests/MyGame/Example/TestSimpleTableWithEnum.kt @@ -43,7 +43,7 @@ class TestSimpleTableWithEnum : Table() { } } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsTestSimpleTableWithEnum(_bb: ByteBuffer): TestSimpleTableWithEnum = getRootAsTestSimpleTableWithEnum(_bb, TestSimpleTableWithEnum()) fun getRootAsTestSimpleTableWithEnum(_bb: ByteBuffer, obj: TestSimpleTableWithEnum): TestSimpleTableWithEnum { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/MyGame/Example/TestSimpleTableWithEnum.lua b/tests/MyGame/Example/TestSimpleTableWithEnum.lua index ed208f01080..a970401a38b 100644 --- a/tests/MyGame/Example/TestSimpleTableWithEnum.lua +++ b/tests/MyGame/Example/TestSimpleTableWithEnum.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/TestSimpleTableWithEnum.nim b/tests/MyGame/Example/TestSimpleTableWithEnum.nim index dad59fc0115..724ca72518b 100644 --- a/tests/MyGame/Example/TestSimpleTableWithEnum.nim +++ b/tests/MyGame/Example/TestSimpleTableWithEnum.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/TypeAliases.cs b/tests/MyGame/Example/TypeAliases.cs index abc4dea7d35..76738e44e44 100644 --- a/tests/MyGame/Example/TypeAliases.cs +++ b/tests/MyGame/Example/TypeAliases.cs @@ -13,7 +13,7 @@ public struct TypeAliases : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb) { return GetRootAsTypeAliases(_bb, new TypeAliases()); } public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb, TypeAliases obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/MyGame/Example/TypeAliases.java b/tests/MyGame/Example/TypeAliases.java index c56875cd835..4829076236d 100644 --- a/tests/MyGame/Example/TypeAliases.java +++ b/tests/MyGame/Example/TypeAliases.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class TypeAliases extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static TypeAliases getRootAsTypeAliases(ByteBuffer _bb) { return getRootAsTypeAliases(_bb, new TypeAliases()); } public static TypeAliases getRootAsTypeAliases(ByteBuffer _bb, TypeAliases obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/MyGame/Example/TypeAliases.kt b/tests/MyGame/Example/TypeAliases.kt index 4ae5f3d7aa2..67425276762 100644 --- a/tests/MyGame/Example/TypeAliases.kt +++ b/tests/MyGame/Example/TypeAliases.kt @@ -215,7 +215,7 @@ class TypeAliases : Table() { } } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsTypeAliases(_bb: ByteBuffer): TypeAliases = getRootAsTypeAliases(_bb, TypeAliases()) fun getRootAsTypeAliases(_bb: ByteBuffer, obj: TypeAliases): TypeAliases { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/MyGame/Example/TypeAliases.lua b/tests/MyGame/Example/TypeAliases.lua index c647d7b9481..2bcfa916bf2 100644 --- a/tests/MyGame/Example/TypeAliases.lua +++ b/tests/MyGame/Example/TypeAliases.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/TypeAliases.nim b/tests/MyGame/Example/TypeAliases.nim index c596405cd82..151d9d6c8af 100644 --- a/tests/MyGame/Example/TypeAliases.nim +++ b/tests/MyGame/Example/TypeAliases.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example/Vec3.lua b/tests/MyGame/Example/Vec3.lua index 941078c1c23..c5d0158000f 100644 --- a/tests/MyGame/Example/Vec3.lua +++ b/tests/MyGame/Example/Vec3.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example/Vec3.nim b/tests/MyGame/Example/Vec3.nim index 74330dc4895..7ecaf685334 100644 --- a/tests/MyGame/Example/Vec3.nim +++ b/tests/MyGame/Example/Vec3.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/Example2/Monster.cs b/tests/MyGame/Example2/Monster.cs index 833a76b7a33..3469fa12d23 100644 --- a/tests/MyGame/Example2/Monster.cs +++ b/tests/MyGame/Example2/Monster.cs @@ -13,7 +13,7 @@ public struct Monster : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static Monster GetRootAsMonster(ByteBuffer _bb) { return GetRootAsMonster(_bb, new Monster()); } public static Monster GetRootAsMonster(ByteBuffer _bb, Monster obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/MyGame/Example2/Monster.java b/tests/MyGame/Example2/Monster.java index 7488a26f3e4..c977193f9e6 100644 --- a/tests/MyGame/Example2/Monster.java +++ b/tests/MyGame/Example2/Monster.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class Monster extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Monster getRootAsMonster(ByteBuffer _bb) { return getRootAsMonster(_bb, new Monster()); } public static Monster getRootAsMonster(ByteBuffer _bb, Monster obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/MyGame/Example2/Monster.kt b/tests/MyGame/Example2/Monster.kt index 9f8a4ca0248..1c41ea0da3e 100644 --- a/tests/MyGame/Example2/Monster.kt +++ b/tests/MyGame/Example2/Monster.kt @@ -29,7 +29,7 @@ class Monster : Table() { return this } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsMonster(_bb: ByteBuffer): Monster = getRootAsMonster(_bb, Monster()) fun getRootAsMonster(_bb: ByteBuffer, obj: Monster): Monster { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/MyGame/Example2/Monster.lua b/tests/MyGame/Example2/Monster.lua index 4cf966cee41..9157277e1a0 100644 --- a/tests/MyGame/Example2/Monster.lua +++ b/tests/MyGame/Example2/Monster.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/Example2/Monster.nim b/tests/MyGame/Example2/Monster.nim index b976a748878..7eac42191b6 100644 --- a/tests/MyGame/Example2/Monster.nim +++ b/tests/MyGame/Example2/Monster.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/InParentNamespace.cs b/tests/MyGame/InParentNamespace.cs index 83077ee74d2..e214d4649b3 100644 --- a/tests/MyGame/InParentNamespace.cs +++ b/tests/MyGame/InParentNamespace.cs @@ -13,7 +13,7 @@ public struct InParentNamespace : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static InParentNamespace GetRootAsInParentNamespace(ByteBuffer _bb) { return GetRootAsInParentNamespace(_bb, new InParentNamespace()); } public static InParentNamespace GetRootAsInParentNamespace(ByteBuffer _bb, InParentNamespace obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/MyGame/InParentNamespace.java b/tests/MyGame/InParentNamespace.java index 61749df963e..1e0c31b9cf5 100644 --- a/tests/MyGame/InParentNamespace.java +++ b/tests/MyGame/InParentNamespace.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class InParentNamespace extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static InParentNamespace getRootAsInParentNamespace(ByteBuffer _bb) { return getRootAsInParentNamespace(_bb, new InParentNamespace()); } public static InParentNamespace getRootAsInParentNamespace(ByteBuffer _bb, InParentNamespace obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/MyGame/InParentNamespace.kt b/tests/MyGame/InParentNamespace.kt index 8ba2ee31c67..d7c75d8dc5a 100644 --- a/tests/MyGame/InParentNamespace.kt +++ b/tests/MyGame/InParentNamespace.kt @@ -29,7 +29,7 @@ class InParentNamespace : Table() { return this } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsInParentNamespace(_bb: ByteBuffer): InParentNamespace = getRootAsInParentNamespace(_bb, InParentNamespace()) fun getRootAsInParentNamespace(_bb: ByteBuffer, obj: InParentNamespace): InParentNamespace { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/MyGame/InParentNamespace.lua b/tests/MyGame/InParentNamespace.lua index 619de51c127..fb971efbf19 100644 --- a/tests/MyGame/InParentNamespace.lua +++ b/tests/MyGame/InParentNamespace.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //monster_test.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/InParentNamespace.nim b/tests/MyGame/InParentNamespace.nim index 6554d2c1bea..431507c228d 100644 --- a/tests/MyGame/InParentNamespace.nim +++ b/tests/MyGame/InParentNamespace.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/MonsterExtra.cs b/tests/MyGame/MonsterExtra.cs index 63a689a31cf..fc20e2ccfd2 100644 --- a/tests/MyGame/MonsterExtra.cs +++ b/tests/MyGame/MonsterExtra.cs @@ -13,7 +13,7 @@ public struct MonsterExtra : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static MonsterExtra GetRootAsMonsterExtra(ByteBuffer _bb) { return GetRootAsMonsterExtra(_bb, new MonsterExtra()); } public static MonsterExtra GetRootAsMonsterExtra(ByteBuffer _bb, MonsterExtra obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static bool MonsterExtraBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "MONE"); } diff --git a/tests/MyGame/MonsterExtra.java b/tests/MyGame/MonsterExtra.java index a518e1466ea..c0c5e19afd2 100644 --- a/tests/MyGame/MonsterExtra.java +++ b/tests/MyGame/MonsterExtra.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class MonsterExtra extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static MonsterExtra getRootAsMonsterExtra(ByteBuffer _bb) { return getRootAsMonsterExtra(_bb, new MonsterExtra()); } public static MonsterExtra getRootAsMonsterExtra(ByteBuffer _bb, MonsterExtra obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static boolean MonsterExtraBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "MONE"); } diff --git a/tests/MyGame/MonsterExtra.kt b/tests/MyGame/MonsterExtra.kt index bcc1d10694a..e95c0c042e6 100644 --- a/tests/MyGame/MonsterExtra.kt +++ b/tests/MyGame/MonsterExtra.kt @@ -187,7 +187,7 @@ class MonsterExtra : Table() { } } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsMonsterExtra(_bb: ByteBuffer): MonsterExtra = getRootAsMonsterExtra(_bb, MonsterExtra()) fun getRootAsMonsterExtra(_bb: ByteBuffer, obj: MonsterExtra): MonsterExtra { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/MyGame/OtherNameSpace/FromInclude.lua b/tests/MyGame/OtherNameSpace/FromInclude.lua index 3a49948a381..2d6b1fd53f6 100644 --- a/tests/MyGame/OtherNameSpace/FromInclude.lua +++ b/tests/MyGame/OtherNameSpace/FromInclude.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //include_test/sub/include_test2.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/OtherNameSpace/FromInclude.nim b/tests/MyGame/OtherNameSpace/FromInclude.nim index 7daf7228649..51538c12a60 100644 --- a/tests/MyGame/OtherNameSpace/FromInclude.nim +++ b/tests/MyGame/OtherNameSpace/FromInclude.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/OtherNameSpace/FromInclude.py b/tests/MyGame/OtherNameSpace/FromInclude.py new file mode 100644 index 00000000000..047601700df --- /dev/null +++ b/tests/MyGame/OtherNameSpace/FromInclude.py @@ -0,0 +1,4 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: OtherNameSpace + diff --git a/tests/MyGame/OtherNameSpace/TableB.lua b/tests/MyGame/OtherNameSpace/TableB.lua index 22cd508906f..52b65abcf1a 100644 --- a/tests/MyGame/OtherNameSpace/TableB.lua +++ b/tests/MyGame/OtherNameSpace/TableB.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //include_test/sub/include_test2.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/OtherNameSpace/TableB.nim b/tests/MyGame/OtherNameSpace/TableB.nim index e597325dfa4..e7bc69c1031 100644 --- a/tests/MyGame/OtherNameSpace/TableB.nim +++ b/tests/MyGame/OtherNameSpace/TableB.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/OtherNameSpace/TableB.py b/tests/MyGame/OtherNameSpace/TableB.py new file mode 100644 index 00000000000..047601700df --- /dev/null +++ b/tests/MyGame/OtherNameSpace/TableB.py @@ -0,0 +1,4 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: OtherNameSpace + diff --git a/tests/MyGame/OtherNameSpace/Unused.lua b/tests/MyGame/OtherNameSpace/Unused.lua index 0ed6d7b1efa..eca8b64a610 100644 --- a/tests/MyGame/OtherNameSpace/Unused.lua +++ b/tests/MyGame/OtherNameSpace/Unused.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //include_test/sub/include_test2.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/MyGame/OtherNameSpace/Unused.nim b/tests/MyGame/OtherNameSpace/Unused.nim index 973ddc15612..8578c846afa 100644 --- a/tests/MyGame/OtherNameSpace/Unused.nim +++ b/tests/MyGame/OtherNameSpace/Unused.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/MyGame/OtherNameSpace/Unused.py b/tests/MyGame/OtherNameSpace/Unused.py new file mode 100644 index 00000000000..047601700df --- /dev/null +++ b/tests/MyGame/OtherNameSpace/Unused.py @@ -0,0 +1,4 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: OtherNameSpace + diff --git a/tests/MyGame/OtherNameSpace/__init__.py b/tests/MyGame/OtherNameSpace/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/Property.nim b/tests/Property.nim index e6bac7f70a0..19c2fd147a2 100644 --- a/tests/Property.nim +++ b/tests/Property.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : ]# diff --git a/tests/PythonTest.sh b/tests/PythonTest.sh index 84e82019dc5..e7199b8770b 100755 --- a/tests/PythonTest.sh +++ b/tests/PythonTest.sh @@ -24,9 +24,9 @@ runtime_library_dir=${test_dir}/../python # Emit Python code for the example schema in the test dir: ${test_dir}/../flatc -p -o ${gen_code_path} -I include_test monster_test.fbs --gen-object-api ${test_dir}/../flatc -p -o ${gen_code_path} -I include_test monster_test.fbs --gen-object-api --gen-onefile -${test_dir}/../flatc -p -o ${gen_code_path} -I include_test monster_extra.fbs --gen-object-api -${test_dir}/../flatc -p -o ${gen_code_path} -I include_test arrays_test.fbs --gen-object-api -${test_dir}/../flatc -p -o ${gen_code_path} -I include_test nested_union_test.fbs --gen-object-api +${test_dir}/../flatc -p -o ${gen_code_path} -I include_test monster_extra.fbs --gen-object-api --python-typing --gen-compare +${test_dir}/../flatc -p -o ${gen_code_path} -I include_test arrays_test.fbs --gen-object-api --python-typing +${test_dir}/../flatc -p -o ${gen_code_path} -I include_test nested_union_test.fbs --gen-object-api --python-typing # Syntax: run_tests # diff --git a/tests/TableA.lua b/tests/TableA.lua index 6c761d059d2..5ce875a6c8a 100644 --- a/tests/TableA.lua +++ b/tests/TableA.lua @@ -3,7 +3,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : //include_test/include_test1.fbs Rooting type : MyGame.Example.Monster (//monster_test.fbs) diff --git a/tests/TableA.nim b/tests/TableA.nim index 0bf7e760293..93d8fa9bfca 100644 --- a/tests/TableA.nim +++ b/tests/TableA.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : MyGame.Example.Monster () diff --git a/tests/TableA.py b/tests/TableA.py new file mode 100644 index 00000000000..ca9b83e34dc --- /dev/null +++ b/tests/TableA.py @@ -0,0 +1,4 @@ +# automatically generated by the FlatBuffers compiler, do not modify + +# namespace: + diff --git a/tests/TestMutatingBool.nim b/tests/TestMutatingBool.nim index 8573580f887..407ccc8a02c 100644 --- a/tests/TestMutatingBool.nim +++ b/tests/TestMutatingBool.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : ]# diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/bazel_repository_test_dir/.bazelrc b/tests/bazel_repository_test_dir/.bazelrc new file mode 100644 index 00000000000..78003332b01 --- /dev/null +++ b/tests/bazel_repository_test_dir/.bazelrc @@ -0,0 +1 @@ +build --symlink_prefix=/ diff --git a/tests/bazel_repository_test_dir/.gitignore b/tests/bazel_repository_test_dir/.gitignore new file mode 100644 index 00000000000..ac51a054d2d --- /dev/null +++ b/tests/bazel_repository_test_dir/.gitignore @@ -0,0 +1 @@ +bazel-* diff --git a/tests/bazel_repository_test_dir/BUILD b/tests/bazel_repository_test_dir/BUILD new file mode 100644 index 00000000000..36fe6bd39db --- /dev/null +++ b/tests/bazel_repository_test_dir/BUILD @@ -0,0 +1,10 @@ +# This test doesn't actually make use of the flatbuffers library. It's just +# here to make sure we can link the library properly when it comes from an +# external repository. You're welcome to expand this test to do more. +cc_test( + name = "pulls_in_flatbuffers_test", + srcs = ["pulls_in_flatbuffers_test.cpp"], + deps = [ + "@com_github_google_flatbuffers//:flatbuffers", + ], +) diff --git a/tests/bazel_repository_test_dir/README.md b/tests/bazel_repository_test_dir/README.md new file mode 100644 index 00000000000..6f7c34a3601 --- /dev/null +++ b/tests/bazel_repository_test_dir/README.md @@ -0,0 +1,8 @@ +This directory is not intended to be used independently of the flatbuffers +repository. Instead, this whole directory serves as a unit test for the +C++ integration in the flatbuffers repo. + +Run this test from the top-level of the flatbuffers repo. +```console +$ bazel test //tests:bazel_repository_test +``` diff --git a/tests/bazel_repository_test_dir/WORKSPACE b/tests/bazel_repository_test_dir/WORKSPACE new file mode 100644 index 00000000000..3adbfc61fc9 --- /dev/null +++ b/tests/bazel_repository_test_dir/WORKSPACE @@ -0,0 +1,6 @@ +workspace(name = "bazel_repository_test") + +local_repository( + name = "com_github_google_flatbuffers", + path = "../../", +) diff --git a/tests/bazel_repository_test_dir/pulls_in_flatbuffers_test.cpp b/tests/bazel_repository_test_dir/pulls_in_flatbuffers_test.cpp new file mode 100644 index 00000000000..76e8197013a --- /dev/null +++ b/tests/bazel_repository_test_dir/pulls_in_flatbuffers_test.cpp @@ -0,0 +1 @@ +int main() { return 0; } diff --git a/tests/ts/bazel_repository_test.sh b/tests/bazel_repository_test_template.sh similarity index 91% rename from tests/ts/bazel_repository_test.sh rename to tests/bazel_repository_test_template.sh index 94e115c747e..5c7736fcf1a 100755 --- a/tests/ts/bazel_repository_test.sh +++ b/tests/bazel_repository_test_template.sh @@ -1,7 +1,7 @@ #!/bin/bash # This test makes sure that a separate repository can import the flatbuffers -# repository and use it in their JavaScript code. +# repository and use it in their code. # --- begin runfiles.bash initialization v3 --- # Copy-pasted from the Bazel Bash runfiles library v3. @@ -24,6 +24,6 @@ fi export PATH="$(dirname "${BAZEL_BIN}"):${PATH}" -cd tests/ts/bazel_repository_test_dir/ +cd {{REPOSITORY_DIR}} bazel test //... diff --git a/tests/cpp17/generated_cpp17/monster_test_generated.h b/tests/cpp17/generated_cpp17/monster_test_generated.h index 4863ea2c547..1e11e222633 100644 --- a/tests/cpp17/generated_cpp17/monster_test_generated.h +++ b/tests/cpp17/generated_cpp17/monster_test_generated.h @@ -10,9 +10,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace MyGame { @@ -1436,6 +1436,12 @@ struct Monster FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_name) const { return strcmp(name()->c_str(), _name); } + template + int KeyCompareWithValue(const StringType& _name) const { + if (name()->c_str() < _name) return -1; + if (_name < name()->c_str()) return 1; + return 0; + } const ::flatbuffers::Vector *inventory() const { return GetPointer *>(VT_INVENTORY); } diff --git a/tests/cpp17/generated_cpp17/optional_scalars_generated.h b/tests/cpp17/generated_cpp17/optional_scalars_generated.h index 92f6e5a5f72..75b8da3bfa8 100644 --- a/tests/cpp17/generated_cpp17/optional_scalars_generated.h +++ b/tests/cpp17/generated_cpp17/optional_scalars_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace optional_scalars { diff --git a/tests/cpp17/generated_cpp17/union_vector_generated.h b/tests/cpp17/generated_cpp17/union_vector_generated.h index 64bf358da7f..e785ecda0d4 100644 --- a/tests/cpp17/generated_cpp17/union_vector_generated.h +++ b/tests/cpp17/generated_cpp17/union_vector_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); struct Attacker; diff --git a/tests/defs.bzl b/tests/defs.bzl new file mode 100644 index 00000000000..033d2303093 --- /dev/null +++ b/tests/defs.bzl @@ -0,0 +1,48 @@ +"""Helper macros and rules for tests.""" + +load("@bazel_skylib//lib:paths.bzl", "paths") +load("@bazel_skylib//rules:expand_template.bzl", "expand_template") + +def flatbuffers_as_external_repo_test(name, directory): + """Run all tests in a bazel workspace that imports flatbuffers as an external repository. + + Args: + name: The name of the test target. + directory: The directory in which the bazel workspace is located. This is the directory + that imports flatbuffers as an external repository. + """ + expand_template( + name = name + "__template_expansion", + out = name + ".sh", + substitutions = { + "{{REPOSITORY_DIR}}": paths.join(native.package_name(), directory), + }, + template = "//tests:bazel_repository_test_template.sh", + ) + + native.sh_test( + name = name, + srcs = [":%s.sh" % name], + data = [ + "//:distribution", + "@bazel_linux_x86_64//file", + ] + native.glob( + [ + directory + "/**/*", + ], + exclude = [ + directory + "/bazel-*/**", + ], + ), + tags = [ + # Since we have bazel downloading external repositories inside this + # test, we need to give it access to the internet. + "requires-network", + ], + # We only have x86_64 Linux bazel exposed so restrict the test to that. + target_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + ], + deps = ["@bazel_tools//tools/bash/runfiles"], + ) diff --git a/tests/evolution_test/evolution_v1_generated.h b/tests/evolution_test/evolution_v1_generated.h index 80e75416515..0ab9dd5b7ed 100644 --- a/tests/evolution_test/evolution_v1_generated.h +++ b/tests/evolution_test/evolution_v1_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace Evolution { diff --git a/tests/evolution_test/evolution_v2_generated.h b/tests/evolution_test/evolution_v2_generated.h index 32aae375fcb..3959eeba3a0 100644 --- a/tests/evolution_test/evolution_v2_generated.h +++ b/tests/evolution_test/evolution_v2_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace Evolution { diff --git a/tests/key_field/key_field_sample_generated.h b/tests/key_field/key_field_sample_generated.h index 6763522750a..41e725cdd80 100644 --- a/tests/key_field/key_field_sample_generated.h +++ b/tests/key_field/key_field_sample_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace keyfield { @@ -598,6 +598,12 @@ struct FooTable FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_c) const { return strcmp(c()->c_str(), _c); } + template + int KeyCompareWithValue(const StringType& _c) const { + if (c()->c_str() < _c) return -1; + if (_c < c()->c_str()) return 1; + return 0; + } const ::flatbuffers::Vector *d() const { return GetPointer *>(VT_D); } diff --git a/tests/monster_extra_generated.h b/tests/monster_extra_generated.h index 017c682450e..e570cf91178 100644 --- a/tests/monster_extra_generated.h +++ b/tests/monster_extra_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace MyGame { diff --git a/tests/monster_test.cpp b/tests/monster_test.cpp index 8ec031a3ddf..b546d2074d8 100644 --- a/tests/monster_test.cpp +++ b/tests/monster_test.cpp @@ -313,6 +313,33 @@ void AccessFlatBufferTest(const uint8_t *flatbuf, size_t length, bool pooled) { TEST_NOTNULL(vecoftables->LookupByKey("Fred")); TEST_NOTNULL(vecoftables->LookupByKey("Wilma")); + // Verify the same objects are returned for char*-based and string-based + // lookups. + TEST_EQ(vecoftables->LookupByKey("Barney"), + vecoftables->LookupByKey(std::string("Barney"))); + TEST_EQ(vecoftables->LookupByKey("Fred"), + vecoftables->LookupByKey(std::string("Fred"))); + TEST_EQ(vecoftables->LookupByKey("Wilma"), + vecoftables->LookupByKey(std::string("Wilma"))); + +#ifdef FLATBUFFERS_HAS_STRING_VIEW + // Tests for LookupByKey with a key that is a truncated + // version of a longer, invalid key. + const std::string invalid_key = "Barney123"; + std::string_view valid_truncated_key = invalid_key; + valid_truncated_key.remove_suffix(3); // "Barney" + TEST_NOTNULL(vecoftables->LookupByKey(valid_truncated_key)); + TEST_EQ(vecoftables->LookupByKey("Barney"), + vecoftables->LookupByKey(valid_truncated_key)); + + // Tests for LookupByKey with a key that is a truncated + // version of a longer, valid key. + const std::string valid_key = "Barney"; + std::string_view invalid_truncated_key = valid_key; + invalid_truncated_key.remove_suffix(3); // "Bar" + TEST_NULL(vecoftables->LookupByKey(invalid_truncated_key)); +#endif // FLATBUFFERS_HAS_STRING_VIEW + // Test accessing a vector of sorted structs auto vecofstructs = monster->testarrayofsortedstruct(); if (vecofstructs) { // not filled in monster_test.bfbs diff --git a/tests/monster_test_generated.h b/tests/monster_test_generated.h index 77b34181954..280fb3675af 100644 --- a/tests/monster_test_generated.h +++ b/tests/monster_test_generated.h @@ -10,9 +10,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); // For access to the binary schema that produced this file. @@ -1432,6 +1432,12 @@ struct Monster FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_name) const { return strcmp(name()->c_str(), _name); } + template + int KeyCompareWithValue(const StringType& _name) const { + if (name()->c_str() < _name) return -1; + if (_name < name()->c_str()) return 1; + return 0; + } const ::flatbuffers::Vector *inventory() const { return GetPointer *>(VT_INVENTORY); } diff --git a/tests/monster_test_suffix/ext_only/monster_test_generated.hpp b/tests/monster_test_suffix/ext_only/monster_test_generated.hpp index f07d5eff895..9059ffd2eea 100644 --- a/tests/monster_test_suffix/ext_only/monster_test_generated.hpp +++ b/tests/monster_test_suffix/ext_only/monster_test_generated.hpp @@ -10,9 +10,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace MyGame { @@ -1423,6 +1423,12 @@ struct Monster FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_name) const { return strcmp(name()->c_str(), _name); } + template + int KeyCompareWithValue(const StringType& _name) const { + if (name()->c_str() < _name) return -1; + if (_name < name()->c_str()) return 1; + return 0; + } const ::flatbuffers::Vector *inventory() const { return GetPointer *>(VT_INVENTORY); } diff --git a/tests/monster_test_suffix/filesuffix_only/monster_test_suffix.h b/tests/monster_test_suffix/filesuffix_only/monster_test_suffix.h index f07d5eff895..9059ffd2eea 100644 --- a/tests/monster_test_suffix/filesuffix_only/monster_test_suffix.h +++ b/tests/monster_test_suffix/filesuffix_only/monster_test_suffix.h @@ -10,9 +10,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace MyGame { @@ -1423,6 +1423,12 @@ struct Monster FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_name) const { return strcmp(name()->c_str(), _name); } + template + int KeyCompareWithValue(const StringType& _name) const { + if (name()->c_str() < _name) return -1; + if (_name < name()->c_str()) return 1; + return 0; + } const ::flatbuffers::Vector *inventory() const { return GetPointer *>(VT_INVENTORY); } diff --git a/tests/monster_test_suffix/monster_test_suffix.hpp b/tests/monster_test_suffix/monster_test_suffix.hpp index f07d5eff895..9059ffd2eea 100644 --- a/tests/monster_test_suffix/monster_test_suffix.hpp +++ b/tests/monster_test_suffix/monster_test_suffix.hpp @@ -10,9 +10,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace MyGame { @@ -1423,6 +1423,12 @@ struct Monster FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { int KeyCompareWithValue(const char *_name) const { return strcmp(name()->c_str(), _name); } + template + int KeyCompareWithValue(const StringType& _name) const { + if (name()->c_str() < _name) return -1; + if (_name < name()->c_str()) return 1; + return 0; + } const ::flatbuffers::Vector *inventory() const { return GetPointer *>(VT_INVENTORY); } diff --git a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.cs b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.cs index fa09fee63ba..d2f3e585067 100644 --- a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.cs +++ b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.cs @@ -13,7 +13,7 @@ public struct TableInNestedNS : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static TableInNestedNS GetRootAsTableInNestedNS(ByteBuffer _bb) { return GetRootAsTableInNestedNS(_bb, new TableInNestedNS()); } public static TableInNestedNS GetRootAsTableInNestedNS(ByteBuffer _bb, TableInNestedNS obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.java b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.java index 6fda3c7892b..6781bf73694 100644 --- a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.java +++ b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.java @@ -9,7 +9,7 @@ @SuppressWarnings("unused") public final class TableInNestedNS extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static TableInNestedNS getRootAsTableInNestedNS(ByteBuffer _bb) { return getRootAsTableInNestedNS(_bb, new TableInNestedNS()); } public static TableInNestedNS getRootAsTableInNestedNS(ByteBuffer _bb, TableInNestedNS obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.kt b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.kt index 3565c9cb8d5..16f3d455471 100644 --- a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.kt +++ b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.kt @@ -44,7 +44,7 @@ class TableInNestedNS : Table() { } } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsTableInNestedNS(_bb: ByteBuffer): TableInNestedNS = getRootAsTableInNestedNS(_bb, TableInNestedNS()) fun getRootAsTableInNestedNS(_bb: ByteBuffer, obj: TableInNestedNS): TableInNestedNS { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/namespace_test/NamespaceA/SecondTableInA.cs b/tests/namespace_test/NamespaceA/SecondTableInA.cs index 98866c74593..66e8645aac4 100644 --- a/tests/namespace_test/NamespaceA/SecondTableInA.cs +++ b/tests/namespace_test/NamespaceA/SecondTableInA.cs @@ -13,7 +13,7 @@ public struct SecondTableInA : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static SecondTableInA GetRootAsSecondTableInA(ByteBuffer _bb) { return GetRootAsSecondTableInA(_bb, new SecondTableInA()); } public static SecondTableInA GetRootAsSecondTableInA(ByteBuffer _bb, SecondTableInA obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/namespace_test/NamespaceA/SecondTableInA.java b/tests/namespace_test/NamespaceA/SecondTableInA.java index 3357ff35bbd..00ade74d7e2 100644 --- a/tests/namespace_test/NamespaceA/SecondTableInA.java +++ b/tests/namespace_test/NamespaceA/SecondTableInA.java @@ -9,7 +9,7 @@ @SuppressWarnings("unused") public final class SecondTableInA extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static SecondTableInA getRootAsSecondTableInA(ByteBuffer _bb) { return getRootAsSecondTableInA(_bb, new SecondTableInA()); } public static SecondTableInA getRootAsSecondTableInA(ByteBuffer _bb, SecondTableInA obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/namespace_test/NamespaceA/SecondTableInA.kt b/tests/namespace_test/NamespaceA/SecondTableInA.kt index a69cfdb6613..76418339266 100644 --- a/tests/namespace_test/NamespaceA/SecondTableInA.kt +++ b/tests/namespace_test/NamespaceA/SecondTableInA.kt @@ -39,7 +39,7 @@ class SecondTableInA : Table() { } } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsSecondTableInA(_bb: ByteBuffer): SecondTableInA = getRootAsSecondTableInA(_bb, SecondTableInA()) fun getRootAsSecondTableInA(_bb: ByteBuffer, obj: SecondTableInA): SecondTableInA { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/namespace_test/NamespaceA/TableInFirstNS.cs b/tests/namespace_test/NamespaceA/TableInFirstNS.cs index 7d7033ba1ba..a0b1904829a 100644 --- a/tests/namespace_test/NamespaceA/TableInFirstNS.cs +++ b/tests/namespace_test/NamespaceA/TableInFirstNS.cs @@ -13,7 +13,7 @@ public struct TableInFirstNS : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static TableInFirstNS GetRootAsTableInFirstNS(ByteBuffer _bb) { return GetRootAsTableInFirstNS(_bb, new TableInFirstNS()); } public static TableInFirstNS GetRootAsTableInFirstNS(ByteBuffer _bb, TableInFirstNS obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/namespace_test/NamespaceA/TableInFirstNS.java b/tests/namespace_test/NamespaceA/TableInFirstNS.java index 3cc33a0ab39..d53d75b2e52 100644 --- a/tests/namespace_test/NamespaceA/TableInFirstNS.java +++ b/tests/namespace_test/NamespaceA/TableInFirstNS.java @@ -9,7 +9,7 @@ @SuppressWarnings("unused") public final class TableInFirstNS extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static TableInFirstNS getRootAsTableInFirstNS(ByteBuffer _bb) { return getRootAsTableInFirstNS(_bb, new TableInFirstNS()); } public static TableInFirstNS getRootAsTableInFirstNS(ByteBuffer _bb, TableInFirstNS obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/namespace_test/NamespaceA/TableInFirstNS.kt b/tests/namespace_test/NamespaceA/TableInFirstNS.kt index 6040a2339e8..a9fc620c9ec 100644 --- a/tests/namespace_test/NamespaceA/TableInFirstNS.kt +++ b/tests/namespace_test/NamespaceA/TableInFirstNS.kt @@ -79,7 +79,7 @@ class TableInFirstNS : Table() { } } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsTableInFirstNS(_bb: ByteBuffer): TableInFirstNS = getRootAsTableInFirstNS(_bb, TableInFirstNS()) fun getRootAsTableInFirstNS(_bb: ByteBuffer, obj: TableInFirstNS): TableInFirstNS { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/namespace_test/NamespaceC/TableInC.cs b/tests/namespace_test/NamespaceC/TableInC.cs index 7d1ed5ae0fa..c4d75f6815a 100644 --- a/tests/namespace_test/NamespaceC/TableInC.cs +++ b/tests/namespace_test/NamespaceC/TableInC.cs @@ -13,7 +13,7 @@ public struct TableInC : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static TableInC GetRootAsTableInC(ByteBuffer _bb) { return GetRootAsTableInC(_bb, new TableInC()); } public static TableInC GetRootAsTableInC(ByteBuffer _bb, TableInC obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/namespace_test/NamespaceC/TableInC.java b/tests/namespace_test/NamespaceC/TableInC.java index 98fc18c5f8e..e51c6075518 100644 --- a/tests/namespace_test/NamespaceC/TableInC.java +++ b/tests/namespace_test/NamespaceC/TableInC.java @@ -9,7 +9,7 @@ @SuppressWarnings("unused") public final class TableInC extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static TableInC getRootAsTableInC(ByteBuffer _bb) { return getRootAsTableInC(_bb, new TableInC()); } public static TableInC getRootAsTableInC(ByteBuffer _bb, TableInC obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/namespace_test/NamespaceC/TableInC.kt b/tests/namespace_test/NamespaceC/TableInC.kt index efcfe30fb5b..ba6b26c2b9b 100644 --- a/tests/namespace_test/NamespaceC/TableInC.kt +++ b/tests/namespace_test/NamespaceC/TableInC.kt @@ -48,7 +48,7 @@ class TableInC : Table() { } } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsTableInC(_bb: ByteBuffer): TableInC = getRootAsTableInC(_bb, TableInC()) fun getRootAsTableInC(_bb: ByteBuffer, obj: TableInC): TableInC { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/namespace_test/namespace_test1_generated.h b/tests/namespace_test/namespace_test1_generated.h index 1671a738aa9..2dfef1cdb96 100644 --- a/tests/namespace_test/namespace_test1_generated.h +++ b/tests/namespace_test/namespace_test1_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace NamespaceA { diff --git a/tests/namespace_test/namespace_test2_generated.h b/tests/namespace_test/namespace_test2_generated.h index 40659a19e4c..150e1771fa2 100644 --- a/tests/namespace_test/namespace_test2_generated.h +++ b/tests/namespace_test/namespace_test2_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace NamespaceA { diff --git a/tests/native_inline_table_test_generated.h b/tests/native_inline_table_test_generated.h index 6843ce11f8e..7589c885f19 100644 --- a/tests/native_inline_table_test_generated.h +++ b/tests/native_inline_table_test_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); struct NativeInlineTable; diff --git a/tests/native_type_test_generated.h b/tests/native_type_test_generated.h index 43779c0c868..13134d4240e 100644 --- a/tests/native_type_test_generated.h +++ b/tests/native_type_test_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); #include "native_type_test_impl.h" diff --git a/tests/nested_namespace_test/nested_namespace_test3_generated.cs b/tests/nested_namespace_test/nested_namespace_test3_generated.cs index 32be9bedeef..63133da7e7d 100644 --- a/tests/nested_namespace_test/nested_namespace_test3_generated.cs +++ b/tests/nested_namespace_test/nested_namespace_test3_generated.cs @@ -13,7 +13,7 @@ public struct ColorTestTable : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static ColorTestTable GetRootAsColorTestTable(ByteBuffer _bb) { return GetRootAsColorTestTable(_bb, new ColorTestTable()); } public static ColorTestTable GetRootAsColorTestTable(ByteBuffer _bb, ColorTestTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/optional_scalars/OptionalByte.nim b/tests/optional_scalars/OptionalByte.nim index f84c506b270..aca9f820512 100644 --- a/tests/optional_scalars/OptionalByte.nim +++ b/tests/optional_scalars/OptionalByte.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : optional_scalars.ScalarStuff () diff --git a/tests/optional_scalars/ScalarStuff.cs b/tests/optional_scalars/ScalarStuff.cs index 29c601495c8..7442c77d643 100644 --- a/tests/optional_scalars/ScalarStuff.cs +++ b/tests/optional_scalars/ScalarStuff.cs @@ -13,7 +13,7 @@ public struct ScalarStuff : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static ScalarStuff GetRootAsScalarStuff(ByteBuffer _bb) { return GetRootAsScalarStuff(_bb, new ScalarStuff()); } public static ScalarStuff GetRootAsScalarStuff(ByteBuffer _bb, ScalarStuff obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static bool ScalarStuffBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "NULL"); } diff --git a/tests/optional_scalars/ScalarStuff.java b/tests/optional_scalars/ScalarStuff.java index 3e6757320eb..f422d9b9214 100644 --- a/tests/optional_scalars/ScalarStuff.java +++ b/tests/optional_scalars/ScalarStuff.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class ScalarStuff extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static ScalarStuff getRootAsScalarStuff(ByteBuffer _bb) { return getRootAsScalarStuff(_bb, new ScalarStuff()); } public static ScalarStuff getRootAsScalarStuff(ByteBuffer _bb, ScalarStuff obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static boolean ScalarStuffBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "NULL"); } diff --git a/tests/optional_scalars/ScalarStuff.kt b/tests/optional_scalars/ScalarStuff.kt index a178b4266f4..fea80ccb733 100644 --- a/tests/optional_scalars/ScalarStuff.kt +++ b/tests/optional_scalars/ScalarStuff.kt @@ -209,7 +209,7 @@ class ScalarStuff : Table() { return if(o != 0) bb.get(o + bb_pos) else 1 } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsScalarStuff(_bb: ByteBuffer): ScalarStuff = getRootAsScalarStuff(_bb, ScalarStuff()) fun getRootAsScalarStuff(_bb: ByteBuffer, obj: ScalarStuff): ScalarStuff { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/optional_scalars/ScalarStuff.nim b/tests/optional_scalars/ScalarStuff.nim index de8544a601b..7cb4a88aad0 100644 --- a/tests/optional_scalars/ScalarStuff.nim +++ b/tests/optional_scalars/ScalarStuff.nim @@ -2,7 +2,7 @@ Automatically generated by the FlatBuffers compiler, do not modify. Or modify. I'm a message, not a cop. - flatc version: 23.5.26 + flatc version: 24.3.25 Declared by : Rooting type : optional_scalars.ScalarStuff () diff --git a/tests/optional_scalars_generated.h b/tests/optional_scalars_generated.h index 51a0c8818c3..f773c2468fe 100644 --- a/tests/optional_scalars_generated.h +++ b/tests/optional_scalars_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace optional_scalars { diff --git a/tests/swift/Wasm.tests/Tests/FlatBuffers.Test.Swift.WasmTests/monster_test_generated.swift b/tests/swift/Wasm.tests/Tests/FlatBuffers.Test.Swift.WasmTests/monster_test_generated.swift index a51cb5461d7..c678282c9b0 100644 --- a/tests/swift/Wasm.tests/Tests/FlatBuffers.Test.Swift.WasmTests/monster_test_generated.swift +++ b/tests/swift/Wasm.tests/Tests/FlatBuffers.Test.Swift.WasmTests/monster_test_generated.swift @@ -237,7 +237,7 @@ public struct MyGame_Example_AnyAmbiguousAliasesUnion { } public struct MyGame_Example_Test: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _a: Int16 private var _b: Int8 @@ -291,7 +291,7 @@ extension MyGame_Example_Test: Encodable { public struct MyGame_Example_Test_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -318,7 +318,7 @@ public struct MyGame_Example_Test_Mutable: FlatBufferObject { public struct MyGame_Example_Vec3: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _x: Float32 private var _y: Float32 @@ -413,7 +413,7 @@ extension MyGame_Example_Vec3: Encodable { public struct MyGame_Example_Vec3_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -447,7 +447,7 @@ public struct MyGame_Example_Vec3_Mutable: FlatBufferObject { public struct MyGame_Example_Ability: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _id: UInt32 private var _distance: UInt32 @@ -500,7 +500,7 @@ extension MyGame_Example_Ability: Encodable { public struct MyGame_Example_Ability_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -527,7 +527,7 @@ public struct MyGame_Example_Ability_Mutable: FlatBufferObject { public struct MyGame_Example_StructOfStructs: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _a: MyGame_Example_Ability private var _b: MyGame_Example_Test @@ -587,7 +587,7 @@ extension MyGame_Example_StructOfStructs: Encodable { public struct MyGame_Example_StructOfStructs_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -613,7 +613,7 @@ public struct MyGame_Example_StructOfStructs_Mutable: FlatBufferObject { public struct MyGame_Example_StructOfStructsOfStructs: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _a: MyGame_Example_StructOfStructs @@ -655,7 +655,7 @@ extension MyGame_Example_StructOfStructsOfStructs: Encodable { public struct MyGame_Example_StructOfStructsOfStructs_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -679,7 +679,7 @@ public struct MyGame_Example_StructOfStructsOfStructs_Mutable: FlatBufferObject public struct MyGame_InParentNamespace: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -731,7 +731,7 @@ public class MyGame_InParentNamespaceT: NativeObject { } public struct MyGame_Example2_Monster: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -783,7 +783,7 @@ public class MyGame_Example2_MonsterT: NativeObject { } internal struct MyGame_Example_TestSimpleTableWithEnum: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } internal var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -864,7 +864,7 @@ internal class MyGame_Example_TestSimpleTableWithEnumT: NativeObject { } public struct MyGame_Example_Stat: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -1003,7 +1003,7 @@ public class MyGame_Example_StatT: NativeObject { } public struct MyGame_Example_Referrable: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -1109,7 +1109,7 @@ public class MyGame_Example_ReferrableT: NativeObject { /// an example documentation comment: "monster object" public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -2405,7 +2405,7 @@ public class MyGame_Example_MonsterT: NativeObject { } public struct MyGame_Example_TypeAliases: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/tests/swift/tests/CodeGenerationTests/test_import_generated.swift b/tests/swift/tests/CodeGenerationTests/test_import_generated.swift index 65725e9ba8a..cff031f3b59 100644 --- a/tests/swift/tests/CodeGenerationTests/test_import_generated.swift +++ b/tests/swift/tests/CodeGenerationTests/test_import_generated.swift @@ -6,7 +6,7 @@ internal struct Message: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } internal var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/tests/swift/tests/CodeGenerationTests/test_no_include_generated.swift b/tests/swift/tests/CodeGenerationTests/test_no_include_generated.swift index d3d279b3702..be8e8db9c39 100644 --- a/tests/swift/tests/CodeGenerationTests/test_no_include_generated.swift +++ b/tests/swift/tests/CodeGenerationTests/test_no_include_generated.swift @@ -4,7 +4,7 @@ public struct BytesCount: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _x: Int64 @@ -47,7 +47,7 @@ extension BytesCount: Encodable { public struct BytesCount_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -72,7 +72,7 @@ public struct BytesCount_Mutable: FlatBufferObject { public struct InternalMessage: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -155,7 +155,7 @@ public class InternalMessageT: NativeObject { } public struct Message: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/tests/swift/tests/Sources/SwiftFlatBuffers/fuzzer_generated.swift b/tests/swift/tests/Sources/SwiftFlatBuffers/fuzzer_generated.swift index e198e99af32..765415672ca 100644 --- a/tests/swift/tests/Sources/SwiftFlatBuffers/fuzzer_generated.swift +++ b/tests/swift/tests/Sources/SwiftFlatBuffers/fuzzer_generated.swift @@ -32,7 +32,7 @@ extension Color: Encodable { public struct Test: NativeStruct, Verifiable, FlatbuffersInitializable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _a: Int16 private var _b: Int8 @@ -81,7 +81,7 @@ extension Test: Encodable { public struct Test_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -93,7 +93,7 @@ public struct Test_Mutable: FlatBufferObject { public struct Vec3: NativeStruct, Verifiable, FlatbuffersInitializable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _x: Float32 private var _y: Float32 @@ -178,7 +178,7 @@ extension Vec3: Encodable { public struct Vec3_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -195,7 +195,7 @@ public struct Vec3_Mutable: FlatBufferObject { /// an example documentation comment: "monster object" public struct Monster: FlatBufferObject, Verifiable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/MutatingBool_generated.swift b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/MutatingBool_generated.swift index 9ed52b3002c..15f096df7d1 100644 --- a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/MutatingBool_generated.swift +++ b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/MutatingBool_generated.swift @@ -6,7 +6,7 @@ import FlatBuffers public struct Property: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _property: Bool @@ -49,7 +49,7 @@ extension Property: Encodable { public struct Property_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -74,7 +74,7 @@ public struct Property_Mutable: FlatBufferObject { public struct TestMutatingBool: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/monster_test_generated.swift b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/monster_test_generated.swift index a51cb5461d7..c678282c9b0 100644 --- a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/monster_test_generated.swift +++ b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/monster_test_generated.swift @@ -237,7 +237,7 @@ public struct MyGame_Example_AnyAmbiguousAliasesUnion { } public struct MyGame_Example_Test: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _a: Int16 private var _b: Int8 @@ -291,7 +291,7 @@ extension MyGame_Example_Test: Encodable { public struct MyGame_Example_Test_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -318,7 +318,7 @@ public struct MyGame_Example_Test_Mutable: FlatBufferObject { public struct MyGame_Example_Vec3: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _x: Float32 private var _y: Float32 @@ -413,7 +413,7 @@ extension MyGame_Example_Vec3: Encodable { public struct MyGame_Example_Vec3_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -447,7 +447,7 @@ public struct MyGame_Example_Vec3_Mutable: FlatBufferObject { public struct MyGame_Example_Ability: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _id: UInt32 private var _distance: UInt32 @@ -500,7 +500,7 @@ extension MyGame_Example_Ability: Encodable { public struct MyGame_Example_Ability_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -527,7 +527,7 @@ public struct MyGame_Example_Ability_Mutable: FlatBufferObject { public struct MyGame_Example_StructOfStructs: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _a: MyGame_Example_Ability private var _b: MyGame_Example_Test @@ -587,7 +587,7 @@ extension MyGame_Example_StructOfStructs: Encodable { public struct MyGame_Example_StructOfStructs_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -613,7 +613,7 @@ public struct MyGame_Example_StructOfStructs_Mutable: FlatBufferObject { public struct MyGame_Example_StructOfStructsOfStructs: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _a: MyGame_Example_StructOfStructs @@ -655,7 +655,7 @@ extension MyGame_Example_StructOfStructsOfStructs: Encodable { public struct MyGame_Example_StructOfStructsOfStructs_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -679,7 +679,7 @@ public struct MyGame_Example_StructOfStructsOfStructs_Mutable: FlatBufferObject public struct MyGame_InParentNamespace: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -731,7 +731,7 @@ public class MyGame_InParentNamespaceT: NativeObject { } public struct MyGame_Example2_Monster: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -783,7 +783,7 @@ public class MyGame_Example2_MonsterT: NativeObject { } internal struct MyGame_Example_TestSimpleTableWithEnum: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } internal var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -864,7 +864,7 @@ internal class MyGame_Example_TestSimpleTableWithEnumT: NativeObject { } public struct MyGame_Example_Stat: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -1003,7 +1003,7 @@ public class MyGame_Example_StatT: NativeObject { } public struct MyGame_Example_Referrable: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -1109,7 +1109,7 @@ public class MyGame_Example_ReferrableT: NativeObject { /// an example documentation comment: "monster object" public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -2405,7 +2405,7 @@ public class MyGame_Example_MonsterT: NativeObject { } public struct MyGame_Example_TypeAliases: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/more_defaults_generated.swift b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/more_defaults_generated.swift index 6abaaf113e8..3decc7958c6 100644 --- a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/more_defaults_generated.swift +++ b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/more_defaults_generated.swift @@ -29,7 +29,7 @@ extension ABC: Encodable { public struct MoreDefaults: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/nan_inf_test_generated.swift b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/nan_inf_test_generated.swift index f7c179f4b67..ab6c5c42c5a 100644 --- a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/nan_inf_test_generated.swift +++ b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/nan_inf_test_generated.swift @@ -6,7 +6,7 @@ import FlatBuffers public struct Swift_Tests_NanInfTable: FlatBufferObject, Verifiable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/optional_scalars_generated.swift b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/optional_scalars_generated.swift index 13598192072..57e9a5799ca 100644 --- a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/optional_scalars_generated.swift +++ b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/optional_scalars_generated.swift @@ -29,7 +29,7 @@ extension optional_scalars_OptionalByte: Encodable { public struct optional_scalars_ScalarStuff: FlatBufferObject, Verifiable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/union_vector_generated.swift b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/union_vector_generated.swift index e35bf6024c2..63f10cfe8d7 100644 --- a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/union_vector_generated.swift +++ b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/union_vector_generated.swift @@ -120,7 +120,7 @@ public struct GadgetUnion { } public struct Rapunzel: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _hairLength: Int32 @@ -163,7 +163,7 @@ extension Rapunzel: Encodable { public struct Rapunzel_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -188,7 +188,7 @@ public struct Rapunzel_Mutable: FlatBufferObject { public struct BookReader: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _booksRead: Int32 @@ -231,7 +231,7 @@ extension BookReader: Encodable { public struct BookReader_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -256,7 +256,7 @@ public struct BookReader_Mutable: FlatBufferObject { public struct FallingTub: NativeStruct, Verifiable, FlatbuffersInitializable, NativeObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } private var _weight: Int32 @@ -299,7 +299,7 @@ extension FallingTub: Encodable { public struct FallingTub_Mutable: FlatBufferObject { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Struct @@ -324,7 +324,7 @@ public struct FallingTub_Mutable: FlatBufferObject { public struct Attacker: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -405,7 +405,7 @@ public class AttackerT: NativeObject { } public struct HandFan: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table @@ -486,7 +486,7 @@ public class HandFanT: NativeObject { } public struct Movie: FlatBufferObject, Verifiable, ObjectAPIPacker { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/vector_has_test_generated.swift b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/vector_has_test_generated.swift index bc991923cc2..c03392a56ed 100644 --- a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/vector_has_test_generated.swift +++ b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/vector_has_test_generated.swift @@ -6,7 +6,7 @@ import FlatBuffers public struct Swift_Tests_Vectors: FlatBufferObject, Verifiable { - static func validateVersion() { FlatBuffersVersion_23_5_26() } + static func validateVersion() { FlatBuffersVersion_24_3_25() } public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table diff --git a/tests/ts/BUILD.bazel b/tests/ts/BUILD.bazel index 82635450b7e..ee97f8fde70 100644 --- a/tests/ts/BUILD.bazel +++ b/tests/ts/BUILD.bazel @@ -1,8 +1,19 @@ load("@aspect_rules_js//js:defs.bzl", "js_test") +load("@aspect_rules_js//npm:defs.bzl", "npm_link_package") load("//:typescript.bzl", "flatbuffer_ts_library") +load("//tests:defs.bzl", "flatbuffers_as_external_repo_test") package(default_visibility = ["//visibility:private"]) +# This is a copy of //ts:node_modules/flatbuffers. The rules_js-based tests +# require this target to live in the same or a parent package. Since we don't +# want to put rules_js targets in the root package, we create a copy here. +npm_link_package( + name = "node_modules/flatbuffers", + src = "//ts:flatbuffers", + root_package = "tests/ts", +) + flatbuffer_ts_library( name = "typescript_ts_fbs", srcs = ["typescript_keywords.fbs"], @@ -37,8 +48,8 @@ TEST_COMPLEX_ARRAYS_DATA = glob([ chdir = package_name(), data = data + [ "package.json", - "//:node_modules/flatbuffers", "//tests:test_data_copied_to_bin", + "//tests/ts:node_modules/flatbuffers", ], entry_point = "%s.js" % test, ) for test, data in ( @@ -50,29 +61,7 @@ TEST_COMPLEX_ARRAYS_DATA = glob([ ("JavaScriptComplexArraysTest", TEST_COMPLEX_ARRAYS_DATA), )] -sh_test( +flatbuffers_as_external_repo_test( name = "bazel_repository_test", - srcs = ["bazel_repository_test.sh"], - data = [ - "//:distribution", - "@bazel_linux_x86_64//file", - ] + glob( - [ - "bazel_repository_test_dir/**/*", - ], - exclude = [ - "bazel_repository_test_dir/bazel-*/**", - ], - ), - tags = [ - # Since we have bazel downloading external repositories inside this - # test, we need to give it access to the internet. - "requires-network", - ], - # We only have x86_64 Linux bazel exposed so restrict the test to that. - target_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os:linux", - ], - deps = ["@bazel_tools//tools/bash/runfiles"], + directory = "bazel_repository_test_dir", ) diff --git a/tests/ts/bazel_repository_test_dir/BUILD.bazel b/tests/ts/bazel_repository_test_dir/BUILD.bazel index f6b01c5ec30..8b97909d34f 100644 --- a/tests/ts/bazel_repository_test_dir/BUILD.bazel +++ b/tests/ts/bazel_repository_test_dir/BUILD.bazel @@ -30,3 +30,12 @@ js_test( ], entry_point = "import_test.js", ) + +js_test( + name = "independent_deps_test", + data = [ + "package.json", + ":node_modules/lodash", + ], + entry_point = "independent_deps_test.js", +) diff --git a/tests/ts/bazel_repository_test_dir/README.md b/tests/ts/bazel_repository_test_dir/README.md new file mode 100644 index 00000000000..a8bf76e1831 --- /dev/null +++ b/tests/ts/bazel_repository_test_dir/README.md @@ -0,0 +1,8 @@ +This directory is not intended to be used independently of the flatbuffers +repository. Instead, this whole directory serves as a unit test for the +`rules_js` integration in the flatbuffers repo. + +Run this test from the top-level of the flatbuffers repo. +```console +$ bazel test //tests/ts:bazel_repository_test +``` diff --git a/tests/ts/bazel_repository_test_dir/WORKSPACE b/tests/ts/bazel_repository_test_dir/WORKSPACE index f7ef4541f38..27fb8d6a468 100644 --- a/tests/ts/bazel_repository_test_dir/WORKSPACE +++ b/tests/ts/bazel_repository_test_dir/WORKSPACE @@ -46,8 +46,12 @@ nodejs_register_toolchains( npm_translate_lock( name = "npm", + data = [ + "//:package.json", + ], npmrc = "//:.npmrc", pnpm_lock = "//:pnpm-lock.yaml", + update_pnpm_lock = False, verify_node_modules_ignored = "//:.bazelignore", ) @@ -69,3 +73,13 @@ esbuild_register_toolchains( name = "esbuild", esbuild_version = LATEST_VERSION, ) + +load("@com_github_google_flatbuffers//ts:repositories.bzl", "flatbuffers_npm") + +flatbuffers_npm( + name = "flatbuffers_npm", +) + +load("@flatbuffers_npm//:repositories.bzl", flatbuffers_npm_repositories = "npm_repositories") + +flatbuffers_npm_repositories() diff --git a/tests/ts/bazel_repository_test_dir/independent_deps_test.js b/tests/ts/bazel_repository_test_dir/independent_deps_test.js new file mode 100644 index 00000000000..02f72b4867e --- /dev/null +++ b/tests/ts/bazel_repository_test_dir/independent_deps_test.js @@ -0,0 +1,18 @@ +// This test has nothing to do with flatbuffers. It only exists to validate +// that other projects can use their own set of dependencies without having to +// explicitly pull in flatbuffers's dependencies. +// +// We pick lodash here not for any particular reason. It could be any package, +// really. I chose it because it's a relatively simple package. + +import assert from 'node:assert/strict' + +import _ from 'lodash' + +function main() { + console.log(_); + assert.deepStrictEqual(_.defaults({ 'a': 1 }, { 'a': 3, 'b': 2 }), { 'a': 1, 'b': 2 }); + assert.deepStrictEqual(_.partition([1, 2, 3, 4], n => n % 2), [[1, 3], [2, 4]]); +} + +main(); diff --git a/tests/ts/bazel_repository_test_dir/package.json b/tests/ts/bazel_repository_test_dir/package.json index 7bab70109d7..2988b7e80f3 100644 --- a/tests/ts/bazel_repository_test_dir/package.json +++ b/tests/ts/bazel_repository_test_dir/package.json @@ -3,6 +3,6 @@ "type": "module", "private": true, "devDependencies": { - "@types/node": "18.15.11" + "lodash": "4.17.21" } } diff --git a/tests/ts/bazel_repository_test_dir/pnpm-lock.yaml b/tests/ts/bazel_repository_test_dir/pnpm-lock.yaml index 331070a317b..09183910901 100644 --- a/tests/ts/bazel_repository_test_dir/pnpm-lock.yaml +++ b/tests/ts/bazel_repository_test_dir/pnpm-lock.yaml @@ -1,12 +1,12 @@ lockfileVersion: '6.0' devDependencies: - '@types/node': - specifier: 18.15.11 - version: 18.15.11 + lodash: + specifier: 4.17.21 + version: 4.17.21 packages: - /@types/node@18.15.11: - resolution: {integrity: sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==} + /lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true diff --git a/tests/ts/test_dir/BUILD.bazel b/tests/ts/test_dir/BUILD.bazel index 6026d9ff569..fdd54ded39b 100644 --- a/tests/ts/test_dir/BUILD.bazel +++ b/tests/ts/test_dir/BUILD.bazel @@ -20,7 +20,7 @@ js_test( data = [ "package.json", ":include_ts_fbs", - "//:node_modules/flatbuffers", + "//tests/ts:node_modules/flatbuffers", ], entry_point = "import_test.js", ) diff --git a/tests/type_field_collsion/Collision.cs b/tests/type_field_collsion/Collision.cs index a33b39d3fbe..88188c6662f 100644 --- a/tests/type_field_collsion/Collision.cs +++ b/tests/type_field_collsion/Collision.cs @@ -13,7 +13,7 @@ public struct Collision : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static Collision GetRootAsCollision(ByteBuffer _bb) { return GetRootAsCollision(_bb, new Collision()); } public static Collision GetRootAsCollision(ByteBuffer _bb, Collision obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static bool VerifyCollision(ByteBuffer _bb) {Google.FlatBuffers.Verifier verifier = new Google.FlatBuffers.Verifier(_bb); return verifier.VerifyBuffer("", false, CollisionVerify.Verify); } diff --git a/tests/union_underlying_type_test_generated.h b/tests/union_underlying_type_test_generated.h index cd822ec5178..a4adaa6b36c 100644 --- a/tests/union_underlying_type_test_generated.h +++ b/tests/union_underlying_type_test_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); namespace UnionUnderlyingType { diff --git a/tests/union_value_collsion/union_value_collision_generated.cs b/tests/union_value_collsion/union_value_collision_generated.cs index e741e9afb18..bcc6251c9ec 100644 --- a/tests/union_value_collsion/union_value_collision_generated.cs +++ b/tests/union_value_collsion/union_value_collision_generated.cs @@ -189,7 +189,7 @@ public struct IntValue : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static IntValue GetRootAsIntValue(ByteBuffer _bb) { return GetRootAsIntValue(_bb, new IntValue()); } public static IntValue GetRootAsIntValue(ByteBuffer _bb, IntValue obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } @@ -250,7 +250,7 @@ public struct Collide : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static Collide GetRootAsCollide(ByteBuffer _bb) { return GetRootAsCollide(_bb, new Collide()); } public static Collide GetRootAsCollide(ByteBuffer _bb, Collide obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } @@ -365,7 +365,7 @@ public struct Collision : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static Collision GetRootAsCollision(ByteBuffer _bb) { return GetRootAsCollision(_bb, new Collision()); } public static Collision GetRootAsCollision(ByteBuffer _bb, Collision obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static bool VerifyCollision(ByteBuffer _bb) {Google.FlatBuffers.Verifier verifier = new Google.FlatBuffers.Verifier(_bb); return verifier.VerifyBuffer("", false, CollisionVerify.Verify); } diff --git a/tests/union_vector/Attacker.cs b/tests/union_vector/Attacker.cs index 1990670e06b..12b04da8934 100644 --- a/tests/union_vector/Attacker.cs +++ b/tests/union_vector/Attacker.cs @@ -10,7 +10,7 @@ public struct Attacker : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static Attacker GetRootAsAttacker(ByteBuffer _bb) { return GetRootAsAttacker(_bb, new Attacker()); } public static Attacker GetRootAsAttacker(ByteBuffer _bb, Attacker obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/union_vector/Attacker.java b/tests/union_vector/Attacker.java index 2a4fa23a6ce..975a5143ac6 100644 --- a/tests/union_vector/Attacker.java +++ b/tests/union_vector/Attacker.java @@ -19,7 +19,7 @@ @SuppressWarnings("unused") public final class Attacker extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Attacker getRootAsAttacker(ByteBuffer _bb) { return getRootAsAttacker(_bb, new Attacker()); } public static Attacker getRootAsAttacker(ByteBuffer _bb, Attacker obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/union_vector/Attacker.kt b/tests/union_vector/Attacker.kt index a623f8d1f02..e2d783a9d1a 100644 --- a/tests/union_vector/Attacker.kt +++ b/tests/union_vector/Attacker.kt @@ -41,7 +41,7 @@ class Attacker : Table() { } } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsAttacker(_bb: ByteBuffer): Attacker = getRootAsAttacker(_bb, Attacker()) fun getRootAsAttacker(_bb: ByteBuffer, obj: Attacker): Attacker { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/union_vector/HandFan.cs b/tests/union_vector/HandFan.cs index 4b1d160db2a..23bf52d0348 100644 --- a/tests/union_vector/HandFan.cs +++ b/tests/union_vector/HandFan.cs @@ -10,7 +10,7 @@ public struct HandFan : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static HandFan GetRootAsHandFan(ByteBuffer _bb) { return GetRootAsHandFan(_bb, new HandFan()); } public static HandFan GetRootAsHandFan(ByteBuffer _bb, HandFan obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } diff --git a/tests/union_vector/HandFan.java b/tests/union_vector/HandFan.java index 8209c945b12..7eb92f0efde 100644 --- a/tests/union_vector/HandFan.java +++ b/tests/union_vector/HandFan.java @@ -19,7 +19,7 @@ @SuppressWarnings("unused") public final class HandFan extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static HandFan getRootAsHandFan(ByteBuffer _bb) { return getRootAsHandFan(_bb, new HandFan()); } public static HandFan getRootAsHandFan(ByteBuffer _bb, HandFan obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } diff --git a/tests/union_vector/HandFan.kt b/tests/union_vector/HandFan.kt index d1e4ba79414..f6d5b856c2e 100644 --- a/tests/union_vector/HandFan.kt +++ b/tests/union_vector/HandFan.kt @@ -41,7 +41,7 @@ class HandFan : Table() { } } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsHandFan(_bb: ByteBuffer): HandFan = getRootAsHandFan(_bb, HandFan()) fun getRootAsHandFan(_bb: ByteBuffer, obj: HandFan): HandFan { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/union_vector/Movie.cs b/tests/union_vector/Movie.cs index 8e75f7c532f..f8f9ee838a9 100644 --- a/tests/union_vector/Movie.cs +++ b/tests/union_vector/Movie.cs @@ -10,7 +10,7 @@ public struct Movie : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } - public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static Movie GetRootAsMovie(ByteBuffer _bb) { return GetRootAsMovie(_bb, new Movie()); } public static Movie GetRootAsMovie(ByteBuffer _bb, Movie obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public static bool MovieBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "MOVI"); } diff --git a/tests/union_vector/Movie.java b/tests/union_vector/Movie.java index 78695ca316e..3debb2de24f 100644 --- a/tests/union_vector/Movie.java +++ b/tests/union_vector/Movie.java @@ -19,7 +19,7 @@ @SuppressWarnings("unused") public final class Movie extends Table { - public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); } + public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); } public static Movie getRootAsMovie(ByteBuffer _bb) { return getRootAsMovie(_bb, new Movie()); } public static Movie getRootAsMovie(ByteBuffer _bb, Movie obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static boolean MovieBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "MOVI"); } diff --git a/tests/union_vector/Movie.kt b/tests/union_vector/Movie.kt index 9d97a19355a..e0ab8760a7d 100644 --- a/tests/union_vector/Movie.kt +++ b/tests/union_vector/Movie.kt @@ -79,7 +79,7 @@ class Movie : Table() { val o = __offset(10); return if (o != 0) __vector_len(o) else 0 } companion object { - fun validateVersion() = Constants.FLATBUFFERS_23_5_26() + fun validateVersion() = Constants.FLATBUFFERS_24_3_25() fun getRootAsMovie(_bb: ByteBuffer): Movie = getRootAsMovie(_bb, Movie()) fun getRootAsMovie(_bb: ByteBuffer, obj: Movie): Movie { _bb.order(ByteOrder.LITTLE_ENDIAN) diff --git a/tests/union_vector/union_vector_generated.h b/tests/union_vector/union_vector_generated.h index 99eabb985fe..0ab015361b3 100644 --- a/tests/union_vector/union_vector_generated.h +++ b/tests/union_vector/union_vector_generated.h @@ -8,9 +8,9 @@ // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. -static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && - FLATBUFFERS_VERSION_MINOR == 5 && - FLATBUFFERS_VERSION_REVISION == 26, +static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && + FLATBUFFERS_VERSION_MINOR == 3 && + FLATBUFFERS_VERSION_REVISION == 25, "Non-compatible flatbuffers version included"); struct Attacker; diff --git a/ts/BUILD.bazel b/ts/BUILD.bazel index 9bd9f4be31a..804faea619a 100644 --- a/ts/BUILD.bazel +++ b/ts/BUILD.bazel @@ -1,17 +1,21 @@ load("@aspect_rules_js//npm:defs.bzl", "npm_package") load("@aspect_rules_ts//ts:defs.bzl", "ts_project") +load("@flatbuffers_npm//:npm_link_all_packages.bzl", "npm_link_all_packages") filegroup( name = "distribution", srcs = [ "BUILD.bazel", "compile_flat_file.sh", + "repositories.bzl", ] + glob([ "*.ts", ]), visibility = ["//visibility:public"], ) +npm_link_all_packages(name = "node_modules") + # Add an index to emulate the top-level package.json's "main" entry. genrule( name = "generate_index.ts", @@ -48,9 +52,7 @@ ts_project( }, visibility = ["//visibility:public"], deps = [ - # Because the main repository instantiates the @npm repository, we need - # to depend on the main repository's node import. - "@//:node_modules/@types/node", + ":node_modules/@types/node", ], ) diff --git a/ts/repositories.bzl b/ts/repositories.bzl new file mode 100644 index 00000000000..284d3d2ac72 --- /dev/null +++ b/ts/repositories.bzl @@ -0,0 +1,23 @@ +"""WORKSPACE macro to load flatbuffers's npm package list.""" + +load("@aspect_rules_js//npm:npm_import.bzl", _npm_translate_lock = "npm_translate_lock") + +def flatbuffers_npm(name): + _npm_translate_lock( + name = name, + npmrc = "@com_github_google_flatbuffers//:.npmrc", + pnpm_lock = "@com_github_google_flatbuffers//:pnpm-lock.yaml", + # Override the Bazel package where pnpm-lock.yaml is located and link + # to the specified package instead. + root_package = "ts", + # Set this to True when the lock file needs to be updated, commit the + # changes, then set to False again. + # Alternatively, run: + # $ bazel run -- @pnpm//:pnpm --dir $PWD install --lockfile-only + update_pnpm_lock = False, + verify_node_modules_ignored = "@com_github_google_flatbuffers//:.bazelignore", + defs_bzl_filename = "npm_link_all_packages.bzl", + data = [ + "@com_github_google_flatbuffers//:package.json", + ], + )