diff --git a/README.md b/README.md index a436d190..a9f7a124 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,20 @@ [ObjectBox](https://objectbox.io/) is a superfast object-oriented database with strong relation support. ObjectBox is embedded into your Android, Linux, macOS, or Windows app. -**Latest version: [2.9.1 (2021/03/15)](https://docs.objectbox.io/#objectbox-changelog)** +**Latest version: [3.0.0 (2021/10/19)](https://docs.objectbox.io/#objectbox-changelog)** Demo code using ObjectBox: +```kotlin +// Kotlin +val playlist = Playlist("My Favorites") +playlist.songs.add(Song("Lalala")) +playlist.songs.add(Song("Lololo")) +box.put(playlist) +``` + ```java +// Java Playlist playlist = new Playlist("My Favorites"); playlist.songs.add(new Song("Lalala")); playlist.songs.add(new Song("Lololo")); @@ -29,27 +38,40 @@ Besides JVM based languages like Java and Kotlin, ObjectBox also offers: Gradle setup ------------ -Add this to your root build.gradle (project level): +For Android projects, add the ObjectBox Gradle plugin to your root `build.gradle`: ```groovy buildscript { - ext.objectboxVersion = '2.9.1' + ext.objectboxVersion = "3.0.0" + repositories { + mavenCentral() + } dependencies { - classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion" + classpath("io.objectbox:objectbox-gradle-plugin:$objectboxVersion") } } ``` -And this to our app's build.gradle (module level): +And in your app's `build.gradle` apply the plugin: ```groovy -apply plugin: 'io.objectbox' // after applying Android plugin +// Using plugins syntax: +plugins { + id("io.objectbox") // Add after other plugins. +} + +// Or using the old apply syntax: +apply plugin: "io.objectbox" // Add after other plugins. ``` First steps ----------- -Create data object class `@Entity`, for example "Playlist". -```java +Create a data object class `@Entity`, for example "Playlist". +``` +// Kotlin +@Entity data class Playlist( ... ) + +// Java @Entity public class Playlist { ... } ``` Now build the project to let ObjectBox generate the class `MyObjectBox` for you. diff --git a/build.gradle b/build.gradle index c3dc9ed3..c3fd61ee 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ buildscript { ext { // Typically, only edit those two: - def objectboxVersionNumber = '2.9.2' // without "-SNAPSHOT", e.g. '2.5.0' or '2.4.0-RC' - def objectboxVersionRelease = false // set to true for releasing to ignore versionPostFix to avoid e.g. "-dev" versions + def objectboxVersionNumber = '3.0.0' // without "-SNAPSHOT", e.g. '2.5.0' or '2.4.0-RC' + def objectboxVersionRelease = true // set to true for releasing to ignore versionPostFix to avoid e.g. "-dev" versions // version post fix: '-' or '' if not defined; e.g. used by CI to pass in branch name def versionPostFixValue = project.findProperty('versionPostFix') diff --git a/objectbox-java/src/main/java/io/objectbox/BoxStore.java b/objectbox-java/src/main/java/io/objectbox/BoxStore.java index 76b6a60e..ec7bd07f 100644 --- a/objectbox-java/src/main/java/io/objectbox/BoxStore.java +++ b/objectbox-java/src/main/java/io/objectbox/BoxStore.java @@ -69,9 +69,9 @@ public class BoxStore implements Closeable { @Nullable private static Object relinker; /** Change so ReLinker will update native library when using workaround loading. */ - public static final String JNI_VERSION = "2.9.2-RC4"; + public static final String JNI_VERSION = "3.0.0"; - private static final String VERSION = "2.9.2-2021-08-19"; + private static final String VERSION = "3.0.0-2021-10-18"; private static BoxStore defaultStore; /** Currently used DB dirs with values from {@link #getCanonicalPath(File)}. */