Skip to content

Commit

Permalink
Merge branch '18-append-v4-to-modpath' into 'dev'
Browse files Browse the repository at this point in the history
Append v4 to module path #18

See merge request objectbox/objectbox-generator!25
  • Loading branch information
dan-obx committed Aug 22, 2024
2 parents 8753ad3 + de0c3cc commit 8069e1d
Show file tree
Hide file tree
Showing 43 changed files with 92 additions and 92 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# ObjectBox Generator

Current version: 4.0.0-alpha2
Current version: 4.0.0-beta

ObjectBox is a superfast cross-platform object-oriented database.
ObjectBox Generator produces code for ObjectBox C, C++ and Go APIs (more languages to be supported in the future).
Expand Down
4 changes: 2 additions & 2 deletions cmake/FindObjectBoxGenerator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The following variables are defined by this module:
.. variable:: ObjectBoxGenerator_VERSION
The full version string of the used ObjectBox Generator executable, e.g. "4.0.0" or "4.0.0-alpha2".
The full version string of the used ObjectBox Generator executable, e.g. "4.0.0" or "4.0.0-beta".
.. variable:: ObjectBoxGenerator_VERSION_MAJOR
.. variable:: ObjectBoxGenerator_VERSION_MINOR
Expand Down Expand Up @@ -128,7 +128,7 @@ Generated headers and sources are written to the sub-directories ``ObjectBoxGene
option(OBX_GENERATOR_ALLOW_FETCH "Opt-in automatic download and prepare for local execution" ON)

# Updated by maintainer to latest available version:
set(ObjectBoxGenerator_FETCH_VERSION 4.0.0-alpha2) # Note: must be safe for filename
set(ObjectBoxGenerator_FETCH_VERSION 4.0.0-beta) # Note: must be safe for filename
# Using the version in the directories used for the generator executable to cleanly support multiple versions.
# This is e.g. relevant when updating to ensure fetching the new version.
set(ObjectBoxGenerator_FETCH_DIR ${CMAKE_BINARY_DIR}/ObjectBoxGenerator-download/${ObjectBoxGenerator_FETCH_VERSION}/fetch)
Expand Down
2 changes: 1 addition & 1 deletion cmd/generatorcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"fmt"
"os"

"github.com/objectbox/objectbox-generator/internal/generator"
"github.com/objectbox/objectbox-generator/v4/internal/generator"
)

const defaultErrorCode = 2
Expand Down
10 changes: 5 additions & 5 deletions cmd/objectbox-generator/objectbox-generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import (
"os"
"strings"

generatorcmd "github.com/objectbox/objectbox-generator/cmd"
"github.com/objectbox/objectbox-generator/internal/generator"
cgenerator "github.com/objectbox/objectbox-generator/internal/generator/c"
"github.com/objectbox/objectbox-generator/internal/generator/flatbuffersc"
gogenerator "github.com/objectbox/objectbox-generator/internal/generator/go"
generatorcmd "github.com/objectbox/objectbox-generator/v4/cmd"
"github.com/objectbox/objectbox-generator/v4/internal/generator"
cgenerator "github.com/objectbox/objectbox-generator/v4/internal/generator/c"
"github.com/objectbox/objectbox-generator/v4/internal/generator/flatbuffersc"
gogenerator "github.com/objectbox/objectbox-generator/v4/internal/generator/go"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions cmd/objectbox-gogen/gogen.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
"fmt"
"os"

generatorcmd "github.com/objectbox/objectbox-generator/cmd"
"github.com/objectbox/objectbox-generator/internal/generator"
gogenerator "github.com/objectbox/objectbox-generator/internal/generator/go"
generatorcmd "github.com/objectbox/objectbox-generator/v4/cmd"
"github.com/objectbox/objectbox-generator/v4/internal/generator"
gogenerator "github.com/objectbox/objectbox-generator/v4/internal/generator/go"
)

const VersionId = generator.VersionId
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/objectbox/objectbox-generator
module github.com/objectbox/objectbox-generator/v4

go 1.11

Expand Down
2 changes: 1 addition & 1 deletion internal/generator/binding/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"strconv"
"strings"

"github.com/objectbox/objectbox-generator/internal/generator/model"
"github.com/objectbox/objectbox-generator/v4/internal/generator/model"
)

// Field holds common field/property information used by specialized code parsers/generators.
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/binding/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"strconv"
"strings"

"github.com/objectbox/objectbox-generator/internal/generator/model"
"github.com/objectbox/objectbox-generator/v4/internal/generator/model"
)

// Object holds common entity information used by specialized code parsers/generators.
Expand Down
8 changes: 4 additions & 4 deletions internal/generator/c/cgenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
"strings"
"text/template"

"github.com/objectbox/objectbox-generator/internal/generator"
"github.com/objectbox/objectbox-generator/internal/generator/c/templates"
"github.com/objectbox/objectbox-generator/internal/generator/flatbuffersc"
"github.com/objectbox/objectbox-generator/internal/generator/model"
"github.com/objectbox/objectbox-generator/v4/internal/generator"
"github.com/objectbox/objectbox-generator/v4/internal/generator/c/templates"
"github.com/objectbox/objectbox-generator/v4/internal/generator/flatbuffersc"
"github.com/objectbox/objectbox-generator/v4/internal/generator/model"
)

type CGenerator struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/generator/c/maps.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ package cgenerator
import (
flatbuffers "github.com/google/flatbuffers/go"

"github.com/objectbox/objectbox-generator/internal/generator/flatbuffersc/reflection"
"github.com/objectbox/objectbox-generator/internal/generator/model"
"github.com/objectbox/objectbox-generator/v4/internal/generator/flatbuffersc/reflection"
"github.com/objectbox/objectbox-generator/v4/internal/generator/model"
)

var fbsTypeToObxType = map[reflection.BaseType]model.PropertyType{
Expand Down
6 changes: 3 additions & 3 deletions internal/generator/c/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"sort"
"strings"

"github.com/objectbox/objectbox-generator/internal/generator/binding"
"github.com/objectbox/objectbox-generator/internal/generator/flatbuffersc/reflection"
"github.com/objectbox/objectbox-generator/internal/generator/model"
"github.com/objectbox/objectbox-generator/v4/internal/generator/binding"
"github.com/objectbox/objectbox-generator/v4/internal/generator/flatbuffersc/reflection"
"github.com/objectbox/objectbox-generator/v4/internal/generator/model"
)

type fbsObject struct {
Expand Down
6 changes: 3 additions & 3 deletions internal/generator/c/schema-reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"sort"
"strings"

"github.com/objectbox/objectbox-generator/internal/generator/binding"
"github.com/objectbox/objectbox-generator/internal/generator/flatbuffersc/reflection"
"github.com/objectbox/objectbox-generator/internal/generator/model"
"github.com/objectbox/objectbox-generator/v4/internal/generator/binding"
"github.com/objectbox/objectbox-generator/v4/internal/generator/flatbuffersc/reflection"
"github.com/objectbox/objectbox-generator/v4/internal/generator/model"
)

var supportedEntityAnnotations = map[string]bool{
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/c/templates/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"strings"
"text/template"

"github.com/objectbox/objectbox-generator/internal/generator/model"
"github.com/objectbox/objectbox-generator/v4/internal/generator/model"
)

// cccToUc converts CapitalCamelCase to UPPER_CASE - only used converty Go PropertyFlags names to C/Core names.
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/flatbuffersc/fbsc.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"fmt"
"unsafe"

"github.com/objectbox/objectbox-generator/internal/generator/flatbuffersc/reflection"
"github.com/objectbox/objectbox-generator/v4/internal/generator/flatbuffersc/reflection"
)

func ParseSchemaFile(filename string) (*reflection.Schema, error) {
Expand Down
4 changes: 2 additions & 2 deletions internal/generator/flatbuffersc/fbsc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"strings"
"testing"

"github.com/objectbox/objectbox-generator/internal/generator/flatbuffersc/reflection"
"github.com/objectbox/objectbox-generator/test/assert"
"github.com/objectbox/objectbox-generator/v4/internal/generator/flatbuffersc/reflection"
"github.com/objectbox/objectbox-generator/v4/test/assert"
)

const testSchema = `
Expand Down
4 changes: 2 additions & 2 deletions internal/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ import (
"strings"
"time"

"github.com/objectbox/objectbox-generator/internal/generator/model"
"github.com/objectbox/objectbox-generator/v4/internal/generator/model"
)

// Version specifies the current generator version.
const Version = "4.0.0-alpha2"
const Version = "4.0.0-beta"

// VersionId specifies the current generator version identifier.
// It is used to validate generated code compatibility and is increased when there are changes in the generated code.
Expand Down
4 changes: 2 additions & 2 deletions internal/generator/go/ast-reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
"strconv"
"strings"

"github.com/objectbox/objectbox-generator/internal/generator/binding"
"github.com/objectbox/objectbox-generator/internal/generator/model"
"github.com/objectbox/objectbox-generator/v4/internal/generator/binding"
"github.com/objectbox/objectbox-generator/v4/internal/generator/model"
)

type uid = uint64
Expand Down
6 changes: 3 additions & 3 deletions internal/generator/go/gogenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (
"path/filepath"
"strings"

"github.com/objectbox/objectbox-generator/internal/generator"
"github.com/objectbox/objectbox-generator/internal/generator/go/templates"
"github.com/objectbox/objectbox-generator/internal/generator/model"
"github.com/objectbox/objectbox-generator/v4/internal/generator"
"github.com/objectbox/objectbox-generator/v4/internal/generator/go/templates"
"github.com/objectbox/objectbox-generator/v4/internal/generator/model"
)

type GoGenerator struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"fmt"
"log"

"github.com/objectbox/objectbox-generator/internal/generator/model"
"github.com/objectbox/objectbox-generator/v4/internal/generator/model"
)

func mergeBindingWithModelInfo(currentModel *model.ModelInfo, storedModel *model.ModelInfo) error {
Expand Down
4 changes: 2 additions & 2 deletions test/basics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
"strings"
"testing"

"github.com/objectbox/objectbox-generator/internal/generator"
"github.com/objectbox/objectbox-generator/test/assert"
"github.com/objectbox/objectbox-generator/v4/internal/generator"
"github.com/objectbox/objectbox-generator/v4/test/assert"
)

// Because of Go generator comparison tests, the go tool may update go.mod file to import `github.com/objectbox/objectbox-go`
Expand Down
4 changes: 2 additions & 2 deletions test/build/c-compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ package build
import (
"testing"

"github.com/objectbox/objectbox-generator/test/assert"
"github.com/objectbox/objectbox-generator/test/cmake"
"github.com/objectbox/objectbox-generator/v4/test/assert"
"github.com/objectbox/objectbox-generator/v4/test/cmake"
)

// Check verifies the C/C++ objectbox test code can be compiled - whether the required libraries are available.
Expand Down
4 changes: 2 additions & 2 deletions test/cmake/libcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"runtime"
"testing"

"github.com/objectbox/objectbox-generator/test/assert"
"github.com/objectbox/objectbox-generator/test/cmake"
"github.com/objectbox/objectbox-generator/v4/test/assert"
"github.com/objectbox/objectbox-generator/v4/test/cmake"
)

func TestLibExists(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions test/comparison/c-helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import (
"path/filepath"
"testing"

"github.com/objectbox/objectbox-generator/internal/generator"
cgenerator "github.com/objectbox/objectbox-generator/internal/generator/c"
"github.com/objectbox/objectbox-generator/test/assert"
"github.com/objectbox/objectbox-generator/test/build"
"github.com/objectbox/objectbox-generator/test/cmake"
"github.com/objectbox/objectbox-generator/v4/internal/generator"
cgenerator "github.com/objectbox/objectbox-generator/v4/internal/generator/c"
"github.com/objectbox/objectbox-generator/v4/test/assert"
"github.com/objectbox/objectbox-generator/v4/test/build"
"github.com/objectbox/objectbox-generator/v4/test/cmake"
)

type cTestHelper struct {
Expand Down
6 changes: 3 additions & 3 deletions test/comparison/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ package comparison
import (
"testing"

"github.com/objectbox/objectbox-generator/internal/generator"
cgenerator "github.com/objectbox/objectbox-generator/internal/generator/c"
gogenerator "github.com/objectbox/objectbox-generator/internal/generator/go"
"github.com/objectbox/objectbox-generator/v4/internal/generator"
cgenerator "github.com/objectbox/objectbox-generator/v4/internal/generator/c"
gogenerator "github.com/objectbox/objectbox-generator/v4/internal/generator/go"
)

type testHelper interface {
Expand Down
2 changes: 1 addition & 1 deletion test/comparison/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"strings"
"testing"

"github.com/objectbox/objectbox-generator/test/assert"
"github.com/objectbox/objectbox-generator/v4/test/assert"
)

// used during development of generator to overwrite the "golden" files
Expand Down
6 changes: 3 additions & 3 deletions test/comparison/go-helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (
"strings"
"testing"

"github.com/objectbox/objectbox-generator/internal/generator"
gogenerator "github.com/objectbox/objectbox-generator/internal/generator/go"
"github.com/objectbox/objectbox-generator/test/assert"
"github.com/objectbox/objectbox-generator/v4/internal/generator"
gogenerator "github.com/objectbox/objectbox-generator/v4/internal/generator/go"
"github.com/objectbox/objectbox-generator/v4/test/assert"
)

// this containing module name - used for test case modules
Expand Down
4 changes: 2 additions & 2 deletions test/comparison/test-all.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
"strings"
"testing"

"github.com/objectbox/objectbox-generator/internal/generator"
"github.com/objectbox/objectbox-generator/test/assert"
"github.com/objectbox/objectbox-generator/v4/internal/generator"
"github.com/objectbox/objectbox-generator/v4/test/assert"
)

func typesFromConfKey(confKey string) (srcType, genType string) {
Expand Down
2 changes: 1 addition & 1 deletion test/comparison/testdata/go/embedding/E.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package object

import "github.com/objectbox/objectbox-generator/test/comparison/testdata/go/embedding/other"
import "github.com/objectbox/objectbox-generator/v4/test/comparison/testdata/go/embedding/other"

type E struct {
other.Trackable `objectbox:"inline"`
Expand Down
2 changes: 1 addition & 1 deletion test/comparison/testdata/go/embedding/E.obx.go.expected
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package object
import (
"errors"
"github.com/google/flatbuffers/go"
"github.com/objectbox/objectbox-generator/test/comparison/testdata/go/embedding/other"
"github.com/objectbox/objectbox-generator/v4/test/comparison/testdata/go/embedding/other"
"github.com/objectbox/objectbox-go/objectbox"
"github.com/objectbox/objectbox-go/objectbox/fbutils"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# github.com/objectbox/objectbox-generator/test/comparison/testdata/go/property-update
# github.com/objectbox/objectbox-generator/v4/test/comparison/testdata/go/property-update
./objectbox-model.go:16:24: undefined: ABinding

exit status 2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# github.com/objectbox/objectbox-generator/test/comparison/testdata/go/rename-property
# github.com/objectbox/objectbox-generator/v4/test/comparison/testdata/go/rename-property
./objectbox-model.go:16:24: undefined: CBinding

exit status 2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# github.com/objectbox/objectbox-generator/test/comparison/testdata/go/rename-relation
# github.com/objectbox/objectbox-generator/v4/test/comparison/testdata/go/rename-relation
./objectbox-model.go:22:24: undefined: NegTaskRelIdBinding
./objectbox-model.go:23:24: undefined: NegTaskRelPtrBinding
./objectbox-model.go:24:24: undefined: NegTaskRelValueBinding
Expand Down
4 changes: 2 additions & 2 deletions test/comparison/testdata/go/typeful/aliases.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package object

import (
"github.com/objectbox/objectbox-generator/test/comparison/testdata/go/typeful/other"
ot "github.com/objectbox/objectbox-generator/test/comparison/testdata/go/typeful/other"
"github.com/objectbox/objectbox-generator/v4/test/comparison/testdata/go/typeful/other"
ot "github.com/objectbox/objectbox-generator/v4/test/comparison/testdata/go/typeful/other"
)

// Tests type aliases and definitions of named types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package object
import (
"errors"
"github.com/google/flatbuffers/go"
ot "github.com/objectbox/objectbox-generator/test/comparison/testdata/go/typeful/other"
ot "github.com/objectbox/objectbox-generator/v4/test/comparison/testdata/go/typeful/other"
"github.com/objectbox/objectbox-go/objectbox"
"github.com/objectbox/objectbox-go/objectbox/fbutils"
)
Expand Down
2 changes: 1 addition & 1 deletion test/comparison/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"strings"
"testing"

"github.com/objectbox/objectbox-generator/test/assert"
"github.com/objectbox/objectbox-generator/v4/test/assert"
)

func checkBuildError(t *testing.T, errorTransformer func(err error) error, stdOut []byte, stdErr []byte, err error, expectedError error) {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/cmake/cmake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"strings"
"testing"

"github.com/objectbox/objectbox-generator/test/assert"
"github.com/objectbox/objectbox-generator/test/cmake"
"github.com/objectbox/objectbox-generator/v4/test/assert"
"github.com/objectbox/objectbox-generator/v4/test/cmake"
)

// excluded: cpp-multiple-targets,cpp-tree-multiple-targets (Visual Studio and XCode)
Expand Down
Loading

0 comments on commit 8069e1d

Please sign in to comment.