Skip to content

Commit

Permalink
README.md: expand the build and getting started section
Browse files Browse the repository at this point in the history
  • Loading branch information
greenrobot authored and dan-obx committed Mar 4, 2024
1 parent ae707f8 commit d6e0092
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,37 @@ ObjectBox is a superfast cross-platform object-oriented database.
ObjectBox Generator produces binding code for ObjectBox C, C++ and Go APIs (more languages to be supported in the future).
This greatly simplifies using ObjectBox in your favourite language.

## Prerequisites/Installation
## Download

Install the objectbox-generator by downloading the latest binary for your OS from [releases](https://github.com/objectbox/objectbox-generator/releases/latest).
If you want, add it to `$PATH` for convenience.
Alternatively, instead of downloading, you can build the generator yourself by cloning this repo and running `make`.
To build yourself, you need a recent Go version, CMake and a C++11 tool chain.

## Build

If you prefer to build the generator yourself (vs. downloading), clone this repo and simply run `make`.
This will produce an "objectbox-generator" binary in the main project directory.

Build notes:

* To build yourself, you need Go, Make, CMake and a C++11 tool chain.
* To run test suite, run `make test-depend test`.
* `test-depend` needs to run only once to download objectbox core library and to build flatcc.
* A full test cycle can be triggered by `make clean all test-depend test`.

## Getting started

To get started, have a look at the projects based on your language of choice:
* C and C++ [repository](https://github.com/objectbox/objectbox-c) and [docs](https://cpp.objectbox.io/)
* Go [repository](https://github.com/objectbox/objectbox-go) and [docs](https://golang.objectbox.io/)
To get started, have a look at the specific language bindings (the approaches differ):

* C and C++ [repository](https://github.com/objectbox/objectbox-c) and [docs](https://cpp.objectbox.io/).
In summary, you define a FlatBuffers schema file, and the ObjectBox Generator will create plain C++ data classes
and helper classes that "glue" the data classes to the ObjectBox runtime library.
* Go [repository](https://github.com/objectbox/objectbox-go) and [docs](https://golang.objectbox.io/).
Here, you start with Go data structs, for which the Generator generates the glue code directly.

# License

```
Copyright (C) 2022 ObjectBox Ltd. All rights reserved.
Copyright (C) 2018-2024 ObjectBox Ltd. All rights reserved.
https://objectbox.io
This file is part of ObjectBox Generator.
Expand Down
4 changes: 3 additions & 1 deletion internal/generator/generator.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 ObjectBox Ltd. All rights reserved.
* Copyright (C) 2018-2024 ObjectBox Ltd. All rights reserved.
* https://objectbox.io
*
* This file is part of ObjectBox Generator.
Expand Down Expand Up @@ -38,6 +38,8 @@ const Version = "0.14.0"

// 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.
// This validation seems to be limited to Go: the generated code "knows" its version,
// and thus we can check at runtime if the generated code matches the lib version.
// Internal generator changes that don't change the output (in an incompatible way) do not cause an increase.
const VersionId = 6

Expand Down

0 comments on commit d6e0092

Please sign in to comment.