Skip to content

Commit

Permalink
FlatBuffers Version 2.0.8 (google#7492)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaileychess authored and Jochen Parmentier committed Oct 29, 2024
1 parent 920c426 commit 92a73d2
Show file tree
Hide file tree
Showing 125 changed files with 198 additions and 180 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ 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.

## 2.0.8 (Aug 29 2022)

* Fix for `--keep-prefix` the was generating the wrong include statements for
C++ (#7469). The bug was introduced in 2.0.7.

* Added the `Verifier::Options` option struct to allow specifying runtime
configuration settings for the verifier (#7489). This allows to skip verifying
nested flatbuffers, a on-by-default change that was introduced in 2.0.7. This
deprecates the existing `Verifier` constructor, which may be removed in a future
version.

* Refactor of `tests/test.cpp` that lead to ~10% speedup in compilation of the
entire project (#7487).

## 2.0.7 (Aug 22 2022)

* This is the first version with an explicit change log, so all the previous
Expand Down
2 changes: 1 addition & 1 deletion CMake/Version.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(VERSION_MAJOR 2)
set(VERSION_MINOR 0)
set(VERSION_PATCH 7)
set(VERSION_PATCH 8)
set(VERSION_COMMIT 0)

find_program(GIT git)
Expand Down
2 changes: 1 addition & 1 deletion dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: flat_buffers
version: 2.0.5
version: 2.0.8
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import FlatBuffers

public struct models_HelloReply: FlatBufferObject, Verifiable {

static func validateVersion() { FlatBuffersVersion_2_0_0() }
static func validateVersion() { FlatBuffersVersion_2_0_8() }
public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table

Expand Down Expand Up @@ -55,7 +55,7 @@ extension models_HelloReply: Encodable {

public struct models_HelloRequest: FlatBufferObject, Verifiable {

static func validateVersion() { FlatBuffersVersion_2_0_0() }
static func validateVersion() { FlatBuffersVersion_2_0_8() }
public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table

Expand Down
2 changes: 1 addition & 1 deletion include/flatbuffers/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@

#define FLATBUFFERS_VERSION_MAJOR 2
#define FLATBUFFERS_VERSION_MINOR 0
#define FLATBUFFERS_VERSION_REVISION 7
#define FLATBUFFERS_VERSION_REVISION 8
#define FLATBUFFERS_STRING_EXPAND(X) #X
#define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X)
namespace flatbuffers {
Expand Down
2 changes: 1 addition & 1 deletion include/flatbuffers/reflection_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 2 &&
FLATBUFFERS_VERSION_MINOR == 0 &&
FLATBUFFERS_VERSION_REVISION == 7,
FLATBUFFERS_VERSION_REVISION == 8,
"Non-compatible flatbuffers version included");

namespace reflection {
Expand Down
2 changes: 1 addition & 1 deletion java/com/google/flatbuffers/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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_2_0_0() {}
public static void FLATBUFFERS_2_0_8() {}
}

/// @endcond
2 changes: 1 addition & 1 deletion net/FlatBuffers/FlatBufferConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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_2_0_0() {}
public static void FLATBUFFERS_2_0_8() {}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flatbuffers",
"version": "2.0.7",
"version": "2.0.8",
"description": "Memory Efficient Serialization Library",
"files": [
"js/**/*.js",
Expand Down
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers-java</artifactId>
<version>2.0.3</version>
<version>2.0.8</version>
<packaging>bundle</packaging>
<name>FlatBuffers Java API</name>
<description>
Expand All @@ -13,6 +13,10 @@
<developer>
<name>Wouter van Oortmerssen</name>
</developer>
<developer>
<name>Derek Bailey</name>
<email>dbaileychess@gmail.com</email>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
2 changes: 1 addition & 1 deletion python/flatbuffers/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

# Placeholder, to be updated during the release process
# by the setup.py
__version__ = u"latest"
__version__ = u"2.0.8"
2 changes: 1 addition & 1 deletion samples/monster_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 2 &&
FLATBUFFERS_VERSION_MINOR == 0 &&
FLATBUFFERS_VERSION_REVISION == 7,
FLATBUFFERS_VERSION_REVISION == 8,
"Non-compatible flatbuffers version included");

namespace MyGame {
Expand Down
8 changes: 4 additions & 4 deletions samples/monster_generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public enum MyGame_Sample_Equipment: UInt8, Enum {

public struct MyGame_Sample_Vec3: NativeStruct {

static func validateVersion() { FlatBuffersVersion_2_0_0() }
static func validateVersion() { FlatBuffersVersion_2_0_8() }

private var _x: Float32
private var _y: Float32
Expand All @@ -56,7 +56,7 @@ public struct MyGame_Sample_Vec3: NativeStruct {

public struct MyGame_Sample_Vec3_Mutable: FlatBufferObject {

static func validateVersion() { FlatBuffersVersion_2_0_0() }
static func validateVersion() { FlatBuffersVersion_2_0_8() }
public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Struct

Expand All @@ -72,7 +72,7 @@ public struct MyGame_Sample_Vec3_Mutable: FlatBufferObject {

public struct MyGame_Sample_Monster: FlatBufferObject {

static func validateVersion() { FlatBuffersVersion_2_0_0() }
static func validateVersion() { FlatBuffersVersion_2_0_8() }
public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table

Expand Down Expand Up @@ -162,7 +162,7 @@ public struct MyGame_Sample_Monster: FlatBufferObject {

public struct MyGame_Sample_Weapon: FlatBufferObject {

static func validateVersion() { FlatBuffersVersion_2_0_0() }
static func validateVersion() { FlatBuffersVersion_2_0_8() }
public var __buffer: ByteBuffer! { return _accessor.bb }
private var _accessor: Table

Expand Down
4 changes: 2 additions & 2 deletions src/idl_gen_csharp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,11 @@ class CSharpGenerator : public BaseGenerator {
code += " public ByteBuffer ByteBuffer { get { return __p.bb; } }\n";

if (!struct_def.fixed) {
// Generate verson check method.
// Generate version check method.
// Force compile time error if not using the same version runtime.
code += " public static void ValidateVersion() {";
code += " FlatBufferConstants.";
code += "FLATBUFFERS_2_0_0(); ";
code += "FLATBUFFERS_2_0_8(); ";
code += "}\n";

// Generate a special accessor for the table that when used as the root
Expand Down
4 changes: 2 additions & 2 deletions src/idl_gen_java.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,11 +661,11 @@ class JavaGenerator : public BaseGenerator {
code += " {\n";

if (!struct_def.fixed) {
// Generate verson check method.
// Generate version check method.
// Force compile time error if not using the same version runtime.
code += " public static void ValidateVersion() {";
code += " Constants.";
code += "FLATBUFFERS_2_0_0(); ";
code += "FLATBUFFERS_2_0_8(); ";
code += "}\n";

// Generate a special accessor for the table that when used as the root
Expand Down
4 changes: 2 additions & 2 deletions src/idl_gen_kotlin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,12 @@ class KotlinGenerator : public BaseGenerator {
if (!struct_def.fixed) {
FieldDef *key_field = nullptr;

// Generate verson check method.
// Generate version check method.
// Force compile time error if not using the same version
// runtime.
GenerateFunOneLine(
writer, "validateVersion", "", "",
[&]() { writer += "Constants.FLATBUFFERS_2_0_0()"; },
[&]() { writer += "Constants.FLATBUFFERS_2_0_8()"; },
options.gen_jvmstatic);

GenerateGetRootAsAccessors(namer_.Type(struct_def), writer, options);
Expand Down
2 changes: 1 addition & 1 deletion src/idl_gen_swift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,7 @@ class SwiftGenerator : public BaseGenerator {
}

std::string ValidateFunc() {
return "static func validateVersion() { FlatBuffersVersion_2_0_0() }";
return "static func validateVersion() { FlatBuffersVersion_2_0_8() }";
}

std::string GenType(const Type &type,
Expand Down
2 changes: 1 addition & 1 deletion swift/Sources/FlatBuffers/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ extension UInt64: Scalar, Verifiable {
public typealias NumericValue = UInt64
}

public func FlatBuffersVersion_2_0_0() {}
public func FlatBuffersVersion_2_0_8() {}
2 changes: 1 addition & 1 deletion tests/DictionaryLookup/LongFloatEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@SuppressWarnings("unused")
public final class LongFloatEntry extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_2_0_0(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_2_0_8(); }
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); }
Expand Down
2 changes: 1 addition & 1 deletion tests/DictionaryLookup/LongFloatEntry.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LongFloatEntry : Table() {
return (val_1 - val_2).sign
}
companion object {
fun validateVersion() = Constants.FLATBUFFERS_2_0_0()
fun validateVersion() = Constants.FLATBUFFERS_2_0_8()
fun getRootAsLongFloatEntry(_bb: ByteBuffer): LongFloatEntry = getRootAsLongFloatEntry(_bb, LongFloatEntry())
fun getRootAsLongFloatEntry(_bb: ByteBuffer, obj: LongFloatEntry): LongFloatEntry {
_bb.order(ByteOrder.LITTLE_ENDIAN)
Expand Down
2 changes: 1 addition & 1 deletion tests/DictionaryLookup/LongFloatMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@SuppressWarnings("unused")
public final class LongFloatMap extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_2_0_0(); }
public static void ValidateVersion() { Constants.FLATBUFFERS_2_0_8(); }
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); }
Expand Down
2 changes: 1 addition & 1 deletion tests/DictionaryLookup/LongFloatMap.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class LongFloatMap : Table() {
}
}
companion object {
fun validateVersion() = Constants.FLATBUFFERS_2_0_0()
fun validateVersion() = Constants.FLATBUFFERS_2_0_8()
fun getRootAsLongFloatMap(_bb: ByteBuffer): LongFloatMap = getRootAsLongFloatMap(_bb, LongFloatMap())
fun getRootAsLongFloatMap(_bb: ByteBuffer, obj: LongFloatMap): LongFloatMap {
_bb.order(ByteOrder.LITTLE_ENDIAN)
Expand Down
Loading

0 comments on commit 92a73d2

Please sign in to comment.